Schema.Union<
readonly [
Schema.Struct<{
readonly _tag: Schema.tag<"isMinProperties">
readonly minProperties: Schema.Int
}>,
Schema.Struct<{
readonly _tag: Schema.tag<"isMaxProperties">
readonly maxProperties: Schema.Int
}>,
Schema.Struct<{
readonly _tag: Schema.tag<"isPropertiesLengthBetween">
readonly minimum: Schema.Int
readonly maximum: Schema.Int
}>,
Schema.Struct<{
readonly _tag: Schema.tag<"isPropertyNames">
readonly propertyNames: Schema.suspend<$Representation>
}>
]
>Schema for ObjectsMeta.
schemasObjectsMeta
Source effect/SchemaRepresentation.ts:13676 lines
export const const $ObjectsMeta: Schema.Union<
readonly [
Schema.Struct<{
readonly _tag: Schema.tag<"isMinProperties">
readonly minProperties: Schema.Int
}>,
Schema.Struct<{
readonly _tag: Schema.tag<"isMaxProperties">
readonly maxProperties: Schema.Int
}>,
Schema.Struct<{
readonly _tag: Schema.tag<"isPropertiesLengthBetween">
readonly minimum: Schema.Int
readonly maximum: Schema.Int
}>,
Schema.Struct<{
readonly _tag: Schema.tag<"isPropertyNames">
readonly propertyNames: Schema.suspend<$Representation>
}>
]
>
const $ObjectsMeta: {
Type: { [K in keyof Members]: Members[K]["Type"]; }[number];
Encoded: { [K in keyof Members]: Members[K]["Encoded"]; }[number];
DecodingServices: { [K in keyof Members]: Members[K]["DecodingServices"]; }[number];
EncodingServices: { [K in keyof Members]: Members[K]["EncodingServices"]; }[number];
Iso: { [K in keyof Members]: Members[K]["Iso"]; }[number];
members: Members;
mapMembers: (f: (members: readonly [Schema.Struct<{ readonly _tag: Schema.tag<'isMinProperties'>; readonly minProperties: Schema.Int }>, Schema.Struct<{ readonly _tag: Schema.tag<'isMaxProperties'>; readonly maxProperties: Schema.Int }>, Schema.Struct…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isMinProperties'>; readonly minProperties: Schema.Int; }, 'Type'> | Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isMaxProperties'>; …;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isMinProperties'>; readonly minProperties: Schema.Int }, 'Type'> | Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isMaxProperties'>; read…;
check: (checks_0: SchemaAST.Check<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isMinProperties'>; readonly minProperties: Schema.Int }, 'Type'> | Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isMaxProperties'>; readonly maxPr…;
rebuild: (ast: SchemaAST.Union<SchemaAST.Objects>) => Schema.Union<readonly [Schema.Struct<{ readonly _tag: Schema.tag<'isMinProperties'>; readonly minProperties: Schema.Int }>, Schema.Struct<{ readonly _tag: Schema.tag<'isMaxProperties'>; readonly…;
make: (input: { readonly minProperties: number; readonly _tag?: 'isMinProperties' | undefined } | { readonly maxProperties: number; readonly _tag?: 'isMaxProperties' | undefined } | { readonly minimum: number; readonly maximum: number; readonly …;
makeOption: (input: { readonly minProperties: number; readonly _tag?: 'isMinProperties' | undefined } | { readonly maxProperties: number; readonly _tag?: 'isMaxProperties' | undefined } | { readonly minimum: number; readonly maximum: number; readonly …;
makeEffect: (input: { readonly minProperties: number; readonly _tag?: 'isMinProperties' | undefined } | { readonly maxProperties: number; readonly _tag?: 'isMaxProperties' | undefined } | { readonly minimum: number; readonly maximum: number; readonly …;
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
ObjectsMeta
.
$ObjectsMeta = 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 $IsMinProperties: Schema.Struct<{
readonly _tag: Schema.tag<"isMinProperties">
readonly minProperties: Schema.Int
}>
const $IsMinProperties: {
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<'isMinProperties'>; readonly minProperties: Schema.Int }) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isMinProperties'>; readonly minProperties: Schema.Int; }, 'Type'>, readonly []>) => Schema.Struct<{ readonly _tag: Schema.tag<'isMinProperties'…;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isMinProperties'>; readonly minProperties: Schema.Int }, 'Type'>>) => Schema.Struct<{ readonly _tag: Schema.tag<'isMinProperties'>; readonly minPr…;
check: (checks_0: SchemaAST.Check<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isMinProperties'>; readonly minProperties: Schema.Int }, 'Type'>>, ...checks: Array<SchemaAST.Check<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'…;
rebuild: (ast: SchemaAST.Objects) => Schema.Struct<{ readonly _tag: Schema.tag<'isMinProperties'>; readonly minProperties: Schema.Int }>;
make: (input: { readonly minProperties: number; readonly _tag?: 'isMinProperties' | undefined }, options?: MakeOptions) => Struct.ReadonlySide<{ readonly _tag: tag<'isMinProperties'>; readonly minProperties: Int }, 'Type'>;
makeOption: (input: { readonly minProperties: number; readonly _tag?: 'isMinProperties' | undefined }, options?: MakeOptions) => Option_.Option<Struct.ReadonlySide<{ readonly _tag: tag<'isMinProperties'>; readonly minProperties: Int }, 'Type'>>;
makeEffect: (input: { readonly minProperties: number; readonly _tag?: 'isMinProperties' | undefined }, options?: MakeOptions) => Effect.Effect<Struct.ReadonlySide<{ readonly _tag: tag<'isMinProperties'>; readonly minProperties: Int }, 'Type'>, SchemaE…;
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; <…;
}
$IsMinProperties,
const $IsMaxProperties: Schema.Struct<{
readonly _tag: Schema.tag<"isMaxProperties">
readonly maxProperties: Schema.Int
}>
const $IsMaxProperties: {
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<'isMaxProperties'>; readonly maxProperties: Schema.Int }) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isMaxProperties'>; readonly maxProperties: Schema.Int; }, 'Type'>, readonly []>) => Schema.Struct<{ readonly _tag: Schema.tag<'isMaxProperties'…;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isMaxProperties'>; readonly maxProperties: Schema.Int }, 'Type'>>) => Schema.Struct<{ readonly _tag: Schema.tag<'isMaxProperties'>; readonly maxPr…;
check: (checks_0: SchemaAST.Check<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isMaxProperties'>; readonly maxProperties: Schema.Int }, 'Type'>>, ...checks: Array<SchemaAST.Check<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'…;
rebuild: (ast: SchemaAST.Objects) => Schema.Struct<{ readonly _tag: Schema.tag<'isMaxProperties'>; readonly maxProperties: Schema.Int }>;
make: (input: { readonly maxProperties: number; readonly _tag?: 'isMaxProperties' | undefined }, options?: MakeOptions) => Struct.ReadonlySide<{ readonly _tag: tag<'isMaxProperties'>; readonly maxProperties: Int }, 'Type'>;
makeOption: (input: { readonly maxProperties: number; readonly _tag?: 'isMaxProperties' | undefined }, options?: MakeOptions) => Option_.Option<Struct.ReadonlySide<{ readonly _tag: tag<'isMaxProperties'>; readonly maxProperties: Int }, 'Type'>>;
makeEffect: (input: { readonly maxProperties: number; readonly _tag?: 'isMaxProperties' | undefined }, options?: MakeOptions) => Effect.Effect<Struct.ReadonlySide<{ readonly _tag: tag<'isMaxProperties'>; readonly maxProperties: Int }, 'Type'>, SchemaE…;
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; <…;
}
$IsMaxProperties,
const $IsPropertiesLengthBetween: Schema.Struct<{
readonly _tag: Schema.tag<"isPropertiesLengthBetween">
readonly minimum: Schema.Int
readonly maximum: Schema.Int
}>
const $IsPropertiesLengthBetween: {
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<'isPropertiesLengthBetween'>; readonly minimum: Schema.Int; readonly maximum: Schema.Int }) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ […;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isPropertiesLengthBetween'>; readonly minimum: Schema.Int; readonly maximum: Schema.Int; }, 'Type'>, readonly []>) => Schema.Struct<{ readonly …;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isPropertiesLengthBetween'>; readonly minimum: Schema.Int; readonly maximum: Schema.Int }, 'Type'>>) => Schema.Struct<{ readonly _tag: Schema.tag<…;
check: (checks_0: SchemaAST.Check<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isPropertiesLengthBetween'>; readonly minimum: Schema.Int; readonly maximum: Schema.Int }, 'Type'>>, ...checks: Array<SchemaAST.Check<Schema.Struct.Readonly…;
rebuild: (ast: SchemaAST.Objects) => Schema.Struct<{ readonly _tag: Schema.tag<'isPropertiesLengthBetween'>; readonly minimum: Schema.Int; readonly maximum: Schema.Int }>;
make: (input: { readonly minimum: number; readonly maximum: number; readonly _tag?: 'isPropertiesLengthBetween' | undefined }, options?: MakeOptions) => Struct.ReadonlySide<{ readonly _tag: tag<'isPropertiesLengthBetween'>; readonly minimum: Int…;
makeOption: (input: { readonly minimum: number; readonly maximum: number; readonly _tag?: 'isPropertiesLengthBetween' | undefined }, options?: MakeOptions) => Option_.Option<Struct.ReadonlySide<{ readonly _tag: tag<'isPropertiesLengthBetween'>; readon…;
makeEffect: (input: { readonly minimum: number; readonly maximum: number; readonly _tag?: 'isPropertiesLengthBetween' | undefined }, options?: MakeOptions) => Effect.Effect<Struct.ReadonlySide<{ readonly _tag: tag<'isPropertiesLengthBetween'>; readonl…;
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; <…;
}
$IsPropertiesLengthBetween,
const $IsPropertyNames: Schema.Struct<{
readonly _tag: Schema.tag<"isPropertyNames">
readonly propertyNames: Schema.suspend<$Representation>
}>
const $IsPropertyNames: {
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<'isPropertyNames'>; readonly propertyNames: Schema.suspend<$Representation> }) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Re…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isPropertyNames'>; readonly propertyNames: Schema.suspend<$Representation>; }, 'Type'>, readonly []>) => Schema.Struct<{ readonly _tag: Schema.…;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isPropertyNames'>; readonly propertyNames: Schema.suspend<$Representation> }, 'Type'>>) => Schema.Struct<{ readonly _tag: Schema.tag<'isPropertyNa…;
check: (checks_0: SchemaAST.Check<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'isPropertyNames'>; readonly propertyNames: Schema.suspend<$Representation> }, 'Type'>>, ...checks: Array<SchemaAST.Check<Schema.Struct.ReadonlySide<{ readon…;
rebuild: (ast: SchemaAST.Objects) => Schema.Struct<{ readonly _tag: Schema.tag<'isPropertyNames'>; readonly propertyNames: Schema.suspend<$Representation> }>;
make: (input: { readonly propertyNames: unknown; readonly _tag?: 'isPropertyNames' | undefined }, options?: MakeOptions) => Struct.ReadonlySide<{ readonly _tag: tag<'isPropertyNames'>; readonly propertyNames: suspend<SchemaRepresentation.$Repres…;
makeOption: (input: { readonly propertyNames: unknown; readonly _tag?: 'isPropertyNames' | undefined }, options?: MakeOptions) => Option_.Option<Struct.ReadonlySide<{ readonly _tag: tag<'isPropertyNames'>; readonly propertyNames: suspend<SchemaReprese…;
makeEffect: (input: { readonly propertyNames: unknown; readonly _tag?: 'isPropertyNames' | undefined }, options?: MakeOptions) => Effect.Effect<Struct.ReadonlySide<{ readonly _tag: tag<'isPropertyNames'>; readonly propertyNames: suspend<SchemaRepresen…;
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; <…;
}
$IsPropertyNames
]).Bottom<unknown, unknown, unknown, unknown, Union<...>, Union<...>, ... 8 more ..., "required">.annotate(annotations: Schema.Annotations.Bottom<Schema.Struct<Fields extends Schema.Struct.Fields>.ReadonlySide<{
readonly _tag: Schema.tag<"isMinProperties">;
readonly minProperties: Schema.Int;
}, "Type"> | Schema.Struct.ReadonlySide<{
readonly _tag: Schema.tag<"isMaxProperties">;
readonly maxProperties: Schema.Int;
}, "Type"> | Schema.Struct.ReadonlySide<{
readonly _tag: Schema.tag<"isPropertiesLengthBetween">;
readonly minimum: Schema.Int;
readonly maximum: Schema.Int;
}, "Type"> | Schema.Struct.ReadonlySide<...>, 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: "ObjectsMeta" })Referenced by 1 symbols