UNPKG

openapi-axios

Version:

OpenAPI(2.0/3.0/3.1) Schema → Type-safe Axios

43 lines (42 loc) 1.43 kB
import { OpenAPILatest } from '../types/openapi'; import { OpenApiLatest_Parameter, OpenApiLatest_PathItem, OpenApiLatest_Request, OpenApiLatest_Response, OpenApiLatest_Schema } from './helpers'; import { PrinterConfigs, PrinterOptions, PrintResults } from './types'; import { Named } from './Named'; type WithId<T> = T & { nodeId: string; namedId?: string; }; type SchemaInfo = WithId<{ position: 'root' | 'anchor'; schema: OpenApiLatest_Schema; typeName: string; nodeName: string; }>; type RequestBodyInfo = WithId<{ requestBody: OpenApiLatest_Request; }>; type ParameterInfo = WithId<{ parameter: OpenApiLatest_Parameter; }>; type ResponseInfo = WithId<{ response: OpenApiLatest_Response; }>; type PathItemInfo = WithId<{ pathItem: OpenApiLatest_PathItem; }>; export declare class Printer { #private; private readonly document; private options?; named: Named; private configs; constructor(document: OpenAPILatest.Document, options?: PrinterOptions | undefined); schemas: Record<string /** nodeId */, SchemaInfo>; requestBodies: Record<string /** nodeId */, RequestBodyInfo>; parameters: Record<string /** nodeId */, ParameterInfo>; responses: Record<string /** nodeId */, ResponseInfo>; pathItems: Record<string /** nodeId */, PathItemInfo>; registerComponents(): void; print(configs?: PrinterConfigs): PrintResults; } export {};