Skip to content

Commit 7e9cf3c

Browse files
committed
Unit test animation scheduler
1 parent 4e7f4e5 commit 7e9cf3c

20 files changed

Lines changed: 210 additions & 47 deletions

@types/animations/animate-css-driver.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export class AnimateCssDriverProvider {
88
| string
99
| ((
1010
$animateCss: any,
11-
$$AnimateRunner: typeof import("./animate-runner.js").AnimateRunner,
11+
$$AnimateRunner: typeof import("./runner/animate-runner.js").AnimateRunner,
1212
$rootElement: Element,
1313
) => (animationDetails: any) => any)
1414
)[];

@types/animations/animate-css.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export class AnimateCssProvider {
33
$get: (
44
| string
55
| ((
6-
$$AnimateRunner: typeof import("./animate-runner.js").AnimateRunner,
6+
$$AnimateRunner: typeof import("./runner/animate-runner.js").AnimateRunner,
77
$$animateCache: any,
88
$$rAFScheduler: any,
99
) => (

@types/animations/animate-js-driver.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export class AnimateJsDriverProvider {
55
| string
66
| ((
77
$$animateJs: any,
8-
$$AnimateRunner: typeof import("./animate-runner.js").AnimateRunner,
8+
$$AnimateRunner: typeof import("./runner/animate-runner.js").AnimateRunner,
99
) => (animationDetails: any) => any)
1010
)[];
1111
}

@types/animations/animate-js.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export class AnimateJsProvider {
55
| string
66
| ((
77
$injector: ng.InjectorService,
8-
$$AnimateRunner: typeof import("./animate-runner.js").AnimateRunner,
8+
$$AnimateRunner: typeof import("./runner/animate-runner.js").AnimateRunner,
99
) => (
1010
element: any,
1111
event: any,

@types/animations/animate-queue.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class AnimateQueueProvider {
1212
$rootScope: import("../core/scope/scope.js").Scope,
1313
$injector: import("../core/di/internal-injector.js").InjectorService,
1414
$$animation: any,
15-
$$AnimateRunner: typeof import("./animate-runner.js").AnimateRunner,
15+
$$AnimateRunner: typeof import("./runner/animate-runner.js").AnimateRunner,
1616
$templateRequest: any,
1717
) => {
1818
on(event: any, container: any, callback: any): void;

@types/animations/animate.d.ts

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ export class AnimateProvider {
218218
* Note that this does not cancel the underlying operation, e.g. the setting of classes or
219219
* adding the element to the DOM.
220220
*
221-
* @param {import('./animate-runner.js').AnimateRunner} runner An animation runner returned by an $animate function.
221+
* @param {import('./runner/animate-runner.js').AnimateRunner} runner An animation runner returned by an $animate function.
222222
*
223223
* @example
224224
<example module="animationExample" deps="angular-animate.js" animations="true" name="animate-cancel">
@@ -282,7 +282,9 @@ export class AnimateProvider {
282282
</file>
283283
</example>
284284
*/
285-
cancel(runner: import("./animate-runner.js").AnimateRunner): void;
285+
cancel(
286+
runner: import("./runner/animate-runner.js").AnimateRunner,
287+
): void;
286288
/**
287289
* Inserts the element into the DOM either after the `after` element (if provided) or
288290
* as the first child within the `parent` element and then triggers an animation.
@@ -293,14 +295,14 @@ export class AnimateProvider {
293295
* @param {Element} parent - the parent element which will append the element as a child (so long as the after element is not present)
294296
* @param {Element} [after] - after the sibling element after which the element will be appended
295297
* @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
298+
* @returns {import('./runner/animate-runner.js').AnimateRunner} the animation runner
297299
*/
298300
enter(
299301
element: Element,
300302
parent: Element,
301303
after?: Element,
302304
options?: AnimationOptions,
303-
): import("./animate-runner.js").AnimateRunner;
305+
): import("./runner/animate-runner.js").AnimateRunner;
304306
/**
305307
* Inserts (moves) the element into its new position in the DOM either after
306308
* the `after` element (if provided) or as the first child within the `parent` element
@@ -311,27 +313,27 @@ export class AnimateProvider {
311313
* @param {Element} parent - the parent element which will append the element as a child (so long as the after element is not present)
312314
* @param {Element} after - after the sibling element after which the element will be appended
313315
* @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
316+
* @returns {import('./runner/animate-runner.js').AnimateRunner} the animation runner
315317
*/
316318
move(
317319
element: Element,
318320
parent: Element,
319321
after: Element,
320322
options?: AnimationOptions,
321-
): import("./animate-runner.js").AnimateRunner;
323+
): import("./runner/animate-runner.js").AnimateRunner;
322324
/**
323325
* Triggers an animation and then removes the element from the DOM.
324326
* When the function is called a promise is returned that will be resolved during the next
325327
* digest once the animation has completed.
326328
*
327329
* @param {Element} element the element which will be removed from the DOM
328330
* @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
331+
* @returns {import('./runner/animate-runner.js').AnimateRunner} the animation runner
330332
*/
331333
leave(
332334
element: Element,
333335
options?: AnimationOptions,
334-
): import("./animate-runner.js").AnimateRunner;
336+
): import("./runner/animate-runner.js").AnimateRunner;
335337
/**
336338
* Triggers an addClass animation surrounding the addition of the provided CSS class(es). Upon
337339
* execution, the addClass operation will only be handled after the next digest and it will not trigger an
@@ -343,13 +345,13 @@ export class AnimateProvider {
343345
* @param {Element} element the element which the CSS classes will be applied to
344346
* @param {string} className the CSS class(es) that will be added (multiple classes are separated via spaces)
345347
* @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
348+
* @return {import('./runner/animate-runner.js').AnimateRunner}} animationRunner the animation runner
347349
*/
348350
addClass(
349351
element: Element,
350352
className: string,
351353
options?: AnimationOptions,
352-
): import("./animate-runner.js").AnimateRunner;
354+
): import("./runner/animate-runner.js").AnimateRunner;
353355
/**
354356
* Triggers a removeClass animation surrounding the removal of the provided CSS class(es). Upon
355357
* execution, the removeClass operation will only be handled after the next digest and it will not trigger an
@@ -361,13 +363,13 @@ export class AnimateProvider {
361363
* @param {Element} element the element which the CSS classes will be applied to
362364
* @param {string} className the CSS class(es) that will be removed (multiple classes are separated via spaces)
363365
* @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
366+
* @return {import('./runner/animate-runner.js').AnimateRunner} animationRunner the animation runner
365367
*/
366368
removeClass(
367369
element: Element,
368370
className: string,
369371
options?: AnimationOptions,
370-
): import("./animate-runner.js").AnimateRunner;
372+
): import("./runner/animate-runner.js").AnimateRunner;
371373
/**
372374
* Performs both the addition and removal of a CSS classes on an element and (during the process)
373375
* triggers an animation surrounding the class addition/removal. Much like `$animate.addClass` and
@@ -381,14 +383,14 @@ export class AnimateProvider {
381383
* @param {string} remove the CSS class(es) that will be removed (multiple classes are separated via spaces)
382384
* @param {object=} options an optional collection of options/styles that will be applied to the element.
383385
*
384-
* @return {import('./animate-runner.js').AnimateRunner} the animation runner
386+
* @return {import('./runner/animate-runner.js').AnimateRunner} the animation runner
385387
*/
386388
setClass(
387389
element: Element,
388390
add: string,
389391
remove: string,
390392
options?: object | undefined,
391-
): import("./animate-runner.js").AnimateRunner;
393+
): import("./runner/animate-runner.js").AnimateRunner;
392394
/**
393395
* Performs an inline animation on the element which applies the provided to and from CSS styles to the element.
394396
* If any detected CSS transition, keyframe or JavaScript matches the provided className value, then the animation will take
@@ -408,15 +410,15 @@ export class AnimateProvider {
408410
* }
409411
* });
410412
* ```
411-
* @return {import('./animate-runner.js').AnimateRunner} the animation runner
413+
* @return {import('./runner/animate-runner.js').AnimateRunner} the animation runner
412414
*/
413415
animate(
414416
element: any,
415417
from: any,
416418
to: any,
417419
className: any,
418420
options: any,
419-
): import("./animate-runner.js").AnimateRunner;
421+
): import("./runner/animate-runner.js").AnimateRunner;
420422
})
421423
)[];
422424
}

@types/animations/animation.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ export class AnimationProvider {
66
| ((
77
$rootScope: ng.RootScopeService,
88
$injector: any,
9-
$$AnimateRunner: typeof import("./animate-runner.js").AnimateRunner,
9+
$$AnimateRunner: typeof import("./runner/animate-runner.js").AnimateRunner,
1010
$$rAFScheduler: any,
1111
$$animateCache: any,
1212
) => (
1313
element: any,
1414
event: any,
1515
options: any,
16-
) => import("./animate-runner.js").AnimateRunner)
16+
) => import("./runner/animate-runner.js").AnimateRunner)
1717
)[];
1818
}

@types/animations/animate-runner.d.ts renamed to @types/animations/runner/animate-runner.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ export class AnimateRunner {
3434
*/
3535
static all(runners: AnimateRunner[], callback: (ok: boolean) => void): void;
3636
/**
37-
* @param {import("./interface.ts").AnimationHost} [host] - Optional animation host.
37+
* @param {import("../interface.ts").AnimationHost} [host] - Optional animation host.
3838
*/
39-
constructor(host?: import("./interface.ts").AnimationHost);
40-
/** @type {import("./interface.ts").AnimationHost} */
41-
host: import("./interface.ts").AnimationHost;
39+
constructor(host?: import("../interface.ts").AnimationHost);
40+
/** @type {import("../interface.ts").AnimationHost} */
41+
host: import("../interface.ts").AnimationHost;
4242
/** @type {Array<(ok: boolean) => void>} */
4343
_doneCallbacks: Array<(ok: boolean) => void>;
4444
/** @type {0|1|2} */
@@ -49,9 +49,9 @@ export class AnimateRunner {
4949
_schedule: (fn: VoidFunction) => void;
5050
/**
5151
* Sets or updates the animation host.
52-
* @param {import("./interface.ts").AnimationHost} host - The host object.
52+
* @param {import("../interface.ts").AnimationHost} host - The host object.
5353
*/
54-
setHost(host: import("./interface.ts").AnimationHost): void;
54+
setHost(host: import("../interface.ts").AnimationHost): void;
5555
/**
5656
* Registers a callback to be called once the animation completes.
5757
* If the animation is already complete, it's called immediately.

src/animations/animate-css-driver.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function AnimateCssDriverProvider($$animationProvider) {
2525
/**
2626
*
2727
* @param {*} $animateCss
28-
* @param {typeof import('./animate-runner.js').AnimateRunner} $$AnimateRunner
28+
* @param {typeof import('./runner/animate-runner.js').AnimateRunner} $$AnimateRunner
2929
* @param {Element} $rootElement
3030
* @returns
3131
*/

src/animations/animate-css.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export function AnimateCssProvider() {
149149

150150
/**
151151
*
152-
* @param {typeof import("./animate-runner.js").AnimateRunner} $$AnimateRunner
152+
* @param {typeof import("./runner/animate-runner.js").AnimateRunner} $$AnimateRunner
153153
* @param {*} $$animateCache
154154
* @param {import("./raf-scheduler").RafScheduler} $$rAFScheduler
155155
* @returns

0 commit comments

Comments
 (0)