SchemaRepresentation95
Constructors
fromASTconstConverts a Schema AST into a Document.fromASTsconstConverts one or more Schema ASTs into a MultiDocument.fromJsonSchemaDocumentfunctionParses a Draft 2020-12 JSON Schema document into a Document.fromJsonSchemaMultiDocumentfunctionParses a Draft 2020-12 JSON Schema multi-document into a MultiDocument.Models
AnyinterfaceThe any type.ArraysinterfaceAn array or tuple type.ArraysMetatypeMetadata union for array-specific validation checks (minLength, maxLength, length, unique).BigIntinterfaceThe bigint type with optional validation checks.BigIntMetatypeMetadata union for bigint-specific validation checks (min, max, between).BooleaninterfaceThe boolean type.ChecktypeA validation constraint attached to a type.DateMetatypeMetadata union for Date-specific validation checks (valid, min, max, between).DeclarationinterfaceA custom type declaration, such as Date, Option, or ReadonlySet.DeclarationMetatypeMetadata union for Declaration checks — either DateMeta or SizeMeta.DocumenttypeA single Representation together with its named References.ElementinterfaceA positional element within an Arrays tuple.EnuminterfaceA TypeScript-style enum.FilterinterfaceA single validation constraint with typed metadata describing the check (e.g.FilterGroupinterfaceA group of validation constraints that are logically combined.IndexSignatureinterfaceAn index signature, such as [key: string]: number, within an Objects.LiteralinterfaceA specific literal value (string, number, boolean, or bigint).MultiDocumenttypeOne or more Representations sharing a common References map.NeverinterfaceThe never type (no valid values).NullinterfaceThe null type.NumberinterfaceThe number type with optional validation checks.NumberMetatypeMetadata union for number-specific validation checks (int, finite, min, max, multipleOf, between).ObjectKeywordinterfaceThe object keyword type (matches any non-primitive).ObjectsinterfaceAn object/struct type with named properties and optional index signatures.ObjectsMetatypeMetadata union for object-specific validation checks (minProperties, maxProperties, propertiesLength, propertyNames).PropertySignatureinterfaceA named property within an Objects representation.ReferenceinterfaceA named reference to a definition in the References map.ReferencesinterfaceA string-keyed map of named Representation definitions.RepresentationtypeThe core tagged union of all supported schema shapes.RevivertypeA callback that handles Declaration nodes during reconstruction (toSchema) or code generation (toCodeDocument).SizeMetatypeMetadata union for size-based validation checks (minSize, maxSize, size).StringinterfaceThe string type with optional validation checks.StringMetatypeMetadata union for string-specific validation checks (minLength, maxLength, pattern, UUID, trimmed, etc.).SuspendinterfaceA lazily resolved representation used for recursive schemas.SymbolinterfaceThe symbol type.TemplateLiteralinterfaceA template literal type composed of a sequence of parts (literals, strings, numbers, etc.).UndefinedinterfaceThe undefined type.UnioninterfaceA union of multiple representations.UniqueSymbolinterfaceA specific unique symbol value.UnknowninterfaceThe unknown type (any value accepted).VoidinterfaceThe void type.Code Generation
ArtifacttypeAn auxiliary code artifact produced during code generation — a symbol declaration, an enum declaration, or an import statement.CodetypeA pair of TypeScript source strings for a schema: runtime is the executable Schema expression, Type is the corresponding TypeScript type.CodeDocumenttypeThe output of toCodeDocument: generated TypeScript code for one or more schemas plus their shared references and auxiliary artifacts.makeCodefunctionConstructs a Code value from a runtime expression string and a TypeScript type string.toCodeDocumentfunctionGenerates TypeScript code strings from a MultiDocument.Runtime Generation
Schemas
$AnnotationsconstSchema for serializing public Schema.Annotations.Annotations values.$AnyconstSchema for the Any representation node.$ArraysconstSchema for the Arrays representation node.$BigIntconstSchema for the BigInt representation node.$BooleanconstSchema for the Boolean representation node.$DateMetaconstSchema for DateMeta.$DeclarationconstSchema for the Declaration representation node.$DeclarationMetaconstSchema for DeclarationMeta.$DocumentconstSchema for Document.$ElementconstSchema for the Element type (positional tuple element).$EnumconstSchema for the Enum representation node.$IndexSignatureconstSchema for the IndexSignature type.$LiteralconstSchema for the Literal representation node.$LiteralValueconstSchema for the literal value types allowed in a Literal node (string, finite number, boolean, or bigint).$MultiDocumentconstSchema for MultiDocument.$NeverconstSchema for the Never representation node.$NullconstSchema for the Null representation node.$NumberconstSchema for the Number representation node.$NumberMetaconstSchema for NumberMeta.$ObjectKeywordconstSchema for the ObjectKeyword representation node.$ObjectsconstSchema for the Objects representation node.$ObjectsMetaconstSchema for ObjectsMeta.$PrimitiveTreeconstSchema for PrimitiveTree.$PropertySignatureconstSchema for the PropertySignature type.$ReferenceconstSchema for the Reference representation node.$RepresentationinterfaceType-level helper for the recursive $Representation codec.$SizeMetaconstSchema for SizeMeta.$StringconstSchema for the String representation node.$StringMetaconstSchema for StringMeta.$SuspendconstSchema for the Suspend representation node.$SymbolconstSchema for the Symbol representation node.$TemplateLiteralconstSchema for the TemplateLiteral representation node.$UndefinedconstSchema for the Undefined representation node.$UnionconstSchema for the Union representation node.$UniqueSymbolconstSchema for the UniqueSymbol representation node.$UnknownconstSchema for the Unknown representation node.$VoidconstSchema for the Void representation node.DocumentFromJsonconstSchema that decodes a Document from JSON and encodes it back.MultiDocumentFromJsonconstSchema for MultiDocument values encoded as JSON.Transforming
toJsonSchemaDocumentconstConverts a Document to a Draft 2020-12 JSON Schema document.toJsonSchemaMultiDocumentconstConverts a MultiDocument to a Draft 2020-12 JSON Schema multi-document.toMultiDocumentfunctionWraps a single Document as a MultiDocument with one representation.toSchemaDefaultReviverconstDefault Reviver for toSchema that handles built-in Effect types, including Option, Result, Redacted, Cause, Exit, ReadonlyMap, HashMap, ReadonlySet, Date, Duration, URL, and RegExp.