<Sch extends Schema.Top>(itemSchema: Sch): Schema.Struct<{
readonly item: Sch
readonly entryId: Schema.String
readonly key: Schema.optional<Schema.String>
readonly priority: Schema.Literals<readonly ["high", "normal", "low"]>
readonly attempts: Schema.Number
readonly timestamps: Schema.Struct<{
readonly enqueuedAt: Schema.DateTimeUtc
readonly startedAt: Schema.optionalKey<Schema.DateTimeUtc>
readonly completedAt: Schema.optionalKey<Schema.DateTimeUtc>
readonly interruptedAt: Schema.optionalKey<Schema.DateTimeUtc>
}>
readonly batchId: Schema.optional<Schema.String>
readonly releaseId: Schema.optional<Schema.String>
readonly sourceHyperlinkId: Schema.optional<Schema.String>
readonly attributes: Schema.optional<
Schema.$Record<Schema.String, Schema.Unknown>
>
}>A queue entry on the wire, parameterized by the per-instance itemSchema. Mirrors the
engine's QueueEntry<T>; used inside queueEvent.
export const const queueEntry: <Sch extends Schema.Top>(itemSchema: Sch) => Schema.Struct<{
readonly item: Sch;
readonly entryId: Schema.String;
readonly key: Schema.optional<Schema.String>;
readonly priority: Schema.Literals<readonly ["high", "normal", "low"]>;
readonly attempts: Schema.Number;
readonly timestamps: Schema.Struct<{
readonly enqueuedAt: Schema.DateTimeUtc;
readonly startedAt: Schema.optionalKey<Schema.DateTimeUtc>;
readonly completedAt: Schema.optionalKey<Schema.DateTimeUtc>;
readonly interruptedAt: Schema.optionalKey<Schema.DateTimeUtc>;
}>;
readonly batchId: Schema.optional<...>;
readonly releaseId: Schema.optional<...>;
readonly sourceHyperlinkId: Schema.optional<...>;
readonly attributes: Schema.optional<...>;
}>
A queue entry on the wire, parameterized by the per-instance itemSchema. Mirrors the
engine's QueueEntry<T>; used inside
queueEvent
.
queueEntry = <function (type parameter) Sch in <Sch extends Schema.Top>(itemSchema: Sch): Schema.Struct<{
readonly item: Sch;
readonly entryId: Schema.String;
readonly key: Schema.optional<Schema.String>;
readonly priority: Schema.Literals<...>;
... 5 more ...;
readonly attributes: Schema.optional<...>;
}>
Sch extends import SchemaSchema.Top>(itemSchema: Sch extends Schema.TopitemSchema: function (type parameter) Sch in <Sch extends Schema.Top>(itemSchema: Sch): Schema.Struct<{
readonly item: Sch;
readonly entryId: Schema.String;
readonly key: Schema.optional<Schema.String>;
readonly priority: Schema.Literals<...>;
... 5 more ...;
readonly attributes: Schema.optional<...>;
}>
Sch) =>
import SchemaSchema.function Struct<{
readonly item: Sch;
readonly entryId: Schema.String;
readonly key: Schema.optional<Schema.String>;
readonly priority: Schema.Literals<readonly ["high", "normal", "low"]>;
readonly attempts: Schema.Number;
readonly timestamps: Schema.Struct<{
readonly enqueuedAt: Schema.DateTimeUtc;
readonly startedAt: Schema.optionalKey<Schema.DateTimeUtc>;
readonly completedAt: Schema.optionalKey<Schema.DateTimeUtc>;
readonly interruptedAt: Schema.optionalKey<Schema.DateTimeUtc>;
}>;
readonly batchId: Schema.optional<...>;
readonly releaseId: Schema.optional<...>;
readonly sourceHyperlinkId: Schema.optional<...>;
readonly attributes: Schema.optional<...>;
}>(fields: {
readonly item: Sch;
readonly entryId: Schema.String;
readonly key: Schema.optional<Schema.String>;
readonly priority: Schema.Literals<readonly ["high", "normal", "low"]>;
readonly attempts: Schema.Number;
readonly timestamps: Schema.Struct<{
readonly enqueuedAt: Schema.DateTimeUtc;
readonly startedAt: Schema.optionalKey<Schema.DateTimeUtc>;
readonly completedAt: Schema.optionalKey<Schema.DateTimeUtc>;
readonly interruptedAt: Schema.optionalKey<Schema.DateTimeUtc>;
}>;
readonly batchId: Schema.optional<...>;
readonly releaseId: Schema.optional<...>;
readonly sourceHyperlinkId: Schema.optional<...>;
readonly attributes: Schema.optional<...>;
}): Schema.Struct<...>
Defines a struct schema from a map of field schemas.
Details
Each field value is a schema. Use
optionalKey
or
optional
to
mark fields as optional, and
mutableKey
to mark them as mutable.
The resulting schema's Type is a readonly object type with the fields'
decoded types. The Encoded form mirrors the field schemas' encoded types.
Example (Defining a basic struct)
import { Schema } from "effect"
const Person = Schema.Struct({
name: Schema.String,
age: Schema.Number,
email: Schema.optionalKey(Schema.String)
})
// { readonly name: string; readonly age: number; readonly email?: string }
type Person = typeof Person.Type
const alice = Schema.decodeUnknownSync(Person)({ name: "Alice", age: 30 })
console.log(alice)
// { name: 'Alice', age: 30 }
Struct({
item: Sch extends Schema.Topitem: itemSchema: Sch extends Schema.TopitemSchema,
entryId: Schema.String(property) entryId: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<string, readonly []>) => Schema.String;
annotateKey: (annotations: Schema.Annotations.Key<string>) => Schema.String;
check: (checks_0: Check<string>, ...checks: Array<Check<string>>) => Schema.String;
rebuild: (ast: String) => Schema.String;
make: (input: string, options?: Schema.MakeOptions) => string;
makeOption: (input: string, options?: Schema.MakeOptions) => Option.Option<string>;
makeEffect: (input: string, options?: Schema.MakeOptions) => Effect.Effect<string, Schema.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; <…;
}
entryId: import SchemaSchema.const String: Schema.Stringconst String: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<string, readonly []>) => Schema.String;
annotateKey: (annotations: Schema.Annotations.Key<string>) => Schema.String;
check: (checks_0: Check<string>, ...checks: Array<Check<string>>) => Schema.String;
rebuild: (ast: String) => Schema.String;
make: (input: string, options?: Schema.MakeOptions) => string;
makeOption: (input: string, options?: Schema.MakeOptions) => Option.Option<string>;
makeEffect: (input: string, options?: Schema.MakeOptions) => Effect.Effect<string, Schema.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 representation of
String
.
Schema for string values. Validates that the input is typeof "string".
String,
// `optional` (not `optionalKey`): the engine emits `key: undefined` explicitly when no dedup
// key, so the wire schema must accept a present-but-undefined value (else encode fails on RPC).
key: Schema.optional<Schema.String>(property) key: {
Rebuild: optional<S>;
Type: S["Type"];
Encoded: S["Encoded"];
DecodingServices: S["DecodingServices"];
EncodingServices: S["EncodingServices"];
Iso: S["Iso"];
schema: S;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<string | undefined, readonly []>) => Schema.optional<Schema.String>;
annotateKey: (annotations: Schema.Annotations.Key<string | undefined>) => Schema.optional<Schema.String>;
check: (checks_0: Check<string | undefined>, ...checks: Array<Check<string | undefined>>) => Schema.optional<Schema.String>;
rebuild: (ast: Union<String | Undefined>) => Schema.optional<Schema.String>;
make: (input: string | undefined, options?: Schema.MakeOptions) => string | undefined;
makeOption: (input: string | undefined, options?: Schema.MakeOptions) => Option.Option<string | undefined>;
makeEffect: (input: string | undefined, options?: Schema.MakeOptions) => Effect.Effect<string | undefined, Schema.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; <…;
}
key: import SchemaSchema.const optional: optionalLambda
<Schema.String>(self: Schema.String) => Schema.optional<Schema.String>
Type-level representation returned by
optional
.
Marks a struct field as optional, allowing the key to be absent or
undefined.
Details
The resulting property may be absent or explicitly set to undefined.
Equivalent to optionalKey(UndefinedOr(S)).
Use
optionalKey
instead if you want exact optional semantics (absent
only, not undefined).
Example (Defining an optional field accepting undefined)
import { Schema } from "effect"
const schema = Schema.Struct({
name: Schema.String,
age: Schema.optional(Schema.Number)
})
// { readonly name: string; readonly age?: number | undefined }
type Person = typeof schema.Type
optional(import SchemaSchema.const String: Schema.Stringconst String: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<string, readonly []>) => Schema.String;
annotateKey: (annotations: Schema.Annotations.Key<string>) => Schema.String;
check: (checks_0: Check<string>, ...checks: Array<Check<string>>) => Schema.String;
rebuild: (ast: String) => Schema.String;
make: (input: string, options?: Schema.MakeOptions) => string;
makeOption: (input: string, options?: Schema.MakeOptions) => Option.Option<string>;
makeEffect: (input: string, options?: Schema.MakeOptions) => Effect.Effect<string, Schema.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 representation of
String
.
Schema for string values. Validates that the input is typeof "string".
String),
priority: Schema.Literals<
readonly ["high", "normal", "low"]
>
(property) priority: {
literals: L;
members: { readonly [K in keyof L]: Literal<L[K]>; };
mapMembers: (f: (members: readonly [Schema.Literal<'high'>, Schema.Literal<'normal'>, Schema.Literal<'low'>]) => To) => Schema.Union<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
pick: (literals: L2) => Schema.Literals<L2>;
transform: (to: L2) => Schema.Union<readonly [Schema.decodeTo<Schema.Literal<L2['0']>, Schema.Literal<'high'>, never, never>, Schema.decodeTo<Schema.Literal<L2['1']>, Schema.Literal<'normal'>, never, never>, Schema.decodeTo<Schema.Literal<L2['2']>, S…;
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<'high' | 'normal' | 'low', readonly []>) => Schema.Literals<readonly ['high', 'normal', 'low']>;
annotateKey: (annotations: Schema.Annotations.Key<'high' | 'normal' | 'low'>) => Schema.Literals<readonly ['high', 'normal', 'low']>;
check: (checks_0: Check<'high' | 'normal' | 'low'>, ...checks: Array<Check<'high' | 'normal' | 'low'>>) => Schema.Literals<readonly ['high', 'normal', 'low']>;
rebuild: (ast: Union<Literal>) => Schema.Literals<readonly ['high', 'normal', 'low']>;
make: (input: 'high' | 'normal' | 'low', options?: Schema.MakeOptions) => 'high' | 'normal' | 'low';
makeOption: (input: 'high' | 'normal' | 'low', options?: Schema.MakeOptions) => Option.Option<'high' | 'normal' | 'low'>;
makeEffect: (input: 'high' | 'normal' | 'low', options?: Schema.MakeOptions) => Effect.Effect<'high' | 'normal' | 'low', Schema.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; <…;
}
priority: const queuePriority: Schema.Literals<
readonly ["high", "normal", "low"]
>
const queuePriority: {
literals: L;
members: { readonly [K in keyof L]: Literal<L[K]>; };
mapMembers: (f: (members: readonly [Schema.Literal<'high'>, Schema.Literal<'normal'>, Schema.Literal<'low'>]) => To) => Schema.Union<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
pick: (literals: L2) => Schema.Literals<L2>;
transform: (to: L2) => Schema.Union<readonly [Schema.decodeTo<Schema.Literal<L2['0']>, Schema.Literal<'high'>, never, never>, Schema.decodeTo<Schema.Literal<L2['1']>, Schema.Literal<'normal'>, never, never>, Schema.decodeTo<Schema.Literal<L2['2']>, S…;
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<'high' | 'normal' | 'low', readonly []>) => Schema.Literals<readonly ['high', 'normal', 'low']>;
annotateKey: (annotations: Schema.Annotations.Key<'high' | 'normal' | 'low'>) => Schema.Literals<readonly ['high', 'normal', 'low']>;
check: (checks_0: Check<'high' | 'normal' | 'low'>, ...checks: Array<Check<'high' | 'normal' | 'low'>>) => Schema.Literals<readonly ['high', 'normal', 'low']>;
rebuild: (ast: Union<Literal>) => Schema.Literals<readonly ['high', 'normal', 'low']>;
make: (input: 'high' | 'normal' | 'low', options?: Schema.MakeOptions) => 'high' | 'normal' | 'low';
makeOption: (input: 'high' | 'normal' | 'low', options?: Schema.MakeOptions) => Option.Option<'high' | 'normal' | 'low'>;
makeEffect: (input: 'high' | 'normal' | 'low', options?: Schema.MakeOptions) => Effect.Effect<'high' | 'normal' | 'low', Schema.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; <…;
}
A queue entry's priority level.
queuePriority,
attempts: Schema.Number(property) attempts: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<number, readonly []>) => Schema.Number;
annotateKey: (annotations: Schema.Annotations.Key<number>) => Schema.Number;
check: (checks_0: Check<number>, ...checks: Array<Check<number>>) => Schema.Number;
rebuild: (ast: Number) => Schema.Number;
make: (input: number, options?: Schema.MakeOptions) => number;
makeOption: (input: number, options?: Schema.MakeOptions) => Option.Option<number>;
makeEffect: (input: number, options?: Schema.MakeOptions) => Effect.Effect<number, Schema.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; <…;
}
attempts: import SchemaSchema.const Number: Schema.Numberconst Number: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<number, readonly []>) => Schema.Number;
annotateKey: (annotations: Schema.Annotations.Key<number>) => Schema.Number;
check: (checks_0: Check<number>, ...checks: Array<Check<number>>) => Schema.Number;
rebuild: (ast: Number) => Schema.Number;
make: (input: number, options?: Schema.MakeOptions) => number;
makeOption: (input: number, options?: Schema.MakeOptions) => Option.Option<number>;
makeEffect: (input: number, options?: Schema.MakeOptions) => Effect.Effect<number, Schema.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 representation of
Number
.
Schema for number values, including NaN, Infinity, and -Infinity.
Details
Default JSON serializer:
- Finite numbers are serialized as numbers.
- Non-finite values are serialized as strings (
"NaN", "Infinity", "-Infinity").
Number,
timestamps: Schema.Struct<{
readonly enqueuedAt: Schema.DateTimeUtc
readonly startedAt: Schema.optionalKey<Schema.DateTimeUtc>
readonly completedAt: Schema.optionalKey<Schema.DateTimeUtc>
readonly interruptedAt: Schema.optionalKey<Schema.DateTimeUtc>
}>
(property) timestamps: {
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 enqueuedAt: Schema.DateTimeUtc; readonly startedAt: Schema.optionalKey<Schema.DateTimeUtc>; readonly completedAt: Schema.optionalKey<Schema.DateTimeUtc>; readonly interruptedAt: Schema.optionalKey<Schema.DateTimeUtc…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly enqueuedAt: DateTime.Utc; readonly startedAt?: DateTime.Utc | undefined; readonly completedAt?: DateTime.Utc | undefined; readonly interruptedAt?: DateTime.Utc | undefined; }, readonly []>…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly enqueuedAt: DateTime.Utc; readonly startedAt?: DateTime.Utc | undefined; readonly completedAt?: DateTime.Utc | undefined; readonly interruptedAt?: DateTime.Utc | undefined }>) => Schema.Struc…;
check: (checks_0: Check<{ readonly enqueuedAt: DateTime.Utc; readonly startedAt?: DateTime.Utc | undefined; readonly completedAt?: DateTime.Utc | undefined; readonly interruptedAt?: DateTime.Utc | undefined }>, ...checks: Array<Check<{ readonly e…;
rebuild: (ast: Objects) => Schema.Struct<{ readonly enqueuedAt: Schema.DateTimeUtc; readonly startedAt: Schema.optionalKey<Schema.DateTimeUtc>; readonly completedAt: Schema.optionalKey<Schema.DateTimeUtc>; readonly interruptedAt: Schema.optionalKey…;
make: (input: { readonly enqueuedAt: DateTime.Utc; readonly startedAt?: DateTime.Utc | undefined; readonly completedAt?: DateTime.Utc | undefined; readonly interruptedAt?: DateTime.Utc | undefined }, options?: Schema.MakeOptions) => { readonly e…;
makeOption: (input: { readonly enqueuedAt: DateTime.Utc; readonly startedAt?: DateTime.Utc | undefined; readonly completedAt?: DateTime.Utc | undefined; readonly interruptedAt?: DateTime.Utc | undefined }, options?: Schema.MakeOptions) => Option.Optio…;
makeEffect: (input: { readonly enqueuedAt: DateTime.Utc; readonly startedAt?: DateTime.Utc | undefined; readonly completedAt?: DateTime.Utc | undefined; readonly interruptedAt?: DateTime.Utc | undefined }, options?: Schema.MakeOptions) => Effect.Effec…;
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; <…;
}
timestamps: const queueEntryTimestamps: Schema.Struct<{
readonly enqueuedAt: Schema.DateTimeUtc
readonly startedAt: Schema.optionalKey<Schema.DateTimeUtc>
readonly completedAt: Schema.optionalKey<Schema.DateTimeUtc>
readonly interruptedAt: Schema.optionalKey<Schema.DateTimeUtc>
}>
const queueEntryTimestamps: {
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 enqueuedAt: Schema.DateTimeUtc; readonly startedAt: Schema.optionalKey<Schema.DateTimeUtc>; readonly completedAt: Schema.optionalKey<Schema.DateTimeUtc>; readonly interruptedAt: Schema.optionalKey<Schema.DateTimeUtc…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly enqueuedAt: DateTime.Utc; readonly startedAt?: DateTime.Utc | undefined; readonly completedAt?: DateTime.Utc | undefined; readonly interruptedAt?: DateTime.Utc | undefined; }, readonly []>…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly enqueuedAt: DateTime.Utc; readonly startedAt?: DateTime.Utc | undefined; readonly completedAt?: DateTime.Utc | undefined; readonly interruptedAt?: DateTime.Utc | undefined }>) => Schema.Struc…;
check: (checks_0: Check<{ readonly enqueuedAt: DateTime.Utc; readonly startedAt?: DateTime.Utc | undefined; readonly completedAt?: DateTime.Utc | undefined; readonly interruptedAt?: DateTime.Utc | undefined }>, ...checks: Array<Check<{ readonly e…;
rebuild: (ast: Objects) => Schema.Struct<{ readonly enqueuedAt: Schema.DateTimeUtc; readonly startedAt: Schema.optionalKey<Schema.DateTimeUtc>; readonly completedAt: Schema.optionalKey<Schema.DateTimeUtc>; readonly interruptedAt: Schema.optionalKey…;
make: (input: { readonly enqueuedAt: DateTime.Utc; readonly startedAt?: DateTime.Utc | undefined; readonly completedAt?: DateTime.Utc | undefined; readonly interruptedAt?: DateTime.Utc | undefined }, options?: Schema.MakeOptions) => { readonly e…;
makeOption: (input: { readonly enqueuedAt: DateTime.Utc; readonly startedAt?: DateTime.Utc | undefined; readonly completedAt?: DateTime.Utc | undefined; readonly interruptedAt?: DateTime.Utc | undefined }, options?: Schema.MakeOptions) => Option.Optio…;
makeEffect: (input: { readonly enqueuedAt: DateTime.Utc; readonly startedAt?: DateTime.Utc | undefined; readonly completedAt?: DateTime.Utc | undefined; readonly interruptedAt?: DateTime.Utc | undefined }, options?: Schema.MakeOptions) => Effect.Effec…;
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; <…;
}
Timestamps carried by a wire
queueEntry
.
queueEntryTimestamps,
// `optional` (not `optionalKey`): the engine's `release`/route paths spread metadata that may
// hold present-but-`undefined` values, so the wire schema must accept them (else encode fails).
batchId: Schema.optional<Schema.String>(property) batchId: {
Rebuild: optional<S>;
Type: S["Type"];
Encoded: S["Encoded"];
DecodingServices: S["DecodingServices"];
EncodingServices: S["EncodingServices"];
Iso: S["Iso"];
schema: S;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<string | undefined, readonly []>) => Schema.optional<Schema.String>;
annotateKey: (annotations: Schema.Annotations.Key<string | undefined>) => Schema.optional<Schema.String>;
check: (checks_0: Check<string | undefined>, ...checks: Array<Check<string | undefined>>) => Schema.optional<Schema.String>;
rebuild: (ast: Union<String | Undefined>) => Schema.optional<Schema.String>;
make: (input: string | undefined, options?: Schema.MakeOptions) => string | undefined;
makeOption: (input: string | undefined, options?: Schema.MakeOptions) => Option.Option<string | undefined>;
makeEffect: (input: string | undefined, options?: Schema.MakeOptions) => Effect.Effect<string | undefined, Schema.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; <…;
}
batchId: import SchemaSchema.const optional: optionalLambda
<Schema.String>(self: Schema.String) => Schema.optional<Schema.String>
Type-level representation returned by
optional
.
Marks a struct field as optional, allowing the key to be absent or
undefined.
Details
The resulting property may be absent or explicitly set to undefined.
Equivalent to optionalKey(UndefinedOr(S)).
Use
optionalKey
instead if you want exact optional semantics (absent
only, not undefined).
Example (Defining an optional field accepting undefined)
import { Schema } from "effect"
const schema = Schema.Struct({
name: Schema.String,
age: Schema.optional(Schema.Number)
})
// { readonly name: string; readonly age?: number | undefined }
type Person = typeof schema.Type
optional(import SchemaSchema.const String: Schema.Stringconst String: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<string, readonly []>) => Schema.String;
annotateKey: (annotations: Schema.Annotations.Key<string>) => Schema.String;
check: (checks_0: Check<string>, ...checks: Array<Check<string>>) => Schema.String;
rebuild: (ast: String) => Schema.String;
make: (input: string, options?: Schema.MakeOptions) => string;
makeOption: (input: string, options?: Schema.MakeOptions) => Option.Option<string>;
makeEffect: (input: string, options?: Schema.MakeOptions) => Effect.Effect<string, Schema.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 representation of
String
.
Schema for string values. Validates that the input is typeof "string".
String),
releaseId: Schema.optional<Schema.String>(property) releaseId: {
Rebuild: optional<S>;
Type: S["Type"];
Encoded: S["Encoded"];
DecodingServices: S["DecodingServices"];
EncodingServices: S["EncodingServices"];
Iso: S["Iso"];
schema: S;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<string | undefined, readonly []>) => Schema.optional<Schema.String>;
annotateKey: (annotations: Schema.Annotations.Key<string | undefined>) => Schema.optional<Schema.String>;
check: (checks_0: Check<string | undefined>, ...checks: Array<Check<string | undefined>>) => Schema.optional<Schema.String>;
rebuild: (ast: Union<String | Undefined>) => Schema.optional<Schema.String>;
make: (input: string | undefined, options?: Schema.MakeOptions) => string | undefined;
makeOption: (input: string | undefined, options?: Schema.MakeOptions) => Option.Option<string | undefined>;
makeEffect: (input: string | undefined, options?: Schema.MakeOptions) => Effect.Effect<string | undefined, Schema.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; <…;
}
releaseId: import SchemaSchema.const optional: optionalLambda
<Schema.String>(self: Schema.String) => Schema.optional<Schema.String>
Type-level representation returned by
optional
.
Marks a struct field as optional, allowing the key to be absent or
undefined.
Details
The resulting property may be absent or explicitly set to undefined.
Equivalent to optionalKey(UndefinedOr(S)).
Use
optionalKey
instead if you want exact optional semantics (absent
only, not undefined).
Example (Defining an optional field accepting undefined)
import { Schema } from "effect"
const schema = Schema.Struct({
name: Schema.String,
age: Schema.optional(Schema.Number)
})
// { readonly name: string; readonly age?: number | undefined }
type Person = typeof schema.Type
optional(import SchemaSchema.const String: Schema.Stringconst String: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<string, readonly []>) => Schema.String;
annotateKey: (annotations: Schema.Annotations.Key<string>) => Schema.String;
check: (checks_0: Check<string>, ...checks: Array<Check<string>>) => Schema.String;
rebuild: (ast: String) => Schema.String;
make: (input: string, options?: Schema.MakeOptions) => string;
makeOption: (input: string, options?: Schema.MakeOptions) => Option.Option<string>;
makeEffect: (input: string, options?: Schema.MakeOptions) => Effect.Effect<string, Schema.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 representation of
String
.
Schema for string values. Validates that the input is typeof "string".
String),
sourceHyperlinkId: Schema.optional<Schema.String>(property) sourceHyperlinkId: {
Rebuild: optional<S>;
Type: S["Type"];
Encoded: S["Encoded"];
DecodingServices: S["DecodingServices"];
EncodingServices: S["EncodingServices"];
Iso: S["Iso"];
schema: S;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<string | undefined, readonly []>) => Schema.optional<Schema.String>;
annotateKey: (annotations: Schema.Annotations.Key<string | undefined>) => Schema.optional<Schema.String>;
check: (checks_0: Check<string | undefined>, ...checks: Array<Check<string | undefined>>) => Schema.optional<Schema.String>;
rebuild: (ast: Union<String | Undefined>) => Schema.optional<Schema.String>;
make: (input: string | undefined, options?: Schema.MakeOptions) => string | undefined;
makeOption: (input: string | undefined, options?: Schema.MakeOptions) => Option.Option<string | undefined>;
makeEffect: (input: string | undefined, options?: Schema.MakeOptions) => Effect.Effect<string | undefined, Schema.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; <…;
}
sourceHyperlinkId: import SchemaSchema.const optional: optionalLambda
<Schema.String>(self: Schema.String) => Schema.optional<Schema.String>
Type-level representation returned by
optional
.
Marks a struct field as optional, allowing the key to be absent or
undefined.
Details
The resulting property may be absent or explicitly set to undefined.
Equivalent to optionalKey(UndefinedOr(S)).
Use
optionalKey
instead if you want exact optional semantics (absent
only, not undefined).
Example (Defining an optional field accepting undefined)
import { Schema } from "effect"
const schema = Schema.Struct({
name: Schema.String,
age: Schema.optional(Schema.Number)
})
// { readonly name: string; readonly age?: number | undefined }
type Person = typeof schema.Type
optional(import SchemaSchema.const String: Schema.Stringconst String: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<string, readonly []>) => Schema.String;
annotateKey: (annotations: Schema.Annotations.Key<string>) => Schema.String;
check: (checks_0: Check<string>, ...checks: Array<Check<string>>) => Schema.String;
rebuild: (ast: String) => Schema.String;
make: (input: string, options?: Schema.MakeOptions) => string;
makeOption: (input: string, options?: Schema.MakeOptions) => Option.Option<string>;
makeEffect: (input: string, options?: Schema.MakeOptions) => Effect.Effect<string, Schema.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 representation of
String
.
Schema for string values. Validates that the input is typeof "string".
String),
attributes: Schema.optional<
Schema.$Record<Schema.String, Schema.Unknown>
>
(property) attributes: {
Rebuild: optional<S>;
Type: S["Type"];
Encoded: S["Encoded"];
DecodingServices: S["DecodingServices"];
EncodingServices: S["EncodingServices"];
Iso: S["Iso"];
schema: S;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly [x: string]: unknown; } | undefined, readonly []>) => Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly [x: string]: unknown } | undefined>) => Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
check: (checks_0: Check<{ readonly [x: string]: unknown } | undefined>, ...checks: Array<Check<{ readonly [x: string]: unknown } | undefined>>) => Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
rebuild: (ast: Union<Undefined | Objects>) => Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
make: (input: { readonly [x: string]: unknown } | undefined, options?: Schema.MakeOptions) => { readonly [x: string]: unknown } | undefined;
makeOption: (input: { readonly [x: string]: unknown } | undefined, options?: Schema.MakeOptions) => Option.Option<{ readonly [x: string]: unknown } | undefined>;
makeEffect: (input: { readonly [x: string]: unknown } | undefined, options?: Schema.MakeOptions) => Effect.Effect<{ readonly [x: string]: unknown } | undefined, Schema.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; <…;
}
attributes: import SchemaSchema.const optional: optionalLambda
<Schema.$Record<Schema.String, Schema.Unknown>>(self: Schema.$Record<Schema.String, Schema.Unknown>) => Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>
Type-level representation returned by
optional
.
Marks a struct field as optional, allowing the key to be absent or
undefined.
Details
The resulting property may be absent or explicitly set to undefined.
Equivalent to optionalKey(UndefinedOr(S)).
Use
optionalKey
instead if you want exact optional semantics (absent
only, not undefined).
Example (Defining an optional field accepting undefined)
import { Schema } from "effect"
const schema = Schema.Struct({
name: Schema.String,
age: Schema.optional(Schema.Number)
})
// { readonly name: string; readonly age?: number | undefined }
type Person = typeof schema.Type
optional(const queueEntryAttributes: Schema.$Record<
Schema.String,
Schema.Unknown
>
const queueEntryAttributes: {
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]: unknown; }, readonly []>) => Schema.$Record<Schema.String, Schema.Unknown>;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly [x: string]: unknown }>) => Schema.$Record<Schema.String, Schema.Unknown>;
check: (checks_0: Check<{ readonly [x: string]: unknown }>, ...checks: Array<Check<{ readonly [x: string]: unknown }>>) => Schema.$Record<Schema.String, Schema.Unknown>;
rebuild: (ast: Objects) => Schema.$Record<Schema.String, Schema.Unknown>;
make: (input: { readonly [x: string]: unknown }, options?: Schema.MakeOptions) => { readonly [x: string]: unknown };
makeOption: (input: { readonly [x: string]: unknown }, options?: Schema.MakeOptions) => Option.Option<{ readonly [x: string]: unknown }>;
makeEffect: (input: { readonly [x: string]: unknown }, options?: Schema.MakeOptions) => Effect.Effect<{ readonly [x: string]: unknown }, Schema.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; <…;
}
Entry/encoded attributes — a readonly record of arbitrary values, matching the engine's
{ readonly [key: string]: unknown } on QueueEntry / QueueEncodedEntry.
queueEntryAttributes),
});