import { type ChangeEvent, type FocusEvent, type Ref, type RefObject } from "react"; export interface UseCanonicalInputEmitterInput { /** External ref forwarded by the consumer. Forwarded to the underlying ``. */ ref: Ref | undefined; /** Consumer's `onChange`. Invoked with synthetic events whose `target.value` is canonical. */ onChange: ((event: ChangeEvent) => void) | undefined; /** Consumer's `onBlur`. Invoked with synthetic events whose `target.value` is canonical. */ onBlur: ((event: FocusEvent) => void) | undefined; /** The locale-formatted display string the underlying `` should always show. */ resolvedValue: string; } export interface CanonicalInputEmitter { /** Internal ref to the underlying `` element. */ inputRef: RefObject; /** Ref-callback to attach to the underlying ``; also forwards to the external `ref`. */ setInputRef: (node: HTMLInputElement | null) => void; /** Builds (without emitting) a synthetic change event with a given value. */ createInputChangeEvent: (value: string, sourceInput: HTMLInputElement | null) => ChangeEvent; /** Builds (without emitting) a synthetic blur event with a given value. */ createInputBlurEvent: (value: string, sourceInput: HTMLInputElement | null) => FocusEvent; /** Mutates the input DOM value to `canonicalValue` and emits a synthetic change event. */ emitCanonicalValueChange: (canonicalValue: string) => void; /** * Mutates the input DOM value to `canonicalValue`, emits a synthetic blur event, then * resyncs the DOM value back to `resolvedValue` (the locale-formatted display value). */ emitCanonicalValueBlur: (canonicalValue: string) => void; } /** * Owns the underlying `` ref, ref forwarding, the DOM-value sync layout effect, and the * synthetic change/blur emitters used to surface the canonical (ISO) value to consumers while * the displayed input value remains in the locale-specific format. * * The dual format is the reason this hook exists at all: the rendered `value` is locale-formatted * (e.g. `15/03/2025`) but `e.target.value` on `onChange`/`onBlur` should be canonical ISO * (`2025-03-15`). The synthetic events carry the canonical value, and the layout effect ensures * the DOM value is reconciled back to the display string on the next paint. */ export declare const useCanonicalInputEmitter: ({ ref, onChange, onBlur, resolvedValue, }: UseCanonicalInputEmitterInput) => CanonicalInputEmitter;