animation_player.d-Dv9iW4uh.d.ts 45 KB

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