Defines the options for the animateWAAPI action.

interface AnimateWAAPI {
    debounce?: number;
    duration?: number;
    enabled?: boolean;
    event?: keyof HTMLElementEventMap;
    keyframeOptions?: KeyframeAnimationOptions;
    keyframes: Keyframe[] | PropertyIndexedKeyframes;
    strategy?: "exclusive" | "cancel";
}

Properties

debounce?: number

Add a debounce to incoming events in milliseconds. Consider using the exclusive strategy.

duration?: number

Duration in milliseconds. Default value: 600.

enabled?: boolean

Is the animation enabled. Default value: true.

event?: keyof HTMLElementEventMap

DOM event name to bind element to respond with the WAAPI animation. Default value: click.

keyframeOptions?: KeyframeAnimationOptions

An object containing one or more timing properties. When defined it is used instead of duration.

An array of keyframe objects or a keyframe object whose properties are arrays of values to iterate over.

strategy?: "exclusive" | "cancel"

The scheduling strategy to take. cancel to cancel any current animation, exclusive to skip scheduling an animation if one is currently running. Default value: cancel.