import { FormHelpers } from "./formHelpers.js"; import { ObjectValidationOptions, UserInput, ValidatorMap } from "../validation/index.js"; interface FormValidationConfig { validators: ValidatorMap; options: ObjectValidationOptions; } export interface LocalFormState extends FormHelpers { /** * The form validation config. */ validationConfig: FormValidationConfig; /** * The form state. */ state: UserInput; /** * Description of necessity for the form fields. Are they required or optional, or a mix? * If mixed, are optional or required fields marked? */ necessityText: string; /** * Make all errors visible, regardless of the field's touch state. */ showAllErrors: () => void; /** * Reset the whole form or a subset */ reset: (...fields: Array) => void; } /** * Hook for handling form data and validation in local state * @param initialState The initial form state * @param validators {@link ValidatorMap} describing validators for the form's fields * @param validationOptions Optional {@link ObjectValidationOptions} for the form to override default behaviour * @returns A {@link LocalFormState} object with the state and helper functions. */ export declare function useLocalFormState(initialState: T, validators: ValidatorMap, validationOptions?: Partial): LocalFormState; export {}; //# sourceMappingURL=useLocalFormState.d.ts.map