@yesstudio/nuxt-composables
    Preparing search index...

    Interface UseAnimation

    Represents the reactive references and methods for managing an animation effect.

    interface UseAnimation {
        animation: Readonly<ShallowRef<Animation | null>>;
        currentTime: WritableComputedRef<CSSNumberish | null>;
        pending: ComputedRef<boolean>;
        playbackRate: WritableComputedRef<number>;
        playState: ComputedRef<AnimationPlayState>;
        replaceState: ComputedRef<AnimationReplaceState>;
        startTime: WritableComputedRef<CSSNumberish | null>;
        timeline: WritableComputedRef<AnimationTimeline | null>;
        cancel(): void;
        finish(): void;
        onError(callback: (parameter: DOMException) => void): { off(): void };
        onReady(callback: (parameter: Animation) => void): { off(): void };
        pause(): void;
        play(): void;
        reverse(): void;
    }
    Index

    Properties

    animation: Readonly<ShallowRef<Animation | null>>

    A readonly reference to the Animation instance.

    currentTime: WritableComputedRef<CSSNumberish | null>

    A writable reference to the animation's current time.

    pending: ComputedRef<boolean>

    A readonly reference indicating whether the animation is pending.

    playbackRate: WritableComputedRef<number>

    A readonly reference to the animation's playback rate.

    A readonly reference to the animation's play state.

    A readonly reference to the animation's replace state.

    A writable reference to the animation's start time.

    A writable reference to the animation's timeline.

    Methods

    • Adds a callback to be called when an error occurs.

      Parameters

      • callback: (parameter: DOMException) => void

        The callback to be added.

      Returns { off(): void }

      An object with a method to remove the callback.