/** * `useAnimation` binds a vanilla `play()` controller to a Vue template * ref. The composable itself performs no side effects on setup; callers * must call `play(def)` (typically from an event handler or * `onMounted`) to start. * * const { ref, play } = useAnimation() * play(tween({ opacity: [0, 1] }, { duration: 400 })) * * On `onBeforeUnmount`, the latest Controls handle is cancelled. * Calling `play()` with a second animation cancels the first * automatically so overlapping animations do not leak handles. */ import type { AnimationDef, AnimationProps, Controls, PlayOpts, StrategyState } from "@kinem/core"; import { type ShallowRef } from "vue"; export interface UseAnimationResult { /** Attach to the element being animated via `ref`. */ readonly ref: ShallowRef; /** Play an `AnimationDef`. Cancels any in-flight animation first. */ play(def: AnimationDef, opts?: PlayOpts): Controls; pause(): void; resume(): void; seek(progress: number): void; reverse(): void; cancel(): void; setSpeed(multiplier: number): void; /** Live state of the most recent playback. `"idle"` if none has started. */ readonly state: StrategyState; } export declare function useAnimation(): UseAnimationResult; //# sourceMappingURL=useAnimation.d.ts.map