katoikia-app/web-ui/web-react/node_modules/dom-helpers/cjs/animate.d.ts

20 lines
902 B
TypeScript
Raw Normal View History

2022-07-06 04:15:11 +00:00
import { EventHandler } from './addEventListener';
import { TransformValue } from './isTransform';
import { Property } from './types';
declare type AnimateProperties = Record<Property | TransformValue, string>;
interface Options {
node: HTMLElement;
properties: AnimateProperties;
duration?: number;
easing?: string;
callback?: EventHandler<'transitionend'>;
}
interface Cancel {
cancel(): void;
}
declare function animate(options: Options): Cancel;
declare function animate(node: HTMLElement, properties: AnimateProperties, duration: number): Cancel;
declare function animate(node: HTMLElement, properties: AnimateProperties, duration: number, callback: EventHandler<'transitionend'>): Cancel;
declare function animate(node: HTMLElement, properties: AnimateProperties, duration: number, easing: string, callback: EventHandler<'transitionend'>): Cancel;
export default animate;