@hey-api/openapi-ts
Version:
🚀 The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more.
50 lines (45 loc) • 1.32 kB
TypeScript
import { k as Config, c as IR, U as UserConfig, W as WatchValues } from './types.d-CXdSuWix.js';
import { JSONSchema } from '@hey-api/json-schema-ref-parser';
import 'semver';
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, dependencies, spec, }: {
config: Config;
dependencies: Record<string, string>;
spec: unknown;
}) => IR.Context | undefined;
/**
* @internal
*/
declare const initConfigs: (userConfig: UserConfig | undefined) => Promise<{
dependencies: Record<string, string>;
results: 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 };