import { FieldValues, Resolver } from 'react-hook-form'; /** * Convert a simple validation function that returns an object matching the form shape with errors * to a validation resolver compatible with react-hook-form. * * @example * const validate = (values: { username: string }) => { * if (values.username == null || values.username.trim() === '') { * return { username: 'Required' }; * } * }; * * const validationResolver = getSimpleValidationResolver(validate); * * const UserForm = () => ( *
* * * ); */ export declare const getSimpleValidationResolver: (validate: ValidateForm) => Resolver; export type ValidateForm = (data: TFieldValues) => Partial> | undefined | Promise> | undefined>; //# sourceMappingURL=getSimpleValidationResolver.d.ts.map