@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.
Files changed (107) hide show
  1. package/@types/angular.d.ts +18 -6
  2. package/@types/animations/animate-css-driver.d.ts +2 -2
  3. package/@types/animations/animate-js-driver.d.ts +11 -1
  4. package/@types/animations/animate-js.d.ts +10 -2
  5. package/@types/animations/animate-swap.d.ts +4 -1
  6. package/@types/animations/animate.d.ts +11 -5
  7. package/@types/animations/animation.d.ts +7 -0
  8. package/@types/animations/css/animate-css.d.ts +16 -0
  9. package/@types/animations/interface.d.ts +308 -19
  10. package/@types/animations/queue/animate-queue.d.ts +16 -7
  11. package/@types/animations/queue/interface.d.ts +14 -7
  12. package/@types/core/compile/attributes.d.ts +1 -1
  13. package/@types/core/compile/compile.d.ts +25 -15
  14. package/@types/core/compile/interface.d.ts +209 -34
  15. package/@types/core/controller/controller.d.ts +30 -38
  16. package/@types/core/controller/interface.d.ts +12 -3
  17. package/@types/core/parse/interface.d.ts +2 -2
  18. package/@types/core/parse/interpreter.d.ts +110 -58
  19. package/@types/core/scope/interface.d.ts +6 -0
  20. package/@types/core/scope/scope.d.ts +2 -1
  21. package/@types/directive/aria/aria.d.ts +66 -26
  22. package/@types/directive/aria/interface.d.ts +9 -0
  23. package/@types/directive/class/class.d.ts +31 -0
  24. package/@types/directive/form/form.d.ts +54 -18
  25. package/@types/directive/input/input.d.ts +59 -18
  26. package/@types/directive/input/interface.d.ts +10 -0
  27. package/@types/directive/messages/messages.d.ts +63 -12
  28. package/@types/directive/model/interface.d.ts +19 -0
  29. package/@types/directive/model/model.d.ts +70 -33
  30. package/@types/directive/model-options/model-options.d.ts +1 -23
  31. package/@types/directive/repeat/repeat.d.ts +2 -3
  32. package/@types/directive/validators/validators.d.ts +1 -5
  33. package/@types/directive/worker/interface.d.ts +9 -0
  34. package/@types/docs.d.ts +24 -0
  35. package/@types/filters/json.d.ts +4 -0
  36. package/@types/interface.d.ts +22 -69
  37. package/@types/namespace.d.ts +66 -40
  38. package/@types/router/common/trace.d.ts +150 -42
  39. package/@types/router/directives/state-directives.d.ts +4 -4
  40. package/@types/router/directives/view-directive.d.ts +2 -5
  41. package/@types/router/hooks/core-resolvables.d.ts +11 -2
  42. package/@types/router/hooks/ignored-transition.d.ts +3 -1
  43. package/@types/router/hooks/invalid-transition.d.ts +3 -1
  44. package/@types/router/hooks/lazy-load.d.ts +17 -13
  45. package/@types/router/hooks/on-enter-exit-retain.d.ts +9 -3
  46. package/@types/router/hooks/redirect-to.d.ts +3 -3
  47. package/@types/router/hooks/resolve.d.ts +11 -3
  48. package/@types/router/hooks/views.d.ts +6 -4
  49. package/@types/router/params/interface.d.ts +3 -2
  50. package/@types/router/params/param-factory.d.ts +24 -3
  51. package/@types/router/params/param-type.d.ts +47 -11
  52. package/@types/router/params/param-types.d.ts +52 -0
  53. package/@types/router/params/param.d.ts +52 -28
  54. package/@types/router/params/state-params.d.ts +5 -3
  55. package/@types/router/path/interface.d.ts +3 -0
  56. package/@types/router/path/path-node.d.ts +34 -14
  57. package/@types/router/path/path-utils.d.ts +75 -25
  58. package/@types/router/resolve/resolvable.d.ts +34 -7
  59. package/@types/router/resolve/resolve-context.d.ts +52 -34
  60. package/@types/router/router.d.ts +10 -12
  61. package/@types/router/state/interface.d.ts +194 -31
  62. package/@types/router/state/state-builder.d.ts +29 -29
  63. package/@types/router/state/state-matcher.d.ts +29 -11
  64. package/@types/router/state/state-object.d.ts +67 -21
  65. package/@types/router/state/state-queue-manager.d.ts +19 -10
  66. package/@types/router/state/state-registry.d.ts +80 -28
  67. package/@types/router/state/state-service.d.ts +182 -123
  68. package/@types/router/state/target-state.d.ts +36 -27
  69. package/@types/router/state/views.d.ts +48 -19
  70. package/@types/router/template-factory.d.ts +8 -15
  71. package/@types/router/transition/hook-builder.d.ts +17 -6
  72. package/@types/router/transition/hook-registry.d.ts +80 -46
  73. package/@types/router/transition/interface.d.ts +138 -118
  74. package/@types/router/transition/reject-factory.d.ts +58 -22
  75. package/@types/router/transition/transition-event-type.d.ts +19 -8
  76. package/@types/router/transition/transition-hook.d.ts +50 -29
  77. package/@types/router/transition/transition-service.d.ts +186 -30
  78. package/@types/router/transition/transition.d.ts +201 -70
  79. package/@types/router/url/interface.d.ts +140 -0
  80. package/@types/router/url/url-config.d.ts +19 -16
  81. package/@types/router/url/url-matcher.d.ts +66 -46
  82. package/@types/router/url/url-rule.d.ts +58 -35
  83. package/@types/router/url/url-rules.d.ts +38 -28
  84. package/@types/router/url/url-service.d.ts +68 -41
  85. package/@types/router/view/interface.d.ts +10 -30
  86. package/@types/router/view/view.d.ts +35 -21
  87. package/@types/services/anchor-scroll/interface.d.ts +1 -1
  88. package/@types/services/http/http.d.ts +19 -22
  89. package/@types/services/http/interface.d.ts +11 -23
  90. package/@types/services/location/interface.d.ts +1 -4
  91. package/@types/services/location/location.d.ts +13 -13
  92. package/@types/services/sce/sce.d.ts +14 -8
  93. package/@types/services/template-request/template-request.d.ts +21 -4
  94. package/@types/shared/common.d.ts +5 -32
  95. package/@types/shared/dom.d.ts +10 -5
  96. package/@types/shared/interface.d.ts +4 -0
  97. package/@types/shared/utils.d.ts +17 -6
  98. package/dist/angular-ts.esm.js +6424 -2850
  99. package/dist/angular-ts.umd.js +6424 -2850
  100. package/dist/angular-ts.umd.min.js +1 -1
  101. package/dist/angular-ts.umd.min.js.gz +0 -0
  102. package/dist/angular-ts.umd.min.js.map +1 -1
  103. package/package.json +1 -2
  104. package/@types/animations/animate-css.d.ts +0 -11
  105. package/@types/filters/filters.d.ts +0 -38
  106. package/@types/router/hooks/update-globals.d.ts +0 -1
  107. package/@types/router/hooks/url.d.ts +0 -5
@@ -1,3 +1,5 @@
1
+ /** @typedef {import("../params/param.js").Param} Param */
2
+ /** @typedef {import("../resolve/resolvable.js").Resolvable} Resolvable */
1
3
  /**
2
4
  * Internal representation of a ng-router state.
3
5
  *
@@ -14,21 +16,59 @@ export class StateObject {
14
16
  * @param {import('./interface.ts').StateDeclaration} config
15
17
  */
16
18
  constructor(config: import("./interface.ts").StateDeclaration);
17
- name: any;
18
- navigable: any;
19
- /** @type {?StateObject} */
20
- parent: StateObject | null;
21
- params: any;
22
- url: any;
19
+ /**
20
+ * @type {string}
21
+ */
22
+ name: string;
23
+ /**
24
+ * @type {{ url: any; } | undefined | null}
25
+ */
26
+ navigable:
27
+ | {
28
+ url: any;
29
+ }
30
+ | undefined
31
+ | null;
32
+ /** @type {StateObject | undefined} */
33
+ parent: StateObject | undefined;
34
+ /**
35
+ * @type {ArrayLike<Param> | undefined}
36
+ */
37
+ params: ArrayLike<Param> | undefined;
38
+ /**
39
+ * @type {{ parameter: (arg0: any, arg1: {}) => any; } | undefined}
40
+ */
41
+ url:
42
+ | {
43
+ parameter: (arg0: any, arg1: {}) => any;
44
+ }
45
+ | undefined;
46
+ /**
47
+ * @type {any}
48
+ */
23
49
  includes: any;
24
- _state: () => this;
25
50
  /**
26
- * @type {ng.StateDeclaration|ng.BuiltStateDeclaration}
51
+ * @type {StateObject[] | undefined}
52
+ */
53
+ path: StateObject[] | undefined;
54
+ /**
55
+ * @type {any}
56
+ */
57
+ views: any;
58
+ /**
59
+ * A list of [[Resolvable]] objects. The internal representation of [[resolve]].
60
+ * @type {Resolvable[] | undefined}
61
+ */
62
+ resolvables: Resolvable[] | undefined;
63
+ /**
64
+ * @type {ng.StateDeclaration}
27
65
  */
28
- self: ng.StateDeclaration | ng.BuiltStateDeclaration;
66
+ self: ng.StateDeclaration;
29
67
  _stateObjectCache: {
30
68
  nameGlob: Glob;
31
69
  };
70
+ /** @returns {StateObject} */
71
+ _state(): StateObject;
32
72
  /**
33
73
  * Returns true if the provided parameter is the same state.
34
74
  *
@@ -36,22 +76,22 @@ export class StateObject {
36
76
  * reference to the actual `State` instance, the original definition object passed to
37
77
  * `$stateProvider.state()`, or the fully-qualified name.
38
78
  *
39
- * @param ref Can be one of (a) a `State` instance, (b) an object that was passed
79
+ * @param {any} ref Can be one of (a) a `State` instance, (b) an object that was passed
40
80
  * into `$stateProvider.state()`, (c) the fully-qualified name of a state as a string.
41
81
  * @returns Returns `true` if `ref` matches the current `State` instance.
42
82
  */
43
83
  is(ref: any): boolean;
44
84
  /**
45
85
  * @deprecated this does not properly handle dot notation
46
- * @returns Returns a dot-separated name of the state.
86
+ * @returns {string} Returns a dot-separated name of the state.
47
87
  */
48
- fqn(): any;
88
+ fqn(): string;
49
89
  /**
50
90
  * Returns the root node of this state's tree.
51
91
  *
52
- * @returns The root of this state's tree.
92
+ * @returns {StateObject} The root of this state's tree.
53
93
  */
54
- root(): any;
94
+ root(): StateObject;
55
95
  /**
56
96
  * Gets the state's `Param` objects
57
97
  *
@@ -59,23 +99,29 @@ export class StateObject {
59
99
  * If `opts.inherit` is true, it also includes the ancestor states' [[Param]] objects.
60
100
  * If `opts.matchingKeys` exists, returns only `Param`s whose `id` is a key on the `matchingKeys` object
61
101
  *
62
- * @param opts options
102
+ * @param {Partial<Param>} [opts] options
103
+ * @returns {Param[]} the list of [[Param]] objects
63
104
  */
64
- parameters(opts: any): any;
105
+ parameters(opts?: Partial<Param>): Param[];
65
106
  /**
66
107
  * Returns a single [[Param]] that is owned by the state
67
108
  *
68
109
  * If `opts.inherit` is true, it also searches the ancestor states` [[Param]]s.
69
- * @param id the name of the [[Param]] to return
70
- * @param opts options
110
+ * @param {string} id the name of the [[Param]] to return
111
+ * @param {Param} [opts] options
112
+ * @returns {Param | undefined} the [[Param]] object, or undefined if it does not exist
71
113
  */
72
- parameter(id: any, opts?: {}): any;
73
- toString(): any;
114
+ parameter(id: string, opts?: Param): Param | undefined;
115
+ toString(): string;
74
116
  }
75
117
  export namespace StateObject {
76
118
  /** Predicate which returns true if the object is a [[StateDeclaration]] object */
77
- function isStateDeclaration(obj: any): boolean;
119
+ function isStateDeclaration(
120
+ obj: StateObject | import("../state/interface.js").StateDeclaration,
121
+ ): boolean;
78
122
  /** Predicate which returns true if the object is an internal [[StateObject]] object */
79
123
  function isState(obj: any): boolean;
80
124
  }
125
+ export type Param = import("../params/param.js").Param;
126
+ export type Resolvable = import("../resolve/resolvable.js").Resolvable;
81
127
  import { Glob } from "../glob/glob.js";
@@ -1,35 +1,44 @@
1
+ /** @typedef {import("./state-registry.js").StateRegistryListener} StateRegistryListener */
1
2
  export class StateQueueManager {
2
3
  /**
3
4
  * @param {import("./state-registry.js").StateRegistryProvider} stateRegistry
4
5
  * @param {import("../url/url-rules.js").UrlRules} urlServiceRules
5
6
  * @param {import("./interface.ts").StateStore} states
6
- * @param {*} builder
7
- * @param {*} listeners
7
+ * @param {import("./state-builder.js").StateBuilder} builder
8
+ * @param {StateRegistryListener[]} listeners
8
9
  */
9
10
  constructor(
10
11
  stateRegistry: import("./state-registry.js").StateRegistryProvider,
11
12
  urlServiceRules: import("../url/url-rules.js").UrlRules,
12
13
  states: import("./interface.ts").StateStore,
13
- builder: any,
14
- listeners: any,
14
+ builder: import("./state-builder.js").StateBuilder,
15
+ listeners: StateRegistryListener[],
15
16
  );
16
17
  stateRegistry: import("./state-registry.js").StateRegistryProvider;
17
18
  /** @type {import("../url/url-rules.js").UrlRules} */
18
19
  urlServiceRules: import("../url/url-rules.js").UrlRules;
20
+ /** @type {import("./interface.ts").StateStore} */
19
21
  states: import("./interface.ts").StateStore;
20
- builder: any;
21
- listeners: any;
22
+ builder: import("./state-builder.js").StateBuilder;
23
+ /** @type {StateRegistryListener[]} */
24
+ listeners: StateRegistryListener[];
22
25
  /**
23
26
  * @type {Array<StateObject>}
24
27
  */
25
28
  queue: Array<StateObject>;
26
- register(stateDecl: any): StateObject;
29
+ /**
30
+ * @param {ng.StateDeclaration} stateDecl
31
+ * @returns {StateObject}
32
+ */
33
+ register(stateDecl: ng.StateDeclaration): StateObject;
27
34
  flush(): import("./interface.ts").StateStore;
28
35
  /**
29
36
  *
30
- * @param {ng.StateDeclaration} state
31
- * @returns {() => void} a function that deregisters the rule
37
+ * @param {StateObject | ng.StateDeclaration} state
38
+ * @returns {void} a function that deregisters the rule
32
39
  */
33
- attachRoute(state: ng.StateDeclaration): () => void;
40
+ attachRoute(state: StateObject | ng.StateDeclaration): void;
34
41
  }
42
+ export type StateRegistryListener =
43
+ import("./state-registry.js").StateRegistryListener;
35
44
  import { StateObject } from "./state-object.js";
@@ -1,4 +1,9 @@
1
+ /** @typedef {import("./state-object.js").StateObject} StateObject */
2
+ /** @typedef {import("./interface.ts").BuiltStateDeclaration} BuiltStateDeclaration */
1
3
  /** @typedef {import('../../interface.ts').ServiceProvider} ServiceProvider } */
4
+ /** @typedef {import("./interface.ts").StateRegistryListener} StateRegistryListener */
5
+ /** @typedef {import("./interface.ts").StateDeclaration} StateDeclaration */
6
+ /** @typedef {import("./interface.ts").StateOrName} StateOrName */
2
7
  /**
3
8
  * A registry for all of the application's [[StateDeclaration]]s
4
9
  *
@@ -21,11 +26,29 @@ export class StateRegistryProvider {
21
26
  );
22
27
  /** @type {import("./interface.ts").StateStore} */
23
28
  states: import("./interface.ts").StateStore;
24
- urlService: import("../url/url-service.js").UrlService;
29
+ /**
30
+ * @type {ng.UrlService}
31
+ */
32
+ urlService: ng.UrlService;
33
+ /**
34
+ * @type {import("../url/url-rules.js").UrlRules}
35
+ */
25
36
  urlServiceRules: import("../url/url-rules.js").UrlRules;
26
- $injector: any;
27
- listeners: any[];
37
+ /**
38
+ * @type {ng.InjectorService|undefined}
39
+ */
40
+ $injector: ng.InjectorService | undefined;
41
+ /**
42
+ * @type {StateRegistryListener[]}
43
+ */
44
+ listeners: StateRegistryListener[];
45
+ /**
46
+ *@type {StateMatcher}
47
+ */
28
48
  matcher: StateMatcher;
49
+ /**
50
+ * @type {StateBuilder}
51
+ */
29
52
  builder: StateBuilder;
30
53
  stateQueue: StateQueueManager;
31
54
  $get: (string | (($injector: any) => StateRegistryProvider))[];
@@ -33,14 +56,15 @@ export class StateRegistryProvider {
33
56
  * This is a [[StateBuilder.builder]] function for angular1 `onEnter`, `onExit`,
34
57
  * `onRetain` callback hooks on a [[StateDeclaration]].
35
58
  *
36
- * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder
37
- * ensures that those hooks are injectable for @uirouter/angularjs (ng1).
38
- *
39
- * @internalapi
59
+ * @param {string} hookName
40
60
  */
41
61
  getStateHookBuilder(
42
- hookName: any,
43
- ): (stateObject: any) => (trans: any, state: any) => any;
62
+ hookName: string,
63
+ ): (
64
+ stateObject: any & Record<string, any>,
65
+ ) =>
66
+ | ((trans: ng.Transition, state: ng.BuiltStateDeclaration) => any)
67
+ | undefined;
44
68
  /**
45
69
  * @private
46
70
  */
@@ -71,12 +95,14 @@ export class StateRegistryProvider {
71
95
  * });
72
96
  * ```
73
97
  *
74
- * @param listener a callback function invoked when the registered states changes.
98
+ * @param {import("./interface.ts").StateRegistryListener} listener a callback function invoked when the registered states changes.
75
99
  * The function receives two parameters, `event` and `state`.
76
100
  * See [[StateRegistryListener]]
77
101
  * @return a function that deregisters the listener
78
102
  */
79
- onStatesChanged(listener: any): any;
103
+ onStatesChanged(
104
+ listener: import("./interface.ts").StateRegistryListener,
105
+ ): () => void;
80
106
  /**
81
107
  * Gets the implicit root state
82
108
  *
@@ -94,54 +120,80 @@ export class StateRegistryProvider {
94
120
  *
95
121
  * Note: a state will be queued if the state's parent isn't yet registered.
96
122
  *
97
- * @param stateDefinition the definition of the state to register.
123
+ * @param {import("./interface.ts")._StateDeclaration} stateDefinition the definition of the state to register.
98
124
  * @returns the internal [[StateObject]] object.
99
125
  * If the state was successfully registered, then the object is fully built (See: [[StateBuilder]]).
100
126
  * If the state was only queued, then the object is not fully built.
101
127
  */
102
- register(stateDefinition: any): import("./state-object.js").StateObject;
103
- _deregisterTree(state: any): any[];
128
+ register(
129
+ stateDefinition: import("./interface.ts")._StateDeclaration,
130
+ ): import("./state-object.js").StateObject;
131
+ /**
132
+ *
133
+ * @param {BuiltStateDeclaration} state
134
+ * @returns {BuiltStateDeclaration[]}
135
+ */
136
+ _deregisterTree(state: BuiltStateDeclaration): BuiltStateDeclaration[];
104
137
  /**
105
138
  * Removes a state from the registry
106
139
  *
107
140
  * This removes a state from the registry.
108
141
  * If the state has children, they are are also removed from the registry.
109
142
  *
110
- * @param stateOrName the state's name or object representation
111
- * @returns {import('./state-object').StateObject[]} a list of removed states
143
+ * @param {StateOrName} stateOrName the state's name or object representation
144
+ * @returns {BuiltStateDeclaration[]} a list of removed states
112
145
  */
113
- deregister(stateOrName: any): any[];
146
+ deregister(stateOrName: StateOrName): BuiltStateDeclaration[];
114
147
  /**
115
148
  * @return {ng.BuiltStateDeclaration[]}
116
149
  */
117
150
  getAll(): ng.BuiltStateDeclaration[];
151
+ /**
152
+ *
153
+ * @param {StateOrName} [stateOrName]
154
+ * @param {StateOrName} [base]
155
+ * @returns {import("./state-service.js").StateDeclaration | import("./state-service.js").StateDeclaration[] | null}
156
+ */
118
157
  get(
119
- stateOrName: any,
120
- base: any,
158
+ stateOrName?: StateOrName,
159
+ base?: StateOrName,
121
160
  ...args: any[]
122
161
  ):
123
- | import("./interface.ts").StateDeclaration
124
- | (
125
- | import("./interface.ts").StateDeclaration
126
- | import("./interface.ts").BuiltStateDeclaration
127
- )[];
162
+ | import("./state-service.js").StateDeclaration
163
+ | import("./state-service.js").StateDeclaration[]
164
+ | null;
128
165
  /**
129
166
  * Registers a [[BuilderFunction]] for a specific [[StateObject]] property (e.g., `parent`, `url`, or `path`).
130
167
  * More than one BuilderFunction can be registered for a given property.
131
168
  *
132
169
  * The BuilderFunction(s) will be used to define the property on any subsequently built [[StateObject]] objects.
133
170
  *
134
- * @param property The name of the State property being registered for.
135
- * @param builderFunction The BuilderFunction which will be used to build the State property
171
+ * @param {string} property The name of the State property being registered for.
172
+ * @param {import("./interface.ts").BuilderFunction} builderFunction The BuilderFunction which will be used to build the State property
136
173
  * @returns a function which deregisters the BuilderFunction
137
174
  */
138
- decorator(property: any, builderFunction: any): any;
175
+ decorator(
176
+ property: string,
177
+ builderFunction: import("./interface.ts").BuilderFunction,
178
+ ):
179
+ | import("./interface.ts").BuilderFunction
180
+ | import("./interface.ts").BuilderFunction[];
139
181
  }
140
- export function getLocals(ctx: any): any;
182
+ export function getLocals(ctx: ResolveContext): {
183
+ [x: string]: any;
184
+ };
185
+ export type StateObject = import("./state-object.js").StateObject;
186
+ export type BuiltStateDeclaration =
187
+ import("./interface.ts").BuiltStateDeclaration;
141
188
  /**
142
189
  * }
143
190
  */
144
191
  export type ServiceProvider = import("../../interface.ts").ServiceProvider;
192
+ export type StateRegistryListener =
193
+ import("./interface.ts").StateRegistryListener;
194
+ export type StateDeclaration = import("./interface.ts").StateDeclaration;
195
+ export type StateOrName = import("./interface.ts").StateOrName;
145
196
  import { StateMatcher } from "./state-matcher.js";
146
197
  import { StateBuilder } from "./state-builder.js";
147
198
  import { StateQueueManager } from "./state-queue-manager.js";
199
+ import { ResolveContext } from "../resolve/resolve-context.js";