import { type FormInstance, type FormProps, type ButtonProps } from "antd"; import { useForm as useFormSF, type UseFormConfig } from "sunflower-antd"; import { type AutoSaveProps, type HttpError, type BaseRecord, type UseFormReturnType as UseFormReturnTypeCore, type UseFormProps as UseFormPropsCore, type CreateResponse, type UpdateResponse } from "@refinedev/core"; export type UseFormProps = UseFormPropsCore & { submitOnEnter?: boolean; /** * Shows notification when unsaved changes exist */ warnWhenUnsavedChanges?: boolean; /** * Disables server-side validation * @default false * @see {@link https://refine.dev/docs/advanced-tutorials/forms/server-side-form-validation/} */ disableServerSideValidation?: boolean; } & AutoSaveProps & Pick; export type UseFormReturnType = UseFormReturnTypeCore & { form: FormInstance; formProps: FormProps; saveButtonProps: ButtonProps & { onClick: () => void; }; onFinish: (values?: TVariables) => Promise | UpdateResponse | void>; } & Pick>, "defaultFormValuesLoading">; /** * `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-reference/core/hooks/useForm} for more details. * * @typeParam TData - Result data of the query extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences#baserecord `BaseRecord`} * @typeParam TError - Custom error object that extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences/#httperror `HttpError`} * @typeParam TVariables - Values for params. default `{}` * @typeParam TData - Result data returned by the `select` function. Extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences#baserecord `BaseRecord`}. Defaults to `TQueryFnData` * @typeParam TResponse - Result data returned by the mutation function. Extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences#baserecord `BaseRecord`}. Defaults to `TData` * @typeParam TResponseError - Custom error object that extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences#httperror `HttpError`}. Defaults to `TError` * * */ export declare const useForm: ({ action, resource, onMutationSuccess: onMutationSuccessProp, onMutationError: onMutationErrorProp, autoSave, submitOnEnter, warnWhenUnsavedChanges: warnWhenUnsavedChangesProp, redirect, successNotification, errorNotification, meta, queryMeta, mutationMeta, liveMode, liveParams, mutationMode, dataProviderName, onLiveEvent, invalidates, undoableTimeout, queryOptions, createMutationOptions, updateMutationOptions, id: idFromProps, overtimeOptions, optimisticUpdateMap, defaultFormValues, disableServerSideValidation: disableServerSideValidationProp, }?: UseFormProps) => UseFormReturnType; //# sourceMappingURL=useForm.d.ts.map