import { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; import { BaseRecord, BaseKey, UpdateResponse, MutationMode, PrevContext as UpdateContext, HttpError, SuccessErrorNotification, MetaDataQuery, IQueryKeys } from "../../interfaces"; export declare type UpdateParams = { /** * Resource name for API data interactions */ resource: string; /** * id for mutation function */ id: BaseKey; /** * [Determines when mutations are executed](/advanced-tutorials/mutation-mode.md) */ mutationMode?: MutationMode; /** * Duration to wait before executing the mutation when `mutationMode = "undoable"` */ undoableTimeout?: number; /** * Callback that runs when undo button is clicked on `mutationMode = "undoable"` */ onCancel?: (cancelMutation: () => void) => void; /** * Values for mutation function */ values: TVariables; /** * Metadata query for `dataProvider`, */ metaData?: MetaDataQuery; /** * If there is more than one `dataProvider`, you should use the `dataProviderName` that you will use. * @default "default" */ dataProviderName?: string; /** * You can use it to manage the invalidations that will occur at the end of the mutation. */ invalidates?: Array; } & SuccessErrorNotification; export declare type UseUpdateReturnType = UseMutationResult, TError, UpdateParams, UpdateContext>; export declare type UseUpdateProps = { mutationOptions?: Omit, TError, UpdateParams, UpdateContext>, "mutationFn" | "onError" | "onSuccess" | "onSettled" | "onMutate">; }; /** * `useUpdate` is a modified version of `react-query`'s {@link https://react-query.tanstack.com/reference/useMutation `useMutation`} for update mutations. * * It uses `update` method as mutation function from the `dataProvider` which is passed to ``. * * @see {@link https://refine.dev/docs/api-references/hooks/data/useUpdate} 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 mutation function * */ export declare const useUpdate: ({ mutationOptions, }?: UseUpdateProps) => UseUpdateReturnType; //# sourceMappingURL=useUpdate.d.ts.map