Schema.decodeTo<
Schema.$Record<Schema.String, Schema.Unknown>,
Schema.$Record<
Schema.String,
Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>
>,
never,
never
>Schema for serializing public Schema.Annotations.Annotations values. It
filters out internal annotation keys and non-primitive values during
encoding.
When to use
Use to serialize schema annotations in representation schemas while retaining only primitive-tree metadata.
Details
Decoding is passthrough. Encoding removes internal annotation keys and values
that are not accepted by $PrimitiveTree.
export const const $Annotations: Schema.decodeTo<
Schema.$Record<Schema.String, Schema.Unknown>,
Schema.$Record<
Schema.String,
Schema.Codec<
PrimitiveTree,
PrimitiveTree,
never,
never
>
>,
never,
never
>
const $Annotations: {
Type: To["Type"];
Encoded: From["Encoded"];
DecodingServices: To["DecodingServices"] | From["DecodingServices"] | RD;
EncodingServices: To["EncodingServices"] | From["EncodingServices"] | RE;
Iso: To["Iso"];
from: From;
to: To;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly [x: string]: unknown; }, readonly []>) => Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, nev…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly [x: string]: unknown }>) => Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, neve…;
check: (checks_0: SchemaAST.Check<{ readonly [x: string]: unknown }>, ...checks: Array<SchemaAST.Check<{ readonly [x: string]: unknown }>>) => Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Cod…;
rebuild: (ast: SchemaAST.Objects) => Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>;
make: (input: { readonly [x: string]: unknown }, options?: MakeOptions) => { readonly [x: string]: unknown };
makeOption: (input: { readonly [x: string]: unknown }, options?: MakeOptions) => Option_.Option<{ readonly [x: string]: unknown }>;
makeEffect: (input: { readonly [x: string]: unknown }, options?: MakeOptions) => Effect.Effect<{ readonly [x: string]: unknown }, 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 serializing public Schema.Annotations.Annotations values. It
filters out internal annotation keys and non-primitive values during
encoding.
When to use
Use to serialize schema annotations in representation schemas while retaining
only primitive-tree metadata.
Details
Decoding is passthrough. Encoding removes internal annotation keys and values
that are not accepted by $PrimitiveTree.
$Annotations = import SchemaSchema.Record(import SchemaSchema.String, import SchemaSchema.Unknown).pipe(
import SchemaSchema.encodeTo(import SchemaSchema.Record(import SchemaSchema.String, const $PrimitiveTree: Schema.Codec<PrimitiveTree>const $PrimitiveTree: {
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
Rebuild: Codec<T, E, RD, RE>;
Type: T;
Iso: Iso;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<PrimitiveTree, any>) => Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>;
annotateKey: (annotations: Schema.Annotations.Key<PrimitiveTree>) => Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>;
check: (checks_0: SchemaAST.Check<PrimitiveTree>, ...checks: Array<SchemaAST.Check<PrimitiveTree>>) => Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>;
rebuild: (ast: SchemaAST.AST) => Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>;
make: (input: unknown, options?: MakeOptions) => SchemaRepresentation.PrimitiveTree;
makeOption: (input: unknown, options?: MakeOptions) => Option_.Option<SchemaRepresentation.PrimitiveTree>;
makeEffect: (input: unknown, options?: MakeOptions) => Effect.Effect<SchemaRepresentation.PrimitiveTree, 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
PrimitiveTree
.
When to use
Use to validate recursive annotation metadata trees whose leaves are null,
number, boolean, bigint, symbol, or string.
$PrimitiveTree), {
decode: SchemaGetter.Getter<
NoInfer<{
readonly [x: string]: PrimitiveTree
}>,
NoInfer<{
readonly [x: string]: PrimitiveTree
}>,
never
>
(property) decode: {
run: (input: Option.Option<E>, options: SchemaAST.ParseOptions) => Effect.Effect<Option.Option<T>, SchemaIssue.Issue, R>;
map: (f: (t: NoInfer<{ readonly [x: string]: PrimitiveTree }>) => T2) => SchemaGetter.Getter<T2, NoInfer<{ readonly [x: string]: PrimitiveTree }>, never>;
compose: (other: SchemaGetter.Getter<T2, NoInfer<{ readonly [x: string]: PrimitiveTree }>, R2>) => SchemaGetter.Getter<T2, NoInfer<{ readonly [x: string]: PrimitiveTree }>, R2>;
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; <…;
}
decode: import SchemaGetterSchemaGetter.passthrough(),
encode: SchemaGetter.Getter<
NoInfer<{
readonly [x: string]: PrimitiveTree
}>,
NoInfer<{ readonly [x: string]: unknown }>,
never
>
(property) encode: {
run: (input: Option.Option<E>, options: SchemaAST.ParseOptions) => Effect.Effect<Option.Option<T>, SchemaIssue.Issue, R>;
map: (f: (t: NoInfer<{ readonly [x: string]: PrimitiveTree }>) => T2) => SchemaGetter.Getter<T2, NoInfer<{ readonly [x: string]: unknown }>, never>;
compose: (other: SchemaGetter.Getter<T2, NoInfer<{ readonly [x: string]: PrimitiveTree }>, R2>) => SchemaGetter.Getter<T2, NoInfer<{ readonly [x: string]: unknown }>, R2>;
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; <…;
}
encode: import SchemaGetterSchemaGetter.transformOptional(import OptionOption.flatMap((r: anyr) => {
const const out: Record<
string,
(typeof $PrimitiveTree)["Type"]
>
out: type Record<K extends keyof any, T> = {
[P in K]: T
}
Construct a type with a set of properties K of type T
Record<string, typeof const $PrimitiveTree: Schema.Codec<PrimitiveTree>const $PrimitiveTree: {
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
Rebuild: Codec<T, E, RD, RE>;
Type: T;
Iso: Iso;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<PrimitiveTree, any>) => Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>;
annotateKey: (annotations: Schema.Annotations.Key<PrimitiveTree>) => Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>;
check: (checks_0: SchemaAST.Check<PrimitiveTree>, ...checks: Array<SchemaAST.Check<PrimitiveTree>>) => Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>;
rebuild: (ast: SchemaAST.AST) => Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>;
make: (input: unknown, options?: MakeOptions) => SchemaRepresentation.PrimitiveTree;
makeOption: (input: unknown, options?: MakeOptions) => Option_.Option<SchemaRepresentation.PrimitiveTree>;
makeEffect: (input: unknown, options?: MakeOptions) => Effect.Effect<SchemaRepresentation.PrimitiveTree, 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
PrimitiveTree
.
When to use
Use to validate recursive annotation metadata trees whose leaves are null,
number, boolean, bigint, symbol, or string.
$PrimitiveTree["Type"]> = {}
for (const [const k: stringk, const v: unknownv] of var Object: ObjectConstructorProvides functionality common to all JavaScript objects.
Object.ObjectConstructor.entries<unknown>(o: {
[s: string]: unknown;
} | ArrayLike<unknown>): [string, unknown][] (+1 overload)
Returns an array of key/values of the enumerable own properties of an object
entries(r: anyr)) {
if (!const toJsonAnnotationsBlacklist: Set<string>toJsonAnnotationsBlacklist.Set<string>.has(value: string): booleanhas(const k: stringk) && const isPrimitiveTree: anyisPrimitiveTree(const v: unknownv)) {
const out: Record<
string,
(typeof $PrimitiveTree)["Type"]
>
out[const k: stringk] = const v: PrimitiveTreev
}
}
return import RecRec.isEmptyRecord(const out: Record<
string,
(typeof $PrimitiveTree)["Type"]
>
out) ? import OptionOption.none() : import OptionOption.some(const out: Record<
string,
(typeof $PrimitiveTree)["Type"]
>
out)
}))
})
).annotate({ identifier: stringidentifier: "Annotations" })