import type { ValidationMode, ValidationState } from '../../validation/types.js'; import type { ValidateFieldOptions } from '../form.types.js'; import type { FormRuntime } from '../runtime/createFormRuntime.js'; /** * Options for `useValidationMode`. * @internal */ export interface ValidationModeOptions { /** * The control's own setting. Overrides the enclosing `
`'s. */ validationMode: ValidationMode | undefined; /** * The id of the `` the control is associated with through its `form` * prop. Not set for a control inside a `` or without one. */ formId: string | undefined; /** * The runtime of the `` the control registers with, if resolved. */ runtime: FormRuntime | undefined; /** * The validation the `` runs on submit. */ validateField: (options: ValidateFieldOptions) => Promise; /** * Reports the mount result to the enclosing ``. `validateField` does * not, because on submit the `` reads its return value instead. */ reportValidity: (state: ValidationState) => void; } /** * Resolves a control's `validationMode` (the control's own setting, then the * enclosing ``'s, then `'auto'`). When it reveals on mount, the control * is validated with `reveal` and `trigger: 'initial'` on mount, the same way a * submit validates it. * * Returns the mode the control resolved on mount, or `undefined` while the * `form` it is associated with has not registered yet. `resetValidation` does * not reveal again. * @internal */ export declare function useValidationMode(options: ValidationModeOptions): { resolvedValidationMode: ValidationMode | undefined; }; //# sourceMappingURL=useValidationMode.d.ts.map