import { FormInstance, FormProps } from "antd"; import { HttpError, BaseRecord, UseFormReturnType as UseFormReturnTypeCore, UseFormProps as UseFormPropsCore, CreateResponse, UpdateResponse } from "@pankod/refine-core"; import { ButtonProps } from "../../components/antd"; export declare type UseFormProps = UseFormPropsCore & { submitOnEnter?: boolean; /** * Shows notification when unsaved changes exist */ warnWhenUnsavedChanges?: boolean; }; export declare type UseFormReturnType = UseFormReturnTypeCore & { form: FormInstance; formProps: FormProps; saveButtonProps: ButtonProps & { onClick: () => void; }; onFinish: (values?: TVariables) => Promise | UpdateResponse | void>; }; /** * `useForm` is used to manage forms. It uses Ant Design {@link https://ant.design/components/form/ Form} data scope management under the hood and returns the required props for managing the form actions. * * @see {@link https://refine.dev/docs/api-references/hooks/form/useForm} for more details. * * @typeParam TData - Result data of the query extends {@link https://refine.dev/docs/api-references/interfaceReferences#baserecord `BaseRecord`} * @typeParam TError - Custom error object that extends {@link https://refine.dev/docs/api-references/interfaceReferences#httperror `HttpError`} * @typeParam TVariables - Values for params. default `{}` * * */ export declare const useForm: ({ action, resource, onMutationSuccess: onMutationSuccessProp, onMutationError, submitOnEnter, warnWhenUnsavedChanges: warnWhenUnsavedChangesProp, redirect, successNotification, errorNotification, metaData, liveMode, liveParams, mutationMode, dataProviderName, onLiveEvent, invalidates, undoableTimeout, queryOptions, createMutationOptions, updateMutationOptions, id: idFromProps, }?: UseFormProps) => UseFormReturnType; //# sourceMappingURL=useForm.d.ts.map