@angular-wave/angular.ts 0.0.21 → 0.0.23

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.
Files changed (134) hide show
  1. package/Makefile +1 -1
  2. package/TODO.md +14 -0
  3. package/dist/angular-ts.esm.js +1 -1
  4. package/dist/angular-ts.umd.js +1 -1
  5. package/index.html +8 -2
  6. package/package.json +1 -1
  7. package/src/animations/animate-css-driver.js +2 -2
  8. package/src/animations/animate-css.js +15 -6
  9. package/src/animations/animate-js.js +1 -1
  10. package/src/animations/animate-queue.js +1 -1
  11. package/src/animations/shared.js +0 -14
  12. package/src/core/compile.js +6 -3
  13. package/src/directive/if.js +0 -79
  14. package/src/directive/if.md +80 -0
  15. package/src/directive/include.js +0 -82
  16. package/src/directive/include.md +86 -0
  17. package/src/directive/repeat.js +0 -1
  18. package/src/filters/order-by.js +8 -8
  19. package/src/loader.js +0 -1
  20. package/src/router/common/trace.js +1 -1
  21. package/src/router/directives/stateDirectives.js +16 -14
  22. package/src/router/directives/viewDirective.js +5 -13
  23. package/src/router/hooks/resolve.js +3 -4
  24. package/src/router/hooks/views.js +3 -2
  25. package/src/router/state/stateService.js +1 -2
  26. package/src/router/stateProvider.js +8 -0
  27. package/src/router/templateFactory.js +13 -7
  28. package/src/router/transition/interface.js +14 -14
  29. package/src/router/transition/rejectFactory.js +29 -20
  30. package/src/router/transition/transition.js +5 -1
  31. package/src/router/transition/transitionHook.js +5 -5
  32. package/src/router/url/urlMatcher.js +1 -2
  33. package/src/router/url/urlRule.js +10 -2
  34. package/src/router/url/urlRules.js +1 -1
  35. package/src/services/browser.js +3 -18
  36. package/src/shared/common.js +0 -1
  37. package/test/module-test.html +44 -12
  38. package/test/router/ng-state-builder.spec.js +81 -0
  39. package/test/router/services.spec.js +70 -0
  40. package/test/router/state-directives.spec.js +1182 -0
  41. package/test/router/template-factory.spec.js +146 -0
  42. package/test/router/url-matcher-factory.spec.js +1313 -0
  43. package/test/router/view-directive.spec.js +2013 -0
  44. package/test/router/view-hook.spec.js +217 -0
  45. package/test/router/view-scroll.spec.js +77 -0
  46. package/test/router/view.spec.js +117 -0
  47. package/types/angular.d.ts +132 -124
  48. package/types/index.d.ts +2350 -2187
  49. package/types/jqlite.d.ts +463 -418
  50. package/types/router/core/common/common.d.ts +70 -24
  51. package/types/router/core/common/coreservices.d.ts +30 -32
  52. package/types/router/core/common/glob.d.ts +9 -9
  53. package/types/router/core/common/hof.d.ts +12 -4
  54. package/types/router/core/common/index.d.ts +8 -8
  55. package/types/router/core/common/predicates.d.ts +1 -1
  56. package/types/router/core/common/queue.d.ts +13 -13
  57. package/types/router/core/common/safeConsole.d.ts +3 -3
  58. package/types/router/core/common/strings.d.ts +4 -2
  59. package/types/router/core/common/trace.d.ts +94 -82
  60. package/types/router/core/globals.d.ts +37 -37
  61. package/types/router/core/hooks/coreResolvables.d.ts +5 -3
  62. package/types/router/core/hooks/ignoredTransition.d.ts +4 -2
  63. package/types/router/core/hooks/invalidTransition.d.ts +4 -2
  64. package/types/router/core/hooks/lazyLoad.d.ts +10 -5
  65. package/types/router/core/hooks/onEnterExitRetain.d.ts +10 -4
  66. package/types/router/core/hooks/redirectTo.d.ts +4 -2
  67. package/types/router/core/hooks/resolve.d.ts +10 -4
  68. package/types/router/core/hooks/updateGlobals.d.ts +4 -2
  69. package/types/router/core/hooks/url.d.ts +4 -2
  70. package/types/router/core/hooks/views.d.ts +7 -3
  71. package/types/router/core/index.d.ts +11 -12
  72. package/types/router/core/interface.d.ts +83 -81
  73. package/types/router/core/params/index.d.ts +5 -5
  74. package/types/router/core/params/interface.d.ts +439 -439
  75. package/types/router/core/params/param.d.ts +72 -60
  76. package/types/router/core/params/paramType.d.ts +40 -40
  77. package/types/router/core/params/paramTypes.d.ts +169 -165
  78. package/types/router/core/params/stateParams.d.ts +13 -13
  79. package/types/router/core/path/index.d.ts +2 -2
  80. package/types/router/core/path/pathNode.d.ts +49 -49
  81. package/types/router/core/path/pathUtils.d.ts +100 -74
  82. package/types/router/core/resolve/index.d.ts +3 -3
  83. package/types/router/core/resolve/interface.d.ts +137 -137
  84. package/types/router/core/resolve/resolvable.d.ts +60 -54
  85. package/types/router/core/resolve/resolveContext.d.ts +84 -79
  86. package/types/router/core/router.d.ts +95 -86
  87. package/types/router/core/state/index.d.ts +8 -8
  88. package/types/router/core/state/interface.d.ts +667 -643
  89. package/types/router/core/state/stateBuilder.d.ts +41 -38
  90. package/types/router/core/state/stateMatcher.d.ts +11 -9
  91. package/types/router/core/state/stateObject.d.ts +154 -139
  92. package/types/router/core/state/stateQueueManager.d.ts +26 -21
  93. package/types/router/core/state/stateRegistry.d.ts +124 -121
  94. package/types/router/core/state/stateService.d.ts +380 -343
  95. package/types/router/core/state/targetState.d.ts +74 -69
  96. package/types/router/core/transition/hookBuilder.d.ts +34 -30
  97. package/types/router/core/transition/hookRegistry.d.ts +96 -74
  98. package/types/router/core/transition/index.d.ts +8 -8
  99. package/types/router/core/transition/interface.d.ts +652 -609
  100. package/types/router/core/transition/rejectFactory.d.ts +97 -97
  101. package/types/router/core/transition/transition.d.ts +565 -517
  102. package/types/router/core/transition/transitionEventType.d.ts +20 -11
  103. package/types/router/core/transition/transitionHook.d.ts +90 -82
  104. package/types/router/core/transition/transitionService.d.ts +228 -161
  105. package/types/router/core/url/index.d.ts +8 -8
  106. package/types/router/core/url/interface.d.ts +100 -87
  107. package/types/router/core/url/urlConfig.d.ts +130 -126
  108. package/types/router/core/url/urlMatcher.d.ts +132 -127
  109. package/types/router/core/url/urlMatcherFactory.d.ts +46 -42
  110. package/types/router/core/url/urlRouter.d.ts +91 -75
  111. package/types/router/core/url/urlRule.d.ts +123 -100
  112. package/types/router/core/url/urlRules.d.ts +240 -232
  113. package/types/router/core/url/urlService.d.ts +201 -201
  114. package/types/router/core/view/index.d.ts +2 -2
  115. package/types/router/core/view/interface.d.ts +26 -26
  116. package/types/router/core/view/view.d.ts +152 -143
  117. package/types/router/directives/viewDirective.d.ts +12 -11
  118. package/types/router/index.d.ts +11 -12
  119. package/types/router/interface.d.ts +361 -351
  120. package/types/router/legacy/resolveService.d.ts +44 -40
  121. package/types/router/legacy/stateEvents.d.ts +1 -1
  122. package/types/router/locationServices.d.ts +45 -37
  123. package/types/router/services.d.ts +9 -9
  124. package/types/router/stateFilters.d.ts +3 -3
  125. package/types/router/stateProvider.d.ts +240 -235
  126. package/types/router/statebuilders/onEnterExitRetain.d.ts +4 -2
  127. package/types/router/statebuilders/views.d.ts +35 -22
  128. package/types/router/templateFactory.d.ts +99 -79
  129. package/types/router/viewScroll.d.ts +7 -7
  130. package/src/directive/a.js +0 -37
  131. package/types/router/angular.d.ts +0 -1
  132. package/types/router/core/vanilla.d.ts +0 -1
  133. package/types/router/directives/stateDirectives.d.ts +0 -3
  134. package/types/router/injectables.d.ts +0 -1
@@ -1,8 +1,8 @@
1
- import { StateObject } from '../state/stateObject';
2
- import { RawParams } from '../params/interface';
3
- import { Param } from '../params/param';
4
- import { Resolvable } from '../resolve/resolvable';
5
- import { ViewConfig } from '../view/interface';
1
+ import { StateObject } from "../state/stateObject";
2
+ import { RawParams } from "../params/interface";
3
+ import { Param } from "../params/param";
4
+ import { Resolvable } from "../resolve/resolvable";
5
+ import { ViewConfig } from "../view/interface";
6
6
  /**
7
7
  * A node in a [[TreeChanges]] path
8
8
  *
@@ -11,50 +11,50 @@ import { ViewConfig } from '../view/interface';
11
11
  * The stateful information includes parameter values and resolve data.
12
12
  */
13
13
  export declare class PathNode {
14
- /** The state being entered, exited, or retained */
15
- state: StateObject;
16
- /** The parameters declared on the state */
17
- paramSchema: Param[];
18
- /** The parameter values that belong to the state */
19
- paramValues: {
20
- [key: string]: any;
21
- };
22
- /** The individual (stateful) resolvable objects that belong to the state */
23
- resolvables: Resolvable[];
24
- /** The state's declared view configuration objects */
25
- views: ViewConfig[];
26
- /**
27
- * Returns a clone of the PathNode
28
- * @deprecated use instance method `node.clone()`
29
- */
30
- static clone: (node: PathNode) => PathNode;
31
- /** Creates a copy of a PathNode */
32
- constructor(node: PathNode);
33
- /** Creates a new (empty) PathNode for a State */
34
- constructor(state: StateObject);
35
- clone(): PathNode;
36
- /** Sets [[paramValues]] for the node, from the values of an object hash */
37
- applyRawParams(params: RawParams): PathNode;
38
- /** Gets a specific [[Param]] metadata that belongs to the node */
39
- parameter(name: string): Param;
40
- /**
41
- * @returns true if the state and parameter values for another PathNode are
42
- * equal to the state and param values for this PathNode
43
- */
44
- equals(node: PathNode, paramsFn?: GetParamsFn): boolean;
45
- /**
46
- * Finds Params with different parameter values on another PathNode.
47
- *
48
- * Given another node (of the same state), finds the parameter values which differ.
49
- * Returns the [[Param]] (schema objects) whose parameter values differ.
50
- *
51
- * Given another node for a different state, returns `false`
52
- *
53
- * @param node The node to compare to
54
- * @param paramsFn A function that returns which parameters should be compared.
55
- * @returns The [[Param]]s which differ, or null if the two nodes are for different states
56
- */
57
- diff(node: PathNode, paramsFn?: GetParamsFn): Param[] | false;
14
+ /** The state being entered, exited, or retained */
15
+ state: StateObject;
16
+ /** The parameters declared on the state */
17
+ paramSchema: Param[];
18
+ /** The parameter values that belong to the state */
19
+ paramValues: {
20
+ [key: string]: any;
21
+ };
22
+ /** The individual (stateful) resolvable objects that belong to the state */
23
+ resolvables: Resolvable[];
24
+ /** The state's declared view configuration objects */
25
+ views: ViewConfig[];
26
+ /**
27
+ * Returns a clone of the PathNode
28
+ * @deprecated use instance method `node.clone()`
29
+ */
30
+ static clone: (node: PathNode) => PathNode;
31
+ /** Creates a copy of a PathNode */
32
+ constructor(node: PathNode);
33
+ /** Creates a new (empty) PathNode for a State */
34
+ constructor(state: StateObject);
35
+ clone(): PathNode;
36
+ /** Sets [[paramValues]] for the node, from the values of an object hash */
37
+ applyRawParams(params: RawParams): PathNode;
38
+ /** Gets a specific [[Param]] metadata that belongs to the node */
39
+ parameter(name: string): Param;
40
+ /**
41
+ * @returns true if the state and parameter values for another PathNode are
42
+ * equal to the state and param values for this PathNode
43
+ */
44
+ equals(node: PathNode, paramsFn?: GetParamsFn): boolean;
45
+ /**
46
+ * Finds Params with different parameter values on another PathNode.
47
+ *
48
+ * Given another node (of the same state), finds the parameter values which differ.
49
+ * Returns the [[Param]] (schema objects) whose parameter values differ.
50
+ *
51
+ * Given another node for a different state, returns `false`
52
+ *
53
+ * @param node The node to compare to
54
+ * @param paramsFn A function that returns which parameters should be compared.
55
+ * @returns The [[Param]]s which differ, or null if the two nodes are for different states
56
+ */
57
+ diff(node: PathNode, paramsFn?: GetParamsFn): Param[] | false;
58
58
  }
59
59
  /** @internal */
60
60
  export declare type GetParamsFn = (pathNode: PathNode) => Param[];
@@ -1,79 +1,105 @@
1
- import { Predicate } from '../common/common';
2
- import { TreeChanges } from '../transition/interface';
3
- import { StateObject } from '../state/stateObject';
4
- import { TargetState } from '../state/targetState';
5
- import { GetParamsFn, PathNode } from './pathNode';
6
- import { ViewService } from '../view/view';
7
- import { Param } from '../params/param';
8
- import { StateRegistry } from '../state';
1
+ import { Predicate } from "../common/common";
2
+ import { TreeChanges } from "../transition/interface";
3
+ import { StateObject } from "../state/stateObject";
4
+ import { TargetState } from "../state/targetState";
5
+ import { GetParamsFn, PathNode } from "./pathNode";
6
+ import { ViewService } from "../view/view";
7
+ import { Param } from "../params/param";
8
+ import { StateRegistry } from "../state";
9
9
  /**
10
10
  * This class contains functions which convert TargetStates, Nodes and paths from one type to another.
11
11
  */
12
12
  export declare class PathUtils {
13
- /** Given a PathNode[], create an TargetState */
14
- static makeTargetState(registry: StateRegistry, path: PathNode[]): TargetState;
15
- static buildPath(targetState: TargetState): PathNode[];
16
- /** Given a fromPath: PathNode[] and a TargetState, builds a toPath: PathNode[] */
17
- static buildToPath(fromPath: PathNode[], targetState: TargetState): PathNode[];
18
- /**
19
- * Creates ViewConfig objects and adds to nodes.
20
- *
21
- * On each [[PathNode]], creates ViewConfig objects from the views: property of the node's state
22
- */
23
- static applyViewConfigs($view: ViewService, path: PathNode[], states: StateObject[]): void;
24
- /**
25
- * Given a fromPath and a toPath, returns a new to path which inherits parameters from the fromPath
26
- *
27
- * For a parameter in a node to be inherited from the from path:
28
- * - The toPath's node must have a matching node in the fromPath (by state).
29
- * - The parameter name must not be found in the toKeys parameter array.
30
- *
31
- * Note: the keys provided in toKeys are intended to be those param keys explicitly specified by some
32
- * caller, for instance, $state.transitionTo(..., toParams). If a key was found in toParams,
33
- * it is not inherited from the fromPath.
34
- */
35
- static inheritParams(fromPath: PathNode[], toPath: PathNode[], toKeys?: string[]): PathNode[];
36
- static nonDynamicParams: (node: PathNode) => Param[];
37
- /**
38
- * Computes the tree changes (entering, exiting) between a fromPath and toPath.
39
- */
40
- static treeChanges(fromPath: PathNode[], toPath: PathNode[], reloadState: StateObject): TreeChanges;
41
- /**
42
- * Returns a new path which is: the subpath of the first path which matches the second path.
43
- *
44
- * The new path starts from root and contains any nodes that match the nodes in the second path.
45
- * It stops before the first non-matching node.
46
- *
47
- * Nodes are compared using their state property and their parameter values.
48
- * If a `paramsFn` is provided, only the [[Param]] returned by the function will be considered when comparing nodes.
49
- *
50
- * @param pathA the first path
51
- * @param pathB the second path
52
- * @param paramsFn a function which returns the parameters to consider when comparing
53
- *
54
- * @returns an array of PathNodes from the first path which match the nodes in the second path
55
- */
56
- static matching(pathA: PathNode[], pathB: PathNode[], paramsFn?: GetParamsFn): PathNode[];
57
- /**
58
- * Returns true if two paths are identical.
59
- *
60
- * @param pathA
61
- * @param pathB
62
- * @param paramsFn a function which returns the parameters to consider when comparing
63
- * @returns true if the the states and parameter values for both paths are identical
64
- */
65
- static equals(pathA: PathNode[], pathB: PathNode[], paramsFn?: GetParamsFn): boolean;
66
- /**
67
- * Return a subpath of a path, which stops at the first matching node
68
- *
69
- * Given an array of nodes, returns a subset of the array starting from the first node,
70
- * stopping when the first node matches the predicate.
71
- *
72
- * @param path a path of [[PathNode]]s
73
- * @param predicate a [[Predicate]] fn that matches [[PathNode]]s
74
- * @returns a subpath up to the matching node, or undefined if no match is found
75
- */
76
- static subPath(path: PathNode[], predicate: Predicate<PathNode>): PathNode[];
77
- /** Gets the raw parameter values from a path */
78
- static paramValues: (path: PathNode[]) => any;
13
+ /** Given a PathNode[], create an TargetState */
14
+ static makeTargetState(
15
+ registry: StateRegistry,
16
+ path: PathNode[],
17
+ ): TargetState;
18
+ static buildPath(targetState: TargetState): PathNode[];
19
+ /** Given a fromPath: PathNode[] and a TargetState, builds a toPath: PathNode[] */
20
+ static buildToPath(
21
+ fromPath: PathNode[],
22
+ targetState: TargetState,
23
+ ): PathNode[];
24
+ /**
25
+ * Creates ViewConfig objects and adds to nodes.
26
+ *
27
+ * On each [[PathNode]], creates ViewConfig objects from the views: property of the node's state
28
+ */
29
+ static applyViewConfigs(
30
+ $view: ViewService,
31
+ path: PathNode[],
32
+ states: StateObject[],
33
+ ): void;
34
+ /**
35
+ * Given a fromPath and a toPath, returns a new to path which inherits parameters from the fromPath
36
+ *
37
+ * For a parameter in a node to be inherited from the from path:
38
+ * - The toPath's node must have a matching node in the fromPath (by state).
39
+ * - The parameter name must not be found in the toKeys parameter array.
40
+ *
41
+ * Note: the keys provided in toKeys are intended to be those param keys explicitly specified by some
42
+ * caller, for instance, $state.transitionTo(..., toParams). If a key was found in toParams,
43
+ * it is not inherited from the fromPath.
44
+ */
45
+ static inheritParams(
46
+ fromPath: PathNode[],
47
+ toPath: PathNode[],
48
+ toKeys?: string[],
49
+ ): PathNode[];
50
+ static nonDynamicParams: (node: PathNode) => Param[];
51
+ /**
52
+ * Computes the tree changes (entering, exiting) between a fromPath and toPath.
53
+ */
54
+ static treeChanges(
55
+ fromPath: PathNode[],
56
+ toPath: PathNode[],
57
+ reloadState: StateObject,
58
+ ): TreeChanges;
59
+ /**
60
+ * Returns a new path which is: the subpath of the first path which matches the second path.
61
+ *
62
+ * The new path starts from root and contains any nodes that match the nodes in the second path.
63
+ * It stops before the first non-matching node.
64
+ *
65
+ * Nodes are compared using their state property and their parameter values.
66
+ * If a `paramsFn` is provided, only the [[Param]] returned by the function will be considered when comparing nodes.
67
+ *
68
+ * @param pathA the first path
69
+ * @param pathB the second path
70
+ * @param paramsFn a function which returns the parameters to consider when comparing
71
+ *
72
+ * @returns an array of PathNodes from the first path which match the nodes in the second path
73
+ */
74
+ static matching(
75
+ pathA: PathNode[],
76
+ pathB: PathNode[],
77
+ paramsFn?: GetParamsFn,
78
+ ): PathNode[];
79
+ /**
80
+ * Returns true if two paths are identical.
81
+ *
82
+ * @param pathA
83
+ * @param pathB
84
+ * @param paramsFn a function which returns the parameters to consider when comparing
85
+ * @returns true if the the states and parameter values for both paths are identical
86
+ */
87
+ static equals(
88
+ pathA: PathNode[],
89
+ pathB: PathNode[],
90
+ paramsFn?: GetParamsFn,
91
+ ): boolean;
92
+ /**
93
+ * Return a subpath of a path, which stops at the first matching node
94
+ *
95
+ * Given an array of nodes, returns a subset of the array starting from the first node,
96
+ * stopping when the first node matches the predicate.
97
+ *
98
+ * @param path a path of [[PathNode]]s
99
+ * @param predicate a [[Predicate]] fn that matches [[PathNode]]s
100
+ * @returns a subpath up to the matching node, or undefined if no match is found
101
+ */
102
+ static subPath(path: PathNode[], predicate: Predicate<PathNode>): PathNode[];
103
+ /** Gets the raw parameter values from a path */
104
+ static paramValues: (path: PathNode[]) => any;
79
105
  }
@@ -1,3 +1,3 @@
1
- export * from './interface';
2
- export * from './resolvable';
3
- export * from './resolveContext';
1
+ export * from "./interface";
2
+ export * from "./resolvable";
3
+ export * from "./resolveContext";
@@ -11,12 +11,12 @@
11
11
  * An interface which is similar to an Angular 2 `Provider`
12
12
  */
13
13
  export interface ProviderLike {
14
- provide: any;
15
- useClass?: any;
16
- useFactory?: Function;
17
- useValue?: any;
18
- useExisting?: any;
19
- deps?: any[];
14
+ provide: any;
15
+ useClass?: any;
16
+ useFactory?: Function;
17
+ useValue?: any;
18
+ useExisting?: any;
19
+ deps?: any[];
20
20
  }
21
21
  /**
22
22
  * A plain object used to describe a [[Resolvable]]
@@ -36,44 +36,44 @@ export interface ProviderLike {
36
36
  * ```
37
37
  */
38
38
  export interface ResolvableLiteral {
39
- /**
40
- * A Dependency Injection token
41
- *
42
- * This Resolvable's DI token.
43
- * The Resolvable will be injectable elsewhere using the token.
44
- */
45
- token: any;
46
- /**
47
- * A function which fetches the Resolvable's data
48
- *
49
- * A function which returns one of:
50
- *
51
- * - The resolved value (synchronously)
52
- * - A promise for the resolved value
53
- * - An Observable of the resolved value(s)
54
- *
55
- * This function will be provided the dependencies listed in [[deps]] as its arguments.
56
- * The resolve system will asynchronously fetch the dependencies before invoking this function.
57
- */
58
- resolveFn: Function;
59
- /**
60
- * Defines the Resolve Policy
61
- *
62
- * A policy that defines when to invoke the resolve,
63
- * and whether to wait for async and unwrap the data
64
- */
65
- policy?: ResolvePolicy;
66
- /**
67
- * The Dependency Injection tokens
68
- *
69
- * This is an array of Dependency Injection tokens for the dependencies of the [[resolveFn]].
70
- *
71
- * The DI tokens are references to other `Resolvables`, or to other
72
- * services from the native DI system.
73
- */
74
- deps?: any[];
75
- /** Pre-resolved data. */
76
- data?: any;
39
+ /**
40
+ * A Dependency Injection token
41
+ *
42
+ * This Resolvable's DI token.
43
+ * The Resolvable will be injectable elsewhere using the token.
44
+ */
45
+ token: any;
46
+ /**
47
+ * A function which fetches the Resolvable's data
48
+ *
49
+ * A function which returns one of:
50
+ *
51
+ * - The resolved value (synchronously)
52
+ * - A promise for the resolved value
53
+ * - An Observable of the resolved value(s)
54
+ *
55
+ * This function will be provided the dependencies listed in [[deps]] as its arguments.
56
+ * The resolve system will asynchronously fetch the dependencies before invoking this function.
57
+ */
58
+ resolveFn: Function;
59
+ /**
60
+ * Defines the Resolve Policy
61
+ *
62
+ * A policy that defines when to invoke the resolve,
63
+ * and whether to wait for async and unwrap the data
64
+ */
65
+ policy?: ResolvePolicy;
66
+ /**
67
+ * The Dependency Injection tokens
68
+ *
69
+ * This is an array of Dependency Injection tokens for the dependencies of the [[resolveFn]].
70
+ *
71
+ * The DI tokens are references to other `Resolvables`, or to other
72
+ * services from the native DI system.
73
+ */
74
+ deps?: any[];
75
+ /** Pre-resolved data. */
76
+ data?: any;
77
77
  }
78
78
  /**
79
79
  * Defines how a resolve is processed during a transition
@@ -110,101 +110,101 @@ export interface ResolvableLiteral {
110
110
  * ```
111
111
  */
112
112
  export interface ResolvePolicy {
113
- /**
114
- * Defines when a Resolvable is resolved (fetched) during a transition
115
- *
116
- * - `LAZY` (default)
117
- * - Resolved as the resolve's state is being entered
118
- * - `EAGER`
119
- * - Resolved as the transition is starting
120
- *
121
- * #### Example:
122
- * Resolves for `main` and `main.home` are fetched when each state is entered.
123
- * All of `main` resolves are processed before fetching `main.home` resolves.
124
- * ```js
125
- * var state = {
126
- * name: 'main',
127
- * resolve: mainResolves, // defined elsewhere
128
- * resolvePolicy: { when: 'LAZY' }, // default
129
- * }
130
- *
131
- * var state = {
132
- * name: 'main.home',
133
- * resolve: homeResolves, // defined elsewhere
134
- * resolvePolicy: { when: 'LAZY' }, // default
135
- * }
136
- * ```
137
- *
138
- * #### Example:
139
- * Resolves for `main` and `main.home` are fetched at the same time when the transition starts.
140
- * This happens earlier in the lifecycle than when states are entered.
141
- * All of the `main` and `main.home` resolves are fetched as soon as possible.
142
- * ```js
143
- * var mainState = {
144
- * name: 'main',
145
- * resolve: mainResolves, // defined elsewhere
146
- * resolvePolicy: { when: 'EAGER' },
147
- * }
148
- *
149
- * var homeState = {
150
- * name: 'main.home',
151
- * resolve: homeResolves, // defined elsewhere
152
- * resolvePolicy: { when: 'EAGER' },
153
- * }
154
- * ```
155
- */
156
- when?: PolicyWhen;
157
- /**
158
- * Determines the unwrapping behavior of asynchronous resolve values.
159
- *
160
- * - `WAIT` (default)
161
- * - If a promise is returned from the resolveFn, wait for the promise before proceeding
162
- * - The unwrapped value from the promise
163
- * - `NOWAIT`
164
- * - If a promise is returned from the resolve, do not wait for the promise.
165
- * - Any other value returned is wrapped in a promise.
166
- * - The promise will not be unwrapped.
167
- * - The promise itself will be provided when the resolve is injected or bound elsewhere.
168
- * - {@link CustomAsyncPolicy}
169
- * - You can define a custom function that will be called with the resolveFn value.
170
- * - This function must return a promise.
171
- * - The transition will wait for this promise before proceeding
172
- *
173
- * NOTE: The previous `RXWAIT` policy has become a CustomAsyncPolicy function exported in `@uirouter/rx` package.
174
- *
175
- * #### Example:
176
- * The `Transition` will not wait for the resolve promise(s) from `main` to settle before continuing.
177
- * Resolves for `main` will be provided to components wrapped in a `Promise`.
178
- *
179
- * The `Transition` will wait for the `main.home` resolve promises.
180
- * Resolved values will be unwrapped before being provided to components.
181
- * ```js
182
- * var mainState = {
183
- * name: 'main',
184
- * resolve: mainResolves, // defined elsewhere
185
- * resolvePolicy: { async: 'NOWAIT' },
186
- * }
187
- * var homeState = {
188
- * name: 'main.home',
189
- * resolve: homeResolves, // defined elsewhere
190
- * resolvePolicy: { async: 'WAIT' }, // default
191
- * }
192
- * ```
193
- */
194
- async?: PolicyAsync;
113
+ /**
114
+ * Defines when a Resolvable is resolved (fetched) during a transition
115
+ *
116
+ * - `LAZY` (default)
117
+ * - Resolved as the resolve's state is being entered
118
+ * - `EAGER`
119
+ * - Resolved as the transition is starting
120
+ *
121
+ * #### Example:
122
+ * Resolves for `main` and `main.home` are fetched when each state is entered.
123
+ * All of `main` resolves are processed before fetching `main.home` resolves.
124
+ * ```js
125
+ * var state = {
126
+ * name: 'main',
127
+ * resolve: mainResolves, // defined elsewhere
128
+ * resolvePolicy: { when: 'LAZY' }, // default
129
+ * }
130
+ *
131
+ * var state = {
132
+ * name: 'main.home',
133
+ * resolve: homeResolves, // defined elsewhere
134
+ * resolvePolicy: { when: 'LAZY' }, // default
135
+ * }
136
+ * ```
137
+ *
138
+ * #### Example:
139
+ * Resolves for `main` and `main.home` are fetched at the same time when the transition starts.
140
+ * This happens earlier in the lifecycle than when states are entered.
141
+ * All of the `main` and `main.home` resolves are fetched as soon as possible.
142
+ * ```js
143
+ * var mainState = {
144
+ * name: 'main',
145
+ * resolve: mainResolves, // defined elsewhere
146
+ * resolvePolicy: { when: 'EAGER' },
147
+ * }
148
+ *
149
+ * var homeState = {
150
+ * name: 'main.home',
151
+ * resolve: homeResolves, // defined elsewhere
152
+ * resolvePolicy: { when: 'EAGER' },
153
+ * }
154
+ * ```
155
+ */
156
+ when?: PolicyWhen;
157
+ /**
158
+ * Determines the unwrapping behavior of asynchronous resolve values.
159
+ *
160
+ * - `WAIT` (default)
161
+ * - If a promise is returned from the resolveFn, wait for the promise before proceeding
162
+ * - The unwrapped value from the promise
163
+ * - `NOWAIT`
164
+ * - If a promise is returned from the resolve, do not wait for the promise.
165
+ * - Any other value returned is wrapped in a promise.
166
+ * - The promise will not be unwrapped.
167
+ * - The promise itself will be provided when the resolve is injected or bound elsewhere.
168
+ * - {@link CustomAsyncPolicy}
169
+ * - You can define a custom function that will be called with the resolveFn value.
170
+ * - This function must return a promise.
171
+ * - The transition will wait for this promise before proceeding
172
+ *
173
+ * NOTE: The previous `RXWAIT` policy has become a CustomAsyncPolicy function exported in `@uirouter/rx` package.
174
+ *
175
+ * #### Example:
176
+ * The `Transition` will not wait for the resolve promise(s) from `main` to settle before continuing.
177
+ * Resolves for `main` will be provided to components wrapped in a `Promise`.
178
+ *
179
+ * The `Transition` will wait for the `main.home` resolve promises.
180
+ * Resolved values will be unwrapped before being provided to components.
181
+ * ```js
182
+ * var mainState = {
183
+ * name: 'main',
184
+ * resolve: mainResolves, // defined elsewhere
185
+ * resolvePolicy: { async: 'NOWAIT' },
186
+ * }
187
+ * var homeState = {
188
+ * name: 'main.home',
189
+ * resolve: homeResolves, // defined elsewhere
190
+ * resolvePolicy: { async: 'WAIT' }, // default
191
+ * }
192
+ * ```
193
+ */
194
+ async?: PolicyAsync;
195
195
  }
196
- export declare type PolicyWhen = 'LAZY' | 'EAGER';
197
- export declare type PolicyAsync = 'WAIT' | 'NOWAIT' | CustomAsyncPolicy;
196
+ export declare type PolicyWhen = "LAZY" | "EAGER";
197
+ export declare type PolicyAsync = "WAIT" | "NOWAIT" | CustomAsyncPolicy;
198
198
  export interface CustomAsyncPolicy {
199
- (data: any): Promise<any>;
199
+ (data: any): Promise<any>;
200
200
  }
201
201
  export declare let resolvePolicies: {
202
- when: {
203
- LAZY: string;
204
- EAGER: string;
205
- };
206
- async: {
207
- WAIT: string;
208
- NOWAIT: string;
209
- };
202
+ when: {
203
+ LAZY: string;
204
+ EAGER: string;
205
+ };
206
+ async: {
207
+ WAIT: string;
208
+ NOWAIT: string;
209
+ };
210
210
  };