UNPKG

@hey-api/openapi-ts

Version:

🚀 The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more.

38 lines (34 loc) • 1.03 kB
import { JSONSchema } from '@hey-api/json-schema-ref-parser'; import { e as Config, I as IR, W as WatchValues } from './types.d-CAqtwzfv.js'; export { i as initConfigs } from './types.d-CAqtwzfv.js'; import 'node:fs'; import 'typescript'; /** * @internal * Parse the resolved OpenAPI specification. This will populate and return * `context` with intermediate representation obtained from the parsed spec. */ declare const parseOpenApiSpec: ({ config, spec, }: { config: Config; spec: unknown; }) => IR.Context | undefined; interface SpecResponse { data: JSONSchema; error?: undefined; response?: undefined; } interface SpecError { data?: undefined; error: 'not-modified' | 'not-ok'; response: Response; } /** * @internal */ declare const getSpec: ({ fetchOptions, inputPath, timeout, watch, }: { fetchOptions?: RequestInit; inputPath: Config["input"]["path"]; timeout: number; watch: WatchValues; }) => Promise<SpecResponse | SpecError>; export { getSpec, parseOpenApiSpec };