import { animatingKey } from './utils'; export declare type EasingFunction = (t: number, b: number, c: number, d: number) => number; export declare type AnimationCallback = (elem: HTMLElement, options: TweenOptions) => void; export declare type AnimationStep = (elem: HTMLElement, pos: number, options: TweenOptions) => void; export declare type TweenFactory = (elem: HTMLElement, options?: TweenOptions) => TweenOptions; declare type Callback = (cancel?: boolean) => void; interface AnimationState { start: number; animation: number | TweenFactory; onComplete: Callback; } interface HTMLElementAnim extends HTMLElement { [animatingKey]?: AnimationState; } export interface TweenOptions { /** Animation duration, ms */ duration?: number; /** Delay before actual animation start, ms */ delay?: number; /** Easing function */ easing?: EasingFunction; /** Callback for animation start */ start?: AnimationCallback; /** Callback for each animation step */ step?: AnimationStep; /** Callback for animation end */ complete?: AnimationCallback; } /** * Starts animation on given element */ export declare function animate(elem: HTMLElementAnim, animation: string | TweenFactory, callback?: Callback): void; /** * Starts CSS animation on given element */ export declare function cssAnimate(elem: HTMLElementAnim, animation: string, callback?: Callback): void; /** * Starts JS animation on given element */ export declare function tweenAnimate(elem: HTMLElementAnim, animation: TweenFactory, callback?: () => void): void; /** * Creates animation CSS value with scoped animation name */ export declare function createAnimation(animation: string, cssScope?: string): string; /** * Composes two tween options objects into single one: instead of simple `assign`, * callbacks from both tweens will be composed into a single call */ export declare function composeTween(tween1?: TweenOptions, tween2?: TweenOptions): TweenOptions; export declare function stopAnimation(elem: HTMLElementAnim, cancel?: boolean): void; export {};