mantine-entity
Version:
A library combining Mantine, TanStack Query, and Mantine React Table for efficient entity management
18 lines (17 loc) • 928 B
TypeScript
import { QueryKey, UseMutationOptions } from "@tanstack/react-query";
interface MutationParams<TArgs> {
url: string;
method: "GET" | "POST" | "PUT" | "DELETE";
body?: TArgs;
headers?: HeadersInit;
}
interface UseMutationParams<TResponse, TArgs> {
mutationParams: MutationParams<TArgs>;
invalidateTags?: QueryKey;
options?: UseMutationOptions<TResponse, unknown, TArgs, unknown>;
httpPost<TResponse, TArgs>(url: string, options?: TArgs | undefined): Promise<TResponse>;
httpPut<TResponse, TArgs>(url: string, options?: TArgs | undefined): Promise<TResponse>;
httpDelete<TResponse>(url: string): Promise<TResponse>;
}
export declare function useMutationQuery<TResponse, TArgs>({ mutationParams, invalidateTags, options, httpDelete, httpPost, httpPut, }: UseMutationParams<TResponse, TArgs>): import("@tanstack/react-query").UseMutationResult<TResponse, unknown, TArgs, unknown>;
export {};