/** * Parsed CSS transition properties ready for Web Animations API. * All timing values are in milliseconds. */ export type ParsedTransition = { /** Duration in milliseconds */ duration: number; /** Delay in milliseconds */ delay: number; /** Easing function string (CSS syntax, directly usable in WAAPI) */ easing: string; /** The CSS property being transitioned (e.g., "transform") */ property: string; }; /** * Parses a CSS time value (e.g., "700ms", "0.7s") to milliseconds. */ export declare function parseTimeToMs(value: string): number; /** * Animation state tracking for precise interruption handling. * Stores the start/end values to calculate exact position via WAAPI progress. */ export type AnimationState = { startTransform: number; endTransform: number; isHorizontal: boolean; }; /** * Parameters for running a WAAPI animation. */ export type RunAnimationParams = { scrollArea: HTMLElement; startValue: number; endValue: number; isHorizontal: boolean; transition: ParsedTransition; /** * Called each frame with the interpolated transform value. * Used by loop mode to update item offsets; can be no-op for non-loop. */ onFrame?: (transform: number) => void; /** * Called when animation completes naturally. */ onComplete: () => void; }; /** * Core WAAPI animation functionality shared between loop and non-loop modes. * Provides consistent animation execution and cancellation behavior. * * Key features: * - Frame-exact position interpolation via WAAPI timing * - Clean cancellation with commitStyles() for seamless handoff * - No getComputedStyle needed during interruption */ export declare class WaapiAnimationCore { protected activeAnimation: Animation | null; protected activeController: AbortController | null; protected currentAnimationState: AnimationState | null; protected scrollArea: HTMLElement; protected parsedTransition: { value: ParsedTransition | null; }; constructor(params: { scrollArea: HTMLElement; parsedTransition: { value: ParsedTransition | null; }; }); /** * Cancels any active animation and returns the exact interpolated position. * Uses WAAPI progress for frame-exact position calculation. * * @returns Current position {x, y} if animation was cancelled, null if no animation */ cancelAnimation(): { x: number; y: number; } | null; /** * Checks if an animation is currently running. */ isAnimating(): boolean; /** * Ensures CSS transition is parsed for WAAPI use. * Can be overridden by subclasses to handle side effects (like updating signals). */ protected ensureTransitionParsed(): void; /** * Gets the parsed CSS transition properties for WAAPI. */ getParsedTransition(): ParsedTransition; /** * Runs a WAAPI animation from startValue to endValue. * Handles transition disable/restore, progress tracking, and cleanup. * * @returns The created Animation object and computed snap delta */ protected runAnimation(params: RunAnimationParams): { snapDelta: number; animation: Animation; }; }