import Style from "./Style"; import { Component } from "./Components"; /** Represents a UI component animation */ export declare abstract class Animation { static enableAll(): void; static disableAll(): void; static readonly isEnabled: boolean; constructor(name: string); /** Unique ID (includes name and a unique number, generated by constructor) */ readonly id: string; /** Name of the animation (not necessarily unique) */ readonly name: string; /** Total duration in milliseconds of (the looping segment of) this animation, set by implementation */ duration: number; /** Play the animation on given component */ abstract play(component: Component): Animation.AnimationControl; /** Play the animation once for the entire duration, and then stop it */ playOnce(component: Component): Animation.AnimationControl; } export declare namespace Animation { /** Represents the public interface for a playing animation */ interface AnimationControl { /** Reference to the animation itself */ animation: AnimationT; /** Stop playing the animation, clear its artifacts */ stop(): void; /** Promise that resolves to the animation control itself, after the animation is over (duration has passed) */ done: PromiseLike>; } } /** Represents an animation with several keyframes */ export declare class KeyframeAnimation extends Animation { /** Create a combined animation out of given key frame animations */ static together(...animations: KeyframeAnimation[]): Animation; /** Get an animation with given keyframes and given playback options ready for use */ constructor(name: string, keyframes?: KeyframeAnimation.Keyframe[], options?: KeyframeAnimation.Options); /** Clone the animation with the same keyframes but with extra options */ clone(options: KeyframeAnimation.Options): KeyframeAnimation; /** Combine this animation with given key frame animations; this does *not* work for animations that use the same CSS property, such as `transform` (rotate, scale, translate...) */ togetherWith(...animations: KeyframeAnimation[]): Animation; /** Clone this animation and override timings */ withTiming(msDuration: number, msDelay?: number): KeyframeAnimation; /** Clone this animation and specify to be played in reverse */ reverse(): KeyframeAnimation; /** Play the animation once on given component */ play(component: Component): Animation.AnimationControl; } export declare namespace KeyframeAnimation { /** Represents a single keyframe in an animation */ interface Keyframe { /** Keyframe position (fraction, 0-1), defaults to the relative position of this keyframe from 0 to 1 (i.e. first keyframe to 0, second in a set of three keyframes to 0.5, second in a set of four keyframes to 0.25, etc) */ t?: number; /** Keyframe style set */ style: Style.StyleSet | Style | string; } } export declare namespace KeyframeAnimation { /** Keyframe animation options */ interface Options { /** Duration in milliseconds (default 500) */ duration?: number; /** Duration specified in CSS (copied from duration if unspecified) */ specDuration?: number; /** Delay in milliseconds before starting the animation (default 0) */ delay?: number; /** Number of iterations to play (default 1; can be Infinity) */ count?: number; /** Direction to play the keyframes in (normal, reverse, alternate, or alternate-reverse; default normal) */ direction?: "normal" | "reverse" | "alternate" | "alternate-reverse"; /** Set to true to ease the animation timing */ ease?: boolean; } } export declare namespace Animation { /** List of basic animations [implementation] */ var basic: { in: { fade: KeyframeAnimation; fadeUp: KeyframeAnimation; fadeDown: KeyframeAnimation; fadeLeft: KeyframeAnimation; fadeRight: KeyframeAnimation; slideUp: KeyframeAnimation; slideDown: KeyframeAnimation; slideLeft: KeyframeAnimation; slideRight: KeyframeAnimation; scale: KeyframeAnimation; scaleOver: KeyframeAnimation; turnX: KeyframeAnimation; turnY: KeyframeAnimation; maxHeight: KeyframeAnimation; maxWidth: KeyframeAnimation; }; out: { fade: KeyframeAnimation; fadeUp: KeyframeAnimation; fadeDown: KeyframeAnimation; fadeLeft: KeyframeAnimation; fadeRight: KeyframeAnimation; slideUp: KeyframeAnimation; slideDown: KeyframeAnimation; slideLeft: KeyframeAnimation; slideRight: KeyframeAnimation; scale: KeyframeAnimation; scaleOver: KeyframeAnimation; turnX: KeyframeAnimation; turnY: KeyframeAnimation; maxHeight: KeyframeAnimation; maxWidth: KeyframeAnimation; }; highlight: { yellow: KeyframeAnimation; jumpOut: KeyframeAnimation; jumpIn: KeyframeAnimation; }; }; } export default Animation;