import { type Ref } from 'react'; /** * Puts `next` into an input as typing would: through the native setter, so * React sees a change, then an `input` event, so state that follows the * field (TextInput's clear button, EmailInput's check) stays in step. * Returns false when there is no input or it already holds `next`. */ export declare function writeInputValue(node: HTMLInputElement | null, next: string): boolean; export interface StateBackedInput { /** For the field's ``. Also sets the `ref` passed to the hook. */ ref: (node: HTMLInputElement | null) => void; /** Wrap the field's change handler, always. It drops the changes the * writes made here cause, and after each edit checks the field against * the state, so an edit the state refuses or rewrites is put back. */ quiet: (handler?: (...args: A) => void) => (...args: A) => void; } /** * For a field whose text the kit keeps in its own state. * * React copies a controlled input's value into its `value` attribute, where * a copied outerHTML or a session replay can read it. TextInput and * TextArea now avoid this for a controlled `value` themselves (useDomValue), * so a field passed straight to them does not need this hook. Give the * field this `ref` and no `value` or `defaultValue`: the input stays * uncontrolled and the state is written to its `value` property, on mount * and whenever the two differ. The attribute never holds the text, not * even the text a field had when it mounted again. An edit the state * refuses or rewrites is put back, as React does, but never in the middle * of an IME composition. `ref` must keep the same identity. */ export declare function useStateBackedInput(value: string, ref?: Ref): StateBackedInput; //# sourceMappingURL=use-state-backed-input.d.ts.map