@eleven-am/xquery
Version:
XQuery is a sophisticated TypeScript wrapper for TanStack React Query, designed to enhance developer productivity with OpenAPI-generated clients. It enables developers to build and execute queries using fully type-safe factories instead of managing query
8 lines (7 loc) • 1.11 kB
TypeScript
import { ActionRecord, InferActionRecord, InferInfiniteRecord, InferMutationRecord, InferQueryRecord, InfiniteRecord, QueryFactoryOptions, QueryRecord, MutationRecord } from "./types";
export declare function queryFactory<TClient, TError>({ clientGetter, mapResponse, mapQueryKey, queryClientGetter }: QueryFactoryOptions<TClient, TError>): {
createQueries: <TNamespace extends string, TRecord extends QueryRecord<TClient, TError>>(namespace: TNamespace, definition: TRecord) => InferQueryRecord<TRecord, TNamespace, TClient, TError>;
createMutations: <TRecord extends MutationRecord<TClient, TError_1>, TError_1>(definition: TRecord) => InferMutationRecord<TRecord, TClient, TError_1>;
createActions: <TNamespace extends string, TRecord extends ActionRecord<TClient, TError>>(namespace: TNamespace, definition: TRecord) => InferActionRecord<TRecord, TNamespace, TClient, TError>;
createInfiniteQueries: <TNamespace extends string, TRecord extends InfiniteRecord<TClient, TError>>(namespace: TNamespace, definition: TRecord) => InferInfiniteRecord<TNamespace, TRecord, TClient, TError>;
};