forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
angular-breadcrumb.d.ts
79 lines (70 loc) · 2.86 KB
/
angular-breadcrumb.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// Type definitions for angular-breadcrumb 0.4.1
// Project: https://github.com/ncuillery/angular-breadcrumb
// Definitions by: Marc Talary <https://github.com/marctalary>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angular-ui-router/angular-ui-router.d.ts" />
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): void;
}
/**
* 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;
}
}