import { Array, Lazy, Literal, Null, Number, Object, Optional, type Parsed, Record, type Runtype, String, Undefined, Union } from 'runtypes'; import { type JSONSchema7 as _JSONSchema7, type JSONSchema7Array as _JSONSchema7Array, type JSONSchema7Definition as _JSONSchema7Definition, type JSONSchema7Object as _JSONSchema7Object, type JSONSchema7Type as _JSONSchema7Type } from 'json-schema'; // This file is generated by runtyping (https://github.com/johngeorgewright/runtyping). // Manual changes might be lost - proceed with caution! export const JSONSchema7Definition: Runtype.Core<_JSONSchema7Definition> = Lazy(() => Union(Literal(false), Literal(true), JSONSchema7,)); export type JSONSchema7Definition = Parsed; export const JSONSchema7TypeName = Union(Literal("string"), Literal("number"), Literal("boolean"), Literal("object"), Literal("integer"), Literal("array"), Literal("null"),); export type JSONSchema7TypeName = Parsed; export const JSONSchema7Object: Runtype.Core<_JSONSchema7Object> = Lazy(() => Record(String, JSONSchema7Type)); export type JSONSchema7Object = Parsed; export const JSONSchema7Array: Runtype.Core<_JSONSchema7Array> = Lazy(() => Array(JSONSchema7Type)); export type JSONSchema7Array = Parsed; export const JSONSchema7Type: Runtype.Core<_JSONSchema7Type> = Lazy(() => Union(Null, String, Number, Literal(false), Literal(true), JSONSchema7Object, JSONSchema7Array,)); export type JSONSchema7Type = Parsed; export const JSONSchema7: Runtype.Core<_JSONSchema7> = Lazy(() => Object({ $id: Optional(Union(String, Undefined,)), $ref: Optional(Union(String, Undefined,)), $schema: Optional(Union(String, Undefined,)), $comment: Optional(Union(String, Undefined,)), $defs: Optional(Union(Record(String, JSONSchema7Definition), Undefined,)), type: Optional(Union(Literal("string"), Literal("number"), Literal("boolean"), Literal("object"), Literal("integer"), Literal("array"), Literal("null"), Array(JSONSchema7TypeName), Undefined,)), enum: Optional(Union(Array(JSONSchema7Type), Undefined,)), const: Optional(Union(Null, String, Number, Literal(false), Literal(true), JSONSchema7Object, JSONSchema7Array, Undefined,)), multipleOf: Optional(Union(Number, Undefined,)), maximum: Optional(Union(Number, Undefined,)), exclusiveMaximum: Optional(Union(Number, Undefined,)), minimum: Optional(Union(Number, Undefined,)), exclusiveMinimum: Optional(Union(Number, Undefined,)), maxLength: Optional(Union(Number, Undefined,)), minLength: Optional(Union(Number, Undefined,)), pattern: Optional(Union(String, Undefined,)), items: Optional(Union(Literal(false), Literal(true), JSONSchema7, Array(JSONSchema7Definition), Undefined,)), additionalItems: Optional(Union(Literal(false), Literal(true), JSONSchema7, Undefined,)), maxItems: Optional(Union(Number, Undefined,)), minItems: Optional(Union(Number, Undefined,)), uniqueItems: Optional(Union(Literal(false), Literal(true), Undefined,)), contains: Optional(Union(Literal(false), Literal(true), JSONSchema7, Undefined,)), maxProperties: Optional(Union(Number, Undefined,)), minProperties: Optional(Union(Number, Undefined,)), required: Optional(Union(Array(String), Undefined,)), properties: Optional(Union(Record(String, JSONSchema7Definition), Undefined,)), patternProperties: Optional(Union(Record(String, JSONSchema7Definition), Undefined,)), additionalProperties: Optional(Union(Literal(false), Literal(true), JSONSchema7, Undefined,)), dependencies: Optional(Union(Record(String, Union(Literal(false), Literal(true), JSONSchema7, Array(String),)), Undefined,)), propertyNames: Optional(Union(Literal(false), Literal(true), JSONSchema7, Undefined,)), if: Optional(Union(Literal(false), Literal(true), JSONSchema7, Undefined,)), then: Optional(Union(Literal(false), Literal(true), JSONSchema7, Undefined,)), else: Optional(Union(Literal(false), Literal(true), JSONSchema7, Undefined,)), allOf: Optional(Union(Array(JSONSchema7Definition), Undefined,)), anyOf: Optional(Union(Array(JSONSchema7Definition), Undefined,)), oneOf: Optional(Union(Array(JSONSchema7Definition), Undefined,)), not: Optional(Union(Literal(false), Literal(true), JSONSchema7, Undefined,)), format: Optional(Union(String, Undefined,)), contentMediaType: Optional(Union(String, Undefined,)), contentEncoding: Optional(Union(String, Undefined,)), definitions: Optional(Union(Record(String, JSONSchema7Definition), Undefined,)), title: Optional(Union(String, Undefined,)), description: Optional(Union(String, Undefined,)), default: Optional(Union(Null, String, Number, Literal(false), Literal(true), JSONSchema7Object, JSONSchema7Array, Undefined,)), readOnly: Optional(Union(Literal(false), Literal(true), Undefined,)), writeOnly: Optional(Union(Literal(false), Literal(true), Undefined,)), examples: Optional(Union(Null, String, Number, Literal(false), Literal(true), JSONSchema7Object, JSONSchema7Array, Undefined,)), })); export type JSONSchema7 = Parsed; export const A = Object({ foo: String, schema: JSONSchema7, }); export type A = Parsed;