UNPKG

902 BTypeScriptView Raw
1import { EventHandler } from './addEventListener';
2import { TransformValue } from './isTransform';
3import { Property } from './types';
4declare type AnimateProperties = Record<Property | TransformValue, string>;
5interface Options {
6 node: HTMLElement;
7 properties: AnimateProperties;
8 duration?: number;
9 easing?: string;
10 callback?: EventHandler<'transitionend'>;
11}
12interface Cancel {
13 cancel(): void;
14}
15declare function animate(options: Options): Cancel;
16declare function animate(node: HTMLElement, properties: AnimateProperties, duration: number): Cancel;
17declare function animate(node: HTMLElement, properties: AnimateProperties, duration: number, callback: EventHandler<'transitionend'>): Cancel;
18declare function animate(node: HTMLElement, properties: AnimateProperties, duration: number, easing: string, callback: EventHandler<'transitionend'>): Cancel;
19export default animate;