import { Errors, FieldPath, FormMode, UseFormStateHook } from './useFormState'; export type UseFormErrorsOptions = { /** * The form state hook. */ formState: UseFormStateHook; /** * The form mode. */ mode: FormMode; }; export type UseFormErrorsHook = { /** * Clears errors for given paths or all errors. * @param paths * @param options */ clearErrors(paths?: FieldPath[], options?: { forceUpdate?: boolean; }): void; /** * Returns the error of a path. * @param path */ getError(path: FieldPath): Errors[FieldPath]; /** * Returns all errors. */ getErrors(): Errors; /** * Returns the initial error of a field. */ getInitialError(path: FieldPath): E | undefined; /** * Returns the initial errors. */ getInitialErrors(): Errors; /** * Restores all initial errors or only for given paths. * @param paths * @param options */ resetErrors(paths?: FieldPath[], options?: { forceUpdate?: boolean; }): void; /** * Sets the error of a path. * @param path * @param error * @param options */ setError(path: FieldPath, error: E | undefined, options?: { forceUpdate?: boolean; }): void; /** * Sets errors for given paths or all errors. * @param errors * @param opts */ setErrors(errors: Partial>, opts?: { forceUpdate?: boolean; partial?: boolean; }): void; }; /** * Returns errors that are not null, undefined or false. * @param errors */ export declare function filterErrors(errors?: Errors): Errors; declare function useFormErrors(options: UseFormErrorsOptions): UseFormErrorsHook; export default useFormErrors; //# sourceMappingURL=useFormErrors.d.ts.map