import { Pose, StyleObject, Timeline } from '../types/index.ts'; import { Integrator } from './integrator'; import { Animation } from './animation'; export interface WebAnimationOptions { element: HTMLElement; integrator: Integrator; style: (t: number, u: number) => StyleObject; /** Default 0 — the value `t` takes at the start of `play()`. */ lowerBound?: number; /** Default 1 — the value `t` takes at the end of `play()`. */ upperBound?: number; onUpdate?: (poses: Pose[]) => void; onComplete?: () => void; } /** * Single-element animation driven by an Integrator simulation, played through * the Web Animation API. * * Lifecycle: * 1. `play()` / `reverse()` calls `simulate()` from the current (position, * velocity) toward the target bound, producing a frame list. * 2. Frames are converted to WAAPI keyframes; `element.animate(...)` runs them. * 3. While playing, `getPose()` interpolates the live position from frames * using `performance.now() - startTime`. * * Identity for motion matching is the DOM element itself — when a previous * animation's pose is handed in via `matchInto`, we look up by element. */ export declare class WebAnimation extends Animation { private element; private integrator; private styleFn; private lowerBound; private upperBound; private currentValue; private currentVelocity; private frames; private waapi; private startTime; private running; private paused; private settled; private reversing; constructor(opts: WebAnimationOptions); play(): void; reverse(): void; pause(): void; complete(): void; get isAnimating(): boolean; get isPaused(): boolean; get isComplete(): boolean; get isReversing(): boolean; get progress(): number; findTimeForProgress(threshold: number): number | null; get playbackRate(): number; set playbackRate(rate: number); getPose(): Pose[]; getTimeline(): Timeline[]; matchInto(poses: Pose[]): void; private runToward; private clearWaapi; private captureLiveState; private applyStyleAt; } //# sourceMappingURL=web-animation.d.ts.map