import { BaseSyntheticEvent } from 'react'; import { FieldValues, SubmitHandler, UseFormProps } from 'react-hook-form'; import { RaRecord } from '../types'; import { SaveHandler } from '../controller'; import { ValidateForm } from './validation/getSimpleValidationResolver'; /** * Wrapper around react-hook-form's useForm * * This hook adds the following features to react-hook-form's useForm: * * - form initialization based on RecordContext * - validation based on a validate function * - sanitization of empty values * - notification on invalid form * - stop form submission event propagation */ export declare const useAugmentedForm: (props: UseAugmentedFormProps) => { form: import("react-hook-form").UseFormReturn; handleSubmit: (values: any, event: any) => Promise; formHandleSubmit: (event: BaseSyntheticEvent) => void; }; export type UseAugmentedFormProps = UseFormOwnProps & Omit & { validate?: ValidateForm; }; export interface UseFormOwnProps { defaultValues?: any; formRootPathname?: string; record?: Partial; onSubmit?: SubmitHandler | SaveHandler; sanitizeEmptyValues?: boolean; disableInvalidFormNotification?: boolean; } //# sourceMappingURL=useAugmentedForm.d.ts.map