36 lines
1.6 KiB
TypeScript
36 lines
1.6 KiB
TypeScript
// This file is auto-generated by @hey-api/openapi-ts
|
|
|
|
import { createClientConfig } from '@/ hey-api-config';
|
|
|
|
import { type ClientOptions, type ClientOptions as ClientOptions3, type Config, type Config as Config2, createClient, createClient as createClient2, createConfig, createConfig as createConfig2 } from './client';
|
|
import type { ClientOptions as ClientOptions2 } from './types.gen';
|
|
|
|
/**
|
|
* The `createClientConfig()` function will be called on client initialization
|
|
* and the returned object will become the client's initial configuration.
|
|
*
|
|
* You may want to initialize your client this way instead of calling
|
|
* `setConfig()`. This is useful for example if you're using Next.js
|
|
* to ensure your client always has the correct values.
|
|
*/
|
|
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
|
|
|
|
export const client = createClient(createConfig<ClientOptions2>({
|
|
baseURL: '/api'
|
|
}));
|
|
|
|
/**
|
|
* The `createClientConfig()` function will be called on client initialization
|
|
* and the returned object will become the client's initial configuration.
|
|
*
|
|
* You may want to initialize your client this way instead of calling
|
|
* `setConfig()`. This is useful for example if you're using Next.js
|
|
* to ensure your client always has the correct values.
|
|
*/
|
|
export type CreateClientConfig2<T extends ClientOptions3 = ClientOptions2> = (override?: Config2<ClientOptions3 & T>) => Config2<Required<ClientOptions3> & T>;
|
|
|
|
export const client2 = createClient2(createClientConfig(createConfig2<ClientOptions2>({
|
|
baseURL: '/api'
|
|
})));
|
|
|