1 | import { StateDeclaration, _ViewDeclaration, _StateDeclaration, LazyLoadResult } from './interface';
|
2 | import { Param } from '../params/param';
|
3 | import { UrlMatcher } from '../url/urlMatcher';
|
4 | import { Resolvable } from '../resolve/resolvable';
|
5 | import { TransitionStateHookFn } from '../transition/interface';
|
6 | import { TargetState } from './targetState';
|
7 | import { Transition } from '../transition/transition';
|
8 | import { Glob } from '../common/glob';
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | export declare class StateObject {
|
20 |
|
21 | parent: StateObject;
|
22 |
|
23 | name: string;
|
24 |
|
25 | abstract: boolean;
|
26 |
|
27 | resolve: {
|
28 | [key: string]: string | any[] | Function;
|
29 | } | any[];
|
30 |
|
31 | resolvables: Resolvable[];
|
32 |
|
33 | resolvePolicy: any;
|
34 |
|
35 | url: UrlMatcher;
|
36 |
|
37 | params: {
|
38 | [key: string]: Param;
|
39 | };
|
40 | |
41 |
|
42 |
|
43 |
|
44 |
|
45 | views: {
|
46 | [key: string]: _ViewDeclaration;
|
47 | };
|
48 | |
49 |
|
50 |
|
51 |
|
52 | self: StateDeclaration;
|
53 |
|
54 | navigable: StateObject;
|
55 |
|
56 | path: StateObject[];
|
57 | |
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 | data: any;
|
64 | |
65 |
|
66 |
|
67 |
|
68 | includes: {
|
69 | [name: string]: boolean;
|
70 | };
|
71 |
|
72 | onExit: TransitionStateHookFn;
|
73 |
|
74 | onRetain: TransitionStateHookFn;
|
75 |
|
76 | onEnter: TransitionStateHookFn;
|
77 |
|
78 | lazyLoad: (transition: Transition, state: StateDeclaration) => Promise<LazyLoadResult>;
|
79 |
|
80 | redirectTo: string | (($transition$: Transition) => TargetState) | {
|
81 | state: string | StateDeclaration;
|
82 | params: {
|
83 | [key: string]: any;
|
84 | };
|
85 | };
|
86 | /** @internal */
|
87 | __stateObjectCache: {
|
88 | /** Might be null */
|
89 | nameGlob?: Glob;
|
90 | };
|
91 | /**
|
92 | * Create a state object to put the private/internal implementation details onto.
|
93 | * The object's prototype chain looks like:
|
94 | * (Internal State Object) -> (Copy of State.prototype) -> (State Declaration object) -> (State Declaration's prototype...)
|
95 | *
|
96 | * @param stateDecl the user-supplied State Declaration
|
97 | * @returns {StateObject} an internal State object
|
98 | */
|
99 | static create(stateDecl: _StateDeclaration): StateObject;
|
100 | /** Predicate which returns true if the object is an class with @State() decorator */
|
101 | static isStateClass: (stateDecl: _StateDeclaration) => stateDecl is new () => StateDeclaration;
|
102 |
|
103 | static isStateDeclaration: (obj: any) => obj is StateDeclaration;
|
104 |
|
105 | static isState: (obj: any) => obj is StateObject;
|
106 |
|
107 | constructor(config?: StateDeclaration);
|
108 | /**
|
109 | * Returns true if the provided parameter is the same state.
|
110 | *
|
111 | * Compares the identity of the state against the passed value, which is either an object
|
112 | * reference to the actual `State` instance, the original definition object passed to
|
113 | * `$stateProvider.state()`, or the fully-qualified name.
|
114 | *
|
115 | * @param ref Can be one of (a) a `State` instance, (b) an object that was passed
|
116 | * into `$stateProvider.state()`, (c) the fully-qualified name of a state as a string.
|
117 | * @returns Returns `true` if `ref` matches the current `State` instance.
|
118 | */
|
119 | is(ref: StateObject | StateDeclaration | string): boolean;
|
120 | /**
|
121 | * @deprecated this does not properly handle dot notation
|
122 | * @returns Returns a dot-separated name of the state.
|
123 | */
|
124 | fqn(): string;
|
125 | /**
|
126 | * Returns the root node of this state's tree.
|
127 | *
|
128 | * @returns The root of this state's tree.
|
129 | */
|
130 | root(): StateObject;
|
131 | /**
|
132 | * Gets the state's `Param` objects
|
133 | *
|
134 | * Gets the list of [[Param]] objects owned by the state.
|
135 | * If `opts.inherit` is true, it also includes the ancestor states' [[Param]] objects.
|
136 | * If `opts.matchingKeys` exists, returns only `Param`s whose `id` is a key on the `matchingKeys` object
|
137 | *
|
138 | * @param opts options
|
139 | */
|
140 | parameters(opts?: {
|
141 | inherit?: boolean;
|
142 | matchingKeys?: any;
|
143 | }): Param[];
|
144 | /**
|
145 | * Returns a single [[Param]] that is owned by the state
|
146 | *
|
147 | * If `opts.inherit` is true, it also searches the ancestor states` [[Param]]s.
|
148 | * @param id the name of the [[Param]] to return
|
149 | * @param opts options
|
150 | */
|
151 | parameter(id: string, opts?: {
|
152 | inherit?: boolean;
|
153 | }): Param;
|
154 | toString(): string;
|
155 | }
|