@angular-wave/angular.ts 0.0.38 → 0.0.40
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/Makefile +8 -5
- package/README.md +1 -1
- package/dist/angular-ts.esm.js +2 -1
- package/dist/angular-ts.umd.js +2 -1
- package/package.json +2 -4
- package/rollup.config.js +11 -2
- package/src/angular.spec.js +25 -26
- package/src/animations/animate-css-driver.js +3 -3
- package/src/animations/animate-queue.js +7 -7
- package/src/animations/animation.js +2 -2
- package/src/animations/shared.js +6 -6
- package/src/binding.spec.js +7 -7
- package/src/core/animate/animate.js +5 -5
- package/src/core/animate/animate.spec.js +31 -31
- package/src/core/cache/cache-factory.html +18 -0
- package/src/core/cache/{cache-factor.test.js → cache-factory.test.js} +1 -1
- package/src/core/compile/compile.js +31 -25
- package/src/core/compile/compile.md +2 -2
- package/src/core/cookie-reader.spec.js +2 -2
- package/src/core/core.html +22 -0
- package/src/core/core.test.js +12 -0
- package/src/core/document.spec.js +4 -4
- package/src/core/exception-handler.js +30 -23
- package/src/core/interpolate/interpolate.js +7 -0
- package/src/core/{cache/cache-factor.html → location/location.html} +1 -1
- package/src/core/location/location.js +2 -2
- package/src/core/location/location.spec.js +17 -17
- package/src/core/location/location.test.js +12 -0
- package/src/core/on.spec.js +3 -3
- package/src/core/parser/parse.html +18 -0
- package/src/core/parser/parse.spec.js +1 -1
- package/src/core/parser/parse.test.js +12 -0
- package/src/core/prop.spec.js +3 -4
- package/src/core/pubsub/pubsub.html +18 -0
- package/src/core/pubsub/pubsub.spec.js +1 -1
- package/src/core/pubsub/pubsub.test.js +12 -0
- package/src/core/q/q.html +18 -0
- package/src/core/q/q.js +33 -0
- package/src/core/q/q.test.js +0 -0
- package/src/core/root-element.spec.js +4 -4
- package/src/core/sanitize/sanitize-uri.spec.js +1 -1
- package/src/core/sanitize/sanitize-uri.test.js +12 -0
- package/src/core/sanitize/sanitize.html +21 -0
- package/src/core/sce/sce.html +18 -0
- package/src/core/sce/sce.spec.js +2 -1
- package/src/core/sce/sce.test.js +12 -0
- package/src/core/scope/scope.html +18 -0
- package/src/core/scope/scope.js +5 -8
- package/src/core/scope/scope.spec.js +1 -1
- package/src/core/scope/scope.test.js +12 -0
- package/src/core/task-tracker-factory.js +9 -11
- package/src/core/timeout/timeout.html +18 -0
- package/src/core/timeout/timeout.js +9 -0
- package/src/core/timeout/timeout.spec.js +2 -2
- package/src/core/timeout/timout.test.js +12 -0
- package/src/core/url-utils/url-utils.html +18 -0
- package/src/core/url-utils/url-utils.spec.js +4 -2
- package/src/core/url-utils/url-utils.test.js +12 -0
- package/src/directive/attrs/attrs.spec.js +1 -2
- package/src/directive/attrs/boolean.spec.js +1 -2
- package/src/directive/attrs/element-style.spec.js +6 -7
- package/src/directive/attrs/src.spec.js +1 -2
- package/src/directive/bind/bind.spec.js +1 -2
- package/src/directive/class/class.spec.js +15 -16
- package/src/directive/cloak/cloak.spec.js +3 -4
- package/src/directive/controller/controller.spec.js +4 -5
- package/src/directive/events/click.spec.js +1 -2
- package/src/directive/events/event.spec.js +1 -1
- package/src/directive/events/events.js +7 -0
- package/src/directive/form/form.spec.js +17 -17
- package/src/directive/if/if.spec.js +2 -2
- package/src/directive/include/include.js +2 -2
- package/src/directive/include/include.spec.js +32 -32
- package/src/directive/init/init.spec.js +2 -3
- package/src/directive/input/input.spec.js +3 -3
- package/src/directive/list/list.spec.js +1 -2
- package/src/directive/model/model.js +13 -0
- package/src/directive/model/model.spec.js +4 -5
- package/src/directive/model-options/model-options.spec.js +3 -3
- package/src/directive/non-bindable/non-bindable.spec.js +1 -2
- package/src/directive/options/options.js +5 -5
- package/src/directive/options/options.spec.js +13 -13
- package/src/directive/ref/href.spec.js +1 -2
- package/src/directive/repeat/repeat.spec.js +12 -12
- package/src/directive/script/script.spec.js +2 -3
- package/src/directive/select/select.js +6 -6
- package/src/directive/select/select.spec.js +5 -5
- package/src/directive/show-hide/show-hide.spec.js +12 -13
- package/src/directive/style/style.spec.js +3 -4
- package/src/directive/switch/switch.spec.js +2 -3
- package/src/directive/validators/validators.spec.js +1 -1
- package/src/exts/aria/aria.spec.js +1 -2
- package/src/exts/messages/messages.spec.js +5 -5
- package/src/filters/filter.spec.js +5 -5
- package/src/filters/filters.html +21 -0
- package/src/filters/filters.spec.js +3 -3
- package/src/filters/filters.test.js +12 -0
- package/src/filters/limit-to.md +1 -1
- package/src/filters/limit-to.spec.js +4 -4
- package/src/filters/order-by.spec.js +2 -2
- package/src/index.js +462 -1
- package/src/loader.js +62 -17
- package/src/public.js +6 -2
- package/src/router/directives/state-directives.spec.js +90 -90
- package/src/router/directives/view-directive.js +2 -2
- package/src/router/directives/view-directive.spec.js +9 -9
- package/src/router/state/state.spec.js +2 -4
- package/src/router/template-factory.spec.js +2 -2
- package/src/router/transition/hook-registry.js +2 -2
- package/src/router/view/view.spec.js +1 -1
- package/src/services/browser.js +56 -39
- package/src/services/document.js +16 -13
- package/src/services/log.js +39 -43
- package/src/services/template-request.js +9 -0
- package/src/shared/common.js +0 -3
- package/src/shared/jqlite/jqlite.js +83 -89
- package/src/shared/jqlite/jqlite.spec.js +218 -222
- package/src/shared/strings.js +2 -2
- package/src/shared/test-utils.js +2 -2
- package/src/shared/utils.js +8 -11
- package/src/src.test.js +10 -0
- package/tsconfig.json +1 -1
- package/tsconfig.types.json +11 -0
- package/types/animations/animate-cache.d.ts +7 -7
- package/types/animations/animate-children-directive.d.ts +3 -6
- package/types/animations/animate-swap.d.ts +7 -16
- package/types/animations/animation.d.ts +2 -11
- package/types/animations/raf-scheduler.d.ts +3 -3
- package/types/animations/shared.d.ts +9 -24
- package/types/core/{animate-css.d.ts → animate/animate-css.d.ts} +2 -8
- package/types/core/{cache.d.ts → cache/cache.d.ts} +5 -5
- package/types/core/compile/compile.d.ts +173 -0
- package/types/core/controller/controller.d.ts +32 -0
- package/types/core/exception-handler.d.ts +9 -42
- package/types/core/filter/filter.d.ts +9 -0
- package/types/core/{interpolate.d.ts → interpolate/interpolate.d.ts} +23 -39
- package/types/core/interval/interval-factory.d.ts +4 -0
- package/types/core/{interval.d.ts → interval/interval.d.ts} +1 -1
- package/types/core/location/location.d.ts +209 -0
- package/types/core/pubsub/pubsub.d.ts +156 -0
- package/types/core/q/q.d.ts +65 -0
- package/types/core/sanitize/sanitize-uri.d.ts +53 -0
- package/types/core/{sce.d.ts → sce/sce.d.ts} +80 -86
- package/types/core/scope/scope.d.ts +727 -0
- package/types/core/task-tracker-factory.d.ts +45 -38
- package/types/core/timeout/timeout.d.ts +29 -0
- package/types/core/{urlUtils.d.ts → url-utils/url-utils.d.ts} +2 -7
- package/types/directive/{bind.d.ts → bind/bind.d.ts} +4 -10
- package/types/directive/{class.d.ts → class/class.d.ts} +12 -21
- package/types/directive/controller/controller.d.ts +6 -0
- package/types/directive/events/events.d.ts +5 -0
- package/types/directive/form/form.d.ts +200 -0
- package/types/directive/if/if.d.ts +8 -0
- package/types/directive/include/include.d.ts +14 -0
- package/types/directive/{input.d.ts → input/input.d.ts} +20 -69
- package/types/directive/{model.d.ts → model/model.d.ts} +281 -280
- package/types/directive/options/options.d.ts +9 -0
- package/types/directive/ref/ref.d.ts +5 -0
- package/types/directive/repeat/repeat.d.ts +8 -0
- package/types/directive/{script.d.ts → script/script.d.ts} +5 -8
- package/types/directive/{show-hide.d.ts → show-hide/show-hide.d.ts} +10 -16
- package/types/directive/switch/switch.d.ts +17 -0
- package/types/directive/transclude/transclude.d.ts +4 -0
- package/types/directive/{validators.d.ts → validators/validators.d.ts} +20 -35
- package/types/filters/filters.d.ts +10 -16
- package/types/filters/order-by.d.ts +2 -4
- package/types/index.d.ts +702 -0
- package/types/injector.d.ts +12 -0
- package/types/public.d.ts +5 -0
- package/types/router/common/coreservices.d.ts +2 -2
- package/types/router/common/glob.d.ts +9 -9
- package/types/router/common/queue.d.ts +13 -13
- package/types/router/common/trace.d.ts +43 -43
- package/types/router/directives/view-directive.d.ts +13 -32
- package/types/router/globals.d.ts +20 -20
- package/types/router/hooks/lazy-load.d.ts +2 -11
- package/types/router/hooks/redirect-to.d.ts +1 -4
- package/types/router/hooks/url.d.ts +1 -5
- package/types/router/hooks/views.d.ts +1 -4
- package/types/router/params/param-factory.d.ts +5 -5
- package/types/router/params/param-type.d.ts +35 -35
- package/types/router/params/param-types.d.ts +11 -11
- package/types/router/params/param.d.ts +38 -38
- package/types/router/params/state-params.d.ts +10 -10
- package/types/router/path/path-node.d.ts +34 -34
- package/types/router/path/path-utils.d.ts +73 -77
- package/types/router/resolve/resolvable.d.ts +32 -32
- package/types/router/resolve/resolve-context.d.ts +84 -84
- package/types/router/services.d.ts +4 -9
- package/types/router/state/state-builder.d.ts +27 -27
- package/types/router/state/state-matcher.d.ts +5 -5
- package/types/router/state/state-object.d.ts +58 -58
- package/types/router/state/state-queue-manager.d.ts +10 -16
- package/types/router/state/state-registry.d.ts +100 -107
- package/types/router/state/state-service.d.ts +411 -411
- package/types/router/state/target-state.d.ts +64 -69
- package/types/router/state/views.d.ts +31 -37
- package/types/router/state-filters.d.ts +7 -7
- package/types/router/state-provider.d.ts +105 -105
- package/types/router/template-factory.d.ts +83 -112
- package/types/router/transition/hook-builder.d.ts +25 -25
- package/types/router/transition/hook-registry.d.ts +68 -83
- package/types/router/transition/interface.d.ts +7 -7
- package/types/router/transition/reject-factory.d.ts +34 -34
- package/types/router/transition/transition-event-type.d.ts +9 -18
- package/types/router/transition/transition-hook.d.ts +77 -82
- package/types/router/transition/transition-service.d.ts +82 -99
- package/types/router/transition/transition.d.ts +369 -377
- package/types/router/url/url-config.d.ts +84 -84
- package/types/router/url/url-matcher.d.ts +115 -119
- package/types/router/url/url-rule.d.ts +114 -124
- package/types/router/url/url-rules.d.ts +217 -217
- package/types/router/url/url-service.d.ts +264 -269
- package/types/router/view/view.d.ts +114 -117
- package/types/router/view-scroll.d.ts +2 -2
- package/types/services/anchor-scroll.d.ts +2 -8
- package/types/services/browser.d.ts +157 -135
- package/types/services/cache-factory.d.ts +25 -25
- package/types/services/cookie-reader.d.ts +2 -2
- package/types/services/document.d.ts +13 -9
- package/types/services/http/http.d.ts +145 -0
- package/types/services/{http-backend.d.ts → http-backend/http-backend.d.ts} +3 -35
- package/types/services/log.d.ts +55 -52
- package/types/services/template-request.d.ts +44 -53
- package/types/shared/common.d.ts +4 -20
- package/types/{constants.d.ts → shared/constants.d.ts} +6 -6
- package/types/shared/hof.d.ts +1 -1
- package/types/{jqLite.d.ts → shared/jqlite/jqlite.d.ts} +16 -17
- package/types/shared/test-utils.d.ts +11 -0
- package/types/shared/utils.d.ts +29 -46
- package/types-back/global.d.ts +3 -1
- package/types-back/index.d.ts +3 -296
- package/types/core/compile.d.ts +0 -206
- package/types/core/controller.d.ts +0 -42
- package/types/core/filter.d.ts +0 -9
- package/types/core/interval-factory.d.ts +0 -21
- package/types/core/location.d.ts +0 -234
- package/types/core/pubsub.d.ts +0 -164
- package/types/core/q.d.ts +0 -33
- package/types/core/root-scope.d.ts +0 -754
- package/types/core/sanitize-uri.d.ts +0 -57
- package/types/core/timeout.d.ts +0 -31
- package/types/directive/controller.d.ts +0 -6
- package/types/directive/events.d.ts +0 -12
- package/types/directive/form.d.ts +0 -230
- package/types/directive/if.d.ts +0 -17
- package/types/directive/include.d.ts +0 -33
- package/types/directive/options.d.ts +0 -16
- package/types/directive/ref.d.ts +0 -11
- package/types/directive/repeat.d.ts +0 -23
- package/types/directive/switch.d.ts +0 -23
- package/types/directive/transclude.d.ts +0 -15
- package/types/services/http.d.ts +0 -157
- /package/src/core/cache/{cache-factor.spec.js → cache-factory.spec.js} +0 -0
- /package/types/directive/{attrs.d.ts → attrs/attrs.d.ts} +0 -0
- /package/types/directive/{change.d.ts → change/change.d.ts} +0 -0
- /package/types/directive/{cloak.d.ts → cloak/cloak.d.ts} +0 -0
- /package/types/directive/{init.d.ts → init/init.d.ts} +0 -0
- /package/types/directive/{list.d.ts → list/list.d.ts} +0 -0
- /package/types/directive/{non-bindable.d.ts → non-bindable/non-bindable.d.ts} +0 -0
- /package/types/directive/{style.d.ts → style/style.d.ts} +0 -0
- /package/types/exts/{aria.d.ts → aria/aria.d.ts} +0 -0
- /package/types/exts/{messages.d.ts → messages/messages.d.ts} +0 -0
|
@@ -2,82 +2,78 @@
|
|
|
2
2
|
* This class contains functions which convert TargetStates, Nodes and paths from one type to another.
|
|
3
3
|
*/
|
|
4
4
|
export class PathUtils {
|
|
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
|
-
static subPath(path: any, predicate: any): any;
|
|
79
|
-
static nonDynamicParams(node: any): any;
|
|
80
|
-
/** Gets the raw parameter values from a path */
|
|
81
|
-
static paramValues(path: any): any;
|
|
5
|
+
/** Given a PathNode[], create an TargetState */
|
|
6
|
+
static makeTargetState(registry: any, path: any): TargetState;
|
|
7
|
+
static buildPath(targetState: any): any;
|
|
8
|
+
/** Given a fromPath: PathNode[] and a TargetState, builds a toPath: PathNode[] */
|
|
9
|
+
static buildToPath(fromPath: any, targetState: any): any;
|
|
10
|
+
/**
|
|
11
|
+
* Creates ViewConfig objects and adds to nodes.
|
|
12
|
+
*
|
|
13
|
+
* On each [[PathNode]], creates ViewConfig objects from the views: property of the node's state
|
|
14
|
+
*/
|
|
15
|
+
static applyViewConfigs($view: any, path: any, states: any): void;
|
|
16
|
+
/**
|
|
17
|
+
* Given a fromPath and a toPath, returns a new to path which inherits parameters from the fromPath
|
|
18
|
+
*
|
|
19
|
+
* For a parameter in a node to be inherited from the from path:
|
|
20
|
+
* - The toPath's node must have a matching node in the fromPath (by state).
|
|
21
|
+
* - The parameter name must not be found in the toKeys parameter array.
|
|
22
|
+
*
|
|
23
|
+
* Note: the keys provided in toKeys are intended to be those param keys explicitly specified by some
|
|
24
|
+
* caller, for instance, $state.transitionTo(..., toParams). If a key was found in toParams,
|
|
25
|
+
* it is not inherited from the fromPath.
|
|
26
|
+
*/
|
|
27
|
+
static inheritParams(fromPath: any, toPath: any, toKeys?: any[]): any;
|
|
28
|
+
/**
|
|
29
|
+
* Computes the tree changes (entering, exiting) between a fromPath and toPath.
|
|
30
|
+
*/
|
|
31
|
+
static treeChanges(fromPath: any, toPath: any, reloadState: any): {
|
|
32
|
+
from: any;
|
|
33
|
+
to: any;
|
|
34
|
+
retained: any;
|
|
35
|
+
retainedWithToParams: any;
|
|
36
|
+
exiting: any;
|
|
37
|
+
entering: any;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Returns a new path which is: the subpath of the first path which matches the second path.
|
|
41
|
+
*
|
|
42
|
+
* The new path starts from root and contains any nodes that match the nodes in the second path.
|
|
43
|
+
* It stops before the first non-matching node.
|
|
44
|
+
*
|
|
45
|
+
* Nodes are compared using their state property and their parameter values.
|
|
46
|
+
* If a `paramsFn` is provided, only the [[Param]] returned by the function will be considered when comparing nodes.
|
|
47
|
+
*
|
|
48
|
+
* @param pathA the first path
|
|
49
|
+
* @param pathB the second path
|
|
50
|
+
* @param paramsFn a function which returns the parameters to consider when comparing
|
|
51
|
+
*
|
|
52
|
+
* @returns an array of PathNodes from the first path which match the nodes in the second path
|
|
53
|
+
*/
|
|
54
|
+
static matching(pathA: any, pathB: any, paramsFn: any): any[];
|
|
55
|
+
/**
|
|
56
|
+
* Returns true if two paths are identical.
|
|
57
|
+
*
|
|
58
|
+
* @param pathA
|
|
59
|
+
* @param pathB
|
|
60
|
+
* @param paramsFn a function which returns the parameters to consider when comparing
|
|
61
|
+
* @returns true if the the states and parameter values for both paths are identical
|
|
62
|
+
*/
|
|
63
|
+
static equals(pathA: any, pathB: any, paramsFn: any): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Return a subpath of a path, which stops at the first matching node
|
|
66
|
+
*
|
|
67
|
+
* Given an array of nodes, returns a subset of the array starting from the first node,
|
|
68
|
+
* stopping when the first node matches the predicate.
|
|
69
|
+
*
|
|
70
|
+
* @param path a path of [[PathNode]]s
|
|
71
|
+
* @param predicate a [[Predicate]] fn that matches [[PathNode]]s
|
|
72
|
+
* @returns a subpath up to the matching node, or undefined if no match is found
|
|
73
|
+
*/
|
|
74
|
+
static subPath(path: any, predicate: any): any;
|
|
75
|
+
static nonDynamicParams(node: any): any;
|
|
76
|
+
/** Gets the raw parameter values from a path */
|
|
77
|
+
static paramValues(path: any): any;
|
|
82
78
|
}
|
|
83
79
|
import { TargetState } from "../state/target-state";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export namespace defaultResolvePolicy {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
let when: string;
|
|
3
|
+
let async: string;
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
6
|
* The basic building block for the resolve system.
|
|
@@ -15,36 +15,36 @@ export namespace defaultResolvePolicy {
|
|
|
15
15
|
* parameter to those fns.
|
|
16
16
|
*/
|
|
17
17
|
export class Resolvable {
|
|
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
|
-
|
|
18
|
+
constructor(arg1: any, resolveFn: any, deps: any, policy: any, data: any);
|
|
19
|
+
resolved: boolean;
|
|
20
|
+
promise: any;
|
|
21
|
+
token: any;
|
|
22
|
+
policy: any;
|
|
23
|
+
resolveFn: any;
|
|
24
|
+
deps: any;
|
|
25
|
+
data: any;
|
|
26
|
+
getPolicy(state: any): {
|
|
27
|
+
when: any;
|
|
28
|
+
async: any;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Asynchronously resolve this Resolvable's data
|
|
32
|
+
*
|
|
33
|
+
* Given a ResolveContext that this Resolvable is found in:
|
|
34
|
+
* Wait for this Resolvable's dependencies, then invoke this Resolvable's function
|
|
35
|
+
* and update the Resolvable's state
|
|
36
|
+
*/
|
|
37
|
+
resolve(resolveContext: any, trans: any): any;
|
|
38
|
+
/**
|
|
39
|
+
* Gets a promise for this Resolvable's data.
|
|
40
|
+
*
|
|
41
|
+
* Fetches the data and returns a promise.
|
|
42
|
+
* Returns the existing promise if it has already been fetched once.
|
|
43
|
+
*/
|
|
44
|
+
get(resolveContext: any, trans: any): any;
|
|
45
|
+
toString(): string;
|
|
46
|
+
clone(): Resolvable;
|
|
47
47
|
}
|
|
48
48
|
export namespace Resolvable {
|
|
49
|
-
|
|
49
|
+
function fromData(token: any, data: any): Resolvable;
|
|
50
50
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export namespace resolvePolicies {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
namespace when {
|
|
3
|
+
let LAZY: string;
|
|
4
|
+
let EAGER: string;
|
|
5
|
+
}
|
|
6
|
+
namespace async {
|
|
7
|
+
let WAIT: string;
|
|
8
|
+
let NOWAIT: string;
|
|
9
|
+
}
|
|
10
10
|
}
|
|
11
11
|
export const NATIVE_INJECTOR_TOKEN: "Native Injector";
|
|
12
12
|
/**
|
|
@@ -20,83 +20,83 @@ export const NATIVE_INJECTOR_TOKEN: "Native Injector";
|
|
|
20
20
|
* The ResolveContext closes over the [[PathNode]]s, and provides DI for the last node in the path.
|
|
21
21
|
*/
|
|
22
22
|
export class ResolveContext {
|
|
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
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
23
|
+
constructor(_path: any);
|
|
24
|
+
_path: any;
|
|
25
|
+
/** Gets all the tokens found in the resolve context, de-duplicated */
|
|
26
|
+
getTokens(): any;
|
|
27
|
+
/**
|
|
28
|
+
* Gets the Resolvable that matches the token
|
|
29
|
+
*
|
|
30
|
+
* Gets the last Resolvable that matches the token in this context, or undefined.
|
|
31
|
+
* Throws an error if it doesn't exist in the ResolveContext
|
|
32
|
+
*/
|
|
33
|
+
getResolvable(token: any): any;
|
|
34
|
+
/** Returns the [[ResolvePolicy]] for the given [[Resolvable]] */
|
|
35
|
+
getPolicy(resolvable: any): any;
|
|
36
|
+
/**
|
|
37
|
+
* Returns a ResolveContext that includes a portion of this one
|
|
38
|
+
*
|
|
39
|
+
* Given a state, this method creates a new ResolveContext from this one.
|
|
40
|
+
* The new context starts at the first node (root) and stops at the node for the `state` parameter.
|
|
41
|
+
*
|
|
42
|
+
* #### Why
|
|
43
|
+
*
|
|
44
|
+
* When a transition is created, the nodes in the "To Path" are injected from a ResolveContext.
|
|
45
|
+
* A ResolveContext closes over a path of [[PathNode]]s and processes the resolvables.
|
|
46
|
+
* The "To State" can inject values from its own resolvables, as well as those from all its ancestor state's (node's).
|
|
47
|
+
* This method is used to create a narrower context when injecting ancestor nodes.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* `let ABCD = new ResolveContext([A, B, C, D]);`
|
|
51
|
+
*
|
|
52
|
+
* Given a path `[A, B, C, D]`, where `A`, `B`, `C` and `D` are nodes for states `a`, `b`, `c`, `d`:
|
|
53
|
+
* When injecting `D`, `D` should have access to all resolvables from `A`, `B`, `C`, `D`.
|
|
54
|
+
* However, `B` should only be able to access resolvables from `A`, `B`.
|
|
55
|
+
*
|
|
56
|
+
* When resolving for the `B` node, first take the full "To Path" Context `[A,B,C,D]` and limit to the subpath `[A,B]`.
|
|
57
|
+
* `let AB = ABCD.subcontext(a)`
|
|
58
|
+
*/
|
|
59
|
+
subContext(state: any): ResolveContext;
|
|
60
|
+
/**
|
|
61
|
+
* Adds Resolvables to the node that matches the state
|
|
62
|
+
*
|
|
63
|
+
* This adds a [[Resolvable]] (generally one created on the fly; not declared on a [[StateDeclaration.resolve]] block).
|
|
64
|
+
* The resolvable is added to the node matching the `state` parameter.
|
|
65
|
+
*
|
|
66
|
+
* These new resolvables are not automatically fetched.
|
|
67
|
+
* The calling code should either fetch them, fetch something that depends on them,
|
|
68
|
+
* or rely on [[resolvePath]] being called when some state is being entered.
|
|
69
|
+
*
|
|
70
|
+
* Note: each resolvable's [[ResolvePolicy]] is merged with the state's policy, and the global default.
|
|
71
|
+
*
|
|
72
|
+
* @param newResolvables the new Resolvables
|
|
73
|
+
* @param state Used to find the node to put the resolvable on
|
|
74
|
+
*/
|
|
75
|
+
addResolvables(newResolvables: any, state: any): void;
|
|
76
|
+
/**
|
|
77
|
+
* Returns a promise for an array of resolved path Element promises
|
|
78
|
+
*
|
|
79
|
+
* @param when
|
|
80
|
+
* @param trans
|
|
81
|
+
* @returns {Promise<any>|any}
|
|
82
|
+
*/
|
|
83
|
+
resolvePath(when: string, trans: any): Promise<any> | any;
|
|
84
|
+
injector(): UIInjectorImpl;
|
|
85
|
+
_injector: UIInjectorImpl;
|
|
86
|
+
findNode(resolvable: any): undefined;
|
|
87
|
+
/**
|
|
88
|
+
* Gets the async dependencies of a Resolvable
|
|
89
|
+
*
|
|
90
|
+
* Given a Resolvable, returns its dependencies as a Resolvable[]
|
|
91
|
+
*/
|
|
92
|
+
getDependencies(resolvable: any): any;
|
|
93
93
|
}
|
|
94
94
|
declare class UIInjectorImpl {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
95
|
+
constructor(context: any);
|
|
96
|
+
context: any;
|
|
97
|
+
native: any;
|
|
98
|
+
get(token: any): any;
|
|
99
|
+
getAsync(token: any): any;
|
|
100
|
+
getNative(token: any): any;
|
|
101
101
|
}
|
|
102
102
|
export {};
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
export function runBlock(
|
|
2
|
-
$injector: any,
|
|
3
|
-
$q: any,
|
|
4
|
-
$stateRegistry: any,
|
|
5
|
-
$urlService: any,
|
|
6
|
-
): void;
|
|
1
|
+
export function runBlock($injector: any, $q: any, $stateRegistry: any, $urlService: any): void;
|
|
7
2
|
export namespace runBlock {
|
|
8
|
-
|
|
3
|
+
let $inject: string[];
|
|
9
4
|
}
|
|
10
5
|
export function watchDigests($rootScope: any): void;
|
|
11
6
|
export namespace watchDigests {
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
let $inject_1: string[];
|
|
8
|
+
export { $inject_1 as $inject };
|
|
14
9
|
}
|
|
@@ -53,33 +53,33 @@ export function resolvablesBuilder(state: any): any[];
|
|
|
53
53
|
* using the [[builder]] method.
|
|
54
54
|
*/
|
|
55
55
|
export class StateBuilder {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
56
|
+
constructor(matcher: any, urlService: any);
|
|
57
|
+
matcher: any;
|
|
58
|
+
$injector: any;
|
|
59
|
+
builders: {
|
|
60
|
+
name: (typeof nameBuilder)[];
|
|
61
|
+
self: (typeof selfBuilder)[];
|
|
62
|
+
parent: ((state: any) => any)[];
|
|
63
|
+
data: (typeof dataBuilder)[];
|
|
64
|
+
url: ((stateObject: any) => any)[];
|
|
65
|
+
navigable: ((state: any) => any)[];
|
|
66
|
+
params: ((state: any) => any)[];
|
|
67
|
+
views: any[];
|
|
68
|
+
path: (typeof pathBuilder)[];
|
|
69
|
+
includes: (typeof includesBuilder)[];
|
|
70
|
+
resolvables: (typeof resolvablesBuilder)[];
|
|
71
|
+
};
|
|
72
|
+
builder(name: any, fn: any): any;
|
|
73
|
+
/**
|
|
74
|
+
* Builds all of the properties on an essentially blank State object, returning a State object which has all its
|
|
75
|
+
* properties and API built.
|
|
76
|
+
*
|
|
77
|
+
* @param state an uninitialized State object
|
|
78
|
+
* @returns the built State object
|
|
79
|
+
*/
|
|
80
|
+
build(state: any): any;
|
|
81
|
+
parentName(state: any): any;
|
|
82
|
+
name(state: any): any;
|
|
83
83
|
}
|
|
84
84
|
declare function nameBuilder(state: any): any;
|
|
85
85
|
declare function selfBuilder(state: any): any;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export class StateMatcher {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
constructor(_states: any);
|
|
3
|
+
_states: any;
|
|
4
|
+
isRelative(stateName: any): boolean;
|
|
5
|
+
find(stateOrName: any, base: any, matchGlob?: boolean): any;
|
|
6
|
+
resolvePath(name: any, base: any): string;
|
|
7
7
|
}
|
|
@@ -9,64 +9,64 @@
|
|
|
9
9
|
* Each of its own properties (i.e., `hasOwnProperty`) are built using builders from the [[StateBuilder]].
|
|
10
10
|
*/
|
|
11
11
|
export class StateObject {
|
|
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
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Create a state object to put the private/internal implementation details onto.
|
|
14
|
+
* The object's prototype chain looks like:
|
|
15
|
+
* (Internal State Object) -> (Copy of State.prototype) -> (State Declaration object) -> (State Declaration's prototype...)
|
|
16
|
+
*
|
|
17
|
+
* @param stateDecl the user-supplied State Declaration
|
|
18
|
+
* @returns {StateObject} an internal State object
|
|
19
|
+
*/
|
|
20
|
+
static create(stateDecl: any): StateObject;
|
|
21
|
+
constructor(config: any);
|
|
22
|
+
/**
|
|
23
|
+
* Returns true if the provided parameter is the same state.
|
|
24
|
+
*
|
|
25
|
+
* Compares the identity of the state against the passed value, which is either an object
|
|
26
|
+
* reference to the actual `State` instance, the original definition object passed to
|
|
27
|
+
* `$stateProvider.state()`, or the fully-qualified name.
|
|
28
|
+
*
|
|
29
|
+
* @param ref Can be one of (a) a `State` instance, (b) an object that was passed
|
|
30
|
+
* into `$stateProvider.state()`, (c) the fully-qualified name of a state as a string.
|
|
31
|
+
* @returns Returns `true` if `ref` matches the current `State` instance.
|
|
32
|
+
*/
|
|
33
|
+
is(ref: any): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated this does not properly handle dot notation
|
|
36
|
+
* @returns Returns a dot-separated name of the state.
|
|
37
|
+
*/
|
|
38
|
+
fqn(): any;
|
|
39
|
+
/**
|
|
40
|
+
* Returns the root node of this state's tree.
|
|
41
|
+
*
|
|
42
|
+
* @returns The root of this state's tree.
|
|
43
|
+
*/
|
|
44
|
+
root(): any;
|
|
45
|
+
/**
|
|
46
|
+
* Gets the state's `Param` objects
|
|
47
|
+
*
|
|
48
|
+
* Gets the list of [[Param]] objects owned by the state.
|
|
49
|
+
* If `opts.inherit` is true, it also includes the ancestor states' [[Param]] objects.
|
|
50
|
+
* If `opts.matchingKeys` exists, returns only `Param`s whose `id` is a key on the `matchingKeys` object
|
|
51
|
+
*
|
|
52
|
+
* @param opts options
|
|
53
|
+
*/
|
|
54
|
+
parameters(opts: any): any;
|
|
55
|
+
/**
|
|
56
|
+
* Returns a single [[Param]] that is owned by the state
|
|
57
|
+
*
|
|
58
|
+
* If `opts.inherit` is true, it also searches the ancestor states` [[Param]]s.
|
|
59
|
+
* @param id the name of the [[Param]] to return
|
|
60
|
+
* @param opts options
|
|
61
|
+
*/
|
|
62
|
+
parameter(id: any, opts?: {}): any;
|
|
63
|
+
toString(): any;
|
|
64
64
|
}
|
|
65
65
|
export namespace StateObject {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
/** Predicate which returns true if the object is an class with @State() decorator */
|
|
67
|
+
function isStateClass(stateDecl: any): boolean;
|
|
68
|
+
/** Predicate which returns true if the object is a [[StateDeclaration]] object */
|
|
69
|
+
function isStateDeclaration(obj: any): boolean;
|
|
70
|
+
/** Predicate which returns true if the object is an internal [[StateObject]] object */
|
|
71
|
+
function isState(obj: any): boolean;
|
|
72
72
|
}
|