-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathanimation_player.d-CTCg5nkL.d.ts
executable file
·1407 lines (1403 loc) · 45.5 KB
/
animation_player.d-CTCg5nkL.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* @license Angular v20.0.0-next.6+sha-c0ef923
* (c) 2010-2025 Google LLC. https://angular.io/
* License: MIT
*/
/**
* Represents a set of CSS styles for use in an animation style as a generic.
*/
interface ɵStyleData {
[key: string]: string | number;
}
/**
* Represents a set of CSS styles for use in an animation style as a Map.
*/
type ɵStyleDataMap = Map<string, string | number>;
/**
* Represents animation-step timing parameters for an animation step.
* @see {@link animate}
*
* @publicApi
*/
declare type AnimateTimings = {
/**
* The full duration of an animation step. A number and optional time unit,
* such as "1s" or "10ms" for one second and 10 milliseconds, respectively.
* The default unit is milliseconds.
*/
duration: number;
/**
* The delay in applying an animation step. A number and optional time unit.
* The default unit is milliseconds.
*/
delay: number;
/**
* An easing style that controls how an animations step accelerates
* and decelerates during its run time. An easing function such as `cubic-bezier()`,
* or one of the following constants:
* - `ease-in`
* - `ease-out`
* - `ease-in-and-out`
*/
easing: string | null;
};
/**
* @description Options that control animation styling and timing.
*
* The following animation functions accept `AnimationOptions` data:
*
* - `transition()`
* - `sequence()`
* - `{@link /api/animations/group group()}`
* - `query()`
* - `animation()`
* - `useAnimation()`
* - `animateChild()`
*
* Programmatic animations built using the `AnimationBuilder` service also
* make use of `AnimationOptions`.
*
* @publicApi
*/
declare interface AnimationOptions {
/**
* Sets a time-delay for initiating an animation action.
* A number and optional time unit, such as "1s" or "10ms" for one second
* and 10 milliseconds, respectively.The default unit is milliseconds.
* Default value is 0, meaning no delay.
*/
delay?: number | string;
/**
* A set of developer-defined parameters that modify styling and timing
* when an animation action starts. An array of key-value pairs, where the provided value
* is used as a default.
*/
params?: {
[name: string]: any;
};
}
/**
* Adds duration options to control animation styling and timing for a child animation.
*
* @see {@link animateChild}
*
* @publicApi
*/
declare interface AnimateChildOptions extends AnimationOptions {
duration?: number | string;
}
/**
* @description Constants for the categories of parameters that can be defined for animations.
*
* A corresponding function defines a set of parameters for each category, and
* collects them into a corresponding `AnimationMetadata` object.
*
* @publicApi
*/
declare enum AnimationMetadataType {
/**
* Associates a named animation state with a set of CSS styles.
* See [`state()`](api/animations/state)
*/
State = 0,
/**
* Data for a transition from one animation state to another.
* See `transition()`
*/
Transition = 1,
/**
* Contains a set of animation steps.
* See `sequence()`
*/
Sequence = 2,
/**
* Contains a set of animation steps.
* See `{@link /api/animations/group group()}`
*/
Group = 3,
/**
* Contains an animation step.
* See `animate()`
*/
Animate = 4,
/**
* Contains a set of animation steps.
* See `keyframes()`
*/
Keyframes = 5,
/**
* Contains a set of CSS property-value pairs into a named style.
* See `style()`
*/
Style = 6,
/**
* Associates an animation with an entry trigger that can be attached to an element.
* See `trigger()`
*/
Trigger = 7,
/**
* Contains a re-usable animation.
* See `animation()`
*/
Reference = 8,
/**
* Contains data to use in executing child animations returned by a query.
* See `animateChild()`
*/
AnimateChild = 9,
/**
* Contains animation parameters for a re-usable animation.
* See `useAnimation()`
*/
AnimateRef = 10,
/**
* Contains child-animation query data.
* See `query()`
*/
Query = 11,
/**
* Contains data for staggering an animation sequence.
* See `stagger()`
*/
Stagger = 12
}
/**
* Specifies automatic styling.
*
* @publicApi
*/
declare const AUTO_STYLE = "*";
/**
* Base for animation data structures.
*
* @publicApi
*/
interface AnimationMetadata {
type: AnimationMetadataType;
}
/**
* Contains an animation trigger. Instantiated and returned by the
* `trigger()` function.
*
* @publicApi
*/
interface AnimationTriggerMetadata extends AnimationMetadata {
/**
* The trigger name, used to associate it with an element. Unique within the component.
*/
name: string;
/**
* An animation definition object, containing an array of state and transition declarations.
*/
definitions: AnimationMetadata[];
/**
* An options object containing a delay and
* developer-defined parameters that provide styling defaults and
* can be overridden on invocation. Default delay is 0.
*/
options: {
params?: {
[name: string]: any;
};
} | null;
}
/**
* Encapsulates an animation state by associating a state name with a set of CSS styles.
* Instantiated and returned by the [`state()`](api/animations/state) function.
*
* @publicApi
*/
interface AnimationStateMetadata extends AnimationMetadata {
/**
* The state name, unique within the component.
*/
name: string;
/**
* The CSS styles associated with this state.
*/
styles: AnimationStyleMetadata;
/**
* An options object containing
* developer-defined parameters that provide styling defaults and
* can be overridden on invocation.
*/
options?: {
params: {
[name: string]: any;
};
};
}
/**
* Encapsulates an animation transition. Instantiated and returned by the
* `transition()` function.
*
* @publicApi
*/
interface AnimationTransitionMetadata extends AnimationMetadata {
/**
* An expression that describes a state change.
*/
expr: string | ((fromState: string, toState: string, element?: any, params?: {
[key: string]: any;
}) => boolean);
/**
* One or more animation objects to which this transition applies.
*/
animation: AnimationMetadata | AnimationMetadata[];
/**
* An options object containing a delay and
* developer-defined parameters that provide styling defaults and
* can be overridden on invocation. Default delay is 0.
*/
options: AnimationOptions | null;
}
/**
* Encapsulates a reusable animation, which is a collection of individual animation steps.
* Instantiated and returned by the `animation()` function, and
* passed to the `useAnimation()` function.
*
* @publicApi
*/
interface AnimationReferenceMetadata extends AnimationMetadata {
/**
* One or more animation step objects.
*/
animation: AnimationMetadata | AnimationMetadata[];
/**
* An options object containing a delay and
* developer-defined parameters that provide styling defaults and
* can be overridden on invocation. Default delay is 0.
*/
options: AnimationOptions | null;
}
/**
* Encapsulates an animation query. Instantiated and returned by
* the `query()` function.
*
* @publicApi
*/
interface AnimationQueryMetadata extends AnimationMetadata {
/**
* The CSS selector for this query.
*/
selector: string;
/**
* One or more animation step objects.
*/
animation: AnimationMetadata | AnimationMetadata[];
/**
* A query options object.
*/
options: AnimationQueryOptions | null;
}
/**
* Encapsulates a keyframes sequence. Instantiated and returned by
* the `keyframes()` function.
*
* @publicApi
*/
interface AnimationKeyframesSequenceMetadata extends AnimationMetadata {
/**
* An array of animation styles.
*/
steps: AnimationStyleMetadata[];
}
/**
* Encapsulates an animation style. Instantiated and returned by
* the `style()` function.
*
* @publicApi
*/
interface AnimationStyleMetadata extends AnimationMetadata {
/**
* A set of CSS style properties.
*/
styles: '*' | {
[key: string]: string | number;
} | Array<{
[key: string]: string | number;
} | '*'>;
/**
* A percentage of the total animate time at which the style is to be applied.
*/
offset: number | null;
}
/**
* Encapsulates an animation step. Instantiated and returned by
* the `animate()` function.
*
* @publicApi
*/
interface AnimationAnimateMetadata extends AnimationMetadata {
/**
* The timing data for the step.
*/
timings: string | number | AnimateTimings;
/**
* A set of styles used in the step.
*/
styles: AnimationStyleMetadata | AnimationKeyframesSequenceMetadata | null;
}
/**
* Encapsulates a child animation, that can be run explicitly when the parent is run.
* Instantiated and returned by the `animateChild` function.
*
* @publicApi
*/
interface AnimationAnimateChildMetadata extends AnimationMetadata {
/**
* An options object containing a delay and
* developer-defined parameters that provide styling defaults and
* can be overridden on invocation. Default delay is 0.
*/
options: AnimationOptions | null;
}
/**
* Encapsulates a reusable animation.
* Instantiated and returned by the `useAnimation()` function.
*
* @publicApi
*/
interface AnimationAnimateRefMetadata extends AnimationMetadata {
/**
* An animation reference object.
*/
animation: AnimationReferenceMetadata;
/**
* An options object containing a delay and
* developer-defined parameters that provide styling defaults and
* can be overridden on invocation. Default delay is 0.
*/
options: AnimationOptions | null;
}
/**
* Encapsulates an animation sequence.
* Instantiated and returned by the `sequence()` function.
*
* @publicApi
*/
interface AnimationSequenceMetadata extends AnimationMetadata {
/**
* An array of animation step objects.
*/
steps: AnimationMetadata[];
/**
* An options object containing a delay and
* developer-defined parameters that provide styling defaults and
* can be overridden on invocation. Default delay is 0.
*/
options: AnimationOptions | null;
}
/**
* Encapsulates an animation group.
* Instantiated and returned by the `group()` function.
*
* @publicApi
*/
interface AnimationGroupMetadata extends AnimationMetadata {
/**
* One or more animation or style steps that form this group.
*/
steps: AnimationMetadata[];
/**
* An options object containing a delay and
* developer-defined parameters that provide styling defaults and
* can be overridden on invocation. Default delay is 0.
*/
options: AnimationOptions | null;
}
/**
* Encapsulates animation query options.
* Passed to the `query()` function.
*
* @publicApi
*/
declare interface AnimationQueryOptions extends AnimationOptions {
/**
* True if this query is optional, false if it is required. Default is false.
* A required query throws an error if no elements are retrieved when
* the query is executed. An optional query does not.
*
*/
optional?: boolean;
/**
* A maximum total number of results to return from the query.
* If negative, results are limited from the end of the query list towards the beginning.
* By default, results are not limited.
*/
limit?: number;
}
/**
* Encapsulates parameters for staggering the start times of a set of animation steps.
* Instantiated and returned by the `stagger()` function.
*
* @publicApi
**/
interface AnimationStaggerMetadata extends AnimationMetadata {
/**
* The timing data for the steps.
*/
timings: string | number;
/**
* One or more animation steps.
*/
animation: AnimationMetadata | AnimationMetadata[];
}
/**
* Creates a named animation trigger, containing a list of [`state()`](api/animations/state)
* and `transition()` entries to be evaluated when the expression
* bound to the trigger changes.
*
* @param name An identifying string.
* @param definitions An animation definition object, containing an array of
* [`state()`](api/animations/state) and `transition()` declarations.
*
* @return An object that encapsulates the trigger data.
*
* @usageNotes
* Define an animation trigger in the `animations` section of `@Component` metadata.
* In the template, reference the trigger by name and bind it to a trigger expression that
* evaluates to a defined animation state, using the following format:
*
* `[@triggerName]="expression"`
*
* Animation trigger bindings convert all values to strings, and then match the
* previous and current values against any linked transitions.
* Booleans can be specified as `1` or `true` and `0` or `false`.
*
* ### Usage Example
*
* The following example creates an animation trigger reference based on the provided
* name value.
* The provided animation value is expected to be an array consisting of state and
* transition declarations.
*
* ```ts
* @Component({
* selector: "my-component",
* templateUrl: "my-component-tpl.html",
* animations: [
* trigger("myAnimationTrigger", [
* state(...),
* state(...),
* transition(...),
* transition(...)
* ])
* ]
* })
* class MyComponent {
* myStatusExp = "something";
* }
* ```
*
* The template associated with this component makes use of the defined trigger
* by binding to an element within its template code.
*
* ```html
* <!-- somewhere inside of my-component-tpl.html -->
* <div [@myAnimationTrigger]="myStatusExp">...</div>
* ```
*
* ### Using an inline function
* The `transition` animation method also supports reading an inline function which can decide
* if its associated animation should be run.
*
* ```ts
* // this method is run each time the `myAnimationTrigger` trigger value changes.
* function myInlineMatcherFn(fromState: string, toState: string, element: any, params: {[key:
string]: any}): boolean {
* // notice that `element` and `params` are also available here
* return toState == 'yes-please-animate';
* }
*
* @Component({
* selector: 'my-component',
* templateUrl: 'my-component-tpl.html',
* animations: [
* trigger('myAnimationTrigger', [
* transition(myInlineMatcherFn, [
* // the animation sequence code
* ]),
* ])
* ]
* })
* class MyComponent {
* myStatusExp = "yes-please-animate";
* }
* ```
*
* ### Disabling Animations
* When true, the special animation control binding `@.disabled` binding prevents
* all animations from rendering.
* Place the `@.disabled` binding on an element to disable
* animations on the element itself, as well as any inner animation triggers
* within the element.
*
* The following example shows how to use this feature:
*
* ```angular-ts
* @Component({
* selector: 'my-component',
* template: `
* <div [@.disabled]="isDisabled">
* <div [@childAnimation]="exp"></div>
* </div>
* `,
* animations: [
* trigger("childAnimation", [
* // ...
* ])
* ]
* })
* class MyComponent {
* isDisabled = true;
* exp = '...';
* }
* ```
*
* When `@.disabled` is true, it prevents the `@childAnimation` trigger from animating,
* along with any inner animations.
*
* ### Disable animations application-wide
* When an area of the template is set to have animations disabled,
* **all** inner components have their animations disabled as well.
* This means that you can disable all animations for an app
* by placing a host binding set on `@.disabled` on the topmost Angular component.
*
* ```ts
* import {Component, HostBinding} from '@angular/core';
*
* @Component({
* selector: 'app-component',
* templateUrl: 'app.component.html',
* })
* class AppComponent {
* @HostBinding('@.disabled')
* public animationsDisabled = true;
* }
* ```
*
* ### Overriding disablement of inner animations
* Despite inner animations being disabled, a parent animation can `query()`
* for inner elements located in disabled areas of the template and still animate
* them if needed. This is also the case for when a sub animation is
* queried by a parent and then later animated using `animateChild()`.
*
* ### Detecting when an animation is disabled
* If a region of the DOM (or the entire application) has its animations disabled, the animation
* trigger callbacks still fire, but for zero seconds. When the callback fires, it provides
* an instance of an `AnimationEvent`. If animations are disabled,
* the `.disabled` flag on the event is true.
*
* @publicApi
*/
declare function trigger(name: string, definitions: AnimationMetadata[]): AnimationTriggerMetadata;
/**
* Defines an animation step that combines styling information with timing information.
*
* @param timings Sets `AnimateTimings` for the parent animation.
* A string in the format "duration [delay] [easing]".
* - Duration and delay are expressed as a number and optional time unit,
* such as "1s" or "10ms" for one second and 10 milliseconds, respectively.
* The default unit is milliseconds.
* - The easing value controls how the animation accelerates and decelerates
* during its runtime. Value is one of `ease`, `ease-in`, `ease-out`,
* `ease-in-out`, or a `cubic-bezier()` function call.
* If not supplied, no easing is applied.
*
* For example, the string "1s 100ms ease-out" specifies a duration of
* 1000 milliseconds, and delay of 100 ms, and the "ease-out" easing style,
* which decelerates near the end of the duration.
* @param styles Sets AnimationStyles for the parent animation.
* A function call to either `style()` or `keyframes()`
* that returns a collection of CSS style entries to be applied to the parent animation.
* When null, uses the styles from the destination state.
* This is useful when describing an animation step that will complete an animation;
* see "Animating to the final state" in `transitions()`.
* @returns An object that encapsulates the animation step.
*
* @usageNotes
* Call within an animation `sequence()`, {@link /api/animations/group group()}, or
* `transition()` call to specify an animation step
* that applies given style data to the parent animation for a given amount of time.
*
* ### Syntax Examples
* **Timing examples**
*
* The following examples show various `timings` specifications.
* - `animate(500)` : Duration is 500 milliseconds.
* - `animate("1s")` : Duration is 1000 milliseconds.
* - `animate("100ms 0.5s")` : Duration is 100 milliseconds, delay is 500 milliseconds.
* - `animate("5s ease-in")` : Duration is 5000 milliseconds, easing in.
* - `animate("5s 10ms cubic-bezier(.17,.67,.88,.1)")` : Duration is 5000 milliseconds, delay is 10
* milliseconds, easing according to a bezier curve.
*
* **Style examples**
*
* The following example calls `style()` to set a single CSS style.
* ```ts
* animate(500, style({ background: "red" }))
* ```
* The following example calls `keyframes()` to set a CSS style
* to different values for successive keyframes.
* ```ts
* animate(500, keyframes(
* [
* style({ background: "blue" }),
* style({ background: "red" })
* ])
* ```
*
* @publicApi
*/
declare function animate(timings: string | number, styles?: AnimationStyleMetadata | AnimationKeyframesSequenceMetadata | null): AnimationAnimateMetadata;
/**
* @description Defines a list of animation steps to be run in parallel.
*
* @param steps An array of animation step objects.
* - When steps are defined by `style()` or `animate()`
* function calls, each call within the group is executed instantly.
* - To specify offset styles to be applied at a later time, define steps with
* `keyframes()`, or use `animate()` calls with a delay value.
* For example:
*
* ```ts
* group([
* animate("1s", style({ background: "black" })),
* animate("2s", style({ color: "white" }))
* ])
* ```
*
* @param options An options object containing a delay and
* developer-defined parameters that provide styling defaults and
* can be overridden on invocation.
*
* @return An object that encapsulates the group data.
*
* @usageNotes
* Grouped animations are useful when a series of styles must be
* animated at different starting times and closed off at different ending times.
*
* When called within a `sequence()` or a
* `transition()` call, does not continue to the next
* instruction until all of the inner animation steps have completed.
*
* @publicApi
*/
declare function group(steps: AnimationMetadata[], options?: AnimationOptions | null): AnimationGroupMetadata;
/**
* Defines a list of animation steps to be run sequentially, one by one.
*
* @param steps An array of animation step objects.
* - Steps defined by `style()` calls apply the styling data immediately.
* - Steps defined by `animate()` calls apply the styling data over time
* as specified by the timing data.
*
* ```ts
* sequence([
* style({ opacity: 0 }),
* animate("1s", style({ opacity: 1 }))
* ])
* ```
*
* @param options An options object containing a delay and
* developer-defined parameters that provide styling defaults and
* can be overridden on invocation.
*
* @return An object that encapsulates the sequence data.
*
* @usageNotes
* When you pass an array of steps to a
* `transition()` call, the steps run sequentially by default.
* Compare this to the {@link /api/animations/group group()} call, which runs animation steps in
*parallel.
*
* When a sequence is used within a {@link /api/animations/group group()} or a `transition()` call,
* execution continues to the next instruction only after each of the inner animation
* steps have completed.
*
* @publicApi
**/
declare function sequence(steps: AnimationMetadata[], options?: AnimationOptions | null): AnimationSequenceMetadata;
/**
* Declares a key/value object containing CSS properties/styles that
* can then be used for an animation [`state`](api/animations/state), within an animation
*`sequence`, or as styling data for calls to `animate()` and `keyframes()`.
*
* @param tokens A set of CSS styles or HTML styles associated with an animation state.
* The value can be any of the following:
* - A key-value style pair associating a CSS property with a value.
* - An array of key-value style pairs.
* - An asterisk (*), to use auto-styling, where styles are derived from the element
* being animated and applied to the animation when it starts.
*
* Auto-styling can be used to define a state that depends on layout or other
* environmental factors.
*
* @return An object that encapsulates the style data.
*
* @usageNotes
* The following examples create animation styles that collect a set of
* CSS property values:
*
* ```ts
* // string values for CSS properties
* style({ background: "red", color: "blue" })
*
* // numerical pixel values
* style({ width: 100, height: 0 })
* ```
*
* The following example uses auto-styling to allow an element to animate from
* a height of 0 up to its full height:
*
* ```ts
* style({ height: 0 }),
* animate("1s", style({ height: "*" }))
* ```
*
* @publicApi
**/
declare function style(tokens: '*' | {
[key: string]: string | number;
} | Array<'*' | {
[key: string]: string | number;
}>): AnimationStyleMetadata;
/**
* Declares an animation state within a trigger attached to an element.
*
* @param name One or more names for the defined state in a comma-separated string.
* The following reserved state names can be supplied to define a style for specific use
* cases:
*
* - `void` You can associate styles with this name to be used when
* the element is detached from the application. For example, when an `ngIf` evaluates
* to false, the state of the associated element is void.
* - `*` (asterisk) Indicates the default state. You can associate styles with this name
* to be used as the fallback when the state that is being animated is not declared
* within the trigger.
*
* @param styles A set of CSS styles associated with this state, created using the
* `style()` function.
* This set of styles persists on the element once the state has been reached.
* @param options Parameters that can be passed to the state when it is invoked.
* 0 or more key-value pairs.
* @return An object that encapsulates the new state data.
*
* @usageNotes
* Use the `trigger()` function to register states to an animation trigger.
* Use the `transition()` function to animate between states.
* When a state is active within a component, its associated styles persist on the element,
* even when the animation ends.
*
* @publicApi
**/
declare function state(name: string, styles: AnimationStyleMetadata, options?: {
params: {
[name: string]: any;
};
}): AnimationStateMetadata;
/**
* Defines a set of animation styles, associating each style with an optional `offset` value.
*
* @param steps A set of animation styles with optional offset data.
* The optional `offset` value for a style specifies a percentage of the total animation
* time at which that style is applied.
* @returns An object that encapsulates the keyframes data.
*
* @usageNotes
* Use with the `animate()` call. Instead of applying animations
* from the current state
* to the destination state, keyframes describe how each style entry is applied and at what point
* within the animation arc.
* Compare [CSS Keyframe Animations](https://www.w3schools.com/css/css3_animations.asp).
*
* ### Usage
*
* In the following example, the offset values describe
* when each `backgroundColor` value is applied. The color is red at the start, and changes to
* blue when 20% of the total time has elapsed.
*
* ```ts
* // the provided offset values
* animate("5s", keyframes([
* style({ backgroundColor: "red", offset: 0 }),
* style({ backgroundColor: "blue", offset: 0.2 }),
* style({ backgroundColor: "orange", offset: 0.3 }),
* style({ backgroundColor: "black", offset: 1 })
* ]))
* ```
*
* If there are no `offset` values specified in the style entries, the offsets
* are calculated automatically.
*
* ```ts
* animate("5s", keyframes([
* style({ backgroundColor: "red" }) // offset = 0
* style({ backgroundColor: "blue" }) // offset = 0.33
* style({ backgroundColor: "orange" }) // offset = 0.66
* style({ backgroundColor: "black" }) // offset = 1
* ]))
*```
* @publicApi
*/
declare function keyframes(steps: AnimationStyleMetadata[]): AnimationKeyframesSequenceMetadata;
/**
* Declares an animation transition which is played when a certain specified condition is met.
*
* @param stateChangeExpr A string with a specific format or a function that specifies when the
* animation transition should occur (see [State Change Expression](#state-change-expression)).
*
* @param steps One or more animation objects that represent the animation's instructions.
*
* @param options An options object that can be used to specify a delay for the animation or provide
* custom parameters for it.
*
* @returns An object that encapsulates the transition data.
*
* @usageNotes
*
* ### State Change Expression
*
* The State Change Expression instructs Angular when to run the transition's animations, it can
*either be
* - a string with a specific syntax
* - or a function that compares the previous and current state (value of the expression bound to
* the element's trigger) and returns `true` if the transition should occur or `false` otherwise
*
* The string format can be:
* - `fromState => toState`, which indicates that the transition's animations should occur then the
* expression bound to the trigger's element goes from `fromState` to `toState`
*
* _Example:_
* ```ts
* transition('open => closed', animate('.5s ease-out', style({ height: 0 }) ))
* ```
*
* - `fromState <=> toState`, which indicates that the transition's animations should occur then
* the expression bound to the trigger's element goes from `fromState` to `toState` or vice versa
*
* _Example:_
* ```ts
* transition('enabled <=> disabled', animate('1s cubic-bezier(0.8,0.3,0,1)'))
* ```
*
* - `:enter`/`:leave`, which indicates that the transition's animations should occur when the
* element enters or exists the DOM
*
* _Example:_
* ```ts
* transition(':enter', [
* style({ opacity: 0 }),
* animate('500ms', style({ opacity: 1 }))
* ])
* ```
*
* - `:increment`/`:decrement`, which indicates that the transition's animations should occur when
* the numerical expression bound to the trigger's element has increased in value or decreased
*
* _Example:_
* ```ts
* transition(':increment', query('@counter', animateChild()))
* ```
*
* - a sequence of any of the above divided by commas, which indicates that transition's animations
* should occur whenever one of the state change expressions matches
*
* _Example:_
* ```ts
* transition(':increment, * => enabled, :enter', animate('1s ease', keyframes([
* style({ transform: 'scale(1)', offset: 0}),
* style({ transform: 'scale(1.1)', offset: 0.7}),
* style({ transform: 'scale(1)', offset: 1})
* ]))),
* ```
*
* Also note that in such context:
* - `void` can be used to indicate the absence of the element
* - asterisks can be used as wildcards that match any state
* - (as a consequence of the above, `void => *` is equivalent to `:enter` and `* => void` is
* equivalent to `:leave`)
* - `true` and `false` also match expression values of `1` and `0` respectively (but do not match
* _truthy_ and _falsy_ values)
*
* <div class="docs-alert docs-alert-helpful">
*
* Be careful about entering end leaving elements as their transitions present a common
* pitfall for developers.
*
* Note that when an element with a trigger enters the DOM its `:enter` transition always
* gets executed, but its `:leave` transition will not be executed if the element is removed
* alongside its parent (as it will be removed "without warning" before its transition has
* a chance to be executed, the only way that such transition can occur is if the element
* is exiting the DOM on its own).
*
*
* </div>
*
* ### Animating to a Final State
*
* If the final step in a transition is a call to `animate()` that uses a timing value
* with no `style` data, that step is automatically considered the final animation arc,
* for the element to reach the final state, in such case Angular automatically adds or removes
* CSS styles to ensure that the element is in the correct final state.
*
*
* ### Usage Examples
*
* - Transition animations applied based on
* the trigger's expression value
*
* ```html
* <div [@myAnimationTrigger]="myStatusExp">
* ...
* </div>
* ```
*
* ```ts
* trigger("myAnimationTrigger", [
* ..., // states
* transition("on => off, open => closed", animate(500)),
* transition("* <=> error", query('.indicator', animateChild()))
* ])
* ```
*
* - Transition animations applied based on custom logic dependent
* on the trigger's expression value and provided parameters
*
* ```html
* <div [@myAnimationTrigger]="{
* value: stepName,
* params: { target: currentTarget }
* }">
* ...
* </div>
* ```
*
* ```ts
* trigger("myAnimationTrigger", [
* ..., // states
* transition(
* (fromState, toState, _element, params) =>
* ['firststep', 'laststep'].includes(fromState.toLowerCase())
* && toState === params?.['target'],
* animate('1s')
* )
* ])
* ```
*
* @publicApi
**/
declare function transition(stateChangeExpr: string | ((fromState: string, toState: string, element?: any, params?: {
[key: string]: any;
}) => boolean), steps: AnimationMetadata | AnimationMetadata[], options?: AnimationOptions | null): AnimationTransitionMetadata;
/**
* Produces a reusable animation that can be invoked in another animation or sequence,
* by calling the `useAnimation()` function.
*
* @param steps One or more animation objects, as returned by the `animate()`