UNPKG

openapi-typescript

Version:

Generate TypeScript types from Swagger OpenAPI specs

21 lines (20 loc) 646 B
/// <reference types="node" /> import { URL } from "url"; import { GlobalContext, Headers } from "./types"; declare type PartialSchema = Record<string, any>; declare type SchemaMap = { [url: string]: PartialSchema; }; export declare const VIRTUAL_JSON_URL = "file:///_json"; export declare function resolveSchema(url: string): URL; interface LoadOptions extends GlobalContext { rootURL: URL; schemas: SchemaMap; urlCache?: Set<string>; httpHeaders?: Headers; httpMethod?: string; } export default function load(schema: URL | PartialSchema, options: LoadOptions): Promise<{ [url: string]: PartialSchema; }>; export {};