/** * Subscriber called every animation frame the spring is active. Receives the * current progress value (`0..1`) so subscribers can update DOM imperatively * without triggering React re-renders. */ export type StickTweenSubscriber = (progress: number) => void; export type StickTweenHandle = Readonly<{ /** Latest spring value. Read this on attach to render the initial frame. */ progressRef: { readonly current: number; }; /** Register a subscriber. Returns an unsubscribe function. */ subscribe: (subscriber: StickTweenSubscriber) => () => void; }>; /** * Drives a single spring toward `target` (`0` or `1`) and notifies subscribers * each frame. Subscribers receive the progress value imperatively so the * marker DOM (surface position, line endpoint, dot scale) can be updated * without re-rendering the React tree on every frame. * * The hook owns one `requestAnimationFrame` loop per marker. The loop: * - starts when `target` differs from the current value, * - clamps long frames (handled inside `stepSpring`), * - pauses when the document becomes hidden and resumes when visible, * - snaps directly to the target when the user prefers reduced motion, * - stops cleanly on unmount. */ export declare const useStickTween: (target: number) => StickTweenHandle;