UNPKG

jswagger-generator

Version:

This is jswagger's generator package.

21 lines 1.17 kB
import { OpenAPI2, OpenAPI3 } from 'jswagger-common'; export declare function comment(text: string): string; /** shim for Object.fromEntries() for Node < 13 */ export declare function fromEntries(entries: [string, any][]): object; /** Return type of node (works for v2 or v3, as there are no conflicting types) */ declare type SchemaObjectType = 'anyOf' | 'array' | 'boolean' | 'enum' | 'number' | 'object' | 'oneOf' | 'ref' | 'string'; export declare function nodeType(obj: any): SchemaObjectType | undefined; /** Return OpenAPI version from definition */ export declare function swaggerVersion(definition: OpenAPI2 | OpenAPI3): 2 | 3; /** Convert $ref to TS ref */ export declare function transformRef(ref: string): string; /** Convert T into T[]; */ export declare function tsArrayOf(type: string): string; /** Convert T, U into T & U; */ export declare function tsIntersectionOf(types: string[]): string; /** Convert T into Partial<T> */ export declare function tsPartial(type: string): string; /** Convert [X, Y, Z] into X | Y | Z */ export declare function tsUnionOf(types: string[]): string; export {}; //# sourceMappingURL=utils.d.ts.map