@hey-api/openapi-ts
Version:
🚀 The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more.
45 lines (40 loc) • 1.18 kB
TypeScript
import { k as Config, c as IR, U as UserConfig, W as WatchValues } from './types.d-CaH9PF-K.js';
import { JSONSchema } from '@hey-api/json-schema-ref-parser';
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;
/**
* @internal
*/
declare const initConfigs: (userConfig: UserConfig | undefined) => Promise<ReadonlyArray<{
config: Config;
errors: ReadonlyArray<Error>;
}>>;
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, initConfigs, parseOpenApiSpec };