@angular-wave/angular.ts 0.0.51 → 0.0.52

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 (37) hide show
  1. package/dist/angular-ts.esm.js +2 -2
  2. package/dist/angular-ts.umd.js +2 -2
  3. package/package.json +1 -1
  4. package/src/animations/animate-children-directive.js +19 -99
  5. package/src/animations/animate-children-directive.md +80 -0
  6. package/src/animations/animate-css-driver.js +250 -256
  7. package/src/animations/animate-css.js +646 -875
  8. package/src/animations/animate-css.md +263 -0
  9. package/src/animations/animate-js-driver.js +54 -56
  10. package/src/animations/animate-js.js +303 -306
  11. package/src/animations/animate-queue.js +707 -716
  12. package/src/animations/animate-swap.js +30 -119
  13. package/src/animations/animate-swap.md +88 -0
  14. package/src/animations/animation.js +3 -3
  15. package/src/core/animate/animate-runner.js +147 -145
  16. package/src/core/animate/animate.js +568 -582
  17. package/src/core/animate/anomate.md +13 -0
  18. package/src/core/compile/compile.spec.js +5 -6
  19. package/src/core/core.html +0 -1
  20. package/src/directive/select/select.js +301 -305
  21. package/src/public.js +0 -1
  22. package/src/router/directives/state-directives.js +256 -574
  23. package/src/router/directives/state-directives.md +435 -0
  24. package/src/router/directives/view-directive.js +3 -3
  25. package/src/router/index.js +7 -7
  26. package/types/animations/animate-children-directive.d.ts +5 -80
  27. package/types/animations/animate-css-driver.d.ts +11 -0
  28. package/types/animations/animate-css.d.ts +8 -0
  29. package/types/animations/animate-js-driver.d.ts +8 -0
  30. package/types/animations/animate-js.d.ts +12 -0
  31. package/types/animations/animate-queue.d.ts +19 -0
  32. package/types/animations/animate-swap.d.ts +5 -89
  33. package/types/core/animate/animate-runner.d.ts +32 -0
  34. package/types/core/animate/animate.d.ts +509 -0
  35. package/types/directive/select/select.d.ts +79 -0
  36. package/types/router/directives/state-directives.d.ts +31 -0
  37. package/src/core/document.spec.js +0 -52
@@ -1,94 +1,10 @@
1
- /**
2
- * @ngdoc directive
3
- * @name ngAnimateSwap
4
- * @restrict A
5
- * @scope
6
- *
7
- * @description
8
- *
9
- * ngAnimateSwap is a animation-oriented directive that allows for the container to
10
- * be removed and entered in whenever the associated expression changes. A
11
- * common usecase for this directive is a rotating banner or slider component which
12
- * contains one image being present at a time. When the active image changes
13
- * then the old image will perform a `leave` animation and the new element
14
- * will be inserted via an `enter` animation.
15
- *
16
- * @animations
17
- * | Animation | Occurs |
18
- * |----------------------------------|--------------------------------------|
19
- * | {@link ng.$animate#enter enter} | when the new element is inserted to the DOM |
20
- * | {@link ng.$animate#leave leave} | when the old element is removed from the DOM |
21
- *
22
- * @example
23
- * <example name="ngAnimateSwap-directive" module="ngAnimateSwapExample"
24
- * deps="angular-animate.js"
25
- * animations="true" fixBase="true">
26
- * <file name="index.html">
27
- * <div class="container" ng-controller="AppCtrl">
28
- * <div ng-animate-swap="number" class="cell swap-animation" ng-class="colorClass(number)">
29
- * {{ number }}
30
- * </div>
31
- * </div>
32
- * </file>
33
- * <file name="script.js">
34
- * angular.module('ngAnimateSwapExample', ['ngAnimate'])
35
- * .controller('AppCtrl', ['$scope', '$interval', function($scope, $interval) {
36
- * $scope.number = 0;
37
- * $interval(function() {
38
- * $scope.number++;
39
- * }, 1000);
40
- *
41
- * let colors = ['red','blue','green','yellow','orange'];
42
- * $scope.colorClass = function(number) {
43
- * return colors[number % colors.length];
44
- * };
45
- * }]);
46
- * </file>
47
- * <file name="animations.css">
48
- * .container {
49
- * height:250px;
50
- * width:250px;
51
- * position:relative;
52
- * overflow:hidden;
53
- * border:2px solid black;
54
- * }
55
- * .container .cell {
56
- * font-size:150px;
57
- * text-align:center;
58
- * line-height:250px;
59
- * position:absolute;
60
- * top:0;
61
- * left:0;
62
- * right:0;
63
- * border-bottom:2px solid black;
64
- * }
65
- * .swap-animation.ng-enter, .swap-animation.ng-leave {
66
- * transition:0.5s linear all;
67
- * }
68
- * .swap-animation.ng-enter {
69
- * top:-250px;
70
- * }
71
- * .swap-animation.ng-enter-active {
72
- * top:0px;
73
- * }
74
- * .swap-animation.ng-leave {
75
- * top:0px;
76
- * }
77
- * .swap-animation.ng-leave-active {
78
- * top:250px;
79
- * }
80
- * .red { background:red; }
81
- * .green { background:green; }
82
- * .blue { background:blue; }
83
- * .yellow { background:yellow; }
84
- * .orange { background:orange; }
85
- * </file>
86
- * </example>
87
- */
88
- export const ngAnimateSwapDirective: (string | (($animate: any) => {
1
+ export function ngAnimateSwapDirective($animate: any): {
89
2
  restrict: string;
90
3
  transclude: string;
91
4
  terminal: boolean;
92
5
  priority: number;
93
6
  link(scope: any, $element: any, attrs: any, ctrl: any, $transclude: any): void;
94
- }))[];
7
+ };
8
+ export namespace ngAnimateSwapDirective {
9
+ let $inject: string[];
10
+ }
@@ -0,0 +1,32 @@
1
+ export function AnimateAsyncRunFactoryProvider(): void;
2
+ export class AnimateAsyncRunFactoryProvider {
3
+ $get: (() => () => (callback: any) => void)[];
4
+ }
5
+ export function AnimateRunnerFactoryProvider(): void;
6
+ export class AnimateRunnerFactoryProvider {
7
+ $get: (string | ((q: any, animateAsyncRun: any, timeout: any) => typeof AnimateRunner))[];
8
+ }
9
+ declare class AnimateRunner {
10
+ static chain(chain: any, callback: any): void;
11
+ static all(runners: any, callback: any): void;
12
+ constructor(host: any);
13
+ _doneCallbacks: any[];
14
+ _tick: (fn: any) => void;
15
+ _state: number;
16
+ setHost(host: any): void;
17
+ host: any;
18
+ done(fn: any): void;
19
+ progress(): void;
20
+ getPromise(): any;
21
+ promise: any;
22
+ then(resolveHandler: any, rejectHandler: any): any;
23
+ catch(handler: any): any;
24
+ finally(handler: any): any;
25
+ pause(): void;
26
+ resume(): void;
27
+ end(): void;
28
+ cancel(): void;
29
+ complete(response: any): void;
30
+ _resolve(response: any): void;
31
+ }
32
+ export {};
@@ -0,0 +1,509 @@
1
+ export function CoreAnimateJsProvider(): void;
2
+ export class CoreAnimateJsProvider {
3
+ $get: () => void;
4
+ }
5
+ export function CoreAnimateQueueProvider(): void;
6
+ export class CoreAnimateQueueProvider {
7
+ $get: (string | (($$AnimateRunner: any, $rootScope: any) => {
8
+ enabled: () => void;
9
+ on: () => void;
10
+ off: () => void;
11
+ pin: () => void;
12
+ push(element: any, event: any, options: any, domOperation: any): any;
13
+ }))[];
14
+ }
15
+ export function AnimateProvider($provide: any): void;
16
+ export class AnimateProvider {
17
+ constructor($provide: any);
18
+ $$registeredAnimations: any;
19
+ /**
20
+ * @ngdoc method
21
+ * @name $animateProvider#register
22
+ *
23
+ * @description
24
+ * Registers a new injectable animation factory function. The factory function produces the
25
+ * animation object which contains callback functions for each event that is expected to be
26
+ * animated.
27
+ *
28
+ * * `eventFn`: `function(element, ... , doneFunction, options)`
29
+ * The element to animate, the `doneFunction` and the options fed into the animation. Depending
30
+ * on the type of animation additional arguments will be injected into the animation function. The
31
+ * list below explains the function signatures for the different animation methods:
32
+ *
33
+ * - setClass: function(element, addedClasses, removedClasses, doneFunction, options)
34
+ * - addClass: function(element, addedClasses, doneFunction, options)
35
+ * - removeClass: function(element, removedClasses, doneFunction, options)
36
+ * - enter, leave, move: function(element, doneFunction, options)
37
+ * - animate: function(element, fromStyles, toStyles, doneFunction, options)
38
+ *
39
+ * Make sure to trigger the `doneFunction` once the animation is fully complete.
40
+ *
41
+ * ```js
42
+ * return {
43
+ * //enter, leave, move signature
44
+ * eventFn : function(element, done, options) {
45
+ * //code to run the animation
46
+ * //once complete, then run done()
47
+ * return function endFunction(wasCancelled) {
48
+ * //code to cancel the animation
49
+ * }
50
+ * }
51
+ * }
52
+ * ```
53
+ *
54
+ * @param {string} name The name of the animation (this is what the class-based CSS value will be compared to).
55
+ * @param {Function} factory The factory function that will be executed to return the animation
56
+ * object.
57
+ */
58
+ register: (name: string, factory: Function) => void;
59
+ /**
60
+ * @ngdoc method
61
+ * @name $animateProvider#customFilter
62
+ *
63
+ * @description
64
+ * Sets and/or returns the custom filter function that is used to "filter" animations, i.e.
65
+ * determine if an animation is allowed or not. When no filter is specified (the default), no
66
+ * animation will be blocked. Setting the `customFilter` value will only allow animations for
67
+ * which the filter function's return value is truthy.
68
+ *
69
+ * This allows to easily create arbitrarily complex rules for filtering animations, such as
70
+ * allowing specific events only, or enabling animations on specific subtrees of the DOM, etc.
71
+ * Filtering animations can also boost performance for low-powered devices, as well as
72
+ * applications containing a lot of structural operations.
73
+ *
74
+ * <div class="alert alert-success">
75
+ * **Best Practice:**
76
+ * Keep the filtering function as lean as possible, because it will be called for each DOM
77
+ * action (e.g. insertion, removal, class change) performed by "animation-aware" directives.
78
+ * See {@link guide/animations#which-directives-support-animations- here} for a list of built-in
79
+ * directives that support animations.
80
+ * Performing computationally expensive or time-consuming operations on each call of the
81
+ * filtering function can make your animations sluggish.
82
+ * </div>
83
+ *
84
+ * **Note:** If present, `customFilter` will be checked before
85
+ * {@link $animateProvider#classNameFilter classNameFilter}.
86
+ *
87
+ * @param {Function=} filterFn - The filter function which will be used to filter all animations.
88
+ * If a falsy value is returned, no animation will be performed. The function will be called
89
+ * with the following arguments:
90
+ * - **node** `{Element}` - The DOM element to be animated.
91
+ * - **event** `{String}` - The name of the animation event (e.g. `enter`, `leave`, `addClass`
92
+ * etc).
93
+ * - **options** `{Object}` - A collection of options/styles used for the animation.
94
+ * @return {Function} The current filter function or `null` if there is none set.
95
+ */
96
+ customFilter: (filterFn?: Function | undefined, ...args: any[]) => Function;
97
+ /**
98
+ * @ngdoc method
99
+ * @name $animateProvider#classNameFilter
100
+ *
101
+ * @description
102
+ * Sets and/or returns the CSS class regular expression that is checked when performing
103
+ * an animation. Upon bootstrap the classNameFilter value is not set at all and will
104
+ * therefore enable $animate to attempt to perform an animation on any element that is triggered.
105
+ * When setting the `classNameFilter` value, animations will only be performed on elements
106
+ * that successfully match the filter expression. This in turn can boost performance
107
+ * for low-powered devices as well as applications containing a lot of structural operations.
108
+ *
109
+ * **Note:** If present, `classNameFilter` will be checked after
110
+ * {@link $animateProvider#customFilter customFilter}. If `customFilter` is present and returns
111
+ * false, `classNameFilter` will not be checked.
112
+ *
113
+ * @param {RegExp=} expression The className expression which will be checked against all animations
114
+ * @return {RegExp} The current CSS className expression value. If null then there is no expression value
115
+ */
116
+ classNameFilter: (expression?: RegExp | undefined, ...args: any[]) => RegExp;
117
+ $get: (string | (($$animateQueue: any) => {
118
+ /**
119
+ *
120
+ * @ngdoc method
121
+ * @name $animate#on
122
+ * @kind function
123
+ * @description Sets up an event listener to fire whenever the animation event (enter, leave, move, etc...)
124
+ * has fired on the given element or among any of its children. Once the listener is fired, the provided callback
125
+ * is fired with the following params:
126
+ *
127
+ * ```js
128
+ * $animate.on('enter', container,
129
+ * function callback(element, phase) {
130
+ * // cool we detected an enter animation within the container
131
+ * }
132
+ * );
133
+ * ```
134
+ *
135
+ * <div class="alert alert-warning">
136
+ * **Note**: Generally, the events that are fired correspond 1:1 to `$animate` method names,
137
+ * e.g. {@link ng.$animate#addClass addClass()} will fire `addClass`, and {@link ng.ngClass}
138
+ * will fire `addClass` if classes are added, and `removeClass` if classes are removed.
139
+ * However, there are two exceptions:
140
+ *
141
+ * <ul>
142
+ * <li>if both an {@link ng.$animate#addClass addClass()} and a
143
+ * {@link ng.$animate#removeClass removeClass()} action are performed during the same
144
+ * animation, the event fired will be `setClass`. This is true even for `ngClass`.</li>
145
+ * <li>an {@link ng.$animate#animate animate()} call that adds and removes classes will fire
146
+ * the `setClass` event, but if it either removes or adds classes,
147
+ * it will fire `animate` instead.</li>
148
+ * </ul>
149
+ *
150
+ * </div>
151
+ *
152
+ * @param {string} event the animation event that will be captured (e.g. enter, leave, move, addClass, removeClass, etc...)
153
+ * @param {Element} container the container element that will capture each of the animation events that are fired on itself
154
+ * as well as among its children
155
+ * @param {Function} callback the callback function that will be fired when the listener is triggered.
156
+ *
157
+ * The arguments present in the callback function are:
158
+ * * `element` - The captured DOM element that the animation was fired on.
159
+ * * `phase` - The phase of the animation. The two possible phases are **start** (when the animation starts) and **close** (when it ends).
160
+ * * `data` - an object with these properties:
161
+ * * addClass - `{string|null}` - space-separated CSS classes to add to the element
162
+ * * removeClass - `{string|null}` - space-separated CSS classes to remove from the element
163
+ * * from - `{Object|null}` - CSS properties & values at the beginning of the animation
164
+ * * to - `{Object|null}` - CSS properties & values at the end of the animation
165
+ *
166
+ * Note that the callback does not trigger a scope digest. Wrap your call into a
167
+ * {@link $rootScope.Scope#$apply scope.$apply} to propagate changes to the scope.
168
+ */
169
+ on: any;
170
+ /**
171
+ *
172
+ * @ngdoc method
173
+ * @name $animate#off
174
+ * @kind function
175
+ * @description Deregisters an event listener based on the event which has been associated with the provided element. This method
176
+ * can be used in three different ways depending on the arguments:
177
+ *
178
+ * ```js
179
+ * // remove all the animation event listeners listening for `enter`
180
+ * $animate.off('enter');
181
+ *
182
+ * // remove listeners for all animation events from the container element
183
+ * $animate.off(container);
184
+ *
185
+ * // remove all the animation event listeners listening for `enter` on the given element and its children
186
+ * $animate.off('enter', container);
187
+ *
188
+ * // remove the event listener function provided by `callback` that is set
189
+ * // to listen for `enter` on the given `container` as well as its children
190
+ * $animate.off('enter', container, callback);
191
+ * ```
192
+ *
193
+ * @param {string|Element} event|container the animation event (e.g. enter, leave, move,
194
+ * addClass, removeClass, etc...), or the container element. If it is the element, all other
195
+ * arguments are ignored.
196
+ * @param {Element=} container the container element the event listener was placed on
197
+ * @param {Function=} callback the callback function that was registered as the listener
198
+ */
199
+ off: any;
200
+ /**
201
+ * @ngdoc method
202
+ * @name $animate#pin
203
+ * @kind function
204
+ * @description Associates the provided element with a host parent element to allow the element to be animated even if it exists
205
+ * outside of the DOM structure of the AngularJS application. By doing so, any animation triggered via `$animate` can be issued on the
206
+ * element despite being outside the realm of the application or within another application. Say for example if the application
207
+ * was bootstrapped on an element that is somewhere inside of the `<body>` tag, but we wanted to allow for an element to be situated
208
+ * as a direct child of `document.body`, then this can be achieved by pinning the element via `$animate.pin(element)`. Keep in mind
209
+ * that calling `$animate.pin(element, parentElement)` will not actually insert into the DOM anywhere; it will just create the association.
210
+ *
211
+ * Note that this feature is only active when the `ngAnimate` module is used.
212
+ *
213
+ * @param {Element} element the external element that will be pinned
214
+ * @param {Element} parentElement the host parent element that will be associated with the external element
215
+ */
216
+ pin: any;
217
+ /**
218
+ *
219
+ * @ngdoc method
220
+ * @name $animate#enabled
221
+ * @kind function
222
+ * @description Used to get and set whether animations are enabled or not on the entire application or on an element and its children. This
223
+ * function can be called in four ways:
224
+ *
225
+ * ```js
226
+ * // returns true or false
227
+ * $animate.enabled();
228
+ *
229
+ * // changes the enabled state for all animations
230
+ * $animate.enabled(false);
231
+ * $animate.enabled(true);
232
+ *
233
+ * // returns true or false if animations are enabled for an element
234
+ * $animate.enabled(element);
235
+ *
236
+ * // changes the enabled state for an element and its children
237
+ * $animate.enabled(element, true);
238
+ * $animate.enabled(element, false);
239
+ * ```
240
+ *
241
+ * @param {Element=} element the element that will be considered for checking/setting the enabled state
242
+ * @param {boolean=} enabled whether or not the animations will be enabled for the element
243
+ *
244
+ * @return {boolean} whether or not animations are enabled
245
+ */
246
+ enabled: any;
247
+ /**
248
+ * @ngdoc method
249
+ * @name $animate#cancel
250
+ * @kind function
251
+ * @description Cancels the provided animation and applies the end state of the animation.
252
+ * Note that this does not cancel the underlying operation, e.g. the setting of classes or
253
+ * adding the element to the DOM.
254
+ *
255
+ * @param {animationRunner} animationRunner An animation runner returned by an $animate function.
256
+ *
257
+ * @example
258
+ <example module="animationExample" deps="angular-animate.js" animations="true" name="animate-cancel">
259
+ <file name="app.js">
260
+ angular.module('animationExample', ['ngAnimate']).component('cancelExample', {
261
+ templateUrl: 'template.html',
262
+ controller: function($element, $animate) {
263
+ this.runner = null;
264
+
265
+ this.addClass = function() {
266
+ this.runner = $animate.addClass($element.find('div'), 'red');
267
+ let ctrl = this;
268
+ this.runner.finally(function() {
269
+ ctrl.runner = null;
270
+ });
271
+ };
272
+
273
+ this.removeClass = function() {
274
+ this.runner = $animate.removeClass($element.find('div'), 'red');
275
+ let ctrl = this;
276
+ this.runner.finally(function() {
277
+ ctrl.runner = null;
278
+ });
279
+ };
280
+
281
+ this.cancel = function() {
282
+ $animate.cancel(this.runner);
283
+ };
284
+ }
285
+ });
286
+ </file>
287
+ <file name="template.html">
288
+ <p>
289
+ <button id="add" ng-click="$ctrl.addClass()">Add</button>
290
+ <button ng-click="$ctrl.removeClass()">Remove</button>
291
+ <br>
292
+ <button id="cancel" ng-click="$ctrl.cancel()" ng-disabled="!$ctrl.runner">Cancel</button>
293
+ <br>
294
+ <div id="target">CSS-Animated Text</div>
295
+ </p>
296
+ </file>
297
+ <file name="index.html">
298
+ <cancel-example></cancel-example>
299
+ </file>
300
+ <file name="style.css">
301
+ .red-add, .red-remove {
302
+ transition: all 4s cubic-bezier(0.250, 0.460, 0.450, 0.940);
303
+ }
304
+
305
+ .red,
306
+ .red-add.red-add-active {
307
+ color: #FF0000;
308
+ font-size: 40px;
309
+ }
310
+
311
+ .red-remove.red-remove-active {
312
+ font-size: 10px;
313
+ color: black;
314
+ }
315
+
316
+ </file>
317
+ </example>
318
+ */
319
+ cancel(runner: any): void;
320
+ /**
321
+ *
322
+ * @ngdoc method
323
+ * @name $animate#enter
324
+ * @kind function
325
+ * @description Inserts the element into the DOM either after the `after` element (if provided) or
326
+ * as the first child within the `parent` element and then triggers an animation.
327
+ * A promise is returned that will be resolved during the next digest once the animation
328
+ * has completed.
329
+ *
330
+ * @param {Element} element the element which will be inserted into the DOM
331
+ * @param {Element} parent the parent element which will append the element as
332
+ * a child (so long as the after element is not present)
333
+ * @param {Element=} after the sibling element after which the element will be appended
334
+ * @param {object=} options an optional collection of options/styles that will be applied to the element.
335
+ * The object can have the following properties:
336
+ *
337
+ * - **addClass** - `{string}` - space-separated CSS classes to add to element
338
+ * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`
339
+ * - **removeClass** - `{string}` - space-separated CSS classes to remove from element
340
+ * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`
341
+ *
342
+ * @return {Runner} the animation runner
343
+ */
344
+ enter(element: Element, parent: Element, after?: Element | undefined, options?: object | undefined): Runner;
345
+ /**
346
+ *
347
+ * @ngdoc method
348
+ * @name $animate#move
349
+ * @kind function
350
+ * @description Inserts (moves) the element into its new position in the DOM either after
351
+ * the `after` element (if provided) or as the first child within the `parent` element
352
+ * and then triggers an animation. A promise is returned that will be resolved
353
+ * during the next digest once the animation has completed.
354
+ *
355
+ * @param {Element} element the element which will be moved into the new DOM position
356
+ * @param {Element} parent the parent element which will append the element as
357
+ * a child (so long as the after element is not present)
358
+ * @param {Element=} after the sibling element after which the element will be appended
359
+ * @param {object=} options an optional collection of options/styles that will be applied to the element.
360
+ * The object can have the following properties:
361
+ *
362
+ * - **addClass** - `{string}` - space-separated CSS classes to add to element
363
+ * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`
364
+ * - **removeClass** - `{string}` - space-separated CSS classes to remove from element
365
+ * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`
366
+ *
367
+ * @return {Runner} the animation runner
368
+ */
369
+ move(element: Element, parent: Element, after?: Element | undefined, options?: object | undefined): Runner;
370
+ /**
371
+ * @ngdoc method
372
+ * @name $animate#leave
373
+ * @kind function
374
+ * @description Triggers an animation and then removes the element from the DOM.
375
+ * When the function is called a promise is returned that will be resolved during the next
376
+ * digest once the animation has completed.
377
+ *
378
+ * @param {Element} element the element which will be removed from the DOM
379
+ * @param {object=} options an optional collection of options/styles that will be applied to the element.
380
+ * The object can have the following properties:
381
+ *
382
+ * - **addClass** - `{string}` - space-separated CSS classes to add to element
383
+ * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`
384
+ * - **removeClass** - `{string}` - space-separated CSS classes to remove from element
385
+ * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`
386
+ *
387
+ * @return {Runner} the animation runner
388
+ */
389
+ leave(element: Element, options?: object | undefined): Runner;
390
+ /**
391
+ * @ngdoc method
392
+ * @name $animate#addClass
393
+ * @kind function
394
+ *
395
+ * @description Triggers an addClass animation surrounding the addition of the provided CSS class(es). Upon
396
+ * execution, the addClass operation will only be handled after the next digest and it will not trigger an
397
+ * animation if element already contains the CSS class or if the class is removed at a later step.
398
+ * Note that class-based animations are treated differently compared to structural animations
399
+ * (like enter, move and leave) since the CSS classes may be added/removed at different points
400
+ * depending if CSS or JavaScript animations are used.
401
+ *
402
+ * @param {Element} element the element which the CSS classes will be applied to
403
+ * @param {string} className the CSS class(es) that will be added (multiple classes are separated via spaces)
404
+ * @param {object=} options an optional collection of options/styles that will be applied to the element.
405
+ * The object can have the following properties:
406
+ *
407
+ * - **removeClass** - `{string}` - space-separated CSS classes to remove from element
408
+ * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`
409
+ * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`
410
+ *
411
+ * @return {Runner} animationRunner the animation runner
412
+ */
413
+ addClass(element: Element, className: string, options?: object | undefined): Runner;
414
+ /**
415
+ * @ngdoc method
416
+ * @name $animate#removeClass
417
+ * @kind function
418
+ *
419
+ * @description Triggers a removeClass animation surrounding the removal of the provided CSS class(es). Upon
420
+ * execution, the removeClass operation will only be handled after the next digest and it will not trigger an
421
+ * animation if element does not contain the CSS class or if the class is added at a later step.
422
+ * Note that class-based animations are treated differently compared to structural animations
423
+ * (like enter, move and leave) since the CSS classes may be added/removed at different points
424
+ * depending if CSS or JavaScript animations are used.
425
+ *
426
+ * @param {Element} element the element which the CSS classes will be applied to
427
+ * @param {string} className the CSS class(es) that will be removed (multiple classes are separated via spaces)
428
+ * @param {object=} options an optional collection of options/styles that will be applied to the element.
429
+ * The object can have the following properties:
430
+ *
431
+ * - **addClass** - `{string}` - space-separated CSS classes to add to element
432
+ * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`
433
+ * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`
434
+ *
435
+ * @return {Runner} the animation runner
436
+ */
437
+ removeClass(element: Element, className: string, options?: object | undefined): Runner;
438
+ /**
439
+ * @ngdoc method
440
+ * @name $animate#setClass
441
+ * @kind function
442
+ *
443
+ * @description Performs both the addition and removal of a CSS classes on an element and (during the process)
444
+ * triggers an animation surrounding the class addition/removal. Much like `$animate.addClass` and
445
+ * `$animate.removeClass`, `setClass` will only evaluate the classes being added/removed once a digest has
446
+ * passed. Note that class-based animations are treated differently compared to structural animations
447
+ * (like enter, move and leave) since the CSS classes may be added/removed at different points
448
+ * depending if CSS or JavaScript animations are used.
449
+ *
450
+ * @param {Element} element the element which the CSS classes will be applied to
451
+ * @param {string} add the CSS class(es) that will be added (multiple classes are separated via spaces)
452
+ * @param {string} remove the CSS class(es) that will be removed (multiple classes are separated via spaces)
453
+ * @param {object=} options an optional collection of options/styles that will be applied to the element.
454
+ * The object can have the following properties:
455
+ *
456
+ * - **addClass** - `{string}` - space-separated CSS classes to add to element
457
+ * - **removeClass** - `{string}` - space-separated CSS classes to remove from element
458
+ * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`
459
+ * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`
460
+ *
461
+ * @return {Runner} the animation runner
462
+ */
463
+ setClass(element: Element, add: string, remove: string, options?: object | undefined): Runner;
464
+ /**
465
+ * @ngdoc method
466
+ * @name $animate#animate
467
+ * @kind function
468
+ *
469
+ * @description Performs an inline animation on the element which applies the provided to and from CSS styles to the element.
470
+ * If any detected CSS transition, keyframe or JavaScript matches the provided className value, then the animation will take
471
+ * on the provided styles. For example, if a transition animation is set for the given className, then the provided `from` and
472
+ * `to` styles will be applied alongside the given transition. If the CSS style provided in `from` does not have a corresponding
473
+ * style in `to`, the style in `from` is applied immediately, and no animation is run.
474
+ * If a JavaScript animation is detected then the provided styles will be given in as function parameters into the `animate`
475
+ * method (or as part of the `options` parameter):
476
+ *
477
+ * ```js
478
+ * ngModule.animation('.my-inline-animation', function() {
479
+ * return {
480
+ * animate : function(element, from, to, done, options) {
481
+ * //animation
482
+ * done();
483
+ * }
484
+ * }
485
+ * });
486
+ * ```
487
+ *
488
+ * @param {Element} element the element which the CSS styles will be applied to
489
+ * @param {object} from the from (starting) CSS styles that will be applied to the element and across the animation.
490
+ * @param {object} to the to (destination) CSS styles that will be applied to the element and across the animation.
491
+ * @param {string=} className an optional CSS class that will be applied to the element for the duration of the animation. If
492
+ * this value is left as empty then a CSS class of `ng-inline-animate` will be applied to the element.
493
+ * (Note that if no animation is detected then this value will not be applied to the element.)
494
+ * @param {object=} options an optional collection of options/styles that will be applied to the element.
495
+ * The object can have the following properties:
496
+ *
497
+ * - **addClass** - `{string}` - space-separated CSS classes to add to element
498
+ * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`
499
+ * - **removeClass** - `{string}` - space-separated CSS classes to remove from element
500
+ * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`
501
+ *
502
+ * @return {Runner} the animation runner
503
+ */
504
+ animate(element: Element, from: object, to: object, className?: string | undefined, options?: object | undefined): Runner;
505
+ }))[];
506
+ }
507
+ export namespace AnimateProvider {
508
+ let $inject: string[];
509
+ }