Schema.Struct<{
readonly representation: $Representation
readonly references: Schema.$Record<Schema.String, $Representation>
}>Schema for Document.
When to use
Use to validate or serialize a single schema representation document with
Schema.decodeUnknownSync or Schema.encodeSync.
Gotchas
This codec validates document structure but does not resolve $ref keys
against references.
export const const $Document: Schema.Struct<{
readonly representation: $Representation
readonly references: Schema.$Record<
Schema.String,
$Representation
>
}>
const $Document: {
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 representation: $Representation; readonly references: Schema.$Record<Schema.String, $Representation> }) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in …;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.ReadonlySide<{ readonly representation: $Representation; readonly references: Schema.$Record<Schema.String, $Representation>; }, 'Type'>, readonly []>) => Schema.Struct<{ readonly repre…;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.ReadonlySide<{ readonly representation: $Representation; readonly references: Schema.$Record<Schema.String, $Representation> }, 'Type'>>) => Schema.Struct<{ readonly representation: $Repre…;
check: (checks_0: SchemaAST.Check<Schema.Struct.ReadonlySide<{ readonly representation: $Representation; readonly references: Schema.$Record<Schema.String, $Representation> }, 'Type'>>, ...checks: Array<SchemaAST.Check<Schema.Struct.ReadonlySide<…;
rebuild: (ast: SchemaAST.Objects) => Schema.Struct<{ readonly representation: $Representation; readonly references: Schema.$Record<Schema.String, $Representation> }>;
make: (input: Struct.ReadonlyMakeIn<{ readonly representation: SchemaRepresentation.$Representation; readonly references: $Record<String, SchemaRepresentation.$Representation> }>, options?: MakeOptions) => Struct.ReadonlySide<{ readonly represen…;
makeOption: (input: Struct.ReadonlyMakeIn<{ readonly representation: SchemaRepresentation.$Representation; readonly references: $Record<String, SchemaRepresentation.$Representation> }>, options?: MakeOptions) => Option_.Option<Struct.ReadonlySide<{ re…;
makeEffect: (input: Struct.ReadonlyMakeIn<{ readonly representation: SchemaRepresentation.$Representation; readonly references: $Record<String, SchemaRepresentation.$Representation> }>, options?: MakeOptions) => Effect.Effect<Struct.ReadonlySide<{ rea…;
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
Document
.
When to use
Use to validate or serialize a single schema representation document with
Schema.decodeUnknownSync or Schema.encodeSync.
Gotchas
This codec validates document structure but does not resolve $ref keys
against references.
$Document = import SchemaSchema.Struct({
representation: $Representation(property) 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; <…;
}
representation: 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,
references: Schema.$Record<
Schema.String,
$Representation
>
(property) references: {
Type: Record.Type<Key, Value>;
Encoded: Record.Encoded<Key, Value>;
DecodingServices: Record.DecodingServices<Key, Value>;
EncodingServices: Record.EncodingServices<Key, Value>;
Iso: Record.Iso<Key, Value>;
key: Key;
value: Value;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly [x: string]: Representation; }, readonly []>) => Schema.$Record<Schema.String, $Representation>;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly [x: string]: Representation }>) => Schema.$Record<Schema.String, $Representation>;
check: (checks_0: SchemaAST.Check<{ readonly [x: string]: Representation }>, ...checks: Array<SchemaAST.Check<{ readonly [x: string]: Representation }>>) => Schema.$Record<Schema.String, $Representation>;
rebuild: (ast: SchemaAST.Objects) => Schema.$Record<Schema.String, $Representation>;
make: (input: { readonly [x: string]: unknown }, options?: MakeOptions) => { readonly [x: string]: SchemaRepresentation.Representation };
makeOption: (input: { readonly [x: string]: unknown }, options?: MakeOptions) => Option_.Option<{ readonly [x: string]: SchemaRepresentation.Representation }>;
makeEffect: (input: { readonly [x: string]: unknown }, options?: MakeOptions) => Effect.Effect<{ readonly [x: string]: 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; <…;
}
references: import SchemaSchema.Record(import SchemaSchema.String, 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)
}).annotate({ identifier: stringidentifier: "Document" })