From f393bc7f52fd7924ebd3a9c7b8fc9d8bc0b5b945 Mon Sep 17 00:00:00 2001 From: Marc Talary Date: Thu, 17 Mar 2016 15:00:30 +0000 Subject: [PATCH 1/2] Added definition for angular-breadcrumb --- angular-breadcrumb/angular-breadcrumb.d.ts | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 angular-breadcrumb/angular-breadcrumb.d.ts diff --git a/angular-breadcrumb/angular-breadcrumb.d.ts b/angular-breadcrumb/angular-breadcrumb.d.ts new file mode 100644 index 000000000..7fedef4cb --- /dev/null +++ b/angular-breadcrumb/angular-breadcrumb.d.ts @@ -0,0 +1,49 @@ +// Type definitions for angular-breadcrumb 0.4.1 +// Project: https://github.com/ncuillery/angular-breadcrumb +// Definitions by: Marc Talary +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +declare namespace angular.ui { + export interface IState { + ncyBreadcrumb?: { + // Contains the label for the step in the breadcrumb. The state name is used if not defined. + label?: string; + // Override the parent state (only for the breadcrumb) + parent?: string; + // When defined to true, the state is never included in the chain of states and never appears in the breadcrumb + skip?: boolean; + }, + ncyBreadcrumbLabel?: string; + ncyBreadcrumbLink?: string; + } +} + +declare namespace ncy { + + // Provider that returns an instance of $breadcrumb service. It contains the global configuration of the module. + export interface $breadcrumbProvider { + // Setter for options defined in a module.config block + setOptions(options: breadcrumbProviderOptions); + } + + // Global configuration options for angular-breadcrumb + export interface breadcrumbProviderOptions { + // An existing state's name to be the state is the first step of the breadcrumb + prefixStateName?: string; + // Contains a predefined template's name; 'bootstrap3' (default), 'bootstrap2' or HTML for a custom template. This property is ignored if templateUrl is defined. + template?: string; + // Contains the path to a template file. This property takes precedence over the template property. + templateUrl?: string; + // If true, abstract states are included in the breadcrumb. This option has a lower priority than the state-specific option skip + includeAbstract?: boolean; + } + + // Service responsible for access to $state and for directive configuration. + export interface $breadcrumbService { + // Returns the state chain to the current state (i.e. all the steps of the breadcrumb). It's an array of state object enriched with the module-specific property ncyBreadcrumbLink (the href for the breadcrumb step). + getStatesChain(): angular.ui.IState[]; + // Return the last step of the breadcrumb, generally the one relative to the current state, expect if it is configured as skipped (the method returns its parent). As getStatesChain, the state object is enriched with ncyBreadcrumbLink. + getLastStep(): angular.ui.IState; + } +} \ No newline at end of file From 84aa9f038474bb570a70f37b0858708a6dd56282 Mon Sep 17 00:00:00 2001 From: marctalary Date: Thu, 17 Mar 2016 15:13:35 +0000 Subject: [PATCH 2/2] Fix no implicit any --- angular-breadcrumb/angular-breadcrumb.d.ts | 58 ++++++++++++++++------ 1 file changed, 44 insertions(+), 14 deletions(-) diff --git a/angular-breadcrumb/angular-breadcrumb.d.ts b/angular-breadcrumb/angular-breadcrumb.d.ts index 7fedef4cb..7df33ddef 100644 --- a/angular-breadcrumb/angular-breadcrumb.d.ts +++ b/angular-breadcrumb/angular-breadcrumb.d.ts @@ -7,11 +7,17 @@ declare namespace angular.ui { export interface IState { ncyBreadcrumb?: { - // Contains the label for the step in the breadcrumb. The state name is used if not defined. + /** + * Contains the label for the step in the breadcrumb. The state name is used if not defined. + **/ label?: string; - // Override the parent state (only for the breadcrumb) + /** + * Override the parent state (only for the breadcrumb) + **/ parent?: string; - // When defined to true, the state is never included in the chain of states and never appears in the breadcrumb + /** + * When defined to true, the state is never included in the chain of states and never appears in the breadcrumb + **/ skip?: boolean; }, ncyBreadcrumbLabel?: string; @@ -21,29 +27,53 @@ declare namespace angular.ui { declare namespace ncy { - // Provider that returns an instance of $breadcrumb service. It contains the global configuration of the module. + /** + * Provider that returns an instance of $breadcrumb service. It contains the global configuration of the module. + **/ export interface $breadcrumbProvider { - // Setter for options defined in a module.config block - setOptions(options: breadcrumbProviderOptions); + /** + * Setter for options defined in a module.config block + **/ + setOptions(options: breadcrumbProviderOptions): void; } - // Global configuration options for angular-breadcrumb + /** + * Global configuration options for angular-breadcrumb + **/ export interface breadcrumbProviderOptions { - // An existing state's name to be the state is the first step of the breadcrumb + /** + * An existing state's name to be the state is the first step of the breadcrumb + **/ prefixStateName?: string; - // Contains a predefined template's name; 'bootstrap3' (default), 'bootstrap2' or HTML for a custom template. This property is ignored if templateUrl is defined. + + /** + * Contains a predefined template's name; 'bootstrap3' (default), 'bootstrap2' or HTML for a custom template. This property is ignored if templateUrl is defined. + **/ template?: string; - // Contains the path to a template file. This property takes precedence over the template property. + + /** + * Contains the path to a template file. This property takes precedence over the template property. + **/ templateUrl?: string; - // If true, abstract states are included in the breadcrumb. This option has a lower priority than the state-specific option skip + + /** + * If true, abstract states are included in the breadcrumb. This option has a lower priority than the state-specific option skip + **/ includeAbstract?: boolean; } - // Service responsible for access to $state and for directive configuration. + /** + * Service responsible for access to $state and for directive configuration. + **/ export interface $breadcrumbService { - // Returns the state chain to the current state (i.e. all the steps of the breadcrumb). It's an array of state object enriched with the module-specific property ncyBreadcrumbLink (the href for the breadcrumb step). + /** + * Returns the state chain to the current state (i.e. all the steps of the breadcrumb). It's an array of state object enriched with the module-specific property ncyBreadcrumbLink (the href for the breadcrumb step). + **/ getStatesChain(): angular.ui.IState[]; - // Return the last step of the breadcrumb, generally the one relative to the current state, expect if it is configured as skipped (the method returns its parent). As getStatesChain, the state object is enriched with ncyBreadcrumbLink. + + /** + * Return the last step of the breadcrumb, generally the one relative to the current state, expect if it is configured as skipped (the method returns its parent). As getStatesChain, the state object is enriched with ncyBreadcrumbLink. + **/ getLastStep(): angular.ui.IState; } } \ No newline at end of file