import { TransformerFactory, SourceFile } from 'typescript'; import { JsonSchemaDraft04 } from './jsonSchemaDraft04'; import { JsonSchemaDraft07 } from './jsonSchemaDraft07'; import { OpenApisV2 } from './openApiV2'; import { OpenApisV3 } from './openApiV3'; import SchemaId from './schemaId'; export import ts = require('typescript'); export declare type JsonSchema = JsonSchemaDraft04.Schema | JsonSchemaDraft07.Schema; export declare type JsonSchemaObject = JsonSchemaDraft04.Schema | JsonSchemaDraft07.SchemaObject; export declare type SchemaType = 'Draft04' | 'Draft07' | '2019-09' | '2020-12' | 'Latest'; export declare function isJsonSchemaDraft04(_content: JsonSchemaObject, type: SchemaType): _content is JsonSchemaDraft04.Schema; export declare type $Ref = OpenApisV3.SchemaJson.Definitions.Reference | OpenApisV2.SchemaJson.Definitions.JsonReference; export interface Schema { type: SchemaType; openApiVersion?: 2 | 3; id: SchemaId; content: JsonSchema; rootSchema?: Schema; } export declare function parseSchema(content: JsonSchema, url?: string): Schema; export declare function readSchemaFromStdin(): Promise; export declare function readSchemasFromFile(pattern: string): Promise; export declare function readSchemaFromUrl(url: string): Promise; export declare function parseFileContent(content: string, filename?: string): JsonSchema; export interface PluginContext { option: boolean | Record; inputSchemas: IterableIterator<[string, Schema]>; } export declare type PreProcessHandler = (contents: Schema[]) => Schema[]; export declare type Plugin = { meta: { name: string; version: string; description?: string; }; preProcess?: (context: PluginContext) => Promise; postProcess?: (context: PluginContext) => Promise | undefined>; }; export declare function loadPlugin(name: string, option: boolean | Record): Promise;