/** * Release handfeel for the width slider: a drag does not stop dead where the * pointer happened to leave the track. The release carries its velocity into a * projected landing point and the column glides there, so a flick overshoots * slightly and settles back instead of snapping. Pure math only (no DOM, no * timers): the caller drives {@link stepSpring} from rAF. * * The integrator is the underdamped step from the handfeel notes — * `vel += (target - x) * k * dt; vel *= damping; x += vel * dt` — with the * damping made frame-rate independent by raising it to `dt * 60`, so a 120Hz * display settles in the same wall-clock time as a 60Hz one. */ /** How far ahead the release velocity is projected (ms): the flick's "throw". */ export declare const PROJECT_MS = 120; /** * Spring stiffness (1/s²) and per-frame damping at 60fps. The pair is tuned for * a column that is also a live layout: ωn = √260 ≈ 16.1 1/s with an effective * damping ratio ζ = -ln(0.66)·60 / (2√260) ≈ 0.77 settles inside ~0.4s, so the * width is usable right after a throw while the ~5% overshoot still reads as * momentum. (The handfeel notes' 0.86/0.60 damping presets pair with a much * softer k = 60–90 and would leave the column oscillating for over a second at * this stiffness.) */ export declare const SPRING_STIFFNESS = 260; export declare const SPRING_DAMPING = 0.66; /** Rest thresholds: below BOTH, the spring has landed. */ export declare const REST_DISTANCE = 1.5; export declare const REST_VELOCITY = 30; /** The velocity sample window (ms); older pointer samples are too stale to use. */ export declare const VELOCITY_WINDOW_MS = 120; /** Below this release speed (width px/ms) a gesture is a stop, not a flick. */ export declare const FLICK_MIN_VELOCITY = 0.05; /** One pointer sample on the track axis (client-X px, epoch ms). */ export interface PointerSample { x: number; t: number; } /** One spring state: position (px) and velocity (px/s). */ export interface SpringState { x: number; vel: number; } /** Pure: the landing point a release is thrown to, from its velocity (px/ms). */ export declare function projectLanding(value: number, velocityPerMs: number, projectMs?: number): number; /** * Pure: one frame of the underdamped step. `dtSec` is clamped: a stalled frame * (backgrounded tab, long task) must not integrate a huge step and fling the * column across the range. */ export declare function stepSpring(state: SpringState, target: number, dtSec: number): SpringState; /** Pure: whether the spring has landed on the target (distance AND speed at rest). */ export declare function isSettled(state: SpringState, target: number): boolean; /** * Pure: the release velocity (px/ms) from recent pointer samples. The oldest * sample inside the window is the baseline, which keeps a long drag from being * averaged into a false zero at the end of a fast flick. */ export declare function dragVelocity(samples: readonly PointerSample[], now: number, windowMs?: number): number;