@openapi-qraft/react
Version:
OpenAPI client for React, providing type-safe requests and dynamic TanStack Query React Hooks via a modular, Proxy-based architecture.
12 lines • 1.03 kB
TypeScript
import type { QueryClient } from '@tanstack/react-query';
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
import type { OperationSchema } from './requestFn.js';
/**
* Calls a query client method with parameters and options,
* and automatically composes the `QueryKey` based on the schema and parameters.
*/
export declare function callQueryClientMethodWithQueryKey<QFMethod extends QueryKeyMethods>(qraftOptions: CreateAPIQueryClientOptions, queryClientMethod: QFMethod, schema: OperationSchema, infinite: boolean, args: [...Parameters<(typeof QueryClient.prototype)[QFMethod]>, QueryClient]): ReturnType<(typeof QueryClient.prototype)[QFMethod]>;
type QueryKeyMethod<QFMethod extends keyof typeof QueryClient.prototype> = QFMethod;
type QueryKeyMethods = QueryKeyMethod<'setQueryData'> | QueryKeyMethod<'getQueryData'> | QueryKeyMethod<'getQueryState'> | QueryKeyMethod<'setQueryDefaults'> | QueryKeyMethod<'getQueryDefaults'>;
export {};
//# sourceMappingURL=callQueryClientMethodWithQueryKey.d.ts.map