@angular-wave/angular.ts 0.10.0 → 0.12.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 (62) hide show
  1. package/@types/angular.d.ts +84 -58
  2. package/@types/animations/animate-css-driver.d.ts +0 -1
  3. package/@types/animations/animate-css.d.ts +0 -1
  4. package/@types/animations/animate-js-driver.d.ts +1 -7
  5. package/@types/animations/animate-js.d.ts +1 -4
  6. package/@types/animations/animate.d.ts +5 -355
  7. package/@types/animations/animation.d.ts +4 -4
  8. package/@types/animations/interface.d.ts +84 -0
  9. package/@types/animations/queue/animate-queue.d.ts +21 -0
  10. package/@types/animations/queue/interface.d.ts +50 -0
  11. package/@types/animations/runner/animate-runner.d.ts +99 -0
  12. package/@types/core/compile/attributes.d.ts +5 -5
  13. package/@types/core/compile/compile.d.ts +4 -4
  14. package/@types/core/controller/controller.d.ts +1 -1
  15. package/@types/core/di/di.d.ts +26 -0
  16. package/@types/core/di/injector.d.ts +0 -11
  17. package/@types/core/di/internal-injector.d.ts +2 -2
  18. package/@types/core/di/ng-module/ng-module.d.ts +197 -0
  19. package/@types/core/filter/filter.d.ts +2 -2
  20. package/@types/core/sanitize/interface.d.ts +8 -0
  21. package/@types/core/sanitize/sanitize-uri.d.ts +5 -2
  22. package/@types/core/scope/interface.d.ts +2 -2
  23. package/@types/core/scope/scope.d.ts +10 -2
  24. package/@types/directive/class/class.d.ts +3 -3
  25. package/@types/directive/form/form.d.ts +7 -7
  26. package/@types/directive/if/if.d.ts +2 -2
  27. package/@types/directive/include/include.d.ts +4 -4
  28. package/@types/directive/inject/inject.d.ts +2 -2
  29. package/@types/directive/input/input.d.ts +10 -10
  30. package/@types/directive/messages/messages.d.ts +19 -23
  31. package/@types/directive/model/model.d.ts +3 -3
  32. package/@types/directive/scope/scope.d.ts +4 -0
  33. package/@types/directive/show-hide/show-hide.d.ts +3 -4
  34. package/@types/directive/switch/switch.d.ts +3 -5
  35. package/@types/directive/wasm/wasm.d.ts +4 -0
  36. package/@types/{services → directive}/worker/interface.d.ts +1 -0
  37. package/@types/directive/worker/worker.d.ts +18 -8
  38. package/@types/interface.d.ts +49 -21
  39. package/@types/namespace.d.ts +29 -4
  40. package/@types/ng.d.ts +3 -5
  41. package/@types/router/params/interface.d.ts +0 -25
  42. package/@types/router/state/interface.d.ts +0 -9
  43. package/@types/router/template-factory.d.ts +1 -1
  44. package/@types/router/transition/interface.d.ts +0 -33
  45. package/@types/services/log/log.d.ts +2 -2
  46. package/@types/services/sce/sce.d.ts +4 -82
  47. package/@types/services/sse/sse.d.ts +1 -5
  48. package/@types/services/storage/interface.d.ts +5 -0
  49. package/@types/services/storage/storage.d.ts +19 -0
  50. package/@types/services/stream/interface.d.ts +18 -0
  51. package/@types/shared/dom.d.ts +25 -10
  52. package/@types/shared/strings.d.ts +0 -6
  53. package/@types/shared/utils.d.ts +24 -14
  54. package/dist/angular-ts.esm.js +1867 -1506
  55. package/dist/angular-ts.umd.js +1867 -1506
  56. package/dist/angular-ts.umd.min.js +1 -1
  57. package/dist/angular.css +1 -1
  58. package/package.json +1 -2
  59. package/@types/animations/animate-queue.d.ts +0 -27
  60. package/@types/animations/animate-runner.d.ts +0 -31
  61. package/@types/core/di/ng-module.d.ts +0 -156
  62. package/@types/services/worker/worker.d.ts +0 -31
@@ -1,18 +1,86 @@
1
1
  export class Angular {
2
2
  $cache: Map<number, import("./interface.ts").ExpandoStore>;
3
- /** @type {import('./services/pubsub/pubsub.js').PubSub} */
4
- $eventBus: import("./services/pubsub/pubsub.js").PubSub;
3
+ /** @type {ng.PubSubService} */
4
+ $eventBus: ng.PubSubService;
5
5
  /**
6
6
  * @type {string} `version` from `package.json`
7
7
  */
8
8
  version: string;
9
9
  /** @type {!Array<string|any>} */
10
10
  bootsrappedModules: Array<string | any>;
11
- getController: typeof getController;
12
- getInjector: typeof getInjector;
13
- getScope: typeof getScope;
11
+ /**
12
+ * Gets the controller instance for a given element, if exists. Defaults to "ngControllerController"
13
+ *
14
+ * @type {(element: Element, name: string?) => ng.Scope|undefined}
15
+ */
16
+ getController: (
17
+ element: Element,
18
+ name: string | null,
19
+ ) => ng.Scope | undefined;
20
+ /**
21
+ * Return instance of InjectorService attached to element
22
+ * @type {(Element) => ng.InjectorService}
23
+ */
24
+ getInjector: (Element: any) => ng.InjectorService;
25
+ /**
26
+ * Gets scope for a given element.
27
+ * @type {(Element) => ng.Scope}
28
+ */
29
+ getScope: (Element: any) => ng.Scope;
14
30
  errorHandlingConfig: typeof errorHandlingConfig;
15
31
  $t: Readonly<Record<string, string>>;
32
+ /**
33
+ *
34
+ * The `angular.module` is a global place for creating, registering and retrieving AngularTS
35
+ * modules.
36
+ * All modules (AngularTS core or 3rd party) that should be available to an application must be
37
+ * registered using this mechanism.
38
+ *
39
+ * Passing one argument retrieves an existing {@link ng.NgModule},
40
+ * whereas passing more than one argument creates a new {@link ng.NgModule}
41
+ *
42
+ *
43
+ * # Module
44
+ *
45
+ * A module is a collection of services, directives, controllers, filters, workers, WebAssembly modules, and configuration information.
46
+ * `angular.module` is used to configure the {@link auto.$injector $injector}.
47
+ *
48
+ * ```js
49
+ * // Create a new module
50
+ * let myModule = angular.module('myModule', []);
51
+ *
52
+ * // register a new service
53
+ * myModule.value('appName', 'MyCoolApp');
54
+ *
55
+ * // configure existing services inside initialization blocks.
56
+ * myModule.config(['$locationProvider', function($locationProvider) {
57
+ * // Configure existing providers
58
+ * $locationProvider.hashPrefix('!');
59
+ * }]);
60
+ * ```
61
+ *
62
+ * Then you can create an injector and load your modules like this:
63
+ *
64
+ * ```js
65
+ * let injector = angular.injector(['ng', 'myModule'])
66
+ * ```
67
+ *
68
+ * However it's more likely that you'll just use
69
+ * `ng-app` directive or
70
+ * {@link bootstrap} to simplify this process for you.
71
+ *
72
+ * @param {string} name The name of the module to create or retrieve.
73
+ * @param {Array.<string>} [requires] If specified then new module is being created. If
74
+ * unspecified then the module is being retrieved for further configuration.
75
+ * @param {ng.Injectable<any>} [configFn] Optional configuration function for the module that gets
76
+ * passed to {@link NgModule.config NgModule.config()}.
77
+ * @returns {NgModule} A newly registered module.
78
+ */
79
+ module(
80
+ name: string,
81
+ requires?: Array<string>,
82
+ configFn?: ng.Injectable<any>,
83
+ ): NgModule;
16
84
  /**
17
85
  * Use this function to manually start up AngularTS application.
18
86
  *
@@ -61,7 +129,8 @@ export class Angular {
61
129
  modules?: Array<string | any>,
62
130
  config?: import("./interface.ts").AngularBootstrapConfig,
63
131
  ): import("./core/di/internal-injector.js").InjectorService;
64
- $injector: import("./core/di/internal-injector.js").InjectorService;
132
+ $rootScope: import("./interface.ts").Scope;
133
+ $injector: import("./interface.ts").InjectorService;
65
134
  /**
66
135
  * @param {any[]} modules
67
136
  * @param {boolean?} strictDi
@@ -76,60 +145,17 @@ export class Angular {
76
145
  */
77
146
  init(element: Element | Document): void;
78
147
  /**
148
+ * Retrieves a scope by its registered name and returns its Proxy wrapper.
79
149
  *
80
- * The `angular.module` is a global place for creating, registering and retrieving AngularTS
81
- * modules.
82
- * All modules (AngularTS core or 3rd party) that should be available to an application must be
83
- * registered using this mechanism.
84
- *
85
- * Passing one argument retrieves an existing {@link import('./interface.ts').Module},
86
- * whereas passing more than one argument creates a new {@link import('./interface.ts').Module}
87
- *
88
- *
89
- * # Module
90
- *
91
- * A module is a collection of services, directives, controllers, filters, and configuration information.
92
- * `angular.module` is used to configure the {@link auto.$injector $injector}.
93
- *
94
- * ```js
95
- * // Create a new module
96
- * let myModule = angular.module('myModule', []);
97
- *
98
- * // register a new service
99
- * myModule.value('appName', 'MyCoolApp');
100
- *
101
- * // configure existing services inside initialization blocks.
102
- * myModule.config(['$locationProvider', function($locationProvider) {
103
- * // Configure existing providers
104
- * $locationProvider.hashPrefix('!');
105
- * }]);
106
- * ```
107
- *
108
- * Then you can create an injector and load your modules like this:
109
- *
110
- * ```js
111
- * let injector = angular.injector(['ng', 'myModule'])
112
- * ```
150
+ * Internally, this walks down the `Scope` tree starting from `$rootScope`
151
+ * and checks for a matching `$scopename` property. The `$scopename` property
152
+ * may be defined statically on controllers using `as` syntax, assigned via the `ngScope` directive,
153
+ * or defined on `$scope` injectable.
113
154
  *
114
- * However it's more likely that you'll just use
115
- * {@link ng.directive:ngApp ngApp} or
116
- * {@link angular.bootstrap} to simplify this process for you.
117
- *
118
- * @param {string} name The name of the module to create or retrieve.
119
- * @param {Array.<string>} [requires] If specified then new module is being created. If
120
- * unspecified then the module is being retrieved for further configuration.
121
- * @param {import("./interface.ts").Injectable<any>} [configFn] Optional configuration function for the module that gets
122
- * passed to {@link NgModule.config NgModule.config()}.
123
- * @returns {NgModule} A newly registered module.
155
+ * @param {string} name
156
+ * @returns {ProxyHandler<ng.Scope>|undefined}
124
157
  */
125
- module(
126
- name: string,
127
- requires?: Array<string>,
128
- configFn?: import("./interface.ts").Injectable<any>,
129
- ): NgModule;
158
+ getScopeByName(name: string): ProxyHandler<ng.Scope> | undefined;
130
159
  }
131
- import { getController } from "./shared/dom.js";
132
- import { getInjector } from "./shared/dom.js";
133
- import { getScope } from "./shared/dom.js";
134
160
  import { errorHandlingConfig } from "./shared/utils.js";
135
- import { NgModule } from "./core/di/ng-module.js";
161
+ import { NgModule } from "./core/di/ng-module/ng-module.js";
@@ -8,7 +8,6 @@ export class AnimateCssDriverProvider {
8
8
  | string
9
9
  | ((
10
10
  $animateCss: any,
11
- $$AnimateRunner: typeof import("./animate-runner.js").AnimateRunner,
12
11
  $rootElement: Element,
13
12
  ) => (animationDetails: any) => any)
14
13
  )[];
@@ -3,7 +3,6 @@ export class AnimateCssProvider {
3
3
  $get: (
4
4
  | string
5
5
  | ((
6
- $$AnimateRunner: any,
7
6
  $$animateCache: any,
8
7
  $$rAFScheduler: any,
9
8
  ) => (
@@ -1,13 +1,7 @@
1
1
  export function AnimateJsDriverProvider($$animationProvider: any): void;
2
2
  export class AnimateJsDriverProvider {
3
3
  constructor($$animationProvider: any);
4
- $get: (
5
- | string
6
- | ((
7
- $$animateJs: any,
8
- $$AnimateRunner: any,
9
- ) => (animationDetails: any) => any)
10
- )[];
4
+ $get: (string | (($$animateJs: any) => (animationDetails: any) => any))[];
11
5
  }
12
6
  export namespace AnimateJsDriverProvider {
13
7
  let $inject: string[];
@@ -3,10 +3,7 @@ export class AnimateJsProvider {
3
3
  constructor($animateProvider: any);
4
4
  $get: (
5
5
  | string
6
- | ((
7
- $injector: ng.InjectorService,
8
- $$AnimateRunner: any,
9
- ) => (
6
+ | (($injector: ng.InjectorService) => (
10
7
  element: any,
11
8
  event: any,
12
9
  classes: any,
@@ -1,10 +1,8 @@
1
- /** @param {import('../interface.ts').Provider} $provide */
2
- export function AnimateProvider(
3
- $provide: import("../interface.ts").Provider,
4
- ): void;
1
+ /** @param {ng.ProvideService} $provide */
2
+ export function AnimateProvider($provide: ng.ProvideService): void;
5
3
  export class AnimateProvider {
6
- /** @param {import('../interface.ts').Provider} $provide */
7
- constructor($provide: import("../interface.ts").Provider);
4
+ /** @param {ng.ProvideService} $provide */
5
+ constructor($provide: ng.ProvideService);
8
6
  $$registeredAnimations: any;
9
7
  /**
10
8
  * Registers a new injectable animation factory function. The factory function produces the
@@ -95,356 +93,8 @@ export class AnimateProvider {
95
93
  * @return {RegExp} The current CSS className expression value. If null then there is no expression value
96
94
  */
97
95
  classNameFilter: (expression?: RegExp | undefined, ...args: any[]) => RegExp;
98
- $get: (
99
- | string
100
- | (($$animateQueue: any) => {
101
- /**
102
- *
103
- * Sets up an event listener to fire whenever the animation event (enter, leave, move, etc...)
104
- * has fired on the given element or among any of its children. Once the listener is fired, the provided callback
105
- * is fired with the following params:
106
- *
107
- * ```js
108
- * $animate.on('enter', container,
109
- * function callback(element, phase) {
110
- * // cool we detected an enter animation within the container
111
- * }
112
- * );
113
- * ```
114
- *
115
- * <div class="alert alert-warning">
116
- * **Note**: Generally, the events that are fired correspond 1:1 to `$animate` method names,
117
- * e.g. {@link ng.$animate#addClass addClass()} will fire `addClass`, and {@link ng.ngClass}
118
- * will fire `addClass` if classes are added, and `removeClass` if classes are removed.
119
- * However, there are two exceptions:
120
- *
121
- * <ul>
122
- * <li>if both an {@link ng.$animate#addClass addClass()} and a
123
- * {@link ng.$animate#removeClass removeClass()} action are performed during the same
124
- * animation, the event fired will be `setClass`. This is true even for `ngClass`.</li>
125
- * <li>an {@link ng.$animate#animate animate()} call that adds and removes classes will fire
126
- * the `setClass` event, but if it either removes or adds classes,
127
- * it will fire `animate` instead.</li>
128
- * </ul>
129
- *
130
- * </div>
131
- *
132
- * @param {string} event the animation event that will be captured (e.g. enter, leave, move, addClass, removeClass, etc...)
133
- * @param {Element} container the container element that will capture each of the animation events that are fired on itself
134
- * as well as among its children
135
- * @param {Function} callback the callback function that will be fired when the listener is triggered.
136
- *
137
- * The arguments present in the callback function are:
138
- * * `element` - The captured DOM element that the animation was fired on.
139
- * * `phase` - The phase of the animation. The two possible phases are **start** (when the animation starts) and **close** (when it ends).
140
- * * `data` - an object with these properties:
141
- * * addClass - `{string|null}` - space-separated CSS classes to add to the element
142
- * * removeClass - `{string|null}` - space-separated CSS classes to remove from the element
143
- * * from - `{Object|null}` - CSS properties & values at the beginning of the animation
144
- * * to - `{Object|null}` - CSS properties & values at the end of the animation
145
- *
146
- * Note that the callback does not trigger a scope digest. Wrap your call into a
147
- * {@link $rootScope.Scope#$apply scope.$apply} to propagate changes to the scope.
148
- */
149
- on: any;
150
- /**
151
- * Deregisters an event listener based on the event which has been associated with the provided element. This method
152
- * can be used in three different ways depending on the arguments:
153
- *
154
- * ```js
155
- * // remove all the animation event listeners listening for `enter`
156
- * $animate.off('enter');
157
- *
158
- * // remove listeners for all animation events from the container element
159
- * $animate.off(container);
160
- *
161
- * // remove all the animation event listeners listening for `enter` on the given element and its children
162
- * $animate.off('enter', container);
163
- *
164
- * // remove the event listener function provided by `callback` that is set
165
- * // to listen for `enter` on the given `container` as well as its children
166
- * $animate.off('enter', container, callback);
167
- * ```
168
- *
169
- * @param {string|Element} event|container the animation event (e.g. enter, leave, move,
170
- * addClass, removeClass, etc...), or the container element. If it is the element, all other
171
- * arguments are ignored.
172
- * @param {Element=} container the container element the event listener was placed on
173
- * @param {Function=} callback the callback function that was registered as the listener
174
- */
175
- off: any;
176
- /**
177
- * Associates the provided element with a host parent element to allow the element to be animated even if it exists
178
- * outside of the DOM structure of the AngularTS application. By doing so, any animation triggered via `$animate` can be issued on the
179
- * element despite being outside the realm of the application or within another application. Say for example if the application
180
- * was bootstrapped on an element that is somewhere inside of the `<body>` tag, but we wanted to allow for an element to be situated
181
- * as a direct child of `document.body`, then this can be achieved by pinning the element via `$animate.pin(element)`. Keep in mind
182
- * that calling `$animate.pin(element, parentElement)` will not actually insert into the DOM anywhere; it will just create the association.
183
- *
184
- * Note that this feature is only active when the `ngAnimate` module is used.
185
- *
186
- * @param {Element} element the external element that will be pinned
187
- * @param {Element} parentElement the host parent element that will be associated with the external element
188
- */
189
- pin: any;
190
- /**
191
- * Used to get and set whether animations are enabled or not on the entire application or on an element and its children. This
192
- * function can be called in four ways:
193
- *
194
- * ```js
195
- * // returns true or false
196
- * $animate.enabled();
197
- *
198
- * // changes the enabled state for all animations
199
- * $animate.enabled(false);
200
- * $animate.enabled(true);
201
- *
202
- * // returns true or false if animations are enabled for an element
203
- * $animate.enabled(element);
204
- *
205
- * // changes the enabled state for an element and its children
206
- * $animate.enabled(element, true);
207
- * $animate.enabled(element, false);
208
- * ```
209
- *
210
- * @param {Element=} element the element that will be considered for checking/setting the enabled state
211
- * @param {boolean=} enabled whether or not the animations will be enabled for the element
212
- *
213
- * @return {boolean} whether or not animations are enabled
214
- */
215
- enabled: any;
216
- /**
217
- * Cancels the provided animation and applies the end state of the animation.
218
- * Note that this does not cancel the underlying operation, e.g. the setting of classes or
219
- * adding the element to the DOM.
220
- *
221
- * @param {import('./animate-runner.js').AnimateRunner} runner An animation runner returned by an $animate function.
222
- *
223
- * @example
224
- <example module="animationExample" deps="angular-animate.js" animations="true" name="animate-cancel">
225
- <file name="app.js">
226
- angular.module('animationExample', []).component('cancelExample', {
227
- templateUrl: 'template.html',
228
- controller: function($element, $animate) {
229
- this.runner = null;
230
-
231
- this.addClass = function() {
232
- this.runner = $animate.addClass($element.querySelectorAll('div'), 'red');
233
- let ctrl = this;
234
- this.runner.finally(function() {
235
- ctrl.runner = null;
236
- });
237
- };
238
-
239
- this.removeClass = function() {
240
- this.runner = $animate.removeClass($element.querySelectorAll('div'), 'red');
241
- let ctrl = this;
242
- this.runner.finally(function() {
243
- ctrl.runner = null;
244
- });
245
- };
246
-
247
- this.cancel = function() {
248
- $animate.cancel(this.runner);
249
- };
250
- }
251
- });
252
- </file>
253
- <file name="template.html">
254
- <p>
255
- <button id="add" ng-click="$ctrl.addClass()">Add</button>
256
- <button ng-click="$ctrl.removeClass()">Remove</button>
257
- <br>
258
- <button id="cancel" ng-click="$ctrl.cancel()" ng-disabled="!$ctrl.runner">Cancel</button>
259
- <br>
260
- <div id="target">CSS-Animated Text</div>
261
- </p>
262
- </file>
263
- <file name="index.html">
264
- <cancel-example></cancel-example>
265
- </file>
266
- <file name="style.css">
267
- .red-add, .red-remove {
268
- transition: all 4s cubic-bezier(0.250, 0.460, 0.450, 0.940);
269
- }
270
-
271
- .red,
272
- .red-add.red-add-active {
273
- color: #FF0000;
274
- font-size: 40px;
275
- }
276
-
277
- .red-remove.red-remove-active {
278
- font-size: 10px;
279
- color: black;
280
- }
281
-
282
- </file>
283
- </example>
284
- */
285
- cancel(runner: import("./animate-runner.js").AnimateRunner): void;
286
- /**
287
- * Inserts the element into the DOM either after the `after` element (if provided) or
288
- * as the first child within the `parent` element and then triggers an animation.
289
- * A promise is returned that will be resolved during the next digest once the animation
290
- * has completed.
291
- *
292
- * @param {Element} element - the element which will be inserted into the DOM
293
- * @param {Element} parent - the parent element which will append the element as a child (so long as the after element is not present)
294
- * @param {Element} [after] - after the sibling element after which the element will be appended
295
- * @param {AnimationOptions} [options] - an optional collection of options/styles that will be applied to the element.
296
- * @returns {import('./animate-runner.js').AnimateRunner} the animation runner
297
- */
298
- enter(
299
- element: Element,
300
- parent: Element,
301
- after?: Element,
302
- options?: AnimationOptions,
303
- ): import("./animate-runner.js").AnimateRunner;
304
- /**
305
- * Inserts (moves) the element into its new position in the DOM either after
306
- * the `after` element (if provided) or as the first child within the `parent` element
307
- * and then triggers an animation. A promise is returned that will be resolved
308
- * during the next digest once the animation has completed.
309
- *
310
- * @param {Element} element - the element which will be inserted into the DOM
311
- * @param {Element} parent - the parent element which will append the element as a child (so long as the after element is not present)
312
- * @param {Element} after - after the sibling element after which the element will be appended
313
- * @param {AnimationOptions} [options] - an optional collection of options/styles that will be applied to the element.
314
- * @returns {import('./animate-runner.js').AnimateRunner} the animation runner
315
- */
316
- move(
317
- element: Element,
318
- parent: Element,
319
- after: Element,
320
- options?: AnimationOptions,
321
- ): import("./animate-runner.js").AnimateRunner;
322
- /**
323
- * Triggers an animation and then removes the element from the DOM.
324
- * When the function is called a promise is returned that will be resolved during the next
325
- * digest once the animation has completed.
326
- *
327
- * @param {Element} element the element which will be removed from the DOM
328
- * @param {AnimationOptions} [options] an optional collection of options/styles that will be applied to the element.
329
- * @returns {import('./animate-runner.js').AnimateRunner} the animation runner
330
- */
331
- leave(
332
- element: Element,
333
- options?: AnimationOptions,
334
- ): import("./animate-runner.js").AnimateRunner;
335
- /**
336
- * Triggers an addClass animation surrounding the addition of the provided CSS class(es). Upon
337
- * execution, the addClass operation will only be handled after the next digest and it will not trigger an
338
- * animation if element already contains the CSS class or if the class is removed at a later step.
339
- * Note that class-based animations are treated differently compared to structural animations
340
- * (like enter, move and leave) since the CSS classes may be added/removed at different points
341
- * depending if CSS or JavaScript animations are used.
342
- *
343
- * @param {Element} element the element which the CSS classes will be applied to
344
- * @param {string} className the CSS class(es) that will be added (multiple classes are separated via spaces)
345
- * @param {AnimationOptions} [options] an optional collection of options/styles that will be applied to the element.
346
- * @return {import('./animate-runner.js').AnimateRunner}} animationRunner the animation runner
347
- */
348
- addClass(
349
- element: Element,
350
- className: string,
351
- options?: AnimationOptions,
352
- ): import("./animate-runner.js").AnimateRunner;
353
- /**
354
- * Triggers a removeClass animation surrounding the removal of the provided CSS class(es). Upon
355
- * execution, the removeClass operation will only be handled after the next digest and it will not trigger an
356
- * animation if element does not contain the CSS class or if the class is added at a later step.
357
- * Note that class-based animations are treated differently compared to structural animations
358
- * (like enter, move and leave) since the CSS classes may be added/removed at different points
359
- * depending if CSS or JavaScript animations are used.
360
- *
361
- * @param {Element} element the element which the CSS classes will be applied to
362
- * @param {string} className the CSS class(es) that will be removed (multiple classes are separated via spaces)
363
- * @param {AnimationOptions} [options] an optional collection of options/styles that will be applied to the element. *
364
- * @return {import('./animate-runner.js').AnimateRunner} animationRunner the animation runner
365
- */
366
- removeClass(
367
- element: Element,
368
- className: string,
369
- options?: AnimationOptions,
370
- ): import("./animate-runner.js").AnimateRunner;
371
- /**
372
- * Performs both the addition and removal of a CSS classes on an element and (during the process)
373
- * triggers an animation surrounding the class addition/removal. Much like `$animate.addClass` and
374
- * `$animate.removeClass`, `setClass` will only evaluate the classes being added/removed once a digest has
375
- * passed. Note that class-based animations are treated differently compared to structural animations
376
- * (like enter, move and leave) since the CSS classes may be added/removed at different points
377
- * depending if CSS or JavaScript animations are used.
378
- *
379
- * @param {Element} element the element which the CSS classes will be applied to
380
- * @param {string} add the CSS class(es) that will be added (multiple classes are separated via spaces)
381
- * @param {string} remove the CSS class(es) that will be removed (multiple classes are separated via spaces)
382
- * @param {object=} options an optional collection of options/styles that will be applied to the element.
383
- *
384
- * @return {import('./animate-runner.js').AnimateRunner} the animation runner
385
- */
386
- setClass(
387
- element: Element,
388
- add: string,
389
- remove: string,
390
- options?: object | undefined,
391
- ): import("./animate-runner.js").AnimateRunner;
392
- /**
393
- * Performs an inline animation on the element which applies the provided to and from CSS styles to the element.
394
- * If any detected CSS transition, keyframe or JavaScript matches the provided className value, then the animation will take
395
- * on the provided styles. For example, if a transition animation is set for the given className, then the provided `from` and
396
- * `to` styles will be applied alongside the given transition. If the CSS style provided in `from` does not have a corresponding
397
- * style in `to`, the style in `from` is applied immediately, and no animation is run.
398
- * If a JavaScript animation is detected then the provided styles will be given in as function parameters into the `animate`
399
- * method (or as part of the `options` parameter):
400
- *
401
- * ```js
402
- * ngModule.animation('.my-inline-animation', function() {
403
- * return {
404
- * animate : function(element, from, to, done, options) {
405
- * //animation
406
- * done();
407
- * }
408
- * }
409
- * });
410
- * ```
411
- * @return {import('./animate-runner.js').AnimateRunner} the animation runner
412
- */
413
- animate(
414
- element: any,
415
- from: any,
416
- to: any,
417
- className: any,
418
- options: any,
419
- ): import("./animate-runner.js").AnimateRunner;
420
- })
421
- )[];
96
+ $get: any[];
422
97
  }
423
98
  export namespace AnimateProvider {
424
99
  let $inject: string[];
425
100
  }
426
- export type AnimationMethod =
427
- | "enter"
428
- | "leave"
429
- | "move"
430
- | "addClass"
431
- | "setClass"
432
- | "removeClass";
433
- export type AnimationOptions = {
434
- /**
435
- * - space-separated CSS classes to add to element
436
- */
437
- addClass: string;
438
- /**
439
- * - CSS properties & values at the beginning of animation. Must have matching `to`
440
- */
441
- from: any;
442
- /**
443
- * - space-separated CSS classes to remove from element
444
- */
445
- removeClass: string;
446
- /**
447
- * - CSS properties & values at end of animation. Must have matching `from`
448
- */
449
- to: string;
450
- };
@@ -5,10 +5,10 @@ export class AnimationProvider {
5
5
  | string
6
6
  | ((
7
7
  $rootScope: ng.RootScopeService,
8
- $injector: any,
9
- $$AnimateRunner: any,
10
- $$rAFScheduler: any,
8
+ $injector: ng.InjectorService,
9
+ $$rAFScheduler: import("./raf-scheduler.js").RafScheduler,
11
10
  $$animateCache: any,
12
- ) => (element: any, event: any, options: any) => any)
11
+ ) => (element: any, event: any, options: any) => AnimateRunner)
13
12
  )[];
14
13
  }
14
+ import { AnimateRunner } from "./runner/animate-runner.js";