/** * `useSpring` returns a scalar value animated by a spring. It is * imperative by design: reading `.get()` or subscribing does not cause * reactive updates. Drive DOM directly by attaching a subscriber, or * combine with `watchEffect` to consume the current value in a * non-reactive way. * * const x = useSpring(0, { stiffness: 170 }) * x.set(100) // animate toward 100 * x.subscribe(v => ...) // raf-frequency updates * * The spring restarts from the current value on each `set()`. The * underlying sampler is `springEasing` from the core package, so the * trajectory and settling behaviour match `spring()` used elsewhere. */ import { type SpringOpts } from "@kinem/core"; export interface SpringValue { /** Current value. Reading is synchronous; no reactive update fires. */ get(): number; /** Start a spring from the current value to `target`. */ set(target: number): void; /** Instantly jump to `value` and cancel any in-flight animation. */ jump(value: number): void; /** Subscribe to value updates. Called on every rAF tick of the spring. */ subscribe(fn: (value: number) => void): () => void; /** Cancel any in-flight spring. The value stays at its current sample. */ stop(): void; /** True while a spring is in progress. */ readonly isAnimating: boolean; } export declare function useSpring(initial: number, opts?: SpringOpts): SpringValue; //# sourceMappingURL=useSpring.d.ts.map