/**
 * Scalar spring primitive for the shared ApexCharts motion core (tree, sankey).
 *
 * A spring animates a single number toward a `target` using a damped
 * harmonic oscillator, integrated with semi-implicit (symplectic) Euler.
 * Unlike a fixed-duration tween, a spring carries `velocity`: retargeting
 * mid-flight redirects the motion smoothly instead of restarting from a
 * standstill. That property is what makes collapse/expand interruptible.
 *
 * All units are in the caller's coordinate space (SVG user units for
 * positions, a 0..1 scalar for scale/opacity). Time is in seconds.
 */
/**
 * Per-spring rest thresholds, in the same units as the spring's value.
 *
 * The defaults (0.05 / 0.05) were picked for SVG user units, where a twentieth
 * of a pixel is invisible. They are absolute numbers, though, so on a 0..1
 * quantity (opacity, scale, a morph progress) they are enormous, and the
 * velocity floor is what bites: the spring declares rest while still moving at
 * 0.05 per second and the remaining gap is closed in a single frame. How much
 * that costs depends on how far the value was travelling, because a shorter
 * trip is slower near the end and so trips the floor earlier. On the `crisp`
 * preset a full 0→1 travel loses 0.4% to that snap, but a 0→0.04 fade loses
 * 10% and a 0→0.02 one loses 22%. Give those springs {@link UNIT_REST}.
 */
export interface SpringRest {
    /** Rest threshold for `|velocity|`. Defaults to 0.05. */
    velocity?: number;
    /** Rest threshold for `|value - target|`. Defaults to 0.05. */
    displacement?: number;
}
/**
 * Rest thresholds for a normalised 0..1 spring (opacity, scale, progress).
 *
 * A velocity floor of 0.01/s with a displacement floor of 0.001, which cuts the
 * end-of-travel snap by roughly five times across the useful range of transition
 * sizes. It costs about seven extra frames of tail (~120ms on the `crisp`
 * preset) in which nothing perceptible happens, which is the right trade for
 * not clipping a tenth off every small fade.
 */
export declare const UNIT_REST: SpringRest;
export interface Spring {
    /** Current animated value. */
    value: number;
    /** Current rate of change (per second). Preserved across retargets. */
    velocity: number;
    /** Value the spring is settling toward. */
    target: number;
    /** Stiffness (k): higher = faster, more forceful pull toward target. */
    stiffness: number;
    /** Damping (c): higher = less oscillation. ~critically damped by default. */
    damping: number;
    /** Rest threshold for `|velocity|`. Falls back to 0.05 when unset. */
    restVelocity?: number;
    /** Rest threshold for `|value - target|`. Falls back to 0.05 when unset. */
    restDisplacement?: number;
}
/**
 * Create a spring at rest at `value`, ready to be retargeted.
 *
 * @param rest Optional per-spring rest thresholds. Omit for a coordinate-space
 *   spring; pass {@link UNIT_REST} for a 0..1 quantity.
 */
export declare function makeSpring(value: number, stiffness: number, damping: number, rest?: SpringRest): Spring;
/**
 * Advance a spring by `dt` seconds. Returns `true` once it has come to rest
 * (both velocity and displacement below threshold), at which point the value
 * is snapped exactly to the target and velocity zeroed.
 *
 * Long frames (tab refocus, GC pauses) are split into fixed sub-steps so a
 * single large `dt` cannot inject spurious energy and overshoot wildly.
 */
export declare function stepSpring(spring: Spring, dt: number): boolean;
/** Retarget a spring, preserving its current value and velocity. */
export declare function retarget(spring: Spring, target: number): void;
/** Immediately snap a spring to a value with zero velocity (used for reduced motion). */
export declare function snapSpring(spring: Spring, value: number): void;
//# sourceMappingURL=spring.d.ts.map