export interface ScrubExpressionOptions { unit?: string; min?: number; max?: number; precision?: number; } /** Cumulative pointer movement (px) required before a drag start is treated * as a real scrub rather than jitter during a plain click. Mirrors * ScrubInput's DRAG_THRESHOLD_PX. */ export declare const SCRUB_DRAG_THRESHOLD_PX = 3; export interface ScrubDragState { startX: number; prevX: number; hasDragged: boolean; } /** Begins tracking a new scrub gesture at the given starting pointer X. */ export declare function startScrubDrag(startX: number): ScrubDragState; export interface ScrubDragTick { /** The updated drag state after this pointermove sample. */ state: ScrubDragState; /** The incremental delta (px) to apply this tick, or null when the move * should be ignored (no movement, or still under the jitter threshold). */ deltaX: number | null; } /** * Processes one pointermove sample against the in-progress drag state. * Mirrors ScrubInput's handlePointerMove threshold/hasDragged logic exactly: * a move is ignored until cumulative movement clears SCRUB_DRAG_THRESHOLD_PX, * after which every subsequent move (including this one) yields an * incremental delta and marks the gesture as a real drag. */ export declare function updateScrubDrag(state: ScrubDragState, clientX: number): ScrubDragTick; export interface ParsedScrubExpression { value: number; normalized: string; } export declare function parseScrubExpression(input: string, currentValue: number, options?: ScrubExpressionOptions): ParsedScrubExpression | null; export declare function normalizeScrubNumber(value: number, options?: ScrubExpressionOptions): number; /** * Whether a field's unit should snap to whole numbers while the user is * actively pointer-dragging (scrubbing) it. Px-type fields (padding, gap, * position, size, radius, etc.) read as integers in Figma-style editors even * though the underlying `precision` option (which also governs *typed* input * and keyboard nudges) allows one decimal place so a typed "12.5" still * commits legally. Scoped to "px" specifically — unitless fields like * line-height (precision-based, fractional by design) and other units (deg, * %) are untouched. */ export declare function scrubSnapsToInteger(unit: string | undefined): boolean; /** * Rounds a live scrub-drag value to a whole number when the field's unit * calls for integer-only scrubbing (see `scrubSnapsToInteger`), applied * *before* `normalizeScrubNumber`'s own min/max/precision clamp so a * following precision clamp (if any) can't reintroduce a fraction. Only the * pointer-drag scrub gesture should call this — typed input and keyboard * nudges keep their existing `precision`-based rounding untouched. */ export declare function roundScrubDragValue(value: number, unit: string | undefined): number; export declare function formatScrubValue(value: number, options?: Pick): string; export declare function getScrubStepFromEvent(event: Pick, step: number): number; //# sourceMappingURL=scrub-input-utils.d.ts.map