@proyecto26/animatable-component
Version:
Animate once, use Everywhere! 💫
47 lines (46 loc) • 1.41 kB
TypeScript
import { IAnimatable } from '../models/animatable';
/**
* Clear props of the animatable context.
* @param context - Animatable context.
* @param options - Keyframe options.
*/
export declare function clearPropsWithOptions(context: IAnimatable, options: KeyframeAnimationOptions): void;
/**
* Load the options of the animation.
* @param context - The data of the animation.
*/
export declare function getAnimationOptions(context: IAnimatable): KeyframeAnimationOptions;
/**
* A manager to handle the animations of the Components.
*/
export declare class AnimationManager {
private element;
private state;
private animation;
private className;
private isUpdatingState;
constructor(initState: IAnimatable);
get currentAnimation(): Animation;
set currentAnimation(value: Animation);
loadAnimation(): Animation;
clearAnimation(): void;
destroyAnimation(): void;
/**
* Emit start event if playState is not running or playing a new animation.
*/
playAnimation(): void;
setState(element: HTMLElement, newState: IAnimatable): void;
savedState(): void;
/**
* Emit `onStart` event and update class name with `fromClassName`.
*/
onStartAnimation: () => void;
/**
* Emit `onCancel` event and restore class name.
*/
onCancelAnimation: () => void;
/**
* Emit `onFinish` event and update class name with `toClassName`.
*/
onFinishAnimation: () => void;
}