fork of hey-api/openapi-ts because I need some additional things
1import {
2 type Client,
3 clientDefaultConfig,
4 clientDefaultMeta,
5 clientPluginHandler,
6 type DefinePlugin,
7 definePluginConfig,
8} from '@hey-api/openapi-ts';
9
10export type Config = Client.Config & {
11 /**
12 * Plugin name. Must be unique.
13 */
14 name: '@hey-api/custom-client';
15};
16
17export type CustomClientPlugin = DefinePlugin<Config, Config>;
18
19export const defaultConfig: CustomClientPlugin['Config'] = {
20 ...clientDefaultMeta,
21 config: {
22 ...clientDefaultConfig,
23 bundle: false,
24 },
25 handler: clientPluginHandler as unknown as CustomClientPlugin['Handler'],
26 name: '@hey-api/custom-client',
27};
28
29/**
30 * Type helper for `@hey-api/custom-client` plugin, returns {@link Plugin.Config} object
31 */
32export const customClientPlugin = definePluginConfig(defaultConfig);