UNPKG

animate-height

Version:

Animate the height of an element to 'auto' or '0px'.

37 lines (36 loc) 937 B
declare enum AnimationState { None = 0, Auto = 1, Zero = 2 } export interface Options { duration?: number; timing?: string; } export declare const defaultOptions: { duration: number; timing: string; }; export default class Animator { el: HTMLElement; state: AnimationState; orgTransition: string; constructor(el: HTMLElement); /** * Animate the height of the element to 'auto'. * * @param options - Animation options * @returns The height of the element after the animation completes. */ autoHeight({ duration, timing }?: Options): Promise<number>; /** * Animate the height of the element to '0px'. * * @param options - Animation options * @param timing - CSS transition timing function */ zeroHeight({ duration, timing }?: Options): Promise<void>; handleEvent(ev: Event): void; onTransitionEnded(): void; } export {};