import { type ReactNode } from "react"; import { type ScrubExpressionOptions } from "./scrub-input-utils.js"; type ScrubInputIcon = (props: { className?: string; "aria-hidden"?: boolean; }) => ReactNode; export interface ScrubInputChangeMeta { source: "commit" | "keyboard" | "scrub"; expression?: string; /** * Gesture-lifecycle signal for downstream consumers that want to throttle * expensive work during a drag and only do the expensive commit once. * * - "preview": a live, in-progress tick — e.g. one pointermove sample while * scrubbing. There can be many of these per gesture; treat each as a * cheap, throttleable preview of the value, not a point to commit at full * cost. * - "commit": the gesture's authoritative, final value. Fired exactly once * per gesture: on pointerup that ends a scrub drag, and for every * `source: "commit"` (blur/Enter) or `source: "keyboard"` (arrow step) * change, since those are already discrete, complete edits. */ phase: "preview" | "commit"; /** * Set when an arrow-key nudge fires on a `mixed` selection (see * `handleKeyDown`): there is no single current value to step from across a * mixed selection, so `onChange`'s `value` arg is the step delta itself * (not a new absolute value) and consumers that support per-target relative * application should add this delta to each selected target's own current * value instead of overwriting every target with `value`. Omitted for * every other change — existing consumers that don't check for it keep * receiving absolute values exactly as before. */ relativeDelta?: number; } export interface ScrubInputProps extends ScrubExpressionOptions { label: string; value: number; onChange: (value: number, meta: ScrubInputChangeMeta) => void; id?: string; step?: number; icon?: ScrubInputIcon | null; /** Use the compact icon-only prefix treatment without relying on CSS selectors. */ prefix?: "label" | "icon"; disabled?: boolean; placeholder?: string; mixed?: boolean; mixedLabel?: string; className?: string; inputClassName?: string; labelClassName?: string; ariaLabel?: string; tooltipLabel?: string; /** Replace the drag-scrub label with explicit minus/plus step buttons. */ steppers?: boolean; decrementLabel?: string; incrementLabel?: string; } export interface PendingScrubCommit { value: number; /** Incoming prop value at commit time. While this exact value remains, the * host has not acknowledged the write yet and the optimistic draft should * stay visible. A different incoming value is authoritative host * normalization/rejection and must supersede the optimistic draft. */ baseline: number; } export declare function resolvePendingScrubCommit(pending: PendingScrubCommit | null, incomingValue: number, options: ScrubExpressionOptions): "none" | "hold" | "confirmed" | "superseded"; export declare function VisualScrubInput({ label, value, onChange, id, step, unit, min, max, precision, icon: Icon, prefix, disabled, placeholder, mixed, mixedLabel, className, inputClassName, labelClassName, ariaLabel, tooltipLabel, steppers, decrementLabel, incrementLabel, }: ScrubInputProps): import("react").JSX.Element; export {}; //# sourceMappingURL=scrub-input.d.ts.map