DeclarationA custom type declaration, such as Date, Option, or ReadonlySet.
When to use
Use when inspecting or transforming non-primitive schema types.
Details
typeParameters holds the inner type arguments, such as the A in
Option<A>. encodedSchema is the fallback representation when no
Reviver recognizes this declaration. annotations.typeConstructor
identifies the declaration kind, such as { _tag: "effect/Option" }.
export interface Declaration {
readonly Declaration._tag: "Declaration"_tag: "Declaration"
readonly Declaration.annotations?: anyannotations?: import SchemaSchema.declareAnnotations.type Schema.Annotations.Annotations = /*unresolved*/ anyAnnotations | undefined
readonly Declaration.typeParameters: ReadonlyArray<Representation>typeParameters: interface ReadonlyArray<T>ReadonlyArray<type Representation =
| Declaration
| Reference
| Suspend
| Null
| Undefined
| Void
| Never
| Unknown
| Any
| String
| Number
| Boolean
| BigInt
| Symbol
| Literal
| UniqueSymbol
| ObjectKeyword
| Enum
| TemplateLiteral
| Arrays
| Objects
| Union
The core tagged union of all supported schema shapes.
Details
Each variant has a _tag discriminator. Switch on _tag to handle each
shape. Most variants carry optional annotations and some carry checks
for validation constraints.
Representation>
readonly Declaration.checks: ReadonlyArray<Check<DeclarationMeta>>checks: interface ReadonlyArray<T>ReadonlyArray<type Check<M> = Filter<M> | FilterGroup<M>A validation constraint attached to a type. Either a single
Filter
or a
FilterGroup
combining multiple checks.
Check<type DeclarationMeta = anyMetadata union for
Declaration
checks — either
DateMeta
or
SizeMeta
.
DeclarationMeta>>
readonly Declaration.encodedSchema: RepresentationencodedSchema: type Representation =
| Declaration
| Reference
| Suspend
| Null
| Undefined
| Void
| Never
| Unknown
| Any
| String
| Number
| Boolean
| BigInt
| Symbol
| Literal
| UniqueSymbol
| ObjectKeyword
| Enum
| TemplateLiteral
| Arrays
| Objects
| Union
The core tagged union of all supported schema shapes.
Details
Each variant has a _tag discriminator. Switch on _tag to handle each
shape. Most variants carry optional annotations and some carry checks
for validation constraints.
Representation
}