/** * spring.ts - rAF-based damped harmonic oscillator * * Drop-in replacement for svelte/motion Spring in framework-agnostic code. * Same physics: stiffness controls return force, damping controls friction. * Snaps to target when velocity is negligible. */ export interface SpringOptions { /** Spring stiffness (default 300). Higher = snappier. */ stiffness?: number; /** Damping coefficient (default 15). Higher = less bounce. */ damping?: number; } export interface Spring { /** Current interpolated value. */ readonly current: number; /** Set to animate toward a new value. */ target: number; /** Register a callback fired every animation frame. */ onUpdate(fn: (value: number) => void): void; /** Stop animation and remove listeners. */ destroy(): void; } export declare function createSpring(initial: number, opts?: SpringOptions): Spring; //# sourceMappingURL=spring.d.ts.map