@angular/animations 20.0.0-next.4 → 20.0.0-next.6

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