import { JSDocStructure, JSDocTagStructure, OptionalKind, WriterFunction } from 'ts-morph'; import { IReference } from './references'; import { CoreSchemaMetaSchema } from './schema'; import { JSONSchema7, JSONSchema7Definition, JSONSchema7Type, JSONSchema7TypeName } from './types'; export type AnyType = 'any' | 'JSONValue' | 'unknown'; export interface IDocEmitOptions { emitSeeDirective?: boolean; } export interface ITypingContext { anyType: AnyType; getNameForReference(ref: IReference): string; shouldEmitTypes(schema: ISchemaNode, parentNode: ISchemaNode): boolean; } export interface ISchemaNode { readonly kind: SchemaNodeKind; readonly baseUri: string; readonly schema: T; readonly uri: string; provideWriterFunction(ctx: ITypingContext): WriterFunction; provideDocs(options?: IDocEmitOptions): OptionalKind | undefined; } export declare enum SchemaNodeKind { Boolean = "Boolean", Schema = "Schema" } export interface SchemaNodeOptions { $id?: string; $ref?: IReference; $schema?: string; $comment?: string; /** * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1 */ type?: JSONSchema7TypeName | JSONSchema7TypeName[]; enum?: JSONSchema7Type[]; const?: JSONSchema7Type; /** * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.2 */ multipleOf?: number; maximum?: number; exclusiveMaximum?: number; minimum?: number; exclusiveMinimum?: number; /** * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.3 */ maxLength?: number; minLength?: number; pattern?: string; /** * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.4 */ items?: ISchemaNode | ISchemaNode[]; additionalItems?: ISchemaNode; maxItems?: number; minItems?: number; uniqueItems?: boolean; contains?: ISchemaNode; /** * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.5 */ maxProperties?: number; minProperties?: number; required?: string[]; properties?: { [key: string]: ISchemaNode; }; patternProperties?: { [key: string]: ISchemaNode; }; additionalProperties?: ISchemaNode; dependencies?: { [key: string]: ISchemaNode | string[]; }; propertyNames?: ISchemaNode; /** * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.6 */ if?: ISchemaNode; then?: ISchemaNode; else?: ISchemaNode; /** * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.7 */ allOf?: ISchemaNode[]; anyOf?: ISchemaNode[]; oneOf?: ISchemaNode[]; not?: ISchemaNode; /** * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-7 */ format?: string; /** * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-8 */ contentMediaType?: string; contentEncoding?: string; /** * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-9 */ definitions?: { [key: string]: ISchemaNode; }; /** * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-10 */ title?: string; description?: string; default?: JSONSchema7Type; readOnly?: boolean; writeOnly?: boolean; examples?: JSONSchema7Type; } declare abstract class BaseSchemaNode implements ISchemaNode { readonly uri: string; readonly baseUri: string; readonly schema: TSchema; protected readonly options: TOptions; abstract readonly kind: SchemaNodeKind; constructor(uri: string, baseUri: string, schema: TSchema, options: TOptions); provideDocs(): OptionalKind | undefined; abstract provideWriterFunction(ctx: ITypingContext): WriterFunction; } export declare class BooleanSchemaNode extends BaseSchemaNode { readonly kind = SchemaNodeKind.Boolean; provideWriterFunction(ctx: ITypingContext): WriterFunction; } export declare class SchemaNode extends BaseSchemaNode { readonly kind = SchemaNodeKind.Schema; provideDocs(options?: IDocEmitOptions): { description: string; tags: OptionalKind[]; } | undefined; provideWriterFunction(ctx: ITypingContext): WriterFunction; private provideWritersForTuple; private provideWritersForTypeArray; private provideWritersForTypeObject; } export {}; //# sourceMappingURL=nodes.d.ts.map