|
3 | 3 | * Do not make direct changes to the file.
|
4 | 4 | */
|
5 | 5 |
|
6 |
| -import { qraftAPIClient, type APIBasicClientServices, type APIBasicQueryClientServices, type APIUtilityClientServices, type CreateAPIBasicQueryClientOptions, type CreateAPIBasicClientOptions, type CreateAPIClientOptions, type CreateAPIQueryClientOptions } from "@openapi-qraft/react"; |
7 |
| -import * as callbacks from "@openapi-qraft/react/callbacks/index"; |
8 |
| -import { services, type Services } from "./services/index.js"; |
9 |
| -export function createAPIClient(options: CreateAPIQueryClientOptions): Services; |
10 |
| -export function createAPIClient(options: CreateAPIBasicQueryClientOptions): APIBasicQueryClientServices<Services, ServiceMethods>; |
11 |
| -export function createAPIClient(options: CreateAPIBasicClientOptions): APIBasicClientServices<Services, ServiceMethods>; |
12 |
| -export function createAPIClient(): APIUtilityClientServices<Services, ServiceMethods>; |
13 |
| -export function createAPIClient(options?: CreateAPIClientOptions): Services | APIBasicClientServices<Services, ServiceMethods> | APIUtilityClientServices<Services, ServiceMethods> { |
| 6 | +import type { APIBasicClientServices, APIBasicQueryClientServices, APIDefaultQueryClientServices, APIUtilityClientServices, CreateAPIBasicClientOptions, CreateAPIBasicQueryClientOptions, CreateAPIClientOptions, CreateAPIQueryClientOptions } from "@openapi-qraft/react"; |
| 7 | +import * as allCallbacks from "@openapi-qraft/react/callbacks/index"; |
| 8 | +import { qraftAPIClient } from "@openapi-qraft/react"; |
| 9 | +import { services } from "./services/index.js"; |
| 10 | +export function createAPIClient(options: CreateAPIQueryClientOptions): APIDefaultQueryClientServices<Services>; |
| 11 | +export function createAPIClient(options: CreateAPIBasicQueryClientOptions): APIBasicQueryClientServices<Services, AllCallbacks>; |
| 12 | +export function createAPIClient(options: CreateAPIBasicClientOptions): APIBasicClientServices<Services, AllCallbacks>; |
| 13 | +export function createAPIClient(): APIUtilityClientServices<Services, AllCallbacks>; |
| 14 | +export function createAPIClient(options?: CreateAPIClientOptions): APIDefaultQueryClientServices<Services> | APIBasicQueryClientServices<Services, AllCallbacks> | APIBasicClientServices<Services, AllCallbacks> | APIUtilityClientServices<Services, AllCallbacks> { |
14 | 15 | if (!options)
|
15 |
| - return qraftAPIClient<Services, ServiceMethods>(services, callbacks); |
| 16 | + return qraftAPIClient(services, allCallbacks); |
16 | 17 | if ("requestFn" in options)
|
17 |
| - return qraftAPIClient<Services, ServiceMethods>(services, callbacks, options); |
18 |
| - return qraftAPIClient<Services, ServiceMethods>(services, callbacks, options); |
| 18 | + return qraftAPIClient(services, allCallbacks, options); |
| 19 | + if ("queryClient" in options) |
| 20 | + return qraftAPIClient(services, allCallbacks, options); |
| 21 | + return qraftAPIClient(services, allCallbacks); |
19 | 22 | }
|
20 |
| -type ServiceMethods = typeof callbacks; |
| 23 | +type AllCallbacks = typeof allCallbacks; |
| 24 | +type Services = typeof services; |
0 commit comments