@angular-wave/angular.ts 0.18.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@types/angular.d.ts +18 -6
- package/@types/animations/animate-css-driver.d.ts +2 -2
- package/@types/animations/animate-js-driver.d.ts +11 -1
- package/@types/animations/animate-js.d.ts +10 -2
- package/@types/animations/animate-swap.d.ts +4 -1
- package/@types/animations/animate.d.ts +11 -5
- package/@types/animations/animation.d.ts +7 -0
- package/@types/animations/css/animate-css.d.ts +16 -0
- package/@types/animations/interface.d.ts +308 -19
- package/@types/animations/queue/animate-queue.d.ts +16 -7
- package/@types/animations/queue/interface.d.ts +14 -7
- package/@types/core/compile/attributes.d.ts +1 -1
- package/@types/core/compile/compile.d.ts +25 -15
- package/@types/core/compile/interface.d.ts +209 -34
- package/@types/core/controller/controller.d.ts +30 -38
- package/@types/core/controller/interface.d.ts +12 -3
- package/@types/core/parse/interface.d.ts +2 -2
- package/@types/core/parse/interpreter.d.ts +110 -58
- package/@types/core/scope/interface.d.ts +6 -0
- package/@types/core/scope/scope.d.ts +2 -1
- package/@types/directive/aria/aria.d.ts +66 -26
- package/@types/directive/aria/interface.d.ts +9 -0
- package/@types/directive/class/class.d.ts +31 -0
- package/@types/directive/form/form.d.ts +54 -18
- package/@types/directive/input/input.d.ts +59 -18
- package/@types/directive/input/interface.d.ts +10 -0
- package/@types/directive/messages/messages.d.ts +63 -12
- package/@types/directive/model/interface.d.ts +19 -0
- package/@types/directive/model/model.d.ts +70 -33
- package/@types/directive/model-options/model-options.d.ts +1 -23
- package/@types/directive/repeat/repeat.d.ts +2 -3
- package/@types/directive/validators/validators.d.ts +1 -5
- package/@types/directive/worker/interface.d.ts +9 -0
- package/@types/docs.d.ts +24 -0
- package/@types/filters/json.d.ts +4 -0
- package/@types/interface.d.ts +22 -69
- package/@types/namespace.d.ts +66 -40
- package/@types/router/common/trace.d.ts +150 -42
- package/@types/router/directives/state-directives.d.ts +4 -4
- package/@types/router/directives/view-directive.d.ts +2 -5
- package/@types/router/hooks/core-resolvables.d.ts +11 -2
- package/@types/router/hooks/ignored-transition.d.ts +3 -1
- package/@types/router/hooks/invalid-transition.d.ts +3 -1
- package/@types/router/hooks/lazy-load.d.ts +17 -13
- package/@types/router/hooks/on-enter-exit-retain.d.ts +9 -3
- package/@types/router/hooks/redirect-to.d.ts +3 -3
- package/@types/router/hooks/resolve.d.ts +11 -3
- package/@types/router/hooks/views.d.ts +6 -4
- package/@types/router/params/interface.d.ts +3 -2
- package/@types/router/params/param-factory.d.ts +24 -3
- package/@types/router/params/param-type.d.ts +47 -11
- package/@types/router/params/param-types.d.ts +52 -0
- package/@types/router/params/param.d.ts +52 -28
- package/@types/router/params/state-params.d.ts +5 -3
- package/@types/router/path/interface.d.ts +3 -0
- package/@types/router/path/path-node.d.ts +34 -14
- package/@types/router/path/path-utils.d.ts +75 -25
- package/@types/router/resolve/resolvable.d.ts +34 -7
- package/@types/router/resolve/resolve-context.d.ts +52 -34
- package/@types/router/router.d.ts +10 -12
- package/@types/router/state/interface.d.ts +194 -31
- package/@types/router/state/state-builder.d.ts +29 -29
- package/@types/router/state/state-matcher.d.ts +29 -11
- package/@types/router/state/state-object.d.ts +67 -21
- package/@types/router/state/state-queue-manager.d.ts +19 -10
- package/@types/router/state/state-registry.d.ts +80 -28
- package/@types/router/state/state-service.d.ts +182 -123
- package/@types/router/state/target-state.d.ts +36 -27
- package/@types/router/state/views.d.ts +48 -19
- package/@types/router/template-factory.d.ts +8 -15
- package/@types/router/transition/hook-builder.d.ts +17 -6
- package/@types/router/transition/hook-registry.d.ts +80 -46
- package/@types/router/transition/interface.d.ts +138 -118
- package/@types/router/transition/reject-factory.d.ts +58 -22
- package/@types/router/transition/transition-event-type.d.ts +19 -8
- package/@types/router/transition/transition-hook.d.ts +50 -29
- package/@types/router/transition/transition-service.d.ts +186 -30
- package/@types/router/transition/transition.d.ts +201 -70
- package/@types/router/url/interface.d.ts +140 -0
- package/@types/router/url/url-config.d.ts +19 -16
- package/@types/router/url/url-matcher.d.ts +66 -46
- package/@types/router/url/url-rule.d.ts +58 -35
- package/@types/router/url/url-rules.d.ts +38 -28
- package/@types/router/url/url-service.d.ts +68 -41
- package/@types/router/view/interface.d.ts +10 -30
- package/@types/router/view/view.d.ts +35 -21
- package/@types/services/anchor-scroll/interface.d.ts +1 -1
- package/@types/services/http/http.d.ts +19 -22
- package/@types/services/http/interface.d.ts +11 -23
- package/@types/services/location/interface.d.ts +1 -4
- package/@types/services/location/location.d.ts +13 -13
- package/@types/services/sce/sce.d.ts +14 -8
- package/@types/services/template-request/template-request.d.ts +21 -4
- package/@types/shared/common.d.ts +5 -32
- package/@types/shared/dom.d.ts +10 -5
- package/@types/shared/interface.d.ts +4 -0
- package/@types/shared/utils.d.ts +17 -6
- package/dist/angular-ts.esm.js +6424 -2850
- package/dist/angular-ts.umd.js +6424 -2850
- package/dist/angular-ts.umd.min.js +1 -1
- package/dist/angular-ts.umd.min.js.gz +0 -0
- package/dist/angular-ts.umd.min.js.map +1 -1
- package/package.json +1 -2
- package/@types/animations/animate-css.d.ts +0 -11
- package/@types/filters/filters.d.ts +0 -38
- package/@types/router/hooks/update-globals.d.ts +0 -1
- package/@types/router/hooks/url.d.ts +0 -5
|
@@ -23,20 +23,36 @@
|
|
|
23
23
|
*/
|
|
24
24
|
export class ParamType {
|
|
25
25
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
* @param {any} def A configuration object which contains the custom type definition. The object's
|
|
27
|
+
properties will override the default methods and/or pattern in `ParamType`'s public interface.
|
|
28
|
+
*/
|
|
29
29
|
constructor(def: any);
|
|
30
30
|
pattern: RegExp;
|
|
31
31
|
inherit: boolean;
|
|
32
|
-
|
|
32
|
+
/** @type {string|undefined} */
|
|
33
|
+
name: string | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* @param {any} val
|
|
36
|
+
*/
|
|
33
37
|
is(val: any): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* @param {any} val
|
|
40
|
+
*/
|
|
34
41
|
encode(val: any): any;
|
|
42
|
+
/**
|
|
43
|
+
* @param {any} val
|
|
44
|
+
*/
|
|
35
45
|
decode(val: any): any;
|
|
46
|
+
/**
|
|
47
|
+
* @param {any} a
|
|
48
|
+
* @param {any} b
|
|
49
|
+
*/
|
|
36
50
|
equals(a: any, b: any): boolean;
|
|
37
|
-
$subPattern(): string;
|
|
38
51
|
toString(): string;
|
|
39
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* Given an encoded string, or a decoded object, returns a decoded object
|
|
54
|
+
* @param {any} val
|
|
55
|
+
*/
|
|
40
56
|
$normalize(val: any): any;
|
|
41
57
|
/**
|
|
42
58
|
* Wraps an existing custom ParamType as an array of ParamType, depending on 'mode'.
|
|
@@ -47,13 +63,33 @@ export class ParamType {
|
|
|
47
63
|
* if `mode` is "auto", then
|
|
48
64
|
* - url: "/path?queryParam=1 will create $stateParams.queryParam: 1
|
|
49
65
|
* - url: "/path?queryParam=1&queryParam=2 will create $stateParams.queryParam: [1, 2]
|
|
66
|
+
* @param {boolean |'auto'} mode
|
|
67
|
+
* @param {any} isSearch
|
|
50
68
|
*/
|
|
51
|
-
$asArray(mode:
|
|
69
|
+
$asArray(mode: boolean | "auto", isSearch: any): ArrayType;
|
|
52
70
|
}
|
|
53
|
-
/**
|
|
54
|
-
|
|
71
|
+
/**
|
|
72
|
+
* Wraps up a `ParamType` object to handle array values.
|
|
73
|
+
* @this {Record<string, any>}
|
|
74
|
+
* @param {ParamType & Record<string, any>} type
|
|
75
|
+
* @param {boolean | 'auto'} mode
|
|
76
|
+
*/
|
|
77
|
+
declare function ArrayType(
|
|
78
|
+
this: Record<string, any>,
|
|
79
|
+
type: ParamType & Record<string, any>,
|
|
80
|
+
mode: boolean | "auto",
|
|
81
|
+
): void;
|
|
55
82
|
declare class ArrayType {
|
|
56
|
-
/**
|
|
57
|
-
|
|
83
|
+
/**
|
|
84
|
+
* Wraps up a `ParamType` object to handle array values.
|
|
85
|
+
* @this {Record<string, any>}
|
|
86
|
+
* @param {ParamType & Record<string, any>} type
|
|
87
|
+
* @param {boolean | 'auto'} mode
|
|
88
|
+
*/
|
|
89
|
+
constructor(
|
|
90
|
+
this: Record<string, any>,
|
|
91
|
+
type: ParamType & Record<string, any>,
|
|
92
|
+
mode: boolean | "auto",
|
|
93
|
+
);
|
|
58
94
|
}
|
|
59
95
|
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A registry for parameter types.
|
|
3
|
+
*
|
|
4
|
+
* This registry manages the built-in (and custom) parameter types.
|
|
5
|
+
*
|
|
6
|
+
* The built-in parameter types are:
|
|
7
|
+
*
|
|
8
|
+
* - [[string]]
|
|
9
|
+
* - [[path]]
|
|
10
|
+
* - [[query]]
|
|
11
|
+
* - [[hash]]
|
|
12
|
+
* - [[int]]
|
|
13
|
+
* - [[bool]]
|
|
14
|
+
* - [[date]]
|
|
15
|
+
* - [[json]]
|
|
16
|
+
* - [[any]]
|
|
17
|
+
*
|
|
18
|
+
* To register custom parameter types, use [[UrlConfig.type]], i.e.,
|
|
19
|
+
*
|
|
20
|
+
* ```js
|
|
21
|
+
* router.urlService.config.type(customType)
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export class ParamTypes {
|
|
25
|
+
enqueue: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* @type {{ name: any; def: any; }[]}
|
|
28
|
+
*/
|
|
29
|
+
typeQueue: {
|
|
30
|
+
name: any;
|
|
31
|
+
def: any;
|
|
32
|
+
}[];
|
|
33
|
+
defaultTypes: Record<string, any>;
|
|
34
|
+
/**
|
|
35
|
+
* @type {Record<string, any>}
|
|
36
|
+
*/
|
|
37
|
+
types: Record<string, any>;
|
|
38
|
+
/**
|
|
39
|
+
* Registers a parameter type
|
|
40
|
+
*
|
|
41
|
+
* End users should call [[UrlMatcherFactory.type]], which delegates to this method.
|
|
42
|
+
* @param {string} name
|
|
43
|
+
* @param {import("./interface.ts").ParamTypeDefinition} [definition]
|
|
44
|
+
* @param {() => import("../params/interface.ts").ParamTypeDefinition} [definitionFn]
|
|
45
|
+
*/
|
|
46
|
+
type(
|
|
47
|
+
name: string,
|
|
48
|
+
definition?: import("./interface.ts").ParamTypeDefinition,
|
|
49
|
+
definitionFn?: () => import("../params/interface.ts").ParamTypeDefinition,
|
|
50
|
+
): any;
|
|
51
|
+
_flushTypeQueue(): void;
|
|
52
|
+
}
|
|
@@ -5,67 +5,91 @@ export namespace DefType {
|
|
|
5
5
|
let _CONFIG: number;
|
|
6
6
|
}
|
|
7
7
|
export class Param {
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* @param {Param[]} params
|
|
10
|
+
* @param {Record<string, any>} values
|
|
11
|
+
* @return {import("./interface.ts").RawParams}
|
|
12
|
+
*/
|
|
13
|
+
static values(
|
|
14
|
+
params: Param[],
|
|
15
|
+
values?: Record<string, any>,
|
|
16
|
+
): import("./interface.ts").RawParams;
|
|
9
17
|
/**
|
|
10
18
|
* Finds [[Param]] objects which have different param values
|
|
11
19
|
*
|
|
12
20
|
* Filters a list of [[Param]] objects to only those whose parameter values differ in two param value objects
|
|
13
|
-
*
|
|
14
|
-
* @param
|
|
15
|
-
* @param
|
|
16
|
-
* @
|
|
17
|
-
*
|
|
18
|
-
* @returns any Param objects whose values were different between values1 and values2
|
|
21
|
+
* @param {Param[]} params : The list of Param objects to filter
|
|
22
|
+
* @param {Record<string, any>} values1 : The first set of parameter values
|
|
23
|
+
* @param {Record<string, any>} values2 : the second set of parameter values
|
|
24
|
+
* @returns {Param[]} any Param objects whose values were different between values1 and values2
|
|
19
25
|
*/
|
|
20
|
-
static changed(
|
|
26
|
+
static changed(
|
|
27
|
+
params: Param[],
|
|
28
|
+
values1?: Record<string, any>,
|
|
29
|
+
values2?: Record<string, any>,
|
|
30
|
+
): Param[];
|
|
21
31
|
/**
|
|
22
32
|
* Checks if two param value objects are equal (for a set of [[Param]] objects)
|
|
23
|
-
*
|
|
24
|
-
* @param params The list of [[Param]] objects to check
|
|
33
|
+
* @param {any[]} params The list of [[Param]] objects to check
|
|
25
34
|
* @param values1 The first set of param values
|
|
26
35
|
* @param values2 The second set of param values
|
|
27
|
-
*
|
|
28
36
|
* @returns true if the param values in values1 and values2 are equal
|
|
29
37
|
*/
|
|
30
|
-
static equals(params: any, values1?: {}, values2?: {}): boolean;
|
|
31
|
-
/**
|
|
32
|
-
|
|
38
|
+
static equals(params: any[], values1?: {}, values2?: {}): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Returns true if a the parameter values are valid, according to the Param definitions
|
|
41
|
+
* @param {any[]} params
|
|
42
|
+
* @param {Record<string, any>} values
|
|
43
|
+
* @return {boolean}
|
|
44
|
+
*/
|
|
45
|
+
static validates(params: any[], values?: Record<string, any>): boolean;
|
|
33
46
|
/**
|
|
34
47
|
*
|
|
35
|
-
* @param {
|
|
36
|
-
* @param {
|
|
48
|
+
* @param {string} id
|
|
49
|
+
* @param {ParamType | null} type
|
|
37
50
|
* @param {DefType} location
|
|
38
51
|
* @param {import("../url/url-config.js").UrlConfigProvider} urlConfig
|
|
39
|
-
* @param {
|
|
52
|
+
* @param {ng.StateDeclaration} state
|
|
40
53
|
*/
|
|
41
54
|
constructor(
|
|
42
|
-
id:
|
|
43
|
-
type:
|
|
55
|
+
id: string,
|
|
56
|
+
type: ParamType | null,
|
|
44
57
|
location: DefType,
|
|
45
58
|
urlConfig: import("../url/url-config.js").UrlConfigProvider,
|
|
46
|
-
state:
|
|
59
|
+
state: ng.StateDeclaration,
|
|
47
60
|
);
|
|
48
61
|
isOptional: boolean;
|
|
49
|
-
type:
|
|
62
|
+
type: ParamType;
|
|
50
63
|
location: number;
|
|
51
|
-
id:
|
|
64
|
+
id: string;
|
|
52
65
|
dynamic: boolean;
|
|
53
66
|
raw: boolean;
|
|
54
|
-
squash:
|
|
67
|
+
squash: string | boolean;
|
|
55
68
|
replace: any;
|
|
56
69
|
inherit: boolean;
|
|
57
|
-
array:
|
|
58
|
-
config:
|
|
59
|
-
|
|
70
|
+
array: boolean;
|
|
71
|
+
config: import("./interface.ts").ParamDeclaration;
|
|
72
|
+
/** @type {import("./interface.ts").RawParams | undefined} */
|
|
73
|
+
matchingKeys: import("./interface.ts").RawParams | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* @param {any} value
|
|
76
|
+
*/
|
|
77
|
+
isDefaultValue(value: any): boolean;
|
|
60
78
|
/**
|
|
61
79
|
* [Internal] Gets the decoded representation of a value if the value is defined, otherwise, returns the
|
|
62
80
|
* default value, which may be the result of an injectable function.
|
|
81
|
+
* @param {undefined} [value]
|
|
63
82
|
*/
|
|
64
|
-
value(value
|
|
83
|
+
value(value?: undefined): any;
|
|
65
84
|
_defaultValueCache: {
|
|
66
85
|
defaultValue: any;
|
|
67
86
|
};
|
|
68
87
|
isSearch(): boolean;
|
|
69
|
-
|
|
88
|
+
/**
|
|
89
|
+
* @param {null} value
|
|
90
|
+
*/
|
|
91
|
+
validates(value: null): boolean;
|
|
70
92
|
toString(): string;
|
|
71
93
|
}
|
|
94
|
+
export type ParamDeclaration = import("./interface.ts").ParamDeclaration;
|
|
95
|
+
import { ParamType } from "./param-type.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @typedef {import("../state/state-object.js").StateObject} StateObject */
|
|
1
2
|
export class StateParams {
|
|
2
3
|
constructor(params?: {});
|
|
3
4
|
/**
|
|
@@ -5,8 +6,9 @@ export class StateParams {
|
|
|
5
6
|
* current state and a given destination state.
|
|
6
7
|
*
|
|
7
8
|
* @param {Object} newParams The set of parameters which will be composited with inherited params.
|
|
8
|
-
* @param {
|
|
9
|
-
* @param {
|
|
9
|
+
* @param {StateObject} $current Internal definition of object representing the current state.
|
|
10
|
+
* @param {StateObject} $to Internal definition of object representing state to transition to.
|
|
10
11
|
*/
|
|
11
|
-
$inherit(newParams: any, $current:
|
|
12
|
+
$inherit(newParams: any, $current: StateObject, $to: StateObject): any;
|
|
12
13
|
}
|
|
14
|
+
export type StateObject = import("../state/state-object.js").StateObject;
|
|
@@ -6,22 +6,39 @@
|
|
|
6
6
|
* The stateful information includes parameter values and resolve data.
|
|
7
7
|
*/
|
|
8
8
|
export class PathNode {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* @param {PathNode | ng.StateObject | undefined} stateOrNode
|
|
11
|
+
*/
|
|
12
|
+
constructor(stateOrNode: PathNode | ng.StateObject | undefined);
|
|
13
|
+
/** @type {ng.StateObject} */
|
|
14
|
+
state: ng.StateObject;
|
|
11
15
|
paramSchema: any;
|
|
12
16
|
paramValues: any;
|
|
13
17
|
resolvables: any;
|
|
14
18
|
views: any;
|
|
15
19
|
clone(): PathNode;
|
|
16
|
-
/** Sets [[paramValues]] for the node, from the values of an object hash */
|
|
17
|
-
applyRawParams(params: any): this;
|
|
18
|
-
/** Gets a specific [[Param]] metadata that belongs to the node */
|
|
19
|
-
parameter(name: any): any;
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
21
|
+
* Sets [[paramValues]] for the node, from the values of an object hash
|
|
22
|
+
* @param {import("../params/interface.js").RawParams} params
|
|
23
|
+
* @returns {PathNode}
|
|
24
|
+
*/
|
|
25
|
+
applyRawParams(params: import("../params/interface.js").RawParams): PathNode;
|
|
26
|
+
/**
|
|
27
|
+
* Gets a specific [[Param]] metadata that belongs to the node
|
|
28
|
+
* @param {string} name
|
|
29
|
+
* @returns {Param | undefined}
|
|
23
30
|
*/
|
|
24
|
-
|
|
31
|
+
parameter(name: string): Param | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* @param {PathNode} node
|
|
34
|
+
* @param {import("./interface.js").GetParamsFn} paramsFn
|
|
35
|
+
* @returns {boolean} true if the state and parameter values for another PathNode are
|
|
36
|
+
equal to the state and param values for this PathNode
|
|
37
|
+
*/
|
|
38
|
+
equals(
|
|
39
|
+
node: PathNode,
|
|
40
|
+
paramsFn: import("./interface.js").GetParamsFn,
|
|
41
|
+
): boolean;
|
|
25
42
|
/**
|
|
26
43
|
* Finds Params with different parameter values on another PathNode.
|
|
27
44
|
*
|
|
@@ -29,10 +46,13 @@ export class PathNode {
|
|
|
29
46
|
* Returns the [[Param]] (schema objects) whose parameter values differ.
|
|
30
47
|
*
|
|
31
48
|
* Given another node for a different state, returns `false`
|
|
32
|
-
*
|
|
33
|
-
* @param
|
|
34
|
-
* @
|
|
35
|
-
* @returns The [[Param]]s which differ, or null if the two nodes are for different states
|
|
49
|
+
* @param {PathNode} node The node to compare to
|
|
50
|
+
* @param {import("./interface.js").GetParamsFn} paramsFn A function that returns which parameters should be compared.
|
|
51
|
+
* @returns { Param[] | false} The [[Param]]s which differ, or null if the two nodes are for different states
|
|
36
52
|
*/
|
|
37
|
-
diff(
|
|
53
|
+
diff(
|
|
54
|
+
node: PathNode,
|
|
55
|
+
paramsFn: import("./interface.js").GetParamsFn,
|
|
56
|
+
): Param[] | false;
|
|
38
57
|
}
|
|
58
|
+
import { Param } from "../params/param.js";
|
|
@@ -1,25 +1,46 @@
|
|
|
1
1
|
/** Given a PathNode[], create an TargetState
|
|
2
2
|
* @param {import("../state/state-registry.js").StateRegistryProvider} registry
|
|
3
3
|
* @param {Array<PathNode>} path
|
|
4
|
-
* @returns
|
|
4
|
+
* @returns {TargetState}
|
|
5
5
|
*/
|
|
6
6
|
export function makeTargetState(
|
|
7
7
|
registry: import("../state/state-registry.js").StateRegistryProvider,
|
|
8
8
|
path: Array<PathNode>,
|
|
9
9
|
): TargetState;
|
|
10
|
+
/** @typedef {import("../params/param.js").Param} Param */
|
|
11
|
+
/** @typedef {import("./interface.ts").GetParamsFn} GetParamsFn */
|
|
12
|
+
/** @typedef {import("../state/state-object.js").StateObject} StateObject */
|
|
13
|
+
/** @typedef {import("../params/interface.ts").RawParams} RawParams */
|
|
10
14
|
/**
|
|
11
15
|
* This class contains functions which convert TargetStates, Nodes and paths from one type to another.
|
|
12
16
|
*/
|
|
13
17
|
export class PathUtils {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
/**
|
|
19
|
+
* @param {TargetState} targetState
|
|
20
|
+
*/
|
|
21
|
+
static buildPath(targetState: TargetState): PathNode[];
|
|
22
|
+
/**
|
|
23
|
+
* Given a fromPath: PathNode[] and a TargetState, builds a toPath: PathNode[]
|
|
24
|
+
* @param {PathNode[]} fromPath
|
|
25
|
+
* @param {TargetState} targetState
|
|
26
|
+
*/
|
|
27
|
+
static buildToPath(
|
|
28
|
+
fromPath: PathNode[],
|
|
29
|
+
targetState: TargetState,
|
|
30
|
+
): PathNode[];
|
|
17
31
|
/**
|
|
18
32
|
* Creates ViewConfig objects and adds to nodes.
|
|
19
33
|
*
|
|
20
34
|
* On each [[PathNode]], creates ViewConfig objects from the views: property of the node's state
|
|
35
|
+
* @param {ng.ViewService} $view
|
|
36
|
+
* @param {PathNode[]} path
|
|
37
|
+
* @param {StateObject[]} states
|
|
21
38
|
*/
|
|
22
|
-
static applyViewConfigs(
|
|
39
|
+
static applyViewConfigs(
|
|
40
|
+
$view: ng.ViewService,
|
|
41
|
+
path: PathNode[],
|
|
42
|
+
states: StateObject[],
|
|
43
|
+
): void;
|
|
23
44
|
/**
|
|
24
45
|
* Given a fromPath and a toPath, returns a new to path which inherits parameters from the fromPath
|
|
25
46
|
*
|
|
@@ -30,19 +51,27 @@ export class PathUtils {
|
|
|
30
51
|
* Note: the keys provided in toKeys are intended to be those param keys explicitly specified by some
|
|
31
52
|
* caller, for instance, $state.transitionTo(..., toParams). If a key was found in toParams,
|
|
32
53
|
* it is not inherited from the fromPath.
|
|
54
|
+
* @param {PathNode[]} fromPath
|
|
55
|
+
* @param {PathNode[]} toPath
|
|
56
|
+
* @param {string[]} [toKeys]
|
|
57
|
+
* @returns {PathNode[]}
|
|
33
58
|
*/
|
|
34
|
-
static inheritParams(
|
|
59
|
+
static inheritParams(
|
|
60
|
+
fromPath: PathNode[],
|
|
61
|
+
toPath: PathNode[],
|
|
62
|
+
toKeys?: string[],
|
|
63
|
+
): PathNode[];
|
|
35
64
|
/**
|
|
36
65
|
* Computes the tree changes (entering, exiting) between a fromPath and toPath.
|
|
37
66
|
* @param {PathNode[]} fromPath
|
|
38
67
|
* @param {PathNode[]} toPath
|
|
39
|
-
* @param {
|
|
68
|
+
* @param {StateObject} reloadState
|
|
40
69
|
* @returns {import("../transition/interface.ts").TreeChanges}
|
|
41
70
|
*/
|
|
42
71
|
static treeChanges(
|
|
43
72
|
fromPath: PathNode[],
|
|
44
73
|
toPath: PathNode[],
|
|
45
|
-
reloadState
|
|
74
|
+
reloadState: StateObject,
|
|
46
75
|
): import("../transition/interface.ts").TreeChanges;
|
|
47
76
|
/**
|
|
48
77
|
* Returns a new path which is: the subpath of the first path which matches the second path.
|
|
@@ -53,36 +82,57 @@ export class PathUtils {
|
|
|
53
82
|
* Nodes are compared using their state property and their parameter values.
|
|
54
83
|
* If a `paramsFn` is provided, only the [[Param]] returned by the function will be considered when comparing nodes.
|
|
55
84
|
*
|
|
56
|
-
* @param pathA the first path
|
|
57
|
-
* @param pathB the second path
|
|
58
|
-
* @param paramsFn a function which returns the parameters to consider when comparing
|
|
85
|
+
* @param {PathNode[]} pathA the first path
|
|
86
|
+
* @param {PathNode[]} pathB the second path
|
|
87
|
+
* @param {GetParamsFn} [paramsFn] a function which returns the parameters to consider when comparing
|
|
59
88
|
*
|
|
60
|
-
* @returns an array of PathNodes from the first path which match the nodes in the second path
|
|
89
|
+
* @returns {PathNode[]} an array of PathNodes from the first path which match the nodes in the second path
|
|
61
90
|
*/
|
|
62
|
-
static matching(
|
|
91
|
+
static matching(
|
|
92
|
+
pathA: PathNode[],
|
|
93
|
+
pathB: PathNode[],
|
|
94
|
+
paramsFn?: GetParamsFn,
|
|
95
|
+
): PathNode[];
|
|
63
96
|
/**
|
|
64
97
|
* Returns true if two paths are identical.
|
|
65
98
|
*
|
|
66
|
-
* @param pathA
|
|
67
|
-
* @param pathB
|
|
68
|
-
* @param paramsFn a function which returns the parameters to consider when comparing
|
|
99
|
+
* @param {PathNode[]} pathA
|
|
100
|
+
* @param {PathNode[]} pathB
|
|
101
|
+
* @param {GetParamsFn} [paramsFn] a function which returns the parameters to consider when comparing
|
|
69
102
|
* @returns true if the the states and parameter values for both paths are identical
|
|
70
103
|
*/
|
|
71
|
-
static equals(
|
|
104
|
+
static equals(
|
|
105
|
+
pathA: PathNode[],
|
|
106
|
+
pathB: PathNode[],
|
|
107
|
+
paramsFn?: GetParamsFn,
|
|
108
|
+
): boolean;
|
|
72
109
|
/**
|
|
73
110
|
* Return a subpath of a path, which stops at the first matching node
|
|
74
111
|
*
|
|
75
112
|
* Given an array of nodes, returns a subset of the array starting from the first node,
|
|
76
113
|
* stopping when the first node matches the predicate.
|
|
77
|
-
*
|
|
78
|
-
* @param
|
|
79
|
-
* @
|
|
80
|
-
|
|
114
|
+
* @param {PathNode[]} path a path of [[PathNode]]s
|
|
115
|
+
* @param {import("../../shared/interface.ts").Predicate<PathNode>} predicate a [[Predicate]] fn that matches [[PathNode]]s
|
|
116
|
+
* @returns {PathNode[] | undefined} a subpath up to the matching node, or undefined if no match is found
|
|
117
|
+
*/
|
|
118
|
+
static subPath(
|
|
119
|
+
path: PathNode[],
|
|
120
|
+
predicate: import("../../shared/interface.ts").Predicate<PathNode>,
|
|
121
|
+
): PathNode[] | undefined;
|
|
122
|
+
/**
|
|
123
|
+
* @param {PathNode} node
|
|
124
|
+
* @return {Param[]}
|
|
125
|
+
*/
|
|
126
|
+
static nonDynamicParams(node: PathNode): Param[];
|
|
127
|
+
/**
|
|
128
|
+
* Gets the raw parameter values from a path
|
|
129
|
+
* @param {PathNode[]} path
|
|
81
130
|
*/
|
|
82
|
-
static
|
|
83
|
-
static nonDynamicParams(node: any): any;
|
|
84
|
-
/** Gets the raw parameter values from a path */
|
|
85
|
-
static paramValues(path: any): any;
|
|
131
|
+
static paramValues(path: PathNode[]): any;
|
|
86
132
|
}
|
|
133
|
+
export type Param = import("../params/param.js").Param;
|
|
134
|
+
export type GetParamsFn = import("./interface.ts").GetParamsFn;
|
|
135
|
+
export type StateObject = import("../state/state-object.js").StateObject;
|
|
136
|
+
export type RawParams = import("../params/interface.ts").RawParams;
|
|
87
137
|
import { PathNode } from "./path-node.js";
|
|
88
138
|
import { TargetState } from "../state/target-state.js";
|
|
@@ -15,7 +15,20 @@ export namespace defaultResolvePolicy {
|
|
|
15
15
|
* parameter to those fns.
|
|
16
16
|
*/
|
|
17
17
|
export class Resolvable {
|
|
18
|
-
|
|
18
|
+
/**
|
|
19
|
+
* @param {any} arg1
|
|
20
|
+
* @param {Function | undefined} [resolveFn]
|
|
21
|
+
* @param {any[]} [deps]
|
|
22
|
+
* @param {import("./interface.ts").ResolvePolicy | undefined} [policy]
|
|
23
|
+
* @param {any} [data]
|
|
24
|
+
*/
|
|
25
|
+
constructor(
|
|
26
|
+
arg1: any,
|
|
27
|
+
resolveFn?: Function | undefined,
|
|
28
|
+
deps?: any[],
|
|
29
|
+
policy?: import("./interface.ts").ResolvePolicy | undefined,
|
|
30
|
+
data?: any,
|
|
31
|
+
);
|
|
19
32
|
resolved: boolean;
|
|
20
33
|
promise: Promise<any>;
|
|
21
34
|
token: any;
|
|
@@ -23,25 +36,39 @@ export class Resolvable {
|
|
|
23
36
|
resolveFn: any;
|
|
24
37
|
deps: any;
|
|
25
38
|
data: any;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
39
|
+
/**
|
|
40
|
+
* @param {ng.BuiltStateDeclaration} state
|
|
41
|
+
* @returns {import("./interface.ts").ResolvePolicy}
|
|
42
|
+
*/
|
|
43
|
+
getPolicy(
|
|
44
|
+
state: ng.BuiltStateDeclaration,
|
|
45
|
+
): import("./interface.ts").ResolvePolicy;
|
|
30
46
|
/**
|
|
31
47
|
* Asynchronously resolve this Resolvable's data
|
|
32
48
|
*
|
|
33
49
|
* Given a ResolveContext that this Resolvable is found in:
|
|
34
50
|
* Wait for this Resolvable's dependencies, then invoke this Resolvable's function
|
|
35
51
|
* and update the Resolvable's state
|
|
52
|
+
* @param {import("./resolve-context.js").ResolveContext} resolveContext
|
|
53
|
+
* @param {ng.Transition} [trans]
|
|
36
54
|
*/
|
|
37
|
-
resolve(
|
|
55
|
+
resolve(
|
|
56
|
+
resolveContext: import("./resolve-context.js").ResolveContext,
|
|
57
|
+
trans?: ng.Transition,
|
|
58
|
+
): Promise<any>;
|
|
38
59
|
/**
|
|
39
60
|
* Gets a promise for this Resolvable's data.
|
|
40
61
|
*
|
|
41
62
|
* Fetches the data and returns a promise.
|
|
42
63
|
* Returns the existing promise if it has already been fetched once.
|
|
64
|
+
* @param {import("./resolve-context.js").ResolveContext} resolveContext
|
|
65
|
+
* @param {ng.Transition | undefined} [trans]
|
|
66
|
+
* @return {Promise<any>}
|
|
43
67
|
*/
|
|
44
|
-
get(
|
|
68
|
+
get(
|
|
69
|
+
resolveContext: import("./resolve-context.js").ResolveContext,
|
|
70
|
+
trans?: ng.Transition | undefined,
|
|
71
|
+
): Promise<any>;
|
|
45
72
|
toString(): string;
|
|
46
73
|
clone(): Resolvable;
|
|
47
74
|
}
|