import { type FormattingOptions, type CaretPositionInfo } from '@/types'; /** * Outcome of `handleOnBeforeInputNumoraInput`. Pure: the helper does not mutate the * input or the event. The caller decides what to do based on the variant: * * - `handled`: caller should preventDefault, write `formatted` to the input via an * undo-preserving write, set caret to `cursorPos`, and notify listeners. * - `reject`: caller should preventDefault. The input value is left untouched. * - `skip`: caller should NOT preventDefault. Includes paste/drop (handled by the * dedicated paste listener) and any unrecognized inputType. */ export type BeforeInputResult = { type: 'handled'; formatted: string; raw: string; cursorPos: number; } | { type: 'reject'; } | { type: 'skip'; }; /** * Computes the formatted value, raw value, and target cursor position for a * `beforeinput` event without mutating the input or the event. * * Callers are responsible for `preventDefault()` and applying the result to the DOM. * * @param e - The InputEvent (beforeinput) * @param decimalMaxLength - The maximum number of decimal places allowed * @param formattingOptions - Optional formatting options * @returns A tagged result describing what the caller should do */ export declare function handleOnBeforeInputNumoraInput(e: InputEvent, decimalMaxLength: number, formattingOptions?: FormattingOptions): BeforeInputResult; /** * Skips the cursor over thousand separators on Delete/Backspace and returns the caret * info the change handler needs to disambiguate Delete-forward (`endOffset: 1`) from * Backspace or non-deletion keys (`endOffset: 0`). Returns undefined for keys that * aren't Delete/Backspace so the caller can null out the stored caret info. */ export declare function handleOnKeyDownNumoraInput(e: KeyboardEvent, formattingOptions?: FormattingOptions): CaretPositionInfo | undefined; /** * Outcome of `handleOnPasteNumoraInput`. The caller always calls preventDefault on the * paste event; the variant says whether to apply a write or leave the input untouched. * * - `handled`: write `formatted` via an undo-preserving write, set caret to `cursorPos`. * - `reject`: do nothing further (input is unchanged). */ export type PasteResult = { type: 'handled'; formatted: string; raw: string; cursorPos: number; } | { type: 'reject'; }; /** * Computes the formatted value and cursor position for a paste event without mutating * the input or the event. The caller owns `preventDefault()` and the DOM write. */ export declare function handleOnPasteNumoraInput(e: ClipboardEvent, decimalMaxLength: number, formattingOptions?: FormattingOptions): PasteResult;