UNPKG

react-hook-form-storage

Version:

A TypeScript library for React Hook Form persist functionality

8 lines (7 loc) 448 B
import type { FieldValues, UseFormReturn } from 'react-hook-form'; import { UseFormStorageOptions } from './types'; export declare const useFormStorage: <T extends FieldValues>(key: string, form: UseFormReturn<T>, { storage, included, excluded, onRestore, onSave, debounce, dirty, touched, validate, serializer, autoSave, }?: UseFormStorageOptions<T>) => { isRestored: boolean; save: () => Promise<void>; clear: () => Promise<void>; };