Schema.Struct<{
readonly payload: Schema.Codec<JsonValue, JsonValue, never, never>
readonly item: Schema.Struct<{
readonly id: Schema.String
readonly version: Schema.String
readonly encoding: Schema.Literal<"json">
readonly jsonSchema: Schema.Unknown
}>
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 in encoded / wire form — the element returned by releaseEncoded. The
item is replaced by its codec descriptor and the value lives in payload (already
JSON-encoded), so an encoded entry crosses RPC without the receiver knowing the item schema.
Mirrors the engine's QueueEncodedEntry.
export const const queueEncodedEntry: Schema.Struct<{
readonly payload: Schema.Codec<JsonValue, JsonValue, never, never>;
readonly item: any;
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<...>;
}>
const queueEncodedEntry: {
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 payload: Schema.Codec<JsonValue, JsonValue, never, never>; readonly item: any; readonly entryId: Schema.String; readonly key: Schema.optional<Schema.String>; readonly priority: Schema.Literals<readonly ['high', 'nor…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ [x: string]: any; }, readonly []>) => Schema.Struct<{ readonly payload: Schema.Codec<JsonValue, JsonValue, never, never>; readonly item: any; readonly entryId: Schema.String; readonly key: Schema.o…;
annotateKey: (annotations: Schema.Annotations.Key<{ [x: string]: any }>) => Schema.Struct<{ readonly payload: Schema.Codec<JsonValue, JsonValue, never, never>; readonly item: any; readonly entryId: Schema.String; readonly key: Schema.optional<Schema.St…;
check: (checks_0: Check<{ [x: string]: any }>, ...checks: Array<Check<{ [x: string]: any }>>) => Schema.Struct<{ readonly payload: Schema.Codec<JsonValue, JsonValue, never, never>; readonly item: any; readonly entryId: Schema.String; readonly key…;
rebuild: (ast: Objects) => Schema.Struct<{ readonly payload: Schema.Codec<JsonValue, JsonValue, never, never>; readonly item: any; readonly entryId: Schema.String; readonly key: Schema.optional<Schema.String>; readonly priority: Schema.Literals<rea…;
make: (input: { [x: string]: any }, options?: Schema.MakeOptions) => { [x: string]: any };
makeOption: (input: { [x: string]: any }, options?: Schema.MakeOptions) => Option.Option<{ [x: string]: any }>;
makeEffect: (input: { [x: string]: any }, options?: Schema.MakeOptions) => Effect.Effect<{ [x: string]: any }, 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 in encoded / wire form — the element returned by releaseEncoded. The
item is replaced by its codec descriptor and the value lives in payload (already
JSON-encoded), so an encoded entry crosses RPC without the receiver knowing the item schema.
Mirrors the engine's QueueEncodedEntry.
queueEncodedEntry = import SchemaSchema.function Struct<{
readonly payload: Schema.Codec<JsonValue, JsonValue, never, never>;
readonly item: any;
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 payload: Schema.Codec<JsonValue, JsonValue, never, never>;
readonly item: any;
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({
// Encoded wire payload is JSON by construction; type it as the narrower `JsonValue` (not
// `Schema.Unknown`) so the schema `.Type` matches the hand-authored `QueueEncodedEntry.payload`
// (retain-narrower — the single-source-of-truth convergence, tightening the schema to the type).
payload: Schema.Codec<
JsonValue,
JsonValue,
never,
never
>
(property) payload: {
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
Rebuild: Codec<T, E, RD, RE>;
Type: T;
Iso: Iso;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<JsonValue, any>) => Schema.Codec<JsonValue, JsonValue, never, never>;
annotateKey: (annotations: Schema.Annotations.Key<JsonValue>) => Schema.Codec<JsonValue, JsonValue, never, never>;
check: (checks_0: Check<JsonValue>, ...checks: Array<Check<JsonValue>>) => Schema.Codec<JsonValue, JsonValue, never, never>;
rebuild: (ast: AST) => Schema.Codec<JsonValue, JsonValue, never, never>;
make: (input: unknown, options?: Schema.MakeOptions) => JsonValue;
makeOption: (input: unknown, options?: Schema.MakeOptions) => Option.Option<JsonValue>;
makeEffect: (input: unknown, options?: Schema.MakeOptions) => Effect.Effect<JsonValue, 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; <…;
}
payload: const jsonValue: Schema.Codec<
JsonValue,
JsonValue,
never,
never
>
const jsonValue: {
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
Rebuild: Codec<T, E, RD, RE>;
Type: T;
Iso: Iso;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<JsonValue, any>) => Schema.Codec<JsonValue, JsonValue, never, never>;
annotateKey: (annotations: Schema.Annotations.Key<JsonValue>) => Schema.Codec<JsonValue, JsonValue, never, never>;
check: (checks_0: Check<JsonValue>, ...checks: Array<Check<JsonValue>>) => Schema.Codec<JsonValue, JsonValue, never, never>;
rebuild: (ast: AST) => Schema.Codec<JsonValue, JsonValue, never, never>;
make: (input: unknown, options?: Schema.MakeOptions) => JsonValue;
makeOption: (input: unknown, options?: Schema.MakeOptions) => Option.Option<JsonValue>;
makeEffect: (input: unknown, options?: Schema.MakeOptions) => Effect.Effect<JsonValue, 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; <…;
}
Recursive structural JSON value schema — decodes to
JsonValue
. Used for the option
attributes, which the engine persists as JSON. Schema.suspend breaks the self-reference.
jsonValue,
item: anyitem: import QueueItemCodecDescriptorSchemaQueueItemCodecDescriptorSchema,
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,
// engine-output entry: optional metadata may be present-but-`undefined` (see queueEntry).
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<Undefined | String>) => 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,
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<Undefined | String>) => 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<Undefined | String>) => 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<Undefined | String>) => 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),
});