import { $Fetch, FetchOptions } from "ofetch"; //#region src/client.d.ts type Fn = (...args: any[]) => T; type HandlerExtension = Fn; type MethodsExtension = Record; type ApiExtension = HandlerExtension | MethodsExtension; type HandlerExtensionBuilder = (client: ApiClient) => HandlerExtension; type MethodsExtensionBuilder = (client: ApiClient) => MethodsExtension; /** Fetch options where `baseURL` keeps the literal type `createClient` inferred, rather than widening to `string`. */ type ClientOptions = Omit & { baseURL?: BaseURL; }; interface ClientFactoryOptions { /** * Fetch every extension of the client issues its requests through. Defaults to an * `ofetch` instance built from `defaultOptions`, which is also what applies them – a * fetch given here is asked for the request as it stands and owns its own options. */ fetch?: $Fetch; } interface ApiClient extends Function { _handler?: Fn; _extensions: Record; defaultOptions: ClientOptions; fetch: $Fetch; with: (createExtension: (client: this) => Extension) => this & Extension; } declare function createClient(defaultOptions?: ClientOptions, { fetch }?: ClientFactoryOptions): ApiClient; //#endregion export { ApiClient, ApiExtension, ClientFactoryOptions, ClientOptions, HandlerExtension, HandlerExtensionBuilder, MethodsExtension, MethodsExtensionBuilder, createClient };