UNPKG

@hey-api/openapi-ts

Version:

🌀 OpenAPI to TypeScript codegen. Production-ready SDKs, Zod schemas, TanStack Query hooks, and 20+ plugins. Used by Vercel, OpenCode, and PayPal.

118 lines (115 loc) • 5.44 kB
import { A as keywords, B as IR, C as Client$1, D as reserved, E as DollarTsDsl, F as TsDslContext, H as LazyOrAsync, I as ctx, L as CallArgs, M as TsDsl, N as TypeTsDsl, O as TypeScriptRenderer, P as ExampleOptions, R as OperationPath, S as Client$3, T as $, U as MaybeArray, V as Casing, _ as Client$2, a as Plugin, b as Client$5, c as OpenApiOperationObject, d as OpenApiResponseObject, f as OpenApiSchemaObject, g as ExpressionTransformer, h as TypeTransformer, i as DefinePlugin, j as MaybeTsDsl, k as regexp, l as OpenApiParameterObject, m as Logger, n as UserConfig, o as OpenApi, p as Context, s as OpenApiMetaObject, u as OpenApiRequestBodyObject, v as PluginHandler, w as Client, x as Client$4, y as Client$6, z as OperationStrategy } from "./config-BzR0jtGH.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 /** * Utilities shared across the package. */ declare const utils: { /** * @deprecated use `toCase` instead */ stringCase({ case: casing, stripLeadingSeparators, value }: { readonly case: Casing | undefined; /** * If leading separators have a semantic meaning, we might not want to * remove them. */ stripLeadingSeparators?: boolean; value: string; }): string; /** * Converts the given string to the specified casing. */ toCase: (value: string, casing: Casing | undefined, options?: { stripLeadingSeparators?: boolean; }) => 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, CallArgs, type Client$2 as Client, type DefinePlugin, DollarTsDsl, ExampleOptions, 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, OperationPath, OperationStrategy, type Plugin, TsDsl, TsDslContext, TypeScriptRenderer, type TypeTransformer, TypeTsDsl, type UserConfig, clientDefaultConfig, clientDefaultMeta, clientPluginHandler, createClient, ctx, defaultPaginationKeywords, defaultPlugins, defineConfig, definePluginConfig, keywords, regexp, reserved, utils }; //# sourceMappingURL=index.d.mts.map