import { type UseMutationOptions } from "@tanstack/react-query"; import type { BaseRecord, CreateResponse, HttpError, IQueryKeys, MetaQuery } from "../../contexts/data/types"; import type { UseMutationResult } from "../../definitions/types"; import type { SuccessErrorNotification } from "../../contexts/notification/types"; import { type UseLoadingOvertimeOptionsProps, type UseLoadingOvertimeReturnType } from "../useLoadingOvertime"; export type UseCreateParams = { /** * Resource name for API data interactions */ resource?: string; /** * Values for mutation function */ values?: TVariables; /** * Meta data for `dataProvider` */ meta?: MetaQuery; /** * Meta data for `dataProvider` /** * If there is more than one `dataProvider`, you should use the `dataProviderName` that you will use. */ dataProviderName?: string; /** * You can use it to manage the invalidations that will occur at the end of the mutation. */ invalidates?: Array; } & SuccessErrorNotification, TError, TVariables>; export type UseCreateReturnType = UseMutationResult, TError, UseCreateParams, unknown>; export type UseCreateProps = { mutationOptions?: Omit, TError, UseCreateParams, unknown>, "mutationFn">; } & UseLoadingOvertimeOptionsProps & UseCreateParams; /** * `useCreate` is a modified version of `react-query`'s {@link https://tanstack.com/query/v5/docs/framework/react/reference/useMutation `useMutation`} for create mutations. * * It uses `create` method as mutation function from the `dataProvider` which is passed to ``. * * @see {@link https://refine.dev/docs/api-reference/core/hooks/data/useCreate} 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 mutation function * */ export declare const useCreate: ({ resource: resourceFromProps, values: valuesFromProps, dataProviderName: dataProviderNameFromProps, successNotification: successNotificationFromProps, errorNotification: errorNotificationFromProps, invalidates: invalidatesFromProps, meta: metaFromProps, mutationOptions, overtimeOptions, }?: UseCreateProps) => UseCreateReturnType & UseLoadingOvertimeReturnType; //# sourceMappingURL=useCreate.d.ts.map