UNPKG

@hey-api/openapi-ts

Version:

🌀 OpenAPI to TypeScript code generator. Generate API clients, SDKs, validators, and more.

101 lines (99 loc) • 4.87 kB
import { A as Client$4, C as MaybeTsDsl, D as PluginHandler, E as Client$2, F as IR, I as LazyOrAsync, L as MaybeArray, M as Client$1, N as Client, O as Client$6, P as StringCase, S as TypeScriptRenderer, T as TypeTsDsl, _ as $, a as Plugin, b as regexp, c as OpenApiOperationObject, d as OpenApiResponseObject, f as OpenApiSchemaObject, g as ExpressionTransformer, h as TypeTransformer, i as DefinePlugin, j as Client$3, k as Client$5, l as OpenApiParameterObject, m as Logger, n as UserConfig, o as OpenApi, p as Context, s as OpenApiMetaObject, u as OpenApiRequestBodyObject, v as DollarTsDsl, w as TsDsl, x as keywords, y as reserved } from "./config-Baq-Kb-6.mjs"; import "@hey-api/codegen-core"; //#region src/generate.d.ts /** * Generate a client from the provided configuration. * * @param userConfig User provided {@link UserConfig} configuration(s). */ declare const createClient: (userConfig?: LazyOrAsync<MaybeArray<UserConfig>>, logger?: Logger) => Promise<ReadonlyArray<Context>>; //#endregion //#region src/config/parser.d.ts declare const defaultPaginationKeywords: readonly ["after", "before", "cursor", "offset", "page", "start"]; //#endregion //#region src/config/plugins.d.ts /** * Default plugins used to generate artifacts if plugins aren't specified. */ declare const defaultPlugins: readonly ["@hey-api/typescript", "@hey-api/sdk"]; //#endregion //#region src/plugins/@hey-api/client-core/config.d.ts declare const clientDefaultConfig: { readonly baseUrl: true; readonly bundle: true; readonly exportFromIndex: false; }; declare const clientDefaultMeta: { readonly dependencies: readonly ["@hey-api/typescript"]; readonly tags: readonly ["client"]; }; //#endregion //#region src/plugins/@hey-api/client-core/plugin.d.ts declare const clientPluginHandler: ({ plugin }: Parameters<PluginHandler>[0]) => void; //#endregion //#region src/plugins/shared/utils/config.d.ts declare const definePluginConfig: <T extends Plugin.Types>(defaultConfig: Plugin.Config<T>) => (userConfig?: Omit<T["config"], "name">) => Omit<Plugin.Config<T>, "name"> & { /** * Cast name to `any` so it doesn't throw type error in `plugins` array. * We could allow any `string` as plugin `name` in the object syntax, but * that TypeScript trick would cause all string methods to appear as * suggested auto completions, which is undesirable. */ name: any; }; //#endregion //#region src/utils/exports.d.ts declare const utils: { stringCase: ({ case: _case, stripLeadingSeparators, value }: { readonly case: StringCase | undefined; stripLeadingSeparators?: boolean; value: string; }) => string; }; //#endregion //#region src/index.d.ts declare module '@hey-api/codegen-core' { interface ProjectRenderMeta { /** * If specified, this will be the file extension used when importing * other modules. By default, we don't add a file extension and let the * runtime resolve it. * * @default null */ importFileExtension?: (string & {}) | null; } interface SymbolMeta { category?: 'client' | 'external' | 'hook' | 'schema' | 'sdk' | 'transform' | 'type' | 'utility' | (string & {}); /** * Path to the resource this symbol represents. */ path?: ReadonlyArray<string | number>; /** * Name of the plugin that registered this symbol. */ pluginName?: string; resource?: 'client' | 'definition' | 'operation' | 'webhook' | (string & {}); resourceId?: string; role?: 'data' | 'error' | 'errors' | 'options' | 'response' | 'responses' | (string & {}); /** * Tags associated with this symbol. */ tags?: ReadonlyArray<string>; tool?: 'angular' | 'arktype' | 'fastify' | 'json-schema' | 'sdk' | 'typescript' | 'valibot' | 'zod' | (string & {}); variant?: 'container' | (string & {}); } } /** * Type helper for openapi-ts.config.ts, returns {@link MaybeArray<UserConfig>} object(s) */ declare const defineConfig: <T extends MaybeArray<UserConfig>>(config: LazyOrAsync<T>) => Promise<T>; //#endregion export { $, type Client as AngularClient, type Client$1 as AxiosClient, type Client$2 as Client, type DefinePlugin, DollarTsDsl, type ExpressionTransformer, type Client$3 as FetchClient, type IR, Logger, MaybeTsDsl, type Client$4 as NextClient, type Client$5 as NuxtClient, type Client$6 as OfetchClient, type OpenApi, type OpenApiMetaObject, type OpenApiOperationObject, type OpenApiParameterObject, type OpenApiRequestBodyObject, type OpenApiResponseObject, type OpenApiSchemaObject, type Plugin, TsDsl, TypeScriptRenderer, type TypeTransformer, TypeTsDsl, type UserConfig, clientDefaultConfig, clientDefaultMeta, clientPluginHandler, createClient, defaultPaginationKeywords, defaultPlugins, defineConfig, definePluginConfig, keywords, regexp, reserved, utils }; //# sourceMappingURL=index.d.mts.map