import { FieldPath, FormMode, ModifiedState, TouchedState, UseFormStateHook, Values } from './useFormState'; export type UseFormStatusOptions = { /** * Update the form when it is modified or touched (happens only at the form level). */ forceUpdateOnStatusChange?: boolean; /** * The form state hook. */ formState: UseFormStateHook; /** * The form mode. */ mode: FormMode; }; export type UseFormStatusHook = { /** * Clears the modified state of given paths or all paths. * @param paths * @param options */ clearModifiedFields(paths?: FieldPath[], options?: { forceUpdate?: boolean; }): void; /** * Clears the touched state of given paths or all paths. * @param paths * @param options */ clearTouchedFields(paths?: FieldPath[], options?: { forceUpdate?: boolean; }): void; /** * Returns modified fields. */ getModifiedFields(): ModifiedState; /** * Returns modified fields. */ getTouchedFields(): TouchedState; /** * Tells if the field was modified else the form if no path is passed. * @param path */ isModified(path?: FieldPath): boolean; /** * Tells if the field was touched else the form if no path is passed. * @param path */ isTouched(path?: FieldPath): boolean; /** * Resets the modified state of given paths or all paths. * @param paths * @param options */ resetModifiedFields(paths?: FieldPath[], options?: { forceUpdate?: boolean; }): void; /** * Resets the touched state of given paths or all paths. * @param paths * @param options */ resetTouchedFields(paths?: FieldPath[], options?: { forceUpdate?: boolean; }): void; /** * Sets the modified state of a path. * @param path * @param value * @param options */ setModifiedField(path: FieldPath, value: boolean, options?: { forceUpdate?: boolean; }): void; /** * Sets the modified state for given paths or all paths. * @param values * @param options */ setModifiedFields(values: ModifiedState, options?: { forceUpdate?: boolean; partial?: boolean; }): void; /** * Sets the touched state of a path. * @param path * @param value * @param options */ setTouchedField(path: FieldPath, value: boolean, options?: { forceUpdate?: boolean; }): void; /** * Sets the touched state for given paths or all paths. * @param values * @param options */ setTouchedFields(values: TouchedState, options?: { forceUpdate?: boolean; partial?: boolean; }): void; }; declare function useFormStatus(options: UseFormStatusOptions): UseFormStatusHook; export default useFormStatus; //# sourceMappingURL=useFormStatus.d.ts.map