import type { ValidationState } from '../../validation/types.js'; import type { ValidateFieldOptions } from '../form.types.js'; /** * The control-provided contract, with callbacks read live so registration * stays stable across renders. * @internal */ export interface FormRuntimeRegistrationOptions { /** Logical form-control id. */ id: string; /** Submit key; snapshot values are keyed by `name ?? id`. */ name?: string; /** Associates with a `
` by id when rendered outside its subtree. */ form?: string; /** Reads the control's current value. */ getValue: () => unknown; /** Focuses the control (focus-first-invalid). */ focus: () => void; /** Runs the control's own validation and resolves with its state. */ validateField: (options: ValidateFieldOptions) => Promise; /** Clears form-managed visual validation state while keeping the value. */ resetValidation?: () => void; } /** * The shared registration primitive behind `useFormRegistration` * (public, custom controls) and `useInternalFormRegistration` (internal, Strato * controls). Resolves the enclosing runtime — from context, or by `form` id for * out-of-subtree controls — registers once, and keeps the descriptor callbacks * live via refs so a re-render never re-registers. * * Returns a `reportValidity` that pushes live validity between submits, or * `undefined` when there is no form to register with (standalone control). * @internal */ export declare function useFormRuntimeRegistration(options: FormRuntimeRegistrationOptions): ((state: ValidationState) => void) | undefined; //# sourceMappingURL=useFormRuntimeRegistration.d.ts.map