UNPKG

51.7 kBTypeScriptView Raw
1/**
2 * @license Angular v15.0.2
3 * (c) 2010-2022 Google LLC. https://angular.io/
4 * License: MIT
5 */
6
7
8/**
9 * Defines an animation step that combines styling information with timing information.
10 *
11 * @param timings Sets `AnimateTimings` for the parent animation.
12 * A string in the format "duration [delay] [easing]".
13 * - Duration and delay are expressed as a number and optional time unit,
14 * such as "1s" or "10ms" for one second and 10 milliseconds, respectively.
15 * The default unit is milliseconds.
16 * - The easing value controls how the animation accelerates and decelerates
17 * during its runtime. Value is one of `ease`, `ease-in`, `ease-out`,
18 * `ease-in-out`, or a `cubic-bezier()` function call.
19 * If not supplied, no easing is applied.
20 *
21 * For example, the string "1s 100ms ease-out" specifies a duration of
22 * 1000 milliseconds, and delay of 100 ms, and the "ease-out" easing style,
23 * which decelerates near the end of the duration.
24 * @param styles Sets AnimationStyles for the parent animation.
25 * A function call to either `style()` or `keyframes()`
26 * that returns a collection of CSS style entries to be applied to the parent animation.
27 * When null, uses the styles from the destination state.
28 * This is useful when describing an animation step that will complete an animation;
29 * see "Animating to the final state" in `transitions()`.
30 * @returns An object that encapsulates the animation step.
31 *
32 * @usageNotes
33 * Call within an animation `sequence()`, `{@link animations/group group()}`, or
34 * `transition()` call to specify an animation step
35 * that applies given style data to the parent animation for a given amount of time.
36 *
37 * ### Syntax Examples
38 * **Timing examples**
39 *
40 * The following examples show various `timings` specifications.
41 * - `animate(500)` : Duration is 500 milliseconds.
42 * - `animate("1s")` : Duration is 1000 milliseconds.
43 * - `animate("100ms 0.5s")` : Duration is 100 milliseconds, delay is 500 milliseconds.
44 * - `animate("5s ease-in")` : Duration is 5000 milliseconds, easing in.
45 * - `animate("5s 10ms cubic-bezier(.17,.67,.88,.1)")` : Duration is 5000 milliseconds, delay is 10
46 * milliseconds, easing according to a bezier curve.
47 *
48 * **Style examples**
49 *
50 * The following example calls `style()` to set a single CSS style.
51 * ```typescript
52 * animate(500, style({ background: "red" }))
53 * ```
54 * The following example calls `keyframes()` to set a CSS style
55 * to different values for successive keyframes.
56 * ```typescript
57 * animate(500, keyframes(
58 * [
59 * style({ background: "blue" }),
60 * style({ background: "red" })
61 * ])
62 * ```
63 *
64 * @publicApi
65 */
66export declare function animate(timings: string | number, styles?: AnimationStyleMetadata | AnimationKeyframesSequenceMetadata | null): AnimationAnimateMetadata;
67
68/**
69 * Executes a queried inner animation element within an animation sequence.
70 *
71 * @param options An options object that can contain a delay value for the start of the
72 * animation, and additional override values for developer-defined parameters.
73 * @return An object that encapsulates the child animation data.
74 *
75 * @usageNotes
76 * Each time an animation is triggered in Angular, the parent animation
77 * has priority and any child animations are blocked. In order
78 * for a child animation to run, the parent animation must query each of the elements
79 * containing child animations, and run them using this function.
80 *
81 * Note that this feature is designed to be used with `query()` and it will only work
82 * with animations that are assigned using the Angular animation library. CSS keyframes
83 * and transitions are not handled by this API.
84 *
85 * @publicApi
86 */
87export declare function animateChild(options?: AnimateChildOptions | null): AnimationAnimateChildMetadata;
88
89/**
90 * Adds duration options to control animation styling and timing for a child animation.
91 *
92 * @see `animateChild()`
93 *
94 * @publicApi
95 */
96export declare interface AnimateChildOptions extends AnimationOptions {
97 duration?: number | string;
98}
99
100/**
101 * Represents animation-step timing parameters for an animation step.
102 * @see `animate()`
103 *
104 * @publicApi
105 */
106export declare type AnimateTimings = {
107 /**
108 * The full duration of an animation step. A number and optional time unit,
109 * such as "1s" or "10ms" for one second and 10 milliseconds, respectively.
110 * The default unit is milliseconds.
111 */
112 duration: number;
113 /**
114 * The delay in applying an animation step. A number and optional time unit.
115 * The default unit is milliseconds.
116 */
117 delay: number;
118 /**
119 * An easing style that controls how an animations step accelerates
120 * and decelerates during its run time. An easing function such as `cubic-bezier()`,
121 * or one of the following constants:
122 * - `ease-in`
123 * - `ease-out`
124 * - `ease-in-and-out`
125 */
126 easing: string | null;
127};
128
129/**
130 * Produces a reusable animation that can be invoked in another animation or sequence,
131 * by calling the `useAnimation()` function.
132 *
133 * @param steps One or more animation objects, as returned by the `animate()`
134 * or `sequence()` function, that form a transformation from one state to another.
135 * A sequence is used by default when you pass an array.
136 * @param options An options object that can contain a delay value for the start of the
137 * animation, and additional developer-defined parameters.
138 * Provided values for additional parameters are used as defaults,
139 * and override values can be passed to the caller on invocation.
140 * @returns An object that encapsulates the animation data.
141 *
142 * @usageNotes
143 * The following example defines a reusable animation, providing some default parameter
144 * values.
145 *
146 * ```typescript
147 * var fadeAnimation = animation([
148 * style({ opacity: '{{ start }}' }),
149 * animate('{{ time }}',
150 * style({ opacity: '{{ end }}'}))
151 * ],
152 * { params: { time: '1000ms', start: 0, end: 1 }});
153 * ```
154 *
155 * The following invokes the defined animation with a call to `useAnimation()`,
156 * passing in override parameter values.
157 *
158 * ```js
159 * useAnimation(fadeAnimation, {
160 * params: {
161 * time: '2s',
162 * start: 1,
163 * end: 0
164 * }
165 * })
166 * ```
167 *
168 * If any of the passed-in parameter values are missing from this call,
169 * the default values are used. If one or more parameter values are missing before a step is
170 * animated, `useAnimation()` throws an error.
171 *
172 * @publicApi
173 */
174export declare function animation(steps: AnimationMetadata | AnimationMetadata[], options?: AnimationOptions | null): AnimationReferenceMetadata;
175
176/**
177 * Encapsulates a child animation, that can be run explicitly when the parent is run.
178 * Instantiated and returned by the `animateChild` function.
179 *
180 * @publicApi
181 */
182export declare interface AnimationAnimateChildMetadata extends AnimationMetadata {
183 /**
184 * An options object containing a delay and
185 * developer-defined parameters that provide styling defaults and
186 * can be overridden on invocation. Default delay is 0.
187 */
188 options: AnimationOptions | null;
189}
190
191/**
192 * Encapsulates an animation step. Instantiated and returned by
193 * the `animate()` function.
194 *
195 * @publicApi
196 */
197export declare interface AnimationAnimateMetadata extends AnimationMetadata {
198 /**
199 * The timing data for the step.
200 */
201 timings: string | number | AnimateTimings;
202 /**
203 * A set of styles used in the step.
204 */
205 styles: AnimationStyleMetadata | AnimationKeyframesSequenceMetadata | null;
206}
207
208/**
209 * Encapsulates a reusable animation.
210 * Instantiated and returned by the `useAnimation()` function.
211 *
212 * @publicApi
213 */
214export declare interface AnimationAnimateRefMetadata extends AnimationMetadata {
215 /**
216 * An animation reference object.
217 */
218 animation: AnimationReferenceMetadata;
219 /**
220 * An options object containing a delay and
221 * developer-defined parameters that provide styling defaults and
222 * can be overridden on invocation. Default delay is 0.
223 */
224 options: AnimationOptions | null;
225}
226
227/**
228 * An injectable service that produces an animation sequence programmatically within an
229 * Angular component or directive.
230 * Provided by the `BrowserAnimationsModule` or `NoopAnimationsModule`.
231 *
232 * @usageNotes
233 *
234 * To use this service, add it to your component or directive as a dependency.
235 * The service is instantiated along with your component.
236 *
237 * Apps do not typically need to create their own animation players, but if you
238 * do need to, follow these steps:
239 *
240 * 1. Use the <code>[AnimationBuilder.build](api/animations/AnimationBuilder#build)()</code> method
241 * to create a programmatic animation. The method returns an `AnimationFactory` instance.
242 *
243 * 2. Use the factory object to create an `AnimationPlayer` and attach it to a DOM element.
244 *
245 * 3. Use the player object to control the animation programmatically.
246 *
247 * For example:
248 *
249 * ```ts
250 * // import the service from BrowserAnimationsModule
251 * import {AnimationBuilder} from '@angular/animations';
252 * // require the service as a dependency
253 * class MyCmp {
254 * constructor(private _builder: AnimationBuilder) {}
255 *
256 * makeAnimation(element: any) {
257 * // first define a reusable animation
258 * const myAnimation = this._builder.build([
259 * style({ width: 0 }),
260 * animate(1000, style({ width: '100px' }))
261 * ]);
262 *
263 * // use the returned factory object to create a player
264 * const player = myAnimation.create(element);
265 *
266 * player.play();
267 * }
268 * }
269 * ```
270 *
271 * @publicApi
272 */
273export declare abstract class AnimationBuilder {
274 /**
275 * Builds a factory for producing a defined animation.
276 * @param animation A reusable animation definition.
277 * @returns A factory object that can create a player for the defined animation.
278 * @see `animate()`
279 */
280 abstract build(animation: AnimationMetadata | AnimationMetadata[]): AnimationFactory;
281}
282
283
284/**
285 * An instance of this class is returned as an event parameter when an animation
286 * callback is captured for an animation either during the start or done phase.
287 *
288 * ```typescript
289 * @Component({
290 * host: {
291 * '[@myAnimationTrigger]': 'someExpression',
292 * '(@myAnimationTrigger.start)': 'captureStartEvent($event)',
293 * '(@myAnimationTrigger.done)': 'captureDoneEvent($event)',
294 * },
295 * animations: [
296 * trigger("myAnimationTrigger", [
297 * // ...
298 * ])
299 * ]
300 * })
301 * class MyComponent {
302 * someExpression: any = false;
303 * captureStartEvent(event: AnimationEvent) {
304 * // the toState, fromState and totalTime data is accessible from the event variable
305 * }
306 *
307 * captureDoneEvent(event: AnimationEvent) {
308 * // the toState, fromState and totalTime data is accessible from the event variable
309 * }
310 * }
311 * ```
312 *
313 * @publicApi
314 */
315declare interface AnimationEvent_2 {
316 /**
317 * The name of the state from which the animation is triggered.
318 */
319 fromState: string;
320 /**
321 * The name of the state in which the animation completes.
322 */
323 toState: string;
324 /**
325 * The time it takes the animation to complete, in milliseconds.
326 */
327 totalTime: number;
328 /**
329 * The animation phase in which the callback was invoked, one of
330 * "start" or "done".
331 */
332 phaseName: string;
333 /**
334 * The element to which the animation is attached.
335 */
336 element: any;
337 /**
338 * Internal.
339 */
340 triggerName: string;
341 /**
342 * Internal.
343 */
344 disabled: boolean;
345}
346export { AnimationEvent_2 as AnimationEvent }
347
348/**
349 * A factory object returned from the
350 * <code>[AnimationBuilder.build](api/animations/AnimationBuilder#build)()</code>
351 * method.
352 *
353 * @publicApi
354 */
355export declare abstract class AnimationFactory {
356 /**
357 * Creates an `AnimationPlayer` instance for the reusable animation defined by
358 * the <code>[AnimationBuilder.build](api/animations/AnimationBuilder#build)()</code>
359 * method that created this factory and attaches the new player a DOM element.
360 *
361 * @param element The DOM element to which to attach the player.
362 * @param options A set of options that can include a time delay and
363 * additional developer-defined parameters.
364 */
365 abstract create(element: any, options?: AnimationOptions): AnimationPlayer;
366}
367
368/**
369 * Encapsulates an animation group.
370 * Instantiated and returned by the `{@link animations/group group()}` function.
371 *
372 * @publicApi
373 */
374export declare interface AnimationGroupMetadata extends AnimationMetadata {
375 /**
376 * One or more animation or style steps that form this group.
377 */
378 steps: AnimationMetadata[];
379 /**
380 * An options object containing a delay and
381 * developer-defined parameters that provide styling defaults and
382 * can be overridden on invocation. Default delay is 0.
383 */
384 options: AnimationOptions | null;
385}
386
387/**
388 * Encapsulates a keyframes sequence. Instantiated and returned by
389 * the `keyframes()` function.
390 *
391 * @publicApi
392 */
393export declare interface AnimationKeyframesSequenceMetadata extends AnimationMetadata {
394 /**
395 * An array of animation styles.
396 */
397 steps: AnimationStyleMetadata[];
398}
399
400/**
401 * Base for animation data structures.
402 *
403 * @publicApi
404 */
405export declare interface AnimationMetadata {
406 type: AnimationMetadataType;
407}
408
409/**
410 * @description Constants for the categories of parameters that can be defined for animations.
411 *
412 * A corresponding function defines a set of parameters for each category, and
413 * collects them into a corresponding `AnimationMetadata` object.
414 *
415 * @publicApi
416 */
417export declare const enum AnimationMetadataType {
418 /**
419 * Associates a named animation state with a set of CSS styles.
420 * See [`state()`](api/animations/state)
421 */
422 State = 0,
423 /**
424 * Data for a transition from one animation state to another.
425 * See `transition()`
426 */
427 Transition = 1,
428 /**
429 * Contains a set of animation steps.
430 * See `sequence()`
431 */
432 Sequence = 2,
433 /**
434 * Contains a set of animation steps.
435 * See `{@link animations/group group()}`
436 */
437 Group = 3,
438 /**
439 * Contains an animation step.
440 * See `animate()`
441 */
442 Animate = 4,
443 /**
444 * Contains a set of animation steps.
445 * See `keyframes()`
446 */
447 Keyframes = 5,
448 /**
449 * Contains a set of CSS property-value pairs into a named style.
450 * See `style()`
451 */
452 Style = 6,
453 /**
454 * Associates an animation with an entry trigger that can be attached to an element.
455 * See `trigger()`
456 */
457 Trigger = 7,
458 /**
459 * Contains a re-usable animation.
460 * See `animation()`
461 */
462 Reference = 8,
463 /**
464 * Contains data to use in executing child animations returned by a query.
465 * See `animateChild()`
466 */
467 AnimateChild = 9,
468 /**
469 * Contains animation parameters for a re-usable animation.
470 * See `useAnimation()`
471 */
472 AnimateRef = 10,
473 /**
474 * Contains child-animation query data.
475 * See `query()`
476 */
477 Query = 11,
478 /**
479 * Contains data for staggering an animation sequence.
480 * See `stagger()`
481 */
482 Stagger = 12
483}
484
485/**
486 * @description Options that control animation styling and timing.
487 *
488 * The following animation functions accept `AnimationOptions` data:
489 *
490 * - `transition()`
491 * - `sequence()`
492 * - `{@link animations/group group()}`
493 * - `query()`
494 * - `animation()`
495 * - `useAnimation()`
496 * - `animateChild()`
497 *
498 * Programmatic animations built using the `AnimationBuilder` service also
499 * make use of `AnimationOptions`.
500 *
501 * @publicApi
502 */
503export declare interface AnimationOptions {
504 /**
505 * Sets a time-delay for initiating an animation action.
506 * A number and optional time unit, such as "1s" or "10ms" for one second
507 * and 10 milliseconds, respectively.The default unit is milliseconds.
508 * Default value is 0, meaning no delay.
509 */
510 delay?: number | string;
511 /**
512 * A set of developer-defined parameters that modify styling and timing
513 * when an animation action starts. An array of key-value pairs, where the provided value
514 * is used as a default.
515 */
516 params?: {
517 [name: string]: any;
518 };
519}
520
521/**
522 * Provides programmatic control of a reusable animation sequence,
523 * built using the <code>[AnimationBuilder.build](api/animations/AnimationBuilder#build)()</code>
524 * method which returns an `AnimationFactory`, whose
525 * <code>[create](api/animations/AnimationFactory#create)()</code> method instantiates and
526 * initializes this interface.
527 *
528 * @see `AnimationBuilder`
529 * @see `AnimationFactory`
530 * @see `animate()`
531 *
532 * @publicApi
533 */
534export declare interface AnimationPlayer {
535 /**
536 * Provides a callback to invoke when the animation finishes.
537 * @param fn The callback function.
538 * @see `finish()`
539 */
540 onDone(fn: () => void): void;
541 /**
542 * Provides a callback to invoke when the animation starts.
543 * @param fn The callback function.
544 * @see `run()`
545 */
546 onStart(fn: () => void): void;
547 /**
548 * Provides a callback to invoke after the animation is destroyed.
549 * @param fn The callback function.
550 * @see `destroy()`
551 * @see `beforeDestroy()`
552 */
553 onDestroy(fn: () => void): void;
554 /**
555 * Initializes the animation.
556 */
557 init(): void;
558 /**
559 * Reports whether the animation has started.
560 * @returns True if the animation has started, false otherwise.
561 */
562 hasStarted(): boolean;
563 /**
564 * Runs the animation, invoking the `onStart()` callback.
565 */
566 play(): void;
567 /**
568 * Pauses the animation.
569 */
570 pause(): void;
571 /**
572 * Restarts the paused animation.
573 */
574 restart(): void;
575 /**
576 * Ends the animation, invoking the `onDone()` callback.
577 */
578 finish(): void;
579 /**
580 * Destroys the animation, after invoking the `beforeDestroy()` callback.
581 * Calls the `onDestroy()` callback when destruction is completed.
582 */
583 destroy(): void;
584 /**
585 * Resets the animation to its initial state.
586 */
587 reset(): void;
588 /**
589 * Sets the position of the animation.
590 * @param position A 0-based offset into the duration, in milliseconds.
591 */
592 setPosition(position: any /** TODO #9100 */): void;
593 /**
594 * Reports the current position of the animation.
595 * @returns A 0-based offset into the duration, in milliseconds.
596 */
597 getPosition(): number;
598 /**
599 * The parent of this player, if any.
600 */
601 parentPlayer: AnimationPlayer | null;
602 /**
603 * The total run time of the animation, in milliseconds.
604 */
605 readonly totalTime: number;
606 /**
607 * Provides a callback to invoke before the animation is destroyed.
608 */
609 beforeDestroy?: () => any;
610}
611
612/**
613 * Encapsulates an animation query. Instantiated and returned by
614 * the `query()` function.
615 *
616 * @publicApi
617 */
618export declare interface AnimationQueryMetadata extends AnimationMetadata {
619 /**
620 * The CSS selector for this query.
621 */
622 selector: string;
623 /**
624 * One or more animation step objects.
625 */
626 animation: AnimationMetadata | AnimationMetadata[];
627 /**
628 * A query options object.
629 */
630 options: AnimationQueryOptions | null;
631}
632
633/**
634 * Encapsulates animation query options.
635 * Passed to the `query()` function.
636 *
637 * @publicApi
638 */
639export declare interface AnimationQueryOptions extends AnimationOptions {
640 /**
641 * True if this query is optional, false if it is required. Default is false.
642 * A required query throws an error if no elements are retrieved when
643 * the query is executed. An optional query does not.
644 *
645 */
646 optional?: boolean;
647 /**
648 * A maximum total number of results to return from the query.
649 * If negative, results are limited from the end of the query list towards the beginning.
650 * By default, results are not limited.
651 */
652 limit?: number;
653}
654
655/**
656 * Encapsulates a reusable animation, which is a collection of individual animation steps.
657 * Instantiated and returned by the `animation()` function, and
658 * passed to the `useAnimation()` function.
659 *
660 * @publicApi
661 */
662export declare interface AnimationReferenceMetadata extends AnimationMetadata {
663 /**
664 * One or more animation step objects.
665 */
666 animation: AnimationMetadata | AnimationMetadata[];
667 /**
668 * An options object containing a delay and
669 * developer-defined parameters that provide styling defaults and
670 * can be overridden on invocation. Default delay is 0.
671 */
672 options: AnimationOptions | null;
673}
674
675/**
676 * Encapsulates an animation sequence.
677 * Instantiated and returned by the `sequence()` function.
678 *
679 * @publicApi
680 */
681export declare interface AnimationSequenceMetadata extends AnimationMetadata {
682 /**
683 * An array of animation step objects.
684 */
685 steps: AnimationMetadata[];
686 /**
687 * An options object containing a delay and
688 * developer-defined parameters that provide styling defaults and
689 * can be overridden on invocation. Default delay is 0.
690 */
691 options: AnimationOptions | null;
692}
693
694/**
695 * Encapsulates parameters for staggering the start times of a set of animation steps.
696 * Instantiated and returned by the `stagger()` function.
697 *
698 * @publicApi
699 **/
700export declare interface AnimationStaggerMetadata extends AnimationMetadata {
701 /**
702 * The timing data for the steps.
703 */
704 timings: string | number;
705 /**
706 * One or more animation steps.
707 */
708 animation: AnimationMetadata | AnimationMetadata[];
709}
710
711/**
712 * Encapsulates an animation state by associating a state name with a set of CSS styles.
713 * Instantiated and returned by the [`state()`](api/animations/state) function.
714 *
715 * @publicApi
716 */
717export declare interface AnimationStateMetadata extends AnimationMetadata {
718 /**
719 * The state name, unique within the component.
720 */
721 name: string;
722 /**
723 * The CSS styles associated with this state.
724 */
725 styles: AnimationStyleMetadata;
726 /**
727 * An options object containing
728 * developer-defined parameters that provide styling defaults and
729 * can be overridden on invocation.
730 */
731 options?: {
732 params: {
733 [name: string]: any;
734 };
735 };
736}
737
738/**
739 * Encapsulates an animation style. Instantiated and returned by
740 * the `style()` function.
741 *
742 * @publicApi
743 */
744export declare interface AnimationStyleMetadata extends AnimationMetadata {
745 /**
746 * A set of CSS style properties.
747 */
748 styles: '*' | {
749 [key: string]: string | number;
750 } | Array<{
751 [key: string]: string | number;
752 } | '*'>;
753 /**
754 * A percentage of the total animate time at which the style is to be applied.
755 */
756 offset: number | null;
757}
758
759/**
760 * Encapsulates an animation transition. Instantiated and returned by the
761 * `transition()` function.
762 *
763 * @publicApi
764 */
765export declare interface AnimationTransitionMetadata extends AnimationMetadata {
766 /**
767 * An expression that describes a state change.
768 */
769 expr: string | ((fromState: string, toState: string, element?: any, params?: {
770 [key: string]: any;
771 }) => boolean);
772 /**
773 * One or more animation objects to which this transition applies.
774 */
775 animation: AnimationMetadata | AnimationMetadata[];
776 /**
777 * An options object containing a delay and
778 * developer-defined parameters that provide styling defaults and
779 * can be overridden on invocation. Default delay is 0.
780 */
781 options: AnimationOptions | null;
782}
783
784/**
785 * Contains an animation trigger. Instantiated and returned by the
786 * `trigger()` function.
787 *
788 * @publicApi
789 */
790export declare interface AnimationTriggerMetadata extends AnimationMetadata {
791 /**
792 * The trigger name, used to associate it with an element. Unique within the component.
793 */
794 name: string;
795 /**
796 * An animation definition object, containing an array of state and transition declarations.
797 */
798 definitions: AnimationMetadata[];
799 /**
800 * An options object containing a delay and
801 * developer-defined parameters that provide styling defaults and
802 * can be overridden on invocation. Default delay is 0.
803 */
804 options: {
805 params?: {
806 [name: string]: any;
807 };
808 } | null;
809}
810
811/**
812 * Specifies automatic styling.
813 *
814 * @publicApi
815 */
816export declare const AUTO_STYLE = "*";
817
818/**
819 * @description Defines a list of animation steps to be run in parallel.
820 *
821 * @param steps An array of animation step objects.
822 * - When steps are defined by `style()` or `animate()`
823 * function calls, each call within the group is executed instantly.
824 * - To specify offset styles to be applied at a later time, define steps with
825 * `keyframes()`, or use `animate()` calls with a delay value.
826 * For example:
827 *
828 * ```typescript
829 * group([
830 * animate("1s", style({ background: "black" })),
831 * animate("2s", style({ color: "white" }))
832 * ])
833 * ```
834 *
835 * @param options An options object containing a delay and
836 * developer-defined parameters that provide styling defaults and
837 * can be overridden on invocation.
838 *
839 * @return An object that encapsulates the group data.
840 *
841 * @usageNotes
842 * Grouped animations are useful when a series of styles must be
843 * animated at different starting times and closed off at different ending times.
844 *
845 * When called within a `sequence()` or a
846 * `transition()` call, does not continue to the next
847 * instruction until all of the inner animation steps have completed.
848 *
849 * @publicApi
850 */
851export declare function group(steps: AnimationMetadata[], options?: AnimationOptions | null): AnimationGroupMetadata;
852
853/**
854 * Defines a set of animation styles, associating each style with an optional `offset` value.
855 *
856 * @param steps A set of animation styles with optional offset data.
857 * The optional `offset` value for a style specifies a percentage of the total animation
858 * time at which that style is applied.
859 * @returns An object that encapsulates the keyframes data.
860 *
861 * @usageNotes
862 * Use with the `animate()` call. Instead of applying animations
863 * from the current state
864 * to the destination state, keyframes describe how each style entry is applied and at what point
865 * within the animation arc.
866 * Compare [CSS Keyframe Animations](https://www.w3schools.com/css/css3_animations.asp).
867 *
868 * ### Usage
869 *
870 * In the following example, the offset values describe
871 * when each `backgroundColor` value is applied. The color is red at the start, and changes to
872 * blue when 20% of the total time has elapsed.
873 *
874 * ```typescript
875 * // the provided offset values
876 * animate("5s", keyframes([
877 * style({ backgroundColor: "red", offset: 0 }),
878 * style({ backgroundColor: "blue", offset: 0.2 }),
879 * style({ backgroundColor: "orange", offset: 0.3 }),
880 * style({ backgroundColor: "black", offset: 1 })
881 * ]))
882 * ```
883 *
884 * If there are no `offset` values specified in the style entries, the offsets
885 * are calculated automatically.
886 *
887 * ```typescript
888 * animate("5s", keyframes([
889 * style({ backgroundColor: "red" }) // offset = 0
890 * style({ backgroundColor: "blue" }) // offset = 0.33
891 * style({ backgroundColor: "orange" }) // offset = 0.66
892 * style({ backgroundColor: "black" }) // offset = 1
893 * ]))
894 *```
895
896 * @publicApi
897 */
898export declare function keyframes(steps: AnimationStyleMetadata[]): AnimationKeyframesSequenceMetadata;
899
900/**
901 * An empty programmatic controller for reusable animations.
902 * Used internally when animations are disabled, to avoid
903 * checking for the null case when an animation player is expected.
904 *
905 * @see `animate()`
906 * @see `AnimationPlayer`
907 * @see `GroupPlayer`
908 *
909 * @publicApi
910 */
911export declare class NoopAnimationPlayer implements AnimationPlayer {
912 private _onDoneFns;
913 private _onStartFns;
914 private _onDestroyFns;
915 private _originalOnDoneFns;
916 private _originalOnStartFns;
917 private _started;
918 private _destroyed;
919 private _finished;
920 private _position;
921 parentPlayer: AnimationPlayer | null;
922 readonly totalTime: number;
923 constructor(duration?: number, delay?: number);
924 private _onFinish;
925 onStart(fn: () => void): void;
926 onDone(fn: () => void): void;
927 onDestroy(fn: () => void): void;
928 hasStarted(): boolean;
929 init(): void;
930 play(): void;
931 private _onStart;
932 pause(): void;
933 restart(): void;
934 finish(): void;
935 destroy(): void;
936 reset(): void;
937 setPosition(position: number): void;
938 getPosition(): number;
939}
940
941/**
942 * Finds one or more inner elements within the current element that is
943 * being animated within a sequence. Use with `animate()`.
944 *
945 * @param selector The element to query, or a set of elements that contain Angular-specific
946 * characteristics, specified with one or more of the following tokens.
947 * - `query(":enter")` or `query(":leave")` : Query for newly inserted/removed elements (not
948 * all elements can be queried via these tokens, see
949 * [Entering and Leaving Elements](#entering-and-leaving-elements))
950 * - `query(":animating")` : Query all currently animating elements.
951 * - `query("@triggerName")` : Query elements that contain an animation trigger.
952 * - `query("@*")` : Query all elements that contain an animation triggers.
953 * - `query(":self")` : Include the current element into the animation sequence.
954 *
955 * @param animation One or more animation steps to apply to the queried element or elements.
956 * An array is treated as an animation sequence.
957 * @param options An options object. Use the 'limit' field to limit the total number of
958 * items to collect.
959 * @return An object that encapsulates the query data.
960 *
961 * @usageNotes
962 *
963 * ### Multiple Tokens
964 *
965 * Tokens can be merged into a combined query selector string. For example:
966 *
967 * ```typescript
968 * query(':self, .record:enter, .record:leave, @subTrigger', [...])
969 * ```
970 *
971 * The `query()` function collects multiple elements and works internally by using
972 * `element.querySelectorAll`. Use the `limit` field of an options object to limit
973 * the total number of items to be collected. For example:
974 *
975 * ```js
976 * query('div', [
977 * animate(...),
978 * animate(...)
979 * ], { limit: 1 })
980 * ```
981 *
982 * By default, throws an error when zero items are found. Set the
983 * `optional` flag to ignore this error. For example:
984 *
985 * ```js
986 * query('.some-element-that-may-not-be-there', [
987 * animate(...),
988 * animate(...)
989 * ], { optional: true })
990 * ```
991 *
992 * ### Entering and Leaving Elements
993 *
994 * Not all elements can be queried via the `:enter` and `:leave` tokens, the only ones
995 * that can are those that Angular assumes can enter/leave based on their own logic
996 * (if their insertion/removal is simply a consequence of that of their parent they
997 * should be queried via a different token in their parent's `:enter`/`:leave` transitions).
998 *
999 * The only elements Angular assumes can enter/leave based on their own logic (thus the only
1000 * ones that can be queried via the `:enter` and `:leave` tokens) are:
1001 * - Those inserted dynamically (via `ViewContainerRef`)
1002 * - Those that have a structural directive (which, under the hood, are a subset of the above ones)
1003 *
1004 * <div class="alert is-helpful">
1005 *
1006 * Note that elements will be successfully queried via `:enter`/`:leave` even if their
1007 * insertion/removal is not done manually via `ViewContainerRef`or caused by their structural
1008 * directive (e.g. they enter/exit alongside their parent).
1009 *
1010 * </div>
1011 *
1012 * <div class="alert is-important">
1013 *
1014 * There is an exception to what previously mentioned, besides elements entering/leaving based on
1015 * their own logic, elements with an animation trigger can always be queried via `:leave` when
1016 * their parent is also leaving.
1017 *
1018 * </div>
1019 *
1020 * ### Usage Example
1021 *
1022 * The following example queries for inner elements and animates them
1023 * individually using `animate()`.
1024 *
1025 * ```typescript
1026 * @Component({
1027 * selector: 'inner',
1028 * template: `
1029 * <div [@queryAnimation]="exp">
1030 * <h1>Title</h1>
1031 * <div class="content">
1032 * Blah blah blah
1033 * </div>
1034 * </div>
1035 * `,
1036 * animations: [
1037 * trigger('queryAnimation', [
1038 * transition('* => goAnimate', [
1039 * // hide the inner elements
1040 * query('h1', style({ opacity: 0 })),
1041 * query('.content', style({ opacity: 0 })),
1042 *
1043 * // animate the inner elements in, one by one
1044 * query('h1', animate(1000, style({ opacity: 1 }))),
1045 * query('.content', animate(1000, style({ opacity: 1 }))),
1046 * ])
1047 * ])
1048 * ]
1049 * })
1050 * class Cmp {
1051 * exp = '';
1052 *
1053 * goAnimate() {
1054 * this.exp = 'goAnimate';
1055 * }
1056 * }
1057 * ```
1058 *
1059 * @publicApi
1060 */
1061export declare function query(selector: string, animation: AnimationMetadata | AnimationMetadata[], options?: AnimationQueryOptions | null): AnimationQueryMetadata;
1062
1063/**
1064 * Defines a list of animation steps to be run sequentially, one by one.
1065 *
1066 * @param steps An array of animation step objects.
1067 * - Steps defined by `style()` calls apply the styling data immediately.
1068 * - Steps defined by `animate()` calls apply the styling data over time
1069 * as specified by the timing data.
1070 *
1071 * ```typescript
1072 * sequence([
1073 * style({ opacity: 0 }),
1074 * animate("1s", style({ opacity: 1 }))
1075 * ])
1076 * ```
1077 *
1078 * @param options An options object containing a delay and
1079 * developer-defined parameters that provide styling defaults and
1080 * can be overridden on invocation.
1081 *
1082 * @return An object that encapsulates the sequence data.
1083 *
1084 * @usageNotes
1085 * When you pass an array of steps to a
1086 * `transition()` call, the steps run sequentially by default.
1087 * Compare this to the `{@link animations/group group()}` call, which runs animation steps in
1088 *parallel.
1089 *
1090 * When a sequence is used within a `{@link animations/group group()}` or a `transition()` call,
1091 * execution continues to the next instruction only after each of the inner animation
1092 * steps have completed.
1093 *
1094 * @publicApi
1095 **/
1096export declare function sequence(steps: AnimationMetadata[], options?: AnimationOptions | null): AnimationSequenceMetadata;
1097
1098/**
1099 * Use within an animation `query()` call to issue a timing gap after
1100 * each queried item is animated.
1101 *
1102 * @param timings A delay value.
1103 * @param animation One ore more animation steps.
1104 * @returns An object that encapsulates the stagger data.
1105 *
1106 * @usageNotes
1107 * In the following example, a container element wraps a list of items stamped out
1108 * by an `ngFor`. The container element contains an animation trigger that will later be set
1109 * to query for each of the inner items.
1110 *
1111 * Each time items are added, the opacity fade-in animation runs,
1112 * and each removed item is faded out.
1113 * When either of these animations occur, the stagger effect is
1114 * applied after each item's animation is started.
1115 *
1116 * ```html
1117 * <!-- list.component.html -->
1118 * <button (click)="toggle()">Show / Hide Items</button>
1119 * <hr />
1120 * <div [@listAnimation]="items.length">
1121 * <div *ngFor="let item of items">
1122 * {{ item }}
1123 * </div>
1124 * </div>
1125 * ```
1126 *
1127 * Here is the component code:
1128 *
1129 * ```typescript
1130 * import {trigger, transition, style, animate, query, stagger} from '@angular/animations';
1131 * @Component({
1132 * templateUrl: 'list.component.html',
1133 * animations: [
1134 * trigger('listAnimation', [
1135 * ...
1136 * ])
1137 * ]
1138 * })
1139 * class ListComponent {
1140 * items = [];
1141 *
1142 * showItems() {
1143 * this.items = [0,1,2,3,4];
1144 * }
1145 *
1146 * hideItems() {
1147 * this.items = [];
1148 * }
1149 *
1150 * toggle() {
1151 * this.items.length ? this.hideItems() : this.showItems();
1152 * }
1153 * }
1154 * ```
1155 *
1156 * Here is the animation trigger code:
1157 *
1158 * ```typescript
1159 * trigger('listAnimation', [
1160 * transition('* => *', [ // each time the binding value changes
1161 * query(':leave', [
1162 * stagger(100, [
1163 * animate('0.5s', style({ opacity: 0 }))
1164 * ])
1165 * ]),
1166 * query(':enter', [
1167 * style({ opacity: 0 }),
1168 * stagger(100, [
1169 * animate('0.5s', style({ opacity: 1 }))
1170 * ])
1171 * ])
1172 * ])
1173 * ])
1174 * ```
1175 *
1176 * @publicApi
1177 */
1178export declare function stagger(timings: string | number, animation: AnimationMetadata | AnimationMetadata[]): AnimationStaggerMetadata;
1179
1180/**
1181 * Declares an animation state within a trigger attached to an element.
1182 *
1183 * @param name One or more names for the defined state in a comma-separated string.
1184 * The following reserved state names can be supplied to define a style for specific use
1185 * cases:
1186 *
1187 * - `void` You can associate styles with this name to be used when
1188 * the element is detached from the application. For example, when an `ngIf` evaluates
1189 * to false, the state of the associated element is void.
1190 * - `*` (asterisk) Indicates the default state. You can associate styles with this name
1191 * to be used as the fallback when the state that is being animated is not declared
1192 * within the trigger.
1193 *
1194 * @param styles A set of CSS styles associated with this state, created using the
1195 * `style()` function.
1196 * This set of styles persists on the element once the state has been reached.
1197 * @param options Parameters that can be passed to the state when it is invoked.
1198 * 0 or more key-value pairs.
1199 * @return An object that encapsulates the new state data.
1200 *
1201 * @usageNotes
1202 * Use the `trigger()` function to register states to an animation trigger.
1203 * Use the `transition()` function to animate between states.
1204 * When a state is active within a component, its associated styles persist on the element,
1205 * even when the animation ends.
1206 *
1207 * @publicApi
1208 **/
1209export declare function state(name: string, styles: AnimationStyleMetadata, options?: {
1210 params: {
1211 [name: string]: any;
1212 };
1213}): AnimationStateMetadata;
1214
1215/**
1216 * Declares a key/value object containing CSS properties/styles that
1217 * can then be used for an animation [`state`](api/animations/state), within an animation
1218 *`sequence`, or as styling data for calls to `animate()` and `keyframes()`.
1219 *
1220 * @param tokens A set of CSS styles or HTML styles associated with an animation state.
1221 * The value can be any of the following:
1222 * - A key-value style pair associating a CSS property with a value.
1223 * - An array of key-value style pairs.
1224 * - An asterisk (*), to use auto-styling, where styles are derived from the element
1225 * being animated and applied to the animation when it starts.
1226 *
1227 * Auto-styling can be used to define a state that depends on layout or other
1228 * environmental factors.
1229 *
1230 * @return An object that encapsulates the style data.
1231 *
1232 * @usageNotes
1233 * The following examples create animation styles that collect a set of
1234 * CSS property values:
1235 *
1236 * ```typescript
1237 * // string values for CSS properties
1238 * style({ background: "red", color: "blue" })
1239 *
1240 * // numerical pixel values
1241 * style({ width: 100, height: 0 })
1242 * ```
1243 *
1244 * The following example uses auto-styling to allow an element to animate from
1245 * a height of 0 up to its full height:
1246 *
1247 * ```
1248 * style({ height: 0 }),
1249 * animate("1s", style({ height: "*" }))
1250 * ```
1251 *
1252 * @publicApi
1253 **/
1254export declare function style(tokens: '*' | {
1255 [key: string]: string | number;
1256} | Array<'*' | {
1257 [key: string]: string | number;
1258}>): AnimationStyleMetadata;
1259
1260/**
1261 * Declares an animation transition which is played when a certain specified condition is met.
1262 *
1263 * @param stateChangeExpr A string with a specific format or a function that specifies when the
1264 * animation transition should occur (see [State Change Expression](#state-change-expression)).
1265 *
1266 * @param steps One or more animation objects that represent the animation's instructions.
1267 *
1268 * @param options An options object that can be used to specify a delay for the animation or provide
1269 * custom parameters for it.
1270 *
1271 * @returns An object that encapsulates the transition data.
1272 *
1273 * @usageNotes
1274 *
1275 * ### State Change Expression
1276 *
1277 * The State Change Expression instructs Angular when to run the transition's animations, it can
1278 *either be
1279 * - a string with a specific syntax
1280 * - or a function that compares the previous and current state (value of the expression bound to
1281 * the element's trigger) and returns `true` if the transition should occur or `false` otherwise
1282 *
1283 * The string format can be:
1284 * - `fromState => toState`, which indicates that the transition's animations should occur then the
1285 * expression bound to the trigger's element goes from `fromState` to `toState`
1286 *
1287 * _Example:_
1288 * ```typescript
1289 * transition('open => closed', animate('.5s ease-out', style({ height: 0 }) ))
1290 * ```
1291 *
1292 * - `fromState <=> toState`, which indicates that the transition's animations should occur then
1293 * the expression bound to the trigger's element goes from `fromState` to `toState` or vice versa
1294 *
1295 * _Example:_
1296 * ```typescript
1297 * transition('enabled <=> disabled', animate('1s cubic-bezier(0.8,0.3,0,1)'))
1298 * ```
1299 *
1300 * - `:enter`/`:leave`, which indicates that the transition's animations should occur when the
1301 * element enters or exists the DOM
1302 *
1303 * _Example:_
1304 * ```typescript
1305 * transition(':enter', [
1306 * style({ opacity: 0 }),
1307 * animate('500ms', style({ opacity: 1 }))
1308 * ])
1309 * ```
1310 *
1311 * - `:increment`/`:decrement`, which indicates that the transition's animations should occur when
1312 * the numerical expression bound to the trigger's element has increased in value or decreased
1313 *
1314 * _Example:_
1315 * ```typescript
1316 * transition(':increment', query('@counter', animateChild()))
1317 * ```
1318 *
1319 * - a sequence of any of the above divided by commas, which indicates that transition's animations
1320 * should occur whenever one of the state change expressions matches
1321 *
1322 * _Example:_
1323 * ```typescript
1324 * transition(':increment, * => enabled, :enter', animate('1s ease', keyframes([
1325 * style({ transform: 'scale(1)', offset: 0}),
1326 * style({ transform: 'scale(1.1)', offset: 0.7}),
1327 * style({ transform: 'scale(1)', offset: 1})
1328 * ]))),
1329 * ```
1330 *
1331 * Also note that in such context:
1332 * - `void` can be used to indicate the absence of the element
1333 * - asterisks can be used as wildcards that match any state
1334 * - (as a consequence of the above, `void => *` is equivalent to `:enter` and `* => void` is
1335 * equivalent to `:leave`)
1336 * - `true` and `false` also match expression values of `1` and `0` respectively (but do not match
1337 * _truthy_ and _falsy_ values)
1338 *
1339 * <div class="alert is-helpful">
1340 *
1341 * Be careful about entering end leaving elements as their transitions present a common
1342 * pitfall for developers.
1343 *
1344 * Note that when an element with a trigger enters the DOM its `:enter` transition always
1345 * gets executed, but its `:leave` transition will not be executed if the element is removed
1346 * alongside its parent (as it will be removed "without warning" before its transition has
1347 * a chance to be executed, the only way that such transition can occur is if the element
1348 * is exiting the DOM on its own).
1349 *
1350 *
1351 * </div>
1352 *
1353 * ### Animating to a Final State
1354 *
1355 * If the final step in a transition is a call to `animate()` that uses a timing value
1356 * with no `style` data, that step is automatically considered the final animation arc,
1357 * for the element to reach the final state, in such case Angular automatically adds or removes
1358 * CSS styles to ensure that the element is in the correct final state.
1359 *
1360 *
1361 * ### Usage Examples
1362 *
1363 * - Transition animations applied based on
1364 * the trigger's expression value
1365 *
1366 * ```HTML
1367 * <div [@myAnimationTrigger]="myStatusExp">
1368 * ...
1369 * </div>
1370 * ```
1371 *
1372 * ```typescript
1373 * trigger("myAnimationTrigger", [
1374 * ..., // states
1375 * transition("on => off, open => closed", animate(500)),
1376 * transition("* <=> error", query('.indicator', animateChild()))
1377 * ])
1378 * ```
1379 *
1380 * - Transition animations applied based on custom logic dependent
1381 * on the trigger's expression value and provided parameters
1382 *
1383 * ```HTML
1384 * <div [@myAnimationTrigger]="{
1385 * value: stepName,
1386 * params: { target: currentTarget }
1387 * }">
1388 * ...
1389 * </div>
1390 * ```
1391 *
1392 * ```typescript
1393 * trigger("myAnimationTrigger", [
1394 * ..., // states
1395 * transition(
1396 * (fromState, toState, _element, params) =>
1397 * ['firststep', 'laststep'].includes(fromState.toLowerCase())
1398 * && toState === params?.['target'],
1399 * animate('1s')
1400 * )
1401 * ])
1402 * ```
1403 *
1404 * @publicApi
1405 **/
1406export declare function transition(stateChangeExpr: string | ((fromState: string, toState: string, element?: any, params?: {
1407 [key: string]: any;
1408}) => boolean), steps: AnimationMetadata | AnimationMetadata[], options?: AnimationOptions | null): AnimationTransitionMetadata;
1409
1410/**
1411 * Creates a named animation trigger, containing a list of [`state()`](api/animations/state)
1412 * and `transition()` entries to be evaluated when the expression
1413 * bound to the trigger changes.
1414 *
1415 * @param name An identifying string.
1416 * @param definitions An animation definition object, containing an array of
1417 * [`state()`](api/animations/state) and `transition()` declarations.
1418 *
1419 * @return An object that encapsulates the trigger data.
1420 *
1421 * @usageNotes
1422 * Define an animation trigger in the `animations` section of `@Component` metadata.
1423 * In the template, reference the trigger by name and bind it to a trigger expression that
1424 * evaluates to a defined animation state, using the following format:
1425 *
1426 * `[@triggerName]="expression"`
1427 *
1428 * Animation trigger bindings convert all values to strings, and then match the
1429 * previous and current values against any linked transitions.
1430 * Booleans can be specified as `1` or `true` and `0` or `false`.
1431 *
1432 * ### Usage Example
1433 *
1434 * The following example creates an animation trigger reference based on the provided
1435 * name value.
1436 * The provided animation value is expected to be an array consisting of state and
1437 * transition declarations.
1438 *
1439 * ```typescript
1440 * @Component({
1441 * selector: "my-component",
1442 * templateUrl: "my-component-tpl.html",
1443 * animations: [
1444 * trigger("myAnimationTrigger", [
1445 * state(...),
1446 * state(...),
1447 * transition(...),
1448 * transition(...)
1449 * ])
1450 * ]
1451 * })
1452 * class MyComponent {
1453 * myStatusExp = "something";
1454 * }
1455 * ```
1456 *
1457 * The template associated with this component makes use of the defined trigger
1458 * by binding to an element within its template code.
1459 *
1460 * ```html
1461 * <!-- somewhere inside of my-component-tpl.html -->
1462 * <div [@myAnimationTrigger]="myStatusExp">...</div>
1463 * ```
1464 *
1465 * ### Using an inline function
1466 * The `transition` animation method also supports reading an inline function which can decide
1467 * if its associated animation should be run.
1468 *
1469 * ```typescript
1470 * // this method is run each time the `myAnimationTrigger` trigger value changes.
1471 * function myInlineMatcherFn(fromState: string, toState: string, element: any, params: {[key:
1472 string]: any}): boolean {
1473 * // notice that `element` and `params` are also available here
1474 * return toState == 'yes-please-animate';
1475 * }
1476 *
1477 * @Component({
1478 * selector: 'my-component',
1479 * templateUrl: 'my-component-tpl.html',
1480 * animations: [
1481 * trigger('myAnimationTrigger', [
1482 * transition(myInlineMatcherFn, [
1483 * // the animation sequence code
1484 * ]),
1485 * ])
1486 * ]
1487 * })
1488 * class MyComponent {
1489 * myStatusExp = "yes-please-animate";
1490 * }
1491 * ```
1492 *
1493 * ### Disabling Animations
1494 * When true, the special animation control binding `@.disabled` binding prevents
1495 * all animations from rendering.
1496 * Place the `@.disabled` binding on an element to disable
1497 * animations on the element itself, as well as any inner animation triggers
1498 * within the element.
1499 *
1500 * The following example shows how to use this feature:
1501 *
1502 * ```typescript
1503 * @Component({
1504 * selector: 'my-component',
1505 * template: `
1506 * <div [@.disabled]="isDisabled">
1507 * <div [@childAnimation]="exp"></div>
1508 * </div>
1509 * `,
1510 * animations: [
1511 * trigger("childAnimation", [
1512 * // ...
1513 * ])
1514 * ]
1515 * })
1516 * class MyComponent {
1517 * isDisabled = true;
1518 * exp = '...';
1519 * }
1520 * ```
1521 *
1522 * When `@.disabled` is true, it prevents the `@childAnimation` trigger from animating,
1523 * along with any inner animations.
1524 *
1525 * ### Disable animations application-wide
1526 * When an area of the template is set to have animations disabled,
1527 * **all** inner components have their animations disabled as well.
1528 * This means that you can disable all animations for an app
1529 * by placing a host binding set on `@.disabled` on the topmost Angular component.
1530 *
1531 * ```typescript
1532 * import {Component, HostBinding} from '@angular/core';
1533 *
1534 * @Component({
1535 * selector: 'app-component',
1536 * templateUrl: 'app.component.html',
1537 * })
1538 * class AppComponent {
1539 * @HostBinding('@.disabled')
1540 * public animationsDisabled = true;
1541 * }
1542 * ```
1543 *
1544 * ### Overriding disablement of inner animations
1545 * Despite inner animations being disabled, a parent animation can `query()`
1546 * for inner elements located in disabled areas of the template and still animate
1547 * them if needed. This is also the case for when a sub animation is
1548 * queried by a parent and then later animated using `animateChild()`.
1549 *
1550 * ### Detecting when an animation is disabled
1551 * If a region of the DOM (or the entire application) has its animations disabled, the animation
1552 * trigger callbacks still fire, but for zero seconds. When the callback fires, it provides
1553 * an instance of an `AnimationEvent`. If animations are disabled,
1554 * the `.disabled` flag on the event is true.
1555 *
1556 * @publicApi
1557 */
1558export declare function trigger(name: string, definitions: AnimationMetadata[]): AnimationTriggerMetadata;
1559
1560/**
1561 * Starts a reusable animation that is created using the `animation()` function.
1562 *
1563 * @param animation The reusable animation to start.
1564 * @param options An options object that can contain a delay value for the start of
1565 * the animation, and additional override values for developer-defined parameters.
1566 * @return An object that contains the animation parameters.
1567 *
1568 * @publicApi
1569 */
1570export declare function useAnimation(animation: AnimationReferenceMetadata, options?: AnimationOptions | null): AnimationAnimateRefMetadata;
1571
1572/**
1573 * A programmatic controller for a group of reusable animations.
1574 * Used internally to control animations.
1575 *
1576 * @see `AnimationPlayer`
1577 * @see `{@link animations/group group()}`
1578 *
1579 */
1580export declare class ɵAnimationGroupPlayer implements AnimationPlayer {
1581 private _onDoneFns;
1582 private _onStartFns;
1583 private _finished;
1584 private _started;
1585 private _destroyed;
1586 private _onDestroyFns;
1587 parentPlayer: AnimationPlayer | null;
1588 totalTime: number;
1589 readonly players: AnimationPlayer[];
1590 constructor(_players: AnimationPlayer[]);
1591 private _onFinish;
1592 init(): void;
1593 onStart(fn: () => void): void;
1594 private _onStart;
1595 onDone(fn: () => void): void;
1596 onDestroy(fn: () => void): void;
1597 hasStarted(): boolean;
1598 play(): void;
1599 pause(): void;
1600 restart(): void;
1601 finish(): void;
1602 destroy(): void;
1603 private _onDestroy;
1604 reset(): void;
1605 setPosition(p: number): void;
1606 getPosition(): number;
1607 beforeDestroy(): void;
1608}
1609
1610export declare const ɵPRE_STYLE = "!";
1611
1612
1613/**
1614 * Represents a set of CSS styles for use in an animation style as a generic.
1615 */
1616export declare interface ɵStyleData {
1617 [key: string]: string | number;
1618}
1619
1620/**
1621 * Represents a set of CSS styles for use in an animation style as a Map.
1622 */
1623export declare type ɵStyleDataMap = Map<string, string | number>;
1624
1625export { }
1626
\No newline at end of file