$RepresentationType-level helper for the recursive $Representation codec.
export interface interface $RepresentationType-level helper for the recursive
$Representation
codec.
Schema for the full
Representation
union. It recursively validates
and encodes any representation node.
$Representation extends import SchemaSchema.interface Codec<out T, out E = T, out RD = never, out RE = never>Namespace of type-level helpers for
Codec
.
A schema that tracks the decoded type T, the encoded type E, and the
Effect services required during decoding (RD) and encoding (RE).
Details
Use Codec<T, E, RD, RE> when you need to preserve full type information
about a schema — both what it decodes to and what it serializes from/to.
Most concrete schemas produced by this module implement Codec.
For APIs that only need one direction, prefer the narrower views:
Decoder
<T, RD> — decode-only
Encoder
<E, RE> — encode-only
Schema
<T> — type-only (no encoded representation)
Example (Accepting a codec that decodes to number from string)
import { Schema } from "effect"
declare function serialize<T>(codec: Schema.Codec<T, string>): string
serialize(Schema.NumberFromString) // ok — decodes number, encoded as string
Codec<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> {}
/**
* Schema for the full {@link Representation} union. It recursively validates
* and encodes any representation node.
*
* @category schemas
* @since 4.0.0
*/
export const const $Representation: $Representationconst $Representation: {
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
Rebuild: Codec<T, E, RD, RE>;
Type: T;
Iso: Iso;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Representation, any>) => Schema.Codec<Representation, Representation, never, never>;
annotateKey: (annotations: Schema.Annotations.Key<Representation>) => Schema.Codec<Representation, Representation, never, never>;
check: (checks_0: SchemaAST.Check<Representation>, ...checks: Array<SchemaAST.Check<Representation>>) => Schema.Codec<Representation, Representation, never, never>;
rebuild: (ast: SchemaAST.AST) => Schema.Codec<Representation, Representation, never, never>;
make: (input: unknown, options?: MakeOptions) => SchemaRepresentation.Representation;
makeOption: (input: unknown, options?: MakeOptions) => Option_.Option<SchemaRepresentation.Representation>;
makeEffect: (input: unknown, options?: MakeOptions) => Effect.Effect<SchemaRepresentation.Representation, SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Type-level helper for the recursive
$Representation
codec.
Schema for the full
Representation
union. It recursively validates
and encodes any representation node.
$Representation: interface $RepresentationType-level helper for the recursive
$Representation
codec.
Schema for the full
Representation
union. It recursively validates
and encodes any representation node.
$Representation = import SchemaSchema.function Union<
Members extends ReadonlyArray<Constraint>
>(
members: Members,
options?: { mode?: "anyOf" | "oneOf" }
): Union<Members>
Creates a union schema from an array of member schemas. Members are tested in
order; the first match is returned.
Details
Optionally, specify mode:
"anyOf" (default) — matches if any member matches.
"oneOf" — matches if exactly one member matches.
Example (Defining a string or number union)
import { Schema } from "effect"
const schema = Schema.Union([Schema.String, Schema.Number])
Schema.decodeUnknownSync(schema)("hello") // "hello"
Schema.decodeUnknownSync(schema)(42) // 42
Union([
const $Null: Schema.Struct<{
readonly _tag: Schema.tag<"Null">
readonly annotations: Schema.optional<
Schema.decodeTo<
Schema.$Record<
Schema.String,
Schema.Unknown
>,
Schema.$Record<
Schema.String,
Schema.Codec<
PrimitiveTree,
PrimitiveTree,
never,
never
>
>,
never,
never
>
>
}>
const $Null: {
Type: Struct.Type<Fields>;
Encoded: Struct.Encoded<Fields>;
DecodingServices: Struct.DecodingServices<Fields>;
EncodingServices: Struct.EncodingServices<Fields>;
Iso: Struct.Iso<Fields>;
fields: Fields;
mapFields: (f: (fields: { readonly _tag: Schema.tag<'Null'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>,…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly _tag: 'Null'; readonly annotations?: { readonly [x: string]: unknown; } | undefined; }, readonly []>) => Schema.Struct<{ readonly _tag: Schema.tag<'Null'>; readonly annotations: Schema.opt…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly _tag: 'Null'; readonly annotations?: { readonly [x: string]: unknown } | undefined }>) => Schema.Struct<{ readonly _tag: Schema.tag<'Null'>; readonly annotations: Schema.optional<Schema.decod…;
check: (checks_0: SchemaAST.Check<{ readonly _tag: 'Null'; readonly annotations?: { readonly [x: string]: unknown } | undefined }>, ...checks: Array<SchemaAST.Check<{ readonly _tag: 'Null'; readonly annotations?: { readonly [x: string]: unknown }…;
rebuild: (ast: SchemaAST.Objects) => Schema.Struct<{ readonly _tag: Schema.tag<'Null'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, P…;
make: (input: { readonly _tag?: 'Null' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => { readonly _tag: 'Null'; readonly annotations?: { readonly [x: string]: unknown } | undefined };
makeOption: (input: { readonly _tag?: 'Null' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Option_.Option<{ readonly _tag: 'Null'; readonly annotations?: { readonly [x: string]: unknown …;
makeEffect: (input: { readonly _tag?: 'Null' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Effect.Effect<{ readonly _tag: 'Null'; readonly annotations?: { readonly [x: string]: unknown }…;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Schema for the
Null
representation node.
$Null,
const $Undefined: Schema.Struct<{
readonly _tag: Schema.tag<"Undefined">
readonly annotations: Schema.optional<
Schema.decodeTo<
Schema.$Record<
Schema.String,
Schema.Unknown
>,
Schema.$Record<
Schema.String,
Schema.Codec<
PrimitiveTree,
PrimitiveTree,
never,
never
>
>,
never,
never
>
>
}>
const $Undefined: {
Type: Struct.Type<Fields>;
Encoded: Struct.Encoded<Fields>;
DecodingServices: Struct.DecodingServices<Fields>;
EncodingServices: Struct.EncodingServices<Fields>;
Iso: Struct.Iso<Fields>;
fields: Fields;
mapFields: (f: (fields: { readonly _tag: Schema.tag<'Undefined'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, nev…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly _tag: 'Undefined'; readonly annotations?: { readonly [x: string]: unknown; } | undefined; }, readonly []>) => Schema.Struct<{ readonly _tag: Schema.tag<'Undefined'>; readonly annotations: …;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly _tag: 'Undefined'; readonly annotations?: { readonly [x: string]: unknown } | undefined }>) => Schema.Struct<{ readonly _tag: Schema.tag<'Undefined'>; readonly annotations: Schema.optional<Sc…;
check: (checks_0: SchemaAST.Check<{ readonly _tag: 'Undefined'; readonly annotations?: { readonly [x: string]: unknown } | undefined }>, ...checks: Array<SchemaAST.Check<{ readonly _tag: 'Undefined'; readonly annotations?: { readonly [x: string]:…;
rebuild: (ast: SchemaAST.Objects) => Schema.Struct<{ readonly _tag: Schema.tag<'Undefined'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTr…;
make: (input: { readonly _tag?: 'Undefined' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => { readonly _tag: 'Undefined'; readonly annotations?: { readonly [x: string]: unknown } | u…;
makeOption: (input: { readonly _tag?: 'Undefined' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Option_.Option<{ readonly _tag: 'Undefined'; readonly annotations?: { readonly [x: string]…;
makeEffect: (input: { readonly _tag?: 'Undefined' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Effect.Effect<{ readonly _tag: 'Undefined'; readonly annotations?: { readonly [x: string]:…;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Schema for the
Undefined
representation node.
$Undefined,
const $Void: Schema.Struct<{
readonly _tag: Schema.tag<"Void">
readonly annotations: Schema.optional<
Schema.decodeTo<
Schema.$Record<
Schema.String,
Schema.Unknown
>,
Schema.$Record<
Schema.String,
Schema.Codec<
PrimitiveTree,
PrimitiveTree,
never,
never
>
>,
never,
never
>
>
}>
const $Void: {
Type: Struct.Type<Fields>;
Encoded: Struct.Encoded<Fields>;
DecodingServices: Struct.DecodingServices<Fields>;
EncodingServices: Struct.EncodingServices<Fields>;
Iso: Struct.Iso<Fields>;
fields: Fields;
mapFields: (f: (fields: { readonly _tag: Schema.tag<'Void'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>,…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly _tag: 'Void'; readonly annotations?: { readonly [x: string]: unknown; } | undefined; }, readonly []>) => Schema.Struct<{ readonly _tag: Schema.tag<'Void'>; readonly annotations: Schema.opt…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly _tag: 'Void'; readonly annotations?: { readonly [x: string]: unknown } | undefined }>) => Schema.Struct<{ readonly _tag: Schema.tag<'Void'>; readonly annotations: Schema.optional<Schema.decod…;
check: (checks_0: SchemaAST.Check<{ readonly _tag: 'Void'; readonly annotations?: { readonly [x: string]: unknown } | undefined }>, ...checks: Array<SchemaAST.Check<{ readonly _tag: 'Void'; readonly annotations?: { readonly [x: string]: unknown }…;
rebuild: (ast: SchemaAST.Objects) => Schema.Struct<{ readonly _tag: Schema.tag<'Void'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, P…;
make: (input: { readonly _tag?: 'Void' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => { readonly _tag: 'Void'; readonly annotations?: { readonly [x: string]: unknown } | undefined };
makeOption: (input: { readonly _tag?: 'Void' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Option_.Option<{ readonly _tag: 'Void'; readonly annotations?: { readonly [x: string]: unknown …;
makeEffect: (input: { readonly _tag?: 'Void' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Effect.Effect<{ readonly _tag: 'Void'; readonly annotations?: { readonly [x: string]: unknown }…;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Schema for the
Void
representation node.
$Void,
const $Never: Schema.Struct<{
readonly _tag: Schema.tag<"Never">
readonly annotations: Schema.optional<
Schema.decodeTo<
Schema.$Record<
Schema.String,
Schema.Unknown
>,
Schema.$Record<
Schema.String,
Schema.Codec<
PrimitiveTree,
PrimitiveTree,
never,
never
>
>,
never,
never
>
>
}>
const $Never: {
Type: Struct.Type<Fields>;
Encoded: Struct.Encoded<Fields>;
DecodingServices: Struct.DecodingServices<Fields>;
EncodingServices: Struct.EncodingServices<Fields>;
Iso: Struct.Iso<Fields>;
fields: Fields;
mapFields: (f: (fields: { readonly _tag: Schema.tag<'Never'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly _tag: 'Never'; readonly annotations?: { readonly [x: string]: unknown; } | undefined; }, readonly []>) => Schema.Struct<{ readonly _tag: Schema.tag<'Never'>; readonly annotations: Schema.o…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly _tag: 'Never'; readonly annotations?: { readonly [x: string]: unknown } | undefined }>) => Schema.Struct<{ readonly _tag: Schema.tag<'Never'>; readonly annotations: Schema.optional<Schema.dec…;
check: (checks_0: SchemaAST.Check<{ readonly _tag: 'Never'; readonly annotations?: { readonly [x: string]: unknown } | undefined }>, ...checks: Array<SchemaAST.Check<{ readonly _tag: 'Never'; readonly annotations?: { readonly [x: string]: unknown…;
rebuild: (ast: SchemaAST.Objects) => Schema.Struct<{ readonly _tag: Schema.tag<'Never'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, …;
make: (input: { readonly _tag?: 'Never' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => { readonly _tag: 'Never'; readonly annotations?: { readonly [x: string]: unknown } | undefined…;
makeOption: (input: { readonly _tag?: 'Never' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Option_.Option<{ readonly _tag: 'Never'; readonly annotations?: { readonly [x: string]: unknow…;
makeEffect: (input: { readonly _tag?: 'Never' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Effect.Effect<{ readonly _tag: 'Never'; readonly annotations?: { readonly [x: string]: unknown…;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Schema for the
Never
representation node.
$Never,
const $Unknown: Schema.Struct<{
readonly _tag: Schema.tag<"Unknown">
readonly annotations: Schema.optional<
Schema.decodeTo<
Schema.$Record<
Schema.String,
Schema.Unknown
>,
Schema.$Record<
Schema.String,
Schema.Codec<
PrimitiveTree,
PrimitiveTree,
never,
never
>
>,
never,
never
>
>
}>
const $Unknown: {
Type: Struct.Type<Fields>;
Encoded: Struct.Encoded<Fields>;
DecodingServices: Struct.DecodingServices<Fields>;
EncodingServices: Struct.EncodingServices<Fields>;
Iso: Struct.Iso<Fields>;
fields: Fields;
mapFields: (f: (fields: { readonly _tag: Schema.tag<'Unknown'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly _tag: 'Unknown'; readonly annotations?: { readonly [x: string]: unknown; } | undefined; }, readonly []>) => Schema.Struct<{ readonly _tag: Schema.tag<'Unknown'>; readonly annotations: Sche…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly _tag: 'Unknown'; readonly annotations?: { readonly [x: string]: unknown } | undefined }>) => Schema.Struct<{ readonly _tag: Schema.tag<'Unknown'>; readonly annotations: Schema.optional<Schema…;
check: (checks_0: SchemaAST.Check<{ readonly _tag: 'Unknown'; readonly annotations?: { readonly [x: string]: unknown } | undefined }>, ...checks: Array<SchemaAST.Check<{ readonly _tag: 'Unknown'; readonly annotations?: { readonly [x: string]: unk…;
rebuild: (ast: SchemaAST.Objects) => Schema.Struct<{ readonly _tag: Schema.tag<'Unknown'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree…;
make: (input: { readonly _tag?: 'Unknown' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => { readonly _tag: 'Unknown'; readonly annotations?: { readonly [x: string]: unknown } | undef…;
makeOption: (input: { readonly _tag?: 'Unknown' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Option_.Option<{ readonly _tag: 'Unknown'; readonly annotations?: { readonly [x: string]: un…;
makeEffect: (input: { readonly _tag?: 'Unknown' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Effect.Effect<{ readonly _tag: 'Unknown'; readonly annotations?: { readonly [x: string]: unk…;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Schema for the
Unknown
representation node.
$Unknown,
const $Any: Schema.Struct<{
readonly _tag: Schema.tag<"Any">
readonly annotations: Schema.optional<
Schema.decodeTo<
Schema.$Record<
Schema.String,
Schema.Unknown
>,
Schema.$Record<
Schema.String,
Schema.Codec<
PrimitiveTree,
PrimitiveTree,
never,
never
>
>,
never,
never
>
>
}>
const $Any: {
Type: Struct.Type<Fields>;
Encoded: Struct.Encoded<Fields>;
DecodingServices: Struct.DecodingServices<Fields>;
EncodingServices: Struct.EncodingServices<Fields>;
Iso: Struct.Iso<Fields>;
fields: Fields;
mapFields: (f: (fields: { readonly _tag: Schema.tag<'Any'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, …;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly _tag: 'Any'; readonly annotations?: { readonly [x: string]: unknown; } | undefined; }, readonly []>) => Schema.Struct<{ readonly _tag: Schema.tag<'Any'>; readonly annotations: Schema.optio…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly _tag: 'Any'; readonly annotations?: { readonly [x: string]: unknown } | undefined }>) => Schema.Struct<{ readonly _tag: Schema.tag<'Any'>; readonly annotations: Schema.optional<Schema.decodeT…;
check: (checks_0: SchemaAST.Check<{ readonly _tag: 'Any'; readonly annotations?: { readonly [x: string]: unknown } | undefined }>, ...checks: Array<SchemaAST.Check<{ readonly _tag: 'Any'; readonly annotations?: { readonly [x: string]: unknown } |…;
rebuild: (ast: SchemaAST.Objects) => Schema.Struct<{ readonly _tag: Schema.tag<'Any'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, Pr…;
make: (input: { readonly _tag?: 'Any' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => { readonly _tag: 'Any'; readonly annotations?: { readonly [x: string]: unknown } | undefined };
makeOption: (input: { readonly _tag?: 'Any' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Option_.Option<{ readonly _tag: 'Any'; readonly annotations?: { readonly [x: string]: unknown } …;
makeEffect: (input: { readonly _tag?: 'Any' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Effect.Effect<{ readonly _tag: 'Any'; readonly annotations?: { readonly [x: string]: unknown } |…;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Schema for the
Any
representation node.
$Any,
const $String: Schema.Struct<{
readonly _tag: Schema.tag<"String">;
readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
readonly checks: Schema.$Array<Schema.Codec<Check<Schema.Struct.ReadonlySide<{
readonly _tag: Schema.tag<"isStringFinite">;
readonly regExp: Schema.RegExp;
}, "Type"> | Schema.Struct.ReadonlySide<{
readonly _tag: Schema.tag<"isStringBigInt">;
readonly regExp: Schema.RegExp;
}, "Type"> | ... 17 more ... | Schema.Struct.ReadonlySide<...>>, Check<...>, never, never>>;
readonly contentMediaType: Schema.optional<...>;
readonly contentSchema: Schema.optional<...>;
}>
const $String: {
Type: Struct.Type<Fields>;
Encoded: Struct.Encoded<Fields>;
DecodingServices: Struct.DecodingServices<Fields>;
EncodingServices: Struct.EncodingServices<Fields>;
Iso: Struct.Iso<Fields>;
fields: Fields;
mapFields: (f: (fields: { readonly _tag: Schema.tag<'String'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly _tag: 'String'; readonly checks: ReadonlyArray<Check<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isStringFinite'>; readonly regExp: Schema.RegExp; }, 'Type'> | Schema.Struct.Re…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly _tag: 'String'; readonly checks: ReadonlyArray<Check<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isStringFinite'>; readonly regExp: Schema.RegExp }, 'Type'> | Schema.Struct.Readon…;
check: (checks_0: SchemaAST.Check<{ readonly _tag: 'String'; readonly checks: ReadonlyArray<Check<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isStringFinite'>; readonly regExp: Schema.RegExp }, 'Type'> | Schema.Struct.ReadonlySide<{ r…;
rebuild: (ast: SchemaAST.Objects) => Schema.Struct<{ readonly _tag: Schema.tag<'String'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree,…;
make: (input: { readonly checks: ReadonlyArray<unknown>; readonly _tag?: 'String' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined; readonly contentMediaType?: string | undefined; readonly contentSchema?: unknown…;
makeOption: (input: { readonly checks: ReadonlyArray<unknown>; readonly _tag?: 'String' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined; readonly contentMediaType?: string | undefined; readonly contentSchema?: unknown…;
makeEffect: (input: { readonly checks: ReadonlyArray<unknown>; readonly _tag?: 'String' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined; readonly contentMediaType?: string | undefined; readonly contentSchema?: unknown…;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Schema for the
String
representation node.
$String,
const $Number: Schema.Struct<{
readonly _tag: Schema.tag<"Number">;
readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
readonly checks: Schema.$Array<Schema.Codec<Check<Schema.Struct.ReadonlySide<{
readonly _tag: Schema.tag<"isInt">;
}, "Type"> | Schema.Struct.ReadonlySide<{
readonly _tag: Schema.tag<"isMultipleOf">;
readonly divisor: Schema.Finite;
}, "Type"> | ... 5 more ... | {
...;
}>, Check<...>, never, never>>;
}>
const $Number: {
Type: Struct.Type<Fields>;
Encoded: Struct.Encoded<Fields>;
DecodingServices: Struct.DecodingServices<Fields>;
EncodingServices: Struct.EncodingServices<Fields>;
Iso: Struct.Iso<Fields>;
fields: Fields;
mapFields: (f: (fields: { readonly _tag: Schema.tag<'Number'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly _tag: 'Number'; readonly checks: ReadonlyArray<Check<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isInt'>; }, 'Type'> | Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'i…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly _tag: 'Number'; readonly checks: ReadonlyArray<Check<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isInt'> }, 'Type'> | Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isMul…;
check: (checks_0: SchemaAST.Check<{ readonly _tag: 'Number'; readonly checks: ReadonlyArray<Check<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isInt'> }, 'Type'> | Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isMultipleOf'>;…;
rebuild: (ast: SchemaAST.Objects) => Schema.Struct<{ readonly _tag: Schema.tag<'Number'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree,…;
make: (input: { readonly checks: ReadonlyArray<unknown>; readonly _tag?: 'Number' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => { readonly _tag: 'Number'; readonly checks: Readonly…;
makeOption: (input: { readonly checks: ReadonlyArray<unknown>; readonly _tag?: 'Number' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Option_.Option<{ readonly _tag: 'Number'; readonly c…;
makeEffect: (input: { readonly checks: ReadonlyArray<unknown>; readonly _tag?: 'Number' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Effect.Effect<{ readonly _tag: 'Number'; readonly ch…;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Schema for the
Number
representation node.
$Number,
const $Boolean: Schema.Struct<{
readonly _tag: Schema.tag<"Boolean">
readonly annotations: Schema.optional<
Schema.decodeTo<
Schema.$Record<
Schema.String,
Schema.Unknown
>,
Schema.$Record<
Schema.String,
Schema.Codec<
PrimitiveTree,
PrimitiveTree,
never,
never
>
>,
never,
never
>
>
}>
const $Boolean: {
Type: Struct.Type<Fields>;
Encoded: Struct.Encoded<Fields>;
DecodingServices: Struct.DecodingServices<Fields>;
EncodingServices: Struct.EncodingServices<Fields>;
Iso: Struct.Iso<Fields>;
fields: Fields;
mapFields: (f: (fields: { readonly _tag: Schema.tag<'Boolean'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly _tag: 'Boolean'; readonly annotations?: { readonly [x: string]: unknown; } | undefined; }, readonly []>) => Schema.Struct<{ readonly _tag: Schema.tag<'Boolean'>; readonly annotations: Sche…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly _tag: 'Boolean'; readonly annotations?: { readonly [x: string]: unknown } | undefined }>) => Schema.Struct<{ readonly _tag: Schema.tag<'Boolean'>; readonly annotations: Schema.optional<Schema…;
check: (checks_0: SchemaAST.Check<{ readonly _tag: 'Boolean'; readonly annotations?: { readonly [x: string]: unknown } | undefined }>, ...checks: Array<SchemaAST.Check<{ readonly _tag: 'Boolean'; readonly annotations?: { readonly [x: string]: unk…;
rebuild: (ast: SchemaAST.Objects) => Schema.Struct<{ readonly _tag: Schema.tag<'Boolean'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree…;
make: (input: { readonly _tag?: 'Boolean' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => { readonly _tag: 'Boolean'; readonly annotations?: { readonly [x: string]: unknown } | undef…;
makeOption: (input: { readonly _tag?: 'Boolean' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Option_.Option<{ readonly _tag: 'Boolean'; readonly annotations?: { readonly [x: string]: un…;
makeEffect: (input: { readonly _tag?: 'Boolean' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Effect.Effect<{ readonly _tag: 'Boolean'; readonly annotations?: { readonly [x: string]: unk…;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Schema for the
Boolean
representation node.
$Boolean,
const $BigInt: Schema.Struct<{
readonly _tag: Schema.tag<"BigInt">
readonly annotations: Schema.optional<
Schema.decodeTo<
Schema.$Record<
Schema.String,
Schema.Unknown
>,
Schema.$Record<
Schema.String,
Schema.Codec<
PrimitiveTree,
PrimitiveTree,
never,
never
>
>,
never,
never
>
>
readonly checks: Schema.$Array<
Schema.Codec<
Check<
| Schema.Struct.ReadonlySide<
{
readonly _tag: Schema.tag<"isGreaterThanBigInt">
readonly exclusiveMinimum: Schema.BigInt
},
"Type"
>
| Schema.Struct.ReadonlySide<
{
readonly _tag: Schema.tag<"isGreaterThanOrEqualToBigInt">
readonly minimum: Schema.BigInt
},
"Type"
>
| Schema.Struct.ReadonlySide<
{
readonly _tag: Schema.tag<"isLessThanBigInt">
readonly exclusiveMaximum: Schema.BigInt
},
"Type"
>
| Schema.Struct.ReadonlySide<
{
readonly _tag: Schema.tag<"isLessThanOrEqualToBigInt">
readonly maximum: Schema.BigInt
},
"Type"
>
| {
readonly _tag: "isBetweenBigInt"
readonly minimum: bigint
readonly maximum: bigint
readonly exclusiveMinimum?:
| boolean
| undefined
readonly exclusiveMaximum?:
| boolean
| undefined
}
>,
Check<
| Schema.Struct.ReadonlySide<
{
readonly _tag: Schema.tag<"isGreaterThanBigInt">
readonly exclusiveMinimum: Schema.BigInt
},
"Type"
>
| Schema.Struct.ReadonlySide<
{
readonly _tag: Schema.tag<"isGreaterThanOrEqualToBigInt">
readonly minimum: Schema.BigInt
},
"Type"
>
| Schema.Struct.ReadonlySide<
{
readonly _tag: Schema.tag<"isLessThanBigInt">
readonly exclusiveMaximum: Schema.BigInt
},
"Type"
>
| Schema.Struct.ReadonlySide<
{
readonly _tag: Schema.tag<"isLessThanOrEqualToBigInt">
readonly maximum: Schema.BigInt
},
"Type"
>
| {
readonly _tag: "isBetweenBigInt"
readonly minimum: bigint
readonly maximum: bigint
readonly exclusiveMinimum?:
| boolean
| undefined
readonly exclusiveMaximum?:
| boolean
| undefined
}
>,
never,
never
>
>
}>
const $BigInt: {
Type: Struct.Type<Fields>;
Encoded: Struct.Encoded<Fields>;
DecodingServices: Struct.DecodingServices<Fields>;
EncodingServices: Struct.EncodingServices<Fields>;
Iso: Struct.Iso<Fields>;
fields: Fields;
mapFields: (f: (fields: { readonly _tag: Schema.tag<'BigInt'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly _tag: 'BigInt'; readonly checks: ReadonlyArray<Check<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isGreaterThanBigInt'>; readonly exclusiveMinimum: Schema.BigInt; }, 'Type'> | S…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly _tag: 'BigInt'; readonly checks: ReadonlyArray<Check<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isGreaterThanBigInt'>; readonly exclusiveMinimum: Schema.BigInt }, 'Type'> | Schem…;
check: (checks_0: SchemaAST.Check<{ readonly _tag: 'BigInt'; readonly checks: ReadonlyArray<Check<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isGreaterThanBigInt'>; readonly exclusiveMinimum: Schema.BigInt }, 'Type'> | Schema.Struct.R…;
rebuild: (ast: SchemaAST.Objects) => Schema.Struct<{ readonly _tag: Schema.tag<'BigInt'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree,…;
make: (input: { readonly checks: ReadonlyArray<unknown>; readonly _tag?: 'BigInt' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => { readonly _tag: 'BigInt'; readonly checks: Readonly…;
makeOption: (input: { readonly checks: ReadonlyArray<unknown>; readonly _tag?: 'BigInt' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Option_.Option<{ readonly _tag: 'BigInt'; readonly c…;
makeEffect: (input: { readonly checks: ReadonlyArray<unknown>; readonly _tag?: 'BigInt' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Effect.Effect<{ readonly _tag: 'BigInt'; readonly ch…;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Schema for the
BigInt
representation node.
When to use
Use to encode, decode, or validate serialized BigInt representation nodes,
not application bigint values.
Details
Accepts representation nodes with _tag: "BigInt", optional annotations,
and bigint-specific validation metadata in checks.
$BigInt,
const $Symbol: Schema.Struct<{
readonly _tag: Schema.tag<"Symbol">
readonly annotations: Schema.optional<
Schema.decodeTo<
Schema.$Record<
Schema.String,
Schema.Unknown
>,
Schema.$Record<
Schema.String,
Schema.Codec<
PrimitiveTree,
PrimitiveTree,
never,
never
>
>,
never,
never
>
>
}>
const $Symbol: {
Type: Struct.Type<Fields>;
Encoded: Struct.Encoded<Fields>;
DecodingServices: Struct.DecodingServices<Fields>;
EncodingServices: Struct.EncodingServices<Fields>;
Iso: Struct.Iso<Fields>;
fields: Fields;
mapFields: (f: (fields: { readonly _tag: Schema.tag<'Symbol'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly _tag: 'Symbol'; readonly annotations?: { readonly [x: string]: unknown; } | undefined; }, readonly []>) => Schema.Struct<{ readonly _tag: Schema.tag<'Symbol'>; readonly annotations: Schema…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly _tag: 'Symbol'; readonly annotations?: { readonly [x: string]: unknown } | undefined }>) => Schema.Struct<{ readonly _tag: Schema.tag<'Symbol'>; readonly annotations: Schema.optional<Schema.d…;
check: (checks_0: SchemaAST.Check<{ readonly _tag: 'Symbol'; readonly annotations?: { readonly [x: string]: unknown } | undefined }>, ...checks: Array<SchemaAST.Check<{ readonly _tag: 'Symbol'; readonly annotations?: { readonly [x: string]: unkno…;
rebuild: (ast: SchemaAST.Objects) => Schema.Struct<{ readonly _tag: Schema.tag<'Symbol'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree,…;
make: (input: { readonly _tag?: 'Symbol' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => { readonly _tag: 'Symbol'; readonly annotations?: { readonly [x: string]: unknown } | undefin…;
makeOption: (input: { readonly _tag?: 'Symbol' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Option_.Option<{ readonly _tag: 'Symbol'; readonly annotations?: { readonly [x: string]: unkn…;
makeEffect: (input: { readonly _tag?: 'Symbol' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Effect.Effect<{ readonly _tag: 'Symbol'; readonly annotations?: { readonly [x: string]: unkno…;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Schema for the
Symbol
representation node.
$Symbol,
const $Literal: Schema.Struct<{
readonly _tag: Schema.tag<"Literal">
readonly annotations: Schema.optional<
Schema.decodeTo<
Schema.$Record<
Schema.String,
Schema.Unknown
>,
Schema.$Record<
Schema.String,
Schema.Codec<
PrimitiveTree,
PrimitiveTree,
never,
never
>
>,
never,
never
>
>
readonly literal: Schema.Union<
readonly [
Schema.String,
Schema.Finite,
Schema.Boolean,
Schema.BigInt
]
>
}>
const $Literal: {
Type: Struct.Type<Fields>;
Encoded: Struct.Encoded<Fields>;
DecodingServices: Struct.DecodingServices<Fields>;
EncodingServices: Struct.EncodingServices<Fields>;
Iso: Struct.Iso<Fields>;
fields: Fields;
mapFields: (f: (fields: { readonly _tag: Schema.tag<'Literal'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly _tag: 'Literal'; readonly literal: string | number | bigint | boolean; readonly annotations?: { readonly [x: string]: unknown; } | undefined; }, readonly []>) => Schema.Struct<{ readonly _…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly _tag: 'Literal'; readonly literal: string | number | bigint | boolean; readonly annotations?: { readonly [x: string]: unknown } | undefined }>) => Schema.Struct<{ readonly _tag: Schema.tag<'L…;
check: (checks_0: SchemaAST.Check<{ readonly _tag: 'Literal'; readonly literal: string | number | bigint | boolean; readonly annotations?: { readonly [x: string]: unknown } | undefined }>, ...checks: Array<SchemaAST.Check<{ readonly _tag: 'Litera…;
rebuild: (ast: SchemaAST.Objects) => Schema.Struct<{ readonly _tag: Schema.tag<'Literal'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree…;
make: (input: { readonly literal: string | number | bigint | boolean; readonly _tag?: 'Literal' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => { readonly _tag: 'Literal'; readonly l…;
makeOption: (input: { readonly literal: string | number | bigint | boolean; readonly _tag?: 'Literal' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Option_.Option<{ readonly _tag: 'Liter…;
makeEffect: (input: { readonly literal: string | number | bigint | boolean; readonly _tag?: 'Literal' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Effect.Effect<{ readonly _tag: 'Litera…;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Schema for the
Literal
representation node.
$Literal,
const $UniqueSymbol: Schema.Struct<{
readonly _tag: Schema.tag<"UniqueSymbol">
readonly annotations: Schema.optional<
Schema.decodeTo<
Schema.$Record<
Schema.String,
Schema.Unknown
>,
Schema.$Record<
Schema.String,
Schema.Codec<
PrimitiveTree,
PrimitiveTree,
never,
never
>
>,
never,
never
>
>
readonly symbol: Schema.Symbol
}>
const $UniqueSymbol: {
Type: Struct.Type<Fields>;
Encoded: Struct.Encoded<Fields>;
DecodingServices: Struct.DecodingServices<Fields>;
EncodingServices: Struct.EncodingServices<Fields>;
Iso: Struct.Iso<Fields>;
fields: Fields;
mapFields: (f: (fields: { readonly _tag: Schema.tag<'UniqueSymbol'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, …;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly symbol: symbol; readonly _tag: 'UniqueSymbol'; readonly annotations?: { readonly [x: string]: unknown; } | undefined; }, readonly []>) => Schema.Struct<{ readonly _tag: Schema.tag<'UniqueS…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly symbol: symbol; readonly _tag: 'UniqueSymbol'; readonly annotations?: { readonly [x: string]: unknown } | undefined }>) => Schema.Struct<{ readonly _tag: Schema.tag<'UniqueSymbol'>; readonly …;
check: (checks_0: SchemaAST.Check<{ readonly symbol: symbol; readonly _tag: 'UniqueSymbol'; readonly annotations?: { readonly [x: string]: unknown } | undefined }>, ...checks: Array<SchemaAST.Check<{ readonly symbol: symbol; readonly _tag: 'Uniqu…;
rebuild: (ast: SchemaAST.Objects) => Schema.Struct<{ readonly _tag: Schema.tag<'UniqueSymbol'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<Primitiv…;
make: (input: { readonly symbol: symbol; readonly _tag?: 'UniqueSymbol' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => { readonly symbol: symbol; readonly _tag: 'UniqueSymbol'; read…;
makeOption: (input: { readonly symbol: symbol; readonly _tag?: 'UniqueSymbol' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Option_.Option<{ readonly symbol: symbol; readonly _tag: 'Uniq…;
makeEffect: (input: { readonly symbol: symbol; readonly _tag?: 'UniqueSymbol' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Effect.Effect<{ readonly symbol: symbol; readonly _tag: 'Uniqu…;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Schema for the
UniqueSymbol
representation node.
$UniqueSymbol,
const $ObjectKeyword: Schema.Struct<{
readonly _tag: Schema.tag<"ObjectKeyword">
readonly annotations: Schema.optional<
Schema.decodeTo<
Schema.$Record<
Schema.String,
Schema.Unknown
>,
Schema.$Record<
Schema.String,
Schema.Codec<
PrimitiveTree,
PrimitiveTree,
never,
never
>
>,
never,
never
>
>
}>
const $ObjectKeyword: {
Type: Struct.Type<Fields>;
Encoded: Struct.Encoded<Fields>;
DecodingServices: Struct.DecodingServices<Fields>;
EncodingServices: Struct.EncodingServices<Fields>;
Iso: Struct.Iso<Fields>;
fields: Fields;
mapFields: (f: (fields: { readonly _tag: Schema.tag<'ObjectKeyword'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never,…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly _tag: 'ObjectKeyword'; readonly annotations?: { readonly [x: string]: unknown; } | undefined; }, readonly []>) => Schema.Struct<{ readonly _tag: Schema.tag<'ObjectKeyword'>; readonly annot…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly _tag: 'ObjectKeyword'; readonly annotations?: { readonly [x: string]: unknown } | undefined }>) => Schema.Struct<{ readonly _tag: Schema.tag<'ObjectKeyword'>; readonly annotations: Schema.opt…;
check: (checks_0: SchemaAST.Check<{ readonly _tag: 'ObjectKeyword'; readonly annotations?: { readonly [x: string]: unknown } | undefined }>, ...checks: Array<SchemaAST.Check<{ readonly _tag: 'ObjectKeyword'; readonly annotations?: { readonly [x: …;
rebuild: (ast: SchemaAST.Objects) => Schema.Struct<{ readonly _tag: Schema.tag<'ObjectKeyword'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<Primiti…;
make: (input: { readonly _tag?: 'ObjectKeyword' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => { readonly _tag: 'ObjectKeyword'; readonly annotations?: { readonly [x: string]: unkno…;
makeOption: (input: { readonly _tag?: 'ObjectKeyword' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Option_.Option<{ readonly _tag: 'ObjectKeyword'; readonly annotations?: { readonly [x:…;
makeEffect: (input: { readonly _tag?: 'ObjectKeyword' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Effect.Effect<{ readonly _tag: 'ObjectKeyword'; readonly annotations?: { readonly [x: …;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Schema for the
ObjectKeyword
representation node.
$ObjectKeyword,
const $Enum: Schema.Struct<{
readonly _tag: Schema.tag<"Enum">
readonly annotations: Schema.optional<
Schema.decodeTo<
Schema.$Record<
Schema.String,
Schema.Unknown
>,
Schema.$Record<
Schema.String,
Schema.Codec<
PrimitiveTree,
PrimitiveTree,
never,
never
>
>,
never,
never
>
>
readonly enums: Schema.$Array<
Schema.Tuple<
readonly [
Schema.String,
Schema.Union<
readonly [Schema.String, Schema.Number]
>
]
>
>
}>
const $Enum: {
Type: Struct.Type<Fields>;
Encoded: Struct.Encoded<Fields>;
DecodingServices: Struct.DecodingServices<Fields>;
EncodingServices: Struct.EncodingServices<Fields>;
Iso: Struct.Iso<Fields>;
fields: Fields;
mapFields: (f: (fields: { readonly _tag: Schema.tag<'Enum'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>,…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly _tag: 'Enum'; readonly enums: ReadonlyArray<readonly [string, string | number]>; readonly annotations?: { readonly [x: string]: unknown; } | undefined; }, readonly []>) => Schema.Struct<{ …;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly _tag: 'Enum'; readonly enums: ReadonlyArray<readonly [string, string | number]>; readonly annotations?: { readonly [x: string]: unknown } | undefined }>) => Schema.Struct<{ readonly _tag: Sch…;
check: (checks_0: SchemaAST.Check<{ readonly _tag: 'Enum'; readonly enums: ReadonlyArray<readonly [string, string | number]>; readonly annotations?: { readonly [x: string]: unknown } | undefined }>, ...checks: Array<SchemaAST.Check<{ readonly _ta…;
rebuild: (ast: SchemaAST.Objects) => Schema.Struct<{ readonly _tag: Schema.tag<'Enum'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, P…;
make: (input: { readonly enums: ReadonlyArray<readonly [string, string | number]>; readonly _tag?: 'Enum' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => { readonly _tag: 'Enum'; rea…;
makeOption: (input: { readonly enums: ReadonlyArray<readonly [string, string | number]>; readonly _tag?: 'Enum' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Option_.Option<{ readonly _t…;
makeEffect: (input: { readonly enums: ReadonlyArray<readonly [string, string | number]>; readonly _tag?: 'Enum' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Effect.Effect<{ readonly _ta…;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Schema for the
Enum
representation node.
$Enum,
const $TemplateLiteral: Schema.Struct<{
readonly _tag: Schema.tag<"TemplateLiteral">
readonly annotations: Schema.optional<
Schema.decodeTo<
Schema.$Record<
Schema.String,
Schema.Unknown
>,
Schema.$Record<
Schema.String,
Schema.Codec<
PrimitiveTree,
PrimitiveTree,
never,
never
>
>,
never,
never
>
>
readonly parts: Schema.$Array<
Schema.suspend<$Representation>
>
}>
const $TemplateLiteral: {
Type: Struct.Type<Fields>;
Encoded: Struct.Encoded<Fields>;
DecodingServices: Struct.DecodingServices<Fields>;
EncodingServices: Struct.EncodingServices<Fields>;
Iso: Struct.Iso<Fields>;
fields: Fields;
mapFields: (f: (fields: { readonly _tag: Schema.tag<'TemplateLiteral'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, neve…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly _tag: 'TemplateLiteral'; readonly parts: ReadonlyArray<Representation>; readonly annotations?: { readonly [x: string]: unknown; } | undefined; }, readonly []>) => Schema.Struct<{ readonly …;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly _tag: 'TemplateLiteral'; readonly parts: ReadonlyArray<Representation>; readonly annotations?: { readonly [x: string]: unknown } | undefined }>) => Schema.Struct<{ readonly _tag: Schema.tag<'…;
check: (checks_0: SchemaAST.Check<{ readonly _tag: 'TemplateLiteral'; readonly parts: ReadonlyArray<Representation>; readonly annotations?: { readonly [x: string]: unknown } | undefined }>, ...checks: Array<SchemaAST.Check<{ readonly _tag: 'Templ…;
rebuild: (ast: SchemaAST.Objects) => Schema.Struct<{ readonly _tag: Schema.tag<'TemplateLiteral'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<Primi…;
make: (input: { readonly parts: ReadonlyArray<unknown>; readonly _tag?: 'TemplateLiteral' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => { readonly _tag: 'TemplateLiteral'; readonly…;
makeOption: (input: { readonly parts: ReadonlyArray<unknown>; readonly _tag?: 'TemplateLiteral' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Option_.Option<{ readonly _tag: 'TemplateLit…;
makeEffect: (input: { readonly parts: ReadonlyArray<unknown>; readonly _tag?: 'TemplateLiteral' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Effect.Effect<{ readonly _tag: 'TemplateLite…;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Schema for the
TemplateLiteral
representation node.
$TemplateLiteral,
const $Arrays: Schema.Struct<{
readonly _tag: Schema.tag<"Arrays">
readonly annotations: Schema.optional<
Schema.decodeTo<
Schema.$Record<
Schema.String,
Schema.Unknown
>,
Schema.$Record<
Schema.String,
Schema.Codec<
PrimitiveTree,
PrimitiveTree,
never,
never
>
>,
never,
never
>
>
readonly elements: Schema.$Array<
Schema.Struct<{
readonly isOptional: Schema.Boolean
readonly type: Schema.suspend<$Representation>
readonly annotations: Schema.optional<
Schema.decodeTo<
Schema.$Record<
Schema.String,
Schema.Unknown
>,
Schema.$Record<
Schema.String,
Schema.Codec<
PrimitiveTree,
PrimitiveTree,
never,
never
>
>,
never,
never
>
>
}>
>
readonly rest: Schema.$Array<
Schema.suspend<$Representation>
>
readonly checks: Schema.$Array<
Schema.Codec<
Check<
| Schema.Struct.ReadonlySide<
{
readonly _tag: Schema.tag<"isMinLength">
readonly minLength: Schema.Int
},
"Type"
>
| Schema.Struct.ReadonlySide<
{
readonly _tag: Schema.tag<"isMaxLength">
readonly maxLength: Schema.Int
},
"Type"
>
| Schema.Struct.ReadonlySide<
{
readonly _tag: Schema.tag<"isLengthBetween">
readonly minimum: Schema.Int
readonly maximum: Schema.Int
},
"Type"
>
| Schema.Struct.ReadonlySide<
{
readonly _tag: Schema.tag<"isUnique">
},
"Type"
>
>,
Check<
| Schema.Struct.ReadonlySide<
{
readonly _tag: Schema.tag<"isMinLength">
readonly minLength: Schema.Int
},
"Type"
>
| Schema.Struct.ReadonlySide<
{
readonly _tag: Schema.tag<"isMaxLength">
readonly maxLength: Schema.Int
},
"Type"
>
| Schema.Struct.ReadonlySide<
{
readonly _tag: Schema.tag<"isLengthBetween">
readonly minimum: Schema.Int
readonly maximum: Schema.Int
},
"Type"
>
| Schema.Struct.ReadonlySide<
{
readonly _tag: Schema.tag<"isUnique">
},
"Type"
>
>,
never,
never
>
>
}>
const $Arrays: {
Type: Struct.Type<Fields>;
Encoded: Struct.Encoded<Fields>;
DecodingServices: Struct.DecodingServices<Fields>;
EncodingServices: Struct.EncodingServices<Fields>;
Iso: Struct.Iso<Fields>;
fields: Fields;
mapFields: (f: (fields: { readonly _tag: Schema.tag<'Arrays'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly _tag: 'Arrays'; readonly checks: ReadonlyArray<Check<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isMinLength'>; readonly minLength: Schema.Int; }, 'Type'> | Schema.Struct.Reado…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly _tag: 'Arrays'; readonly checks: ReadonlyArray<Check<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isMinLength'>; readonly minLength: Schema.Int }, 'Type'> | Schema.Struct.ReadonlyS…;
check: (checks_0: SchemaAST.Check<{ readonly _tag: 'Arrays'; readonly checks: ReadonlyArray<Check<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isMinLength'>; readonly minLength: Schema.Int }, 'Type'> | Schema.Struct.ReadonlySide<{ read…;
rebuild: (ast: SchemaAST.Objects) => Schema.Struct<{ readonly _tag: Schema.tag<'Arrays'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree,…;
make: (input: { readonly checks: ReadonlyArray<unknown>; readonly elements: ReadonlyArray<{ readonly isOptional: boolean; readonly type: unknown; readonly annotations?: { readonly [x: string]: unknown } | undefined }>; readonly rest: ReadonlyArr…;
makeOption: (input: { readonly checks: ReadonlyArray<unknown>; readonly elements: ReadonlyArray<{ readonly isOptional: boolean; readonly type: unknown; readonly annotations?: { readonly [x: string]: unknown } | undefined }>; readonly rest: ReadonlyArr…;
makeEffect: (input: { readonly checks: ReadonlyArray<unknown>; readonly elements: ReadonlyArray<{ readonly isOptional: boolean; readonly type: unknown; readonly annotations?: { readonly [x: string]: unknown } | undefined }>; readonly rest: ReadonlyArr…;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Schema for the
Arrays
representation node.
$Arrays,
const $Objects: Schema.Struct<{
readonly _tag: Schema.tag<"Objects">;
readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
readonly propertySignatures: Schema.$Array<Schema.Struct<{
readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
readonly name: Schema.Union<...>;
readonly type: Schema.suspend<...>;
readonly isOptional: Schema.Boolean;
readonly isMutable: Schema.Boolean;
}>>;
readonly indexSignatures: Schema.$Array<...>;
readonly checks: Schema.$Array<...>;
}>
const $Objects: {
Type: Struct.Type<Fields>;
Encoded: Struct.Encoded<Fields>;
DecodingServices: Struct.DecodingServices<Fields>;
EncodingServices: Struct.EncodingServices<Fields>;
Iso: Struct.Iso<Fields>;
fields: Fields;
mapFields: (f: (fields: { readonly _tag: Schema.tag<'Objects'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly _tag: 'Objects'; readonly checks: ReadonlyArray<Check<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isMinProperties'>; readonly minProperties: Schema.Int; }, 'Type'> | Schema.Str…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly _tag: 'Objects'; readonly checks: ReadonlyArray<Check<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isMinProperties'>; readonly minProperties: Schema.Int }, 'Type'> | Schema.Struct.…;
check: (checks_0: SchemaAST.Check<{ readonly _tag: 'Objects'; readonly checks: ReadonlyArray<Check<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isMinProperties'>; readonly minProperties: Schema.Int }, 'Type'> | Schema.Struct.ReadonlySi…;
rebuild: (ast: SchemaAST.Objects) => Schema.Struct<{ readonly _tag: Schema.tag<'Objects'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree…;
make: (input: { readonly checks: ReadonlyArray<unknown>; readonly propertySignatures: ReadonlyArray<{ readonly isOptional: boolean; readonly type: unknown; readonly name: string | number | symbol; readonly isMutable: boolean; readonly annotation…;
makeOption: (input: { readonly checks: ReadonlyArray<unknown>; readonly propertySignatures: ReadonlyArray<{ readonly isOptional: boolean; readonly type: unknown; readonly name: string | number | symbol; readonly isMutable: boolean; readonly annotation…;
makeEffect: (input: { readonly checks: ReadonlyArray<unknown>; readonly propertySignatures: ReadonlyArray<{ readonly isOptional: boolean; readonly type: unknown; readonly name: string | number | symbol; readonly isMutable: boolean; readonly annotation…;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Schema for the
Objects
representation node.
$Objects,
const $Union: Schema.Struct<{
readonly _tag: Schema.tag<"Union">
readonly annotations: Schema.optional<
Schema.decodeTo<
Schema.$Record<
Schema.String,
Schema.Unknown
>,
Schema.$Record<
Schema.String,
Schema.Codec<
PrimitiveTree,
PrimitiveTree,
never,
never
>
>,
never,
never
>
>
readonly types: Schema.$Array<
Schema.suspend<$Representation>
>
readonly mode: Schema.Literals<
readonly ["anyOf", "oneOf"]
>
}>
const $Union: {
Type: Struct.Type<Fields>;
Encoded: Struct.Encoded<Fields>;
DecodingServices: Struct.DecodingServices<Fields>;
EncodingServices: Struct.EncodingServices<Fields>;
Iso: Struct.Iso<Fields>;
fields: Fields;
mapFields: (f: (fields: { readonly _tag: Schema.tag<'Union'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly _tag: 'Union'; readonly types: ReadonlyArray<Representation>; readonly mode: 'anyOf' | 'oneOf'; readonly annotations?: { readonly [x: string]: unknown; } | undefined; }, readonly []>) => S…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly _tag: 'Union'; readonly types: ReadonlyArray<Representation>; readonly mode: 'anyOf' | 'oneOf'; readonly annotations?: { readonly [x: string]: unknown } | undefined }>) => Schema.Struct<{ rea…;
check: (checks_0: SchemaAST.Check<{ readonly _tag: 'Union'; readonly types: ReadonlyArray<Representation>; readonly mode: 'anyOf' | 'oneOf'; readonly annotations?: { readonly [x: string]: unknown } | undefined }>, ...checks: Array<SchemaAST.Check…;
rebuild: (ast: SchemaAST.Objects) => Schema.Struct<{ readonly _tag: Schema.tag<'Union'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, …;
make: (input: { readonly types: ReadonlyArray<unknown>; readonly mode: 'anyOf' | 'oneOf'; readonly _tag?: 'Union' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => { readonly _tag: 'Un…;
makeOption: (input: { readonly types: ReadonlyArray<unknown>; readonly mode: 'anyOf' | 'oneOf'; readonly _tag?: 'Union' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Option_.Option<{ rea…;
makeEffect: (input: { readonly types: ReadonlyArray<unknown>; readonly mode: 'anyOf' | 'oneOf'; readonly _tag?: 'Union' | undefined; readonly annotations?: { readonly [x: string]: unknown } | undefined }, options?: MakeOptions) => Effect.Effect<{ read…;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Schema for the
Union
representation node.
$Union,
const $Reference: Schema.Struct<{
readonly _tag: Schema.tag<"Reference">
readonly $ref: Schema.String
}>
const $Reference: {
Type: Struct.Type<Fields>;
Encoded: Struct.Encoded<Fields>;
DecodingServices: Struct.DecodingServices<Fields>;
EncodingServices: Struct.EncodingServices<Fields>;
Iso: Struct.Iso<Fields>;
fields: Fields;
mapFields: (f: (fields: { readonly _tag: Schema.tag<'Reference'>; readonly $ref: Schema.String }) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Reference'>; readonly $ref: Schema.String; }, 'Type'>, readonly []>) => Schema.Struct<{ readonly _tag: Schema.tag<'Reference'>; readonly $ref: …;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Reference'>; readonly $ref: Schema.String }, 'Type'>>) => Schema.Struct<{ readonly _tag: Schema.tag<'Reference'>; readonly $ref: Schema.String }>;
check: (checks_0: SchemaAST.Check<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Reference'>; readonly $ref: Schema.String }, 'Type'>>, ...checks: Array<SchemaAST.Check<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Reference'>;…;
rebuild: (ast: SchemaAST.Objects) => Schema.Struct<{ readonly _tag: Schema.tag<'Reference'>; readonly $ref: Schema.String }>;
make: (input: { readonly $ref: string; readonly _tag?: 'Reference' | undefined }, options?: MakeOptions) => Struct.ReadonlySide<{ readonly _tag: tag<'Reference'>; readonly $ref: String }, 'Type'>;
makeOption: (input: { readonly $ref: string; readonly _tag?: 'Reference' | undefined }, options?: MakeOptions) => Option_.Option<Struct.ReadonlySide<{ readonly _tag: tag<'Reference'>; readonly $ref: String }, 'Type'>>;
makeEffect: (input: { readonly $ref: string; readonly _tag?: 'Reference' | undefined }, options?: MakeOptions) => Effect.Effect<Struct.ReadonlySide<{ readonly _tag: tag<'Reference'>; readonly $ref: String }, 'Type'>, SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Schema for the
Reference
representation node.
$Reference,
const $Declaration: Schema.Struct<{
readonly _tag: Schema.tag<"Declaration">;
readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
readonly typeParameters: Schema.$Array<Schema.suspend<$Representation>>;
readonly checks: Schema.$Array<Schema.Codec<Check<Schema.Struct.ReadonlySide<{
readonly _tag: Schema.tag<"isDateValid">;
}, "Type"> | ... 7 more ... | Schema.Struct.ReadonlySide<...>>, Check<...>, never, never>>;
readonly encodedSchema: Schema.suspend<...>;
}>
const $Declaration: {
Type: Struct.Type<Fields>;
Encoded: Struct.Encoded<Fields>;
DecodingServices: Struct.DecodingServices<Fields>;
EncodingServices: Struct.EncodingServices<Fields>;
Iso: Struct.Iso<Fields>;
fields: Fields;
mapFields: (f: (fields: { readonly _tag: Schema.tag<'Declaration'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, n…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly typeParameters: ReadonlyArray<Representation>; readonly _tag: 'Declaration'; readonly checks: ReadonlyArray<Check<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isDateValid'>; }, …;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly typeParameters: ReadonlyArray<Representation>; readonly _tag: 'Declaration'; readonly checks: ReadonlyArray<Check<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isDateValid'> }, 'Typ…;
check: (checks_0: SchemaAST.Check<{ readonly typeParameters: ReadonlyArray<Representation>; readonly _tag: 'Declaration'; readonly checks: ReadonlyArray<Check<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isDateValid'> }, 'Type'> | Sche…;
rebuild: (ast: SchemaAST.Objects) => Schema.Struct<{ readonly _tag: Schema.tag<'Declaration'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<Primitive…;
make: (input: { readonly typeParameters: ReadonlyArray<unknown>; readonly checks: ReadonlyArray<unknown>; readonly encodedSchema: unknown; readonly _tag?: 'Declaration' | undefined; readonly annotations?: { readonly [x: string]: unknown } | unde…;
makeOption: (input: { readonly typeParameters: ReadonlyArray<unknown>; readonly checks: ReadonlyArray<unknown>; readonly encodedSchema: unknown; readonly _tag?: 'Declaration' | undefined; readonly annotations?: { readonly [x: string]: unknown } | unde…;
makeEffect: (input: { readonly typeParameters: ReadonlyArray<unknown>; readonly checks: ReadonlyArray<unknown>; readonly encodedSchema: unknown; readonly _tag?: 'Declaration' | undefined; readonly annotations?: { readonly [x: string]: unknown } | unde…;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Schema for the
Declaration
representation node.
$Declaration,
const $Suspend: Schema.Struct<{
readonly _tag: Schema.tag<"Suspend">
readonly annotations: Schema.optional<
Schema.decodeTo<
Schema.$Record<
Schema.String,
Schema.Unknown
>,
Schema.$Record<
Schema.String,
Schema.Codec<
PrimitiveTree,
PrimitiveTree,
never,
never
>
>,
never,
never
>
>
readonly checks: Schema.Tuple<readonly []>
readonly thunk: Schema.suspend<$Representation>
}>
const $Suspend: {
Type: Struct.Type<Fields>;
Encoded: Struct.Encoded<Fields>;
DecodingServices: Struct.DecodingServices<Fields>;
EncodingServices: Struct.EncodingServices<Fields>;
Iso: Struct.Iso<Fields>;
fields: Fields;
mapFields: <To>(f: (fields: { readonly _tag: Schema.tag<'Suspend'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, n…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly _tag: 'Suspend'; readonly checks: readonly []; readonly thunk: Representation; readonly annotations?: { readonly [x: string]: unknown; } | undefined; }, readonly []>) => Schema.Struct<{ re…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly _tag: 'Suspend'; readonly checks: readonly []; readonly thunk: Representation; readonly annotations?: { readonly [x: string]: unknown; } | undefined; }>) => Schema.Struct<{ readonly _tag: Sch…;
check: (checks_0: SchemaAST.Check<{ readonly _tag: 'Suspend'; readonly checks: readonly []; readonly thunk: Representation; readonly annotations?: { readonly [x: string]: unknown; } | undefined; }>, ...checks: Array<SchemaAST.Check<{ readonly _ta…;
rebuild: (ast: SchemaAST.Objects) => Schema.Struct<{ readonly _tag: Schema.tag<'Suspend'>; readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree…;
make: (input: { readonly checks: readonly []; readonly thunk: unknown; readonly _tag?: 'Suspend' | undefined; readonly annotations?: { readonly [x: string]: unknown; } | undefined; }, options?: Schema.MakeOptions) => { readonly _tag: 'Suspend'; …;
makeOption: (input: { readonly checks: readonly []; readonly thunk: unknown; readonly _tag?: 'Suspend' | undefined; readonly annotations?: { readonly [x: string]: unknown; } | undefined; }, options?: Schema.MakeOptions) => Option.Option<{ readonly _ta…;
makeEffect: (input: { readonly checks: readonly []; readonly thunk: unknown; readonly _tag?: 'Suspend' | undefined; readonly annotations?: { readonly [x: string]: unknown; } | undefined; }, options?: Schema.MakeOptions) => Effect<{ readonly _tag: 'Sus…;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Schema for the
Suspend
representation node.
$Suspend
]).Bottom<unknown, unknown, unknown, unknown, Union<...>, Union<...>, ... 8 more ..., "required">.annotate(annotations: Schema.Annotations.Bottom<{
readonly _tag: "Null";
readonly annotations?: {
readonly [x: string]: unknown;
} | undefined;
} | {
readonly _tag: "Undefined";
readonly annotations?: {
readonly [x: string]: unknown;
} | undefined;
} | {
readonly _tag: "Void";
readonly annotations?: {
readonly [x: string]: unknown;
} | undefined;
} | {
readonly _tag: "Never";
readonly annotations?: {
readonly [x: string]: unknown;
} | undefined;
} | {
readonly _tag: "Unknown";
readonly annotations?: {
readonly [x: string]: unknown;
} | undefined;
} | {
readonly _tag: "Any";
readonly annotations?: {
readonly [x: string]: unknown;
} | undefined;
} | {
readonly _tag: "String";
readonly checks: readonly Check<Schema.Struct<Fields extends Schema.Struct.Fields>.ReadonlySide<{
readonly _tag: Schema.tag<"isStringFinite">;
readonly regExp: Schema.RegExp;
}, "Type"> | ... 18 more ... | Schema.Struct.ReadonlySide<...>>[];
readonly contentMediaType?: string | undefined;
readonly contentSchema?: Representation | undefined;
readonly annotations?: {
readonly [x: string]: unknown;
} | undefined;
} | ... 14 more ... | {
...;
}, readonly []>): Schema.Union<...>
annotate({ Annotations.Bottom<T, TypeParameters extends ReadonlyArray<Constraint>>.identifier?: string | undefinedStable identifier for this schema node.
Details
Identifiers are used by schema tooling, including JSON Schema
generation, to name references. The default formatter also uses
identifier as the expected label for type-level failures, such as
Expected UserId, got null.
identifier does not name a failed filter or refinement. If the base
type matches and a filter fails, put expected or message on the
filter/refinement instead.
identifier: "Schema" })