import { MutateMethod, MutateState } from "./Mutate"; import { Omit, UseGetProps } from "./useGet"; export interface UseMutateProps extends Omit, "lazy" | "debounce" | "mock"> { /** * What HTTP verb are we using? */ verb: "POST" | "PUT" | "PATCH" | "DELETE"; /** * Callback called after the mutation is done. * * @param body - Body given to mutate * @param data - Response data */ onMutate?: (body: TRequestBody, data: TData) => void; /** * Developer mode * Override the state with some mocks values and avoid to fetch */ mock?: { mutate?: MutateMethod; loading?: boolean; }; /** * A function to encode body of DELETE requests when appending it * to an existing path */ pathInlineBodyEncode?: typeof encodeURIComponent; } export interface UseMutateReturn extends MutateState { /** * Cancel the current fetch */ cancel: () => void; /** * Call the mutate endpoint */ mutate: MutateMethod; } export declare function useMutate(props: UseMutateProps): UseMutateReturn; export declare function useMutate(verb: UseMutateProps["verb"], path: UseMutateProps["path"], props?: Omit, "path" | "verb">): UseMutateReturn; //# sourceMappingURL=useMutate.d.ts.map