fork of hey-api/openapi-ts because I need some additional things

Merge pull request #610 from hey-api/fix/client-beta-1

fix: export Client interface

authored by

Lubos and committed by
GitHub
0ac94017 037fb5c3

+12 -7
+5
.changeset/rich-grapes-matter.md
··· 1 + --- 2 + '@hey-api/client-fetch': patch 3 + --- 4 + 5 + fix: export Client interface
+3 -3
packages/client-fetch/src/index.ts
··· 1 - import type { Config, FetchClient, RequestOptions } from './types'; 1 + import type { Client, Config, RequestOptions } from './types'; 2 2 import { 3 3 createDefaultConfig, 4 4 createInterceptors, ··· 21 21 RequestOptions 22 22 >(); 23 23 24 - export const createClient = (config: Config): FetchClient => { 24 + export const createClient = (config: Config): Client => { 25 25 const defaultConfig = createDefaultConfig(); 26 26 const _config = { ...defaultConfig, ...config }; 27 27 ··· 41 41 : createInterceptors<Request, Response, RequestOptions>(); 42 42 43 43 // @ts-ignore 44 - const request: FetchClient['request'] = async (options) => { 44 + const request: Client['request'] = async (options) => { 45 45 const config = getConfig(); 46 46 47 47 const opts: RequestOptions = {
+1 -1
packages/client-fetch/src/node/index.ts
··· 1 1 export { client, createClient } from '../'; 2 - export type { Options } from '../types'; 2 + export type { Client, Options } from '../types'; 3 3 export { formDataBodySerializer, jsonBodySerializer } from '../utils';
+3 -3
packages/client-fetch/src/types.ts
··· 110 110 options: RequestOptionsBase & Pick<Required<RequestOptionsBase>, 'method'>, 111 111 ) => RequestResult<Data, Error>; 112 112 113 - interface Client<Request = unknown, Response = unknown, Options = unknown> { 113 + interface ClientBase<Request = unknown, Response = unknown, Options = unknown> { 114 114 connect: MethodFn; 115 115 delete: MethodFn; 116 116 get: MethodFn; ··· 130 130 headers: Headers; 131 131 }; 132 132 133 - export type FetchClient = Client<Request, Response, RequestOptions>; 133 + export type Client = ClientBase<Request, Response, RequestOptions>; 134 134 135 135 type OptionsBase = Omit<RequestOptionsBase, 'url'> & { 136 136 /** ··· 138 138 * individual options. This might be also useful if you want to implement a 139 139 * custom client. 140 140 */ 141 - client?: FetchClient; 141 + client?: Client; 142 142 }; 143 143 144 144 export type Options<T = unknown> = T extends { body: any; headers: any }