import { type ValidationState } from '../../validation/types.js'; import type { FormControlValidator } from '../form.types.js'; /** * Options for `useFormRegistration`. * @internal */ export interface FormRegistrationOptions { /** Logical form-control id — matches the input's `id`. */ id: string; /** Submit key; the form snapshot keys values by `name ?? id`. */ name?: string; /** * Associates with a `
` by id when the control is rendered outside the * form's React subtree (mirrors the native `form="…"` attribute). */ form?: string; /** * The underlying input element, reserved for a11y / focus wiring. Accepted * now so the contract is stable; the runtime does not yet consume it — the * focus/blur wiring that reads it lands with APPDEV-17909. */ inputElement?: HTMLElement | null; /** Focuses the control on error (focus-first-invalid). */ focus: () => void; /** Reads the control's current value. */ getValue: () => TValue; /** Optional per-control validator. */ validate?: FormControlValidator; } /** * Registers a custom (non-Strato) control with the enclosing `` so it * participates in submit, validation, snapshot, and focus-first-invalid. Strato * controls do not call this directly — they register through `FormField`. * * Returns a `reportValidity` for controls that want to push live validity * between submits; ignoring it is fine — the form pulls each control on submit. * @internal */ export declare function useFormRegistration(options: FormRegistrationOptions): (state: ValidationState) => void; //# sourceMappingURL=useFormRegistration.d.ts.map