import { AnimationBuilder, AnimationPlayer } from '@angular/animations'; import { ElementRef } from '@angular/core'; import { Observable } from 'rxjs/internal/Observable'; import { IAnimationConfiguration } from '../../contracts/i-animation-configuration'; import { AnimationParameters } from '../../helpers/animation-parameters/animation-parameters'; import { AnimationParameterService } from '../animation-parameter/animation-parameter.service'; /** * Animation player repository. */ export declare class AnimationPlayerRepository { private readonly _ANIMATION_BUILDER; private readonly _ANIMATION_DATA_FACTORY; private readonly _ANIMATIONS_CONFIGURATION; /** * The available animation keys. */ private readonly _animationKeys; /** * The instantiated animation players. */ private readonly _animationPlayers; /** * The registered animation players data. */ private readonly _animationPlayersData; /** * Animation progress subject. */ private readonly _progress$; /** * The progress timer instance. */ private _progressTimer; /** * The current animation state. */ private _state; /** * Gets progress observable. */ readonly progress$: Observable; /** * Gets the animation state. */ /** * Sets the animation state matching the given key. * @param key - The key of the animation state to set. */ state: string; /** * Creates a new {@link AnimationPlayerRepository} instance. * @param _ANIMATION_BUILDER - The Angular animation builder to inject. * @param _ANIMATION_DATA_FACTORY - The animation data service to inject. * @param _ANIMATIONS_CONFIGURATION - The animations configuration. */ constructor(_ANIMATION_BUILDER: AnimationBuilder, _ANIMATION_DATA_FACTORY: AnimationParameterService, _ANIMATIONS_CONFIGURATION: IAnimationConfiguration); /** * Gets the animation player matching the given key. * @param key - The key of the animation player to get. */ get(key: string): AnimationPlayer; /** * Plays the animation matching the given key. * @param key - The key of the animation to play. * @param playerStart - The callback called when the player starts. * @param playerDone - The callback called when the player ends. * @param progressTimeout - The timeout in milliseconds between two animation progresses check. */ play(key: string, playerStart: () => void, playerDone: () => void, progressTimeout: number): void; /** * Sets the animation data to the given key. * @param key - The key to use to register the given animation data. * @param animationParameters - The animation data to register. * @param defaultData - The default animation data. * @param element - The element to animate. */ set(key: string, animationParameters: string[] | AnimationParameters[], defaultData: string | AnimationParameters, element: ElementRef): void; /** * Creates an animation player. * @param key - The key to use to to register the animation player. * @param animationParameters - The animation data used to build the animation player. * @param element - The element to set the animation player on. * @returns A new animation player instance. */ private createPlayer; /** * Reports the animation progress. * @param player - The animation player. * @param progressTimeout - The animation progress timeout. */ private reportAnimationProgress; /** * Resolves the animation key. * @param key - The animation key. * @param animationParameters - The animation parameters. * @returns The animation key. */ private resolveAnimations; }