<
F extends Schema.Struct.Fields,
Success extends Schema.Top = Schema.Void,
Error extends Schema.Top = Schema.Never
>(
itemSchema: Schema.Struct<F>,
wire?: { readonly success?: Success; readonly error?: Error }
): {
add: Hyperlink.Method<
Schema.Union<
readonly [Schema.Struct<F>, Schema.$Array<Schema.Struct<F>>]
>,
Schema.Void,
Schema.Never,
false,
Hyperlink.MethodAnnotations & { description: string },
{
(item: Hyperlink.Decoded<typeof itemSchema>): Effect.Effect<void>
(
items: readonly Hyperlink.Decoded<typeof itemSchema>[]
): Effect.Effect<void>
(
itemOrItems:
| Hyperlink.Decoded<typeof itemSchema>
| readonly Hyperlink.Decoded<typeof itemSchema>[]
): Effect.Effect<void>
}
>
prioritize: Hyperlink.Method<
Schema.Union<
readonly [Schema.Struct<F>, Schema.$Array<Schema.Struct<F>>]
>,
Schema.Void,
Schema.Never,
false,
Hyperlink.MethodAnnotations & { description: string },
{
(item: Hyperlink.Decoded<typeof itemSchema>): Effect.Effect<void>
(
items: readonly Hyperlink.Decoded<typeof itemSchema>[]
): Effect.Effect<void>
(
itemOrItems:
| Hyperlink.Decoded<typeof itemSchema>
| readonly Hyperlink.Decoded<typeof itemSchema>[]
): Effect.Effect<void>
}
>
defer: Hyperlink.Method<
Schema.Union<
readonly [Schema.Struct<F>, Schema.$Array<Schema.Struct<F>>]
>,
Schema.Void,
Schema.Never,
false,
Hyperlink.MethodAnnotations & { description: string },
{
(item: Hyperlink.Decoded<typeof itemSchema>): Effect.Effect<void>
(
items: readonly Hyperlink.Decoded<typeof itemSchema>[]
): Effect.Effect<void>
(
itemOrItems:
| Hyperlink.Decoded<typeof itemSchema>
| readonly Hyperlink.Decoded<typeof itemSchema>[]
): Effect.Effect<void>
}
>
enqueue: Hyperlink.Method<
Schema.$Array<
Schema.Struct<{
readonly item: Schema.Struct<F>
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>
>
}>
>,
Schema.Void,
Schema.Never,
false,
Hyperlink.MethodAnnotations & { description: string },
Hyperlink.Derive
>
release: Hyperlink.Method<
{
readonly options: Schema.optionalKey<
Schema.Struct<{
readonly scope: Schema.optionalKey<
Schema.Literal<"pendingOnly">
>
readonly releaseId: Schema.optionalKey<Schema.String>
readonly attributes: Schema.optionalKey<
Schema.$Record<
Schema.String,
Schema.Codec<JsonValue, JsonValue, never, never>
>
>
}>
>
},
Schema.$Array<
Schema.Struct<{
readonly item: Schema.Struct<F>
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>
>
}>
>,
Schema.Never,
false,
Hyperlink.MethodAnnotations & {
description: string
destructive: true
},
Hyperlink.Derive
>
releaseEncoded: Hyperlink.Method<
{
readonly options: Schema.optionalKey<
Schema.Struct<{
readonly scope: Schema.optionalKey<
Schema.Literal<"pendingOnly">
>
readonly releaseId: Schema.optionalKey<Schema.String>
readonly attributes: Schema.optionalKey<
Schema.$Record<
Schema.String,
Schema.Codec<JsonValue, JsonValue, never, never>
>
>
}>
>
},
Schema.$Array<
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>
>
}>
>,
Schema.Union<
readonly [
typeof QueueMissingItemSchemaError,
typeof QueueItemEncodingError
]
>,
false,
Hyperlink.MethodAnnotations & {
description: string
destructive: true
},
Hyperlink.Derive
>
deadLetter: Hyperlink.Method<
{
readonly selector: Schema.Struct<{
readonly entryId: Schema.optionalKey<Schema.String>
readonly key: Schema.optional<Schema.String>
readonly item: Schema.optionalKey<Schema.Struct<F>>
}>
readonly options: Schema.Struct<{
readonly reason: Schema.String
readonly attributes: Schema.optionalKey<
Schema.$Record<
Schema.String,
Schema.Codec<JsonValue, JsonValue, never, never>
>
>
}>
},
Schema.$Array<
Schema.Struct<{
readonly item: Schema.Struct<F>
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>
>
}>
>,
Schema.Never,
false,
Hyperlink.MethodAnnotations & {
description: string
destructive: true
},
Hyperlink.Derive
>
drop: Hyperlink.Method<
{
readonly selector: Schema.Struct<{
readonly entryId: Schema.optionalKey<Schema.String>
readonly key: Schema.optional<Schema.String>
readonly item: Schema.optionalKey<Schema.Struct<F>>
}>
readonly options: Schema.Struct<{
readonly reason: Schema.String
readonly attributes: Schema.optionalKey<
Schema.$Record<
Schema.String,
Schema.Codec<JsonValue, JsonValue, never, never>
>
>
}>
},
Schema.$Array<
Schema.Struct<{
readonly item: Schema.Struct<F>
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>
>
}>
>,
Schema.Never,
false,
Hyperlink.MethodAnnotations & {
description: string
destructive: true
},
Hyperlink.Derive
>
events: Hyperlink.Method<
undefined,
Schema.Union<
readonly [
Schema.TaggedStruct<"Start", { readonly key: Schema.String }>,
Schema.TaggedStruct<
"Enqueued",
{
readonly entries: Schema.$Array<
Schema.Struct<{
readonly item: Schema.Struct<F>
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>
>
}>
>
readonly priority: Schema.Literals<
readonly ["high", "normal", "low"]
>
readonly batchId: Schema.optionalKey<Schema.String>
}
>,
Schema.TaggedStruct<
"Started",
{
readonly entry: Schema.Struct<{
readonly item: Schema.Struct<F>
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>
>
}>
}
>,
Schema.TaggedStruct<
"Completed",
{
readonly entry: Schema.Struct<{
readonly item: Schema.Struct<F>
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>
>
}>
readonly success: Schema.Union<readonly [Success]>
readonly elapsed: Schema.Duration
}
>,
Schema.TaggedStruct<
"Failed",
{
readonly entry: Schema.Struct<{
readonly item: Schema.Struct<F>
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>
>
}>
readonly cause: Schema.Cause<Error, Schema.Unknown>
readonly elapsed: Schema.Duration
}
>,
Schema.TaggedStruct<
"RetryScheduled",
{
readonly entry: Schema.Struct<{
readonly item: Schema.Struct<F>
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>
>
}>
readonly cause: Schema.Cause<Error, Schema.Unknown>
readonly nextAttempt: Schema.Number
}
>,
Schema.TaggedStruct<
"RetryExhausted",
{
readonly entry: Schema.Struct<{
readonly item: Schema.Struct<F>
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>
>
}>
readonly cause: Schema.Cause<Error, Schema.Unknown>
}
>,
Schema.TaggedStruct<
"Drained",
{
readonly key: Schema.String
readonly completed: Schema.Number
}
>,
Schema.TaggedStruct<
"Cleared",
{ readonly key: Schema.String; readonly count: Schema.Number }
>,
Schema.TaggedStruct<
"ShutdownRequested",
{
readonly key: Schema.String
readonly mode: Schema.Literals<
readonly ["drain", "finishActive"]
>
readonly pending: Schema.Number
}
>,
Schema.TaggedStruct<
"ShutdownComplete",
{
readonly key: Schema.String
readonly completed: Schema.Number
}
>,
Schema.TaggedStruct<
"Released",
{
readonly key: Schema.String
readonly releaseId: Schema.String
readonly entries: Schema.$Array<
Schema.Struct<{
readonly item: Schema.Struct<F>
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>
>
}>
>
}
>,
Schema.TaggedStruct<
"DeadLettered",
{
readonly key: Schema.String
readonly entries: Schema.$Array<
Schema.Struct<{
readonly item: Schema.Struct<F>
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>
>
}>
>
readonly reason: Schema.String
}
>,
Schema.TaggedStruct<
"Dropped",
{
readonly key: Schema.String
readonly entries: Schema.$Array<
Schema.Struct<{
readonly item: Schema.Struct<F>
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>
>
}>
>
readonly reason: Schema.String
}
>,
Schema.TaggedStruct<
"RateLimitExceeded",
{
readonly key: Schema.String
readonly entry: Schema.Struct<{
readonly item: Schema.Struct<F>
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>
>
}>
readonly limitKey: Schema.String
readonly algorithm: Schema.Literals<
readonly ["fixed-window", "token-bucket"]
>
readonly outcome: Schema.Literals<
readonly ["delayed", "rejected"]
>
}
>
]
>,
Schema.Never,
true,
Hyperlink.MethodAnnotations & { description: string },
Hyperlink.Derive
>
status: Hyperlink.Marked<
Hyperlink.Method<
undefined,
Schema.Struct<{
readonly sizes: Schema.Struct<{
readonly high: Schema.Number
readonly normal: Schema.Number
readonly low: Schema.Number
}>
readonly paused: Schema.Boolean
readonly inFlight: Schema.Number
readonly completed: Schema.Number
readonly phase: Schema.Literals<
readonly ["running", "draining", "off"]
>
}>,
Schema.Never,
true,
Hyperlink.MethodAnnotations & { description: string },
Hyperlink.Derive
>,
{ readonly _tag: "ref" }
>
size: Hyperlink.Marked<
Hyperlink.Method<
undefined,
Schema.Number,
Schema.Never,
true,
Hyperlink.MethodAnnotations & { description: string },
Hyperlink.Derive
>,
{ readonly _tag: "ref" }
>
isEmpty: Hyperlink.Marked<
Hyperlink.Method<
undefined,
Schema.Boolean,
Schema.Never,
true,
Hyperlink.MethodAnnotations & { description: string },
Hyperlink.Derive
>,
{ readonly _tag: "ref" }
>
start: Hyperlink.Method<
undefined,
Schema.Void,
Schema.Never,
false,
Hyperlink.MethodAnnotations & { description: string },
Hyperlink.Derive
>
pause: Hyperlink.Method<
undefined,
Schema.Void,
Schema.Never,
false,
Hyperlink.MethodAnnotations & { description: string },
Hyperlink.Derive
>
resume: Hyperlink.Method<
undefined,
Schema.Void,
Schema.Never,
false,
Hyperlink.MethodAnnotations & { description: string },
Hyperlink.Derive
>
shutdown: Hyperlink.Method<
undefined,
Schema.Void,
Schema.Never,
false,
Hyperlink.MethodAnnotations & {
description: string
destructive: true
},
Hyperlink.Derive
>
clear: Hyperlink.Method<
undefined,
Schema.Number,
Schema.Never,
false,
Hyperlink.MethodAnnotations & {
description: string
destructive: true
},
Hyperlink.Derive
>
metrics: {
stream: Hyperlink.Method<
undefined,
Schema.Struct<{
readonly windowStart: Schema.DateTimeUtc
readonly windowEnd: Schema.DateTimeUtc
readonly windowMillis: Schema.Number
readonly enqueued: Schema.Number
readonly started: Schema.Number
readonly completed: Schema.Number
readonly failed: Schema.Number
readonly retried: Schema.Number
readonly deadLettered: Schema.Number
readonly dropped: Schema.Number
readonly rateLimitExceeded: Schema.Number
readonly inFlight: Schema.Number
readonly throughputPerSec: Schema.Number
readonly avgWaitMillis: Schema.Struct<{
readonly high: Schema.optionalKey<Schema.Number>
readonly normal: Schema.optionalKey<Schema.Number>
readonly low: Schema.optionalKey<Schema.Number>
}>
readonly avgExecutionMillis: Schema.optionalKey<Schema.Number>
readonly avgTotalMillis: Schema.optionalKey<Schema.Number>
}>,
Schema.Never,
true,
Hyperlink.MethodAnnotations & { description: string },
Hyperlink.Derive
>
query: Hyperlink.Method<
{
limit: Schema.optionalKey<Schema.Number>
since: Schema.optionalKey<Schema.DateTimeUtc>
until: Schema.optionalKey<Schema.DateTimeUtc>
},
Schema.$Array<
Schema.Struct<{
readonly windowStart: Schema.DateTimeUtc
readonly windowEnd: Schema.DateTimeUtc
readonly windowMillis: Schema.Number
readonly enqueued: Schema.Number
readonly started: Schema.Number
readonly completed: Schema.Number
readonly failed: Schema.Number
readonly retried: Schema.Number
readonly deadLettered: Schema.Number
readonly dropped: Schema.Number
readonly rateLimitExceeded: Schema.Number
readonly inFlight: Schema.Number
readonly throughputPerSec: Schema.Number
readonly avgWaitMillis: Schema.Struct<{
readonly high: Schema.optionalKey<Schema.Number>
readonly normal: Schema.optionalKey<Schema.Number>
readonly low: Schema.optionalKey<Schema.Number>
}>
readonly avgExecutionMillis: Schema.optionalKey<Schema.Number>
readonly avgTotalMillis: Schema.optionalKey<Schema.Number>
}>
>,
Schema.Never,
false,
Hyperlink.MethodAnnotations & { description: string },
Hyperlink.Derive
>
}
}Build a queue instance spec (model B): the shared queueControlSpec plus
per-instance data-plane procedures typed by itemSchema — the enqueue verbs (add,
prioritize, defer, enqueue) and the events stream. Pass the result to
Hyperlink.Tag — each instance is its own resource (its own RPC group):
class Jobs extends Hyperlink.Tag<Jobs>()("@app/Jobs", queueSpec(JobSchema)) {}
const q = yield* Jobs;
yield* q.add(aJob); // the item itself is the payload — validated against JobSchema on both sidesitemSchema becomes the rpc payload schema, so RPC validates items on the wire — the
client rejects bad items before the round trip and the server re-validates on decode.
export const const queueSpec: <
F extends Schema.Struct.Fields,
Success extends Schema.Top = Schema.Void,
Error extends Schema.Top = Schema.Never
>(
itemSchema: Schema.Struct<F>,
wire?: {
readonly success?: Success
readonly error?: Error
}
) => {
add: any
prioritize: any
defer: any
enqueue: any
release: any
releaseEncoded: any
deadLetter: any
drop: any
events: any
status: any
size: any
isEmpty: any
start: any
pause: any
resume: any
shutdown: any
clear: any
metrics: {
stream: any
query: any
}
}
Build a queue instance spec (model B): the shared
queueControlSpec
plus
per-instance data-plane procedures typed by itemSchema — the enqueue verbs (add,
prioritize, defer, enqueue) and the events stream. Pass the result to
Hyperlink.Tag
— each instance is its own resource (its own RPC group):
class Jobs extends Hyperlink.Tag<Jobs>()("@app/Jobs", queueSpec(JobSchema)) {}
const q = yield* Jobs;
yield* q.add(aJob); // the item itself is the payload — validated against JobSchema on both sides
itemSchema becomes the rpc payload schema, so RPC validates items on the wire — the
client rejects bad items before the round trip and the server re-validates on decode.
queueSpec = <
function (type parameter) F in <F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void, Error extends Schema.Top = Schema.Never>(itemSchema: Schema.Struct<F>, wire?: {
readonly success?: Success;
readonly error?: Error;
}): {
...;
}
F extends import SchemaSchema.Struct.type Struct<Fields extends Struct.Fields>.Fields = {
readonly [x: string]: Schema.Constraint;
readonly [x: number]: Schema.Constraint;
readonly [x: symbol]: Schema.Constraint;
}
Constraint for a struct field map: an object whose values are schemas.
Fields,
function (type parameter) Success in <F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void, Error extends Schema.Top = Schema.Never>(itemSchema: Schema.Struct<F>, wire?: {
readonly success?: Success;
readonly error?: Error;
}): {
...;
}
Success extends import SchemaSchema.Top = typeof import SchemaSchema.const Void: Schema.Voidconst Void: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<void, readonly []>) => Schema.Void;
annotateKey: (annotations: Schema.Annotations.Key<void>) => Schema.Void;
check: (checks_0: Check<void>, ...checks: Array<Check<void>>) => Schema.Void;
rebuild: (ast: Void) => Schema.Void;
make: (input: void, options?: Schema.MakeOptions) => void;
makeOption: (input: void, options?: Schema.MakeOptions) => Option.Option<void>;
makeEffect: (input: void, options?: Schema.MakeOptions) => Effect.Effect<void, 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
Void
.
Schema for a TypeScript void return value.
When to use
Use when you need to model the return value of a function, RPC, or endpoint
whose result is intentionally ignored.
Details
Runtime parsing accepts any present value and discards it, producing
undefined. The public decoded and encoded TypeScript representation remains
void, so typed construction, decoding, and encoding APIs are still modeled
as void.
Void,
function (type parameter) Error in <F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void, Error extends Schema.Top = Schema.Never>(itemSchema: Schema.Struct<F>, wire?: {
readonly success?: Success;
readonly error?: Error;
}): {
...;
}
Error extends import SchemaSchema.Top = typeof import SchemaSchema.const Never: Schema.Neverconst Never: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<never, readonly []>) => Schema.Never;
annotateKey: (annotations: Schema.Annotations.Key<never>) => Schema.Never;
check: (checks_0: Check<never>, ...checks: Array<Check<never>>) => Schema.Never;
rebuild: (ast: Never) => Schema.Never;
make: (input: never, options?: Schema.MakeOptions) => never;
makeOption: (input: never, options?: Schema.MakeOptions) => Option.Option<never>;
makeEffect: (input: never, options?: Schema.MakeOptions) => Effect.Effect<never, 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
Never
.
Schema for the never type. Always fails validation — no value satisfies it.
Never,
>(
itemSchema: Schema.Struct<F>(parameter) itemSchema: {
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: F) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>, readonly []>) => Schema.Struct<F>;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>) => Schema.Struct<F>;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>, ...checks: Array<Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>…;
rebuild: (ast: Objects) => Schema.Struct<F>;
make: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMut…;
makeOption: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Option.Option<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
makeEffect: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Effect.Effect<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
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; <…;
}
itemSchema: import SchemaSchema.interface Struct<Fields extends Schema.Struct.Fields>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 }
Namespace for struct field type utilities.
Details
These types compute the decoded Type, encoded Encoded, and constructor
input MakeIn of a
Struct
from its field map, handling optional,
mutable, and other field modifiers automatically.
Struct.Fields — constraint for the field map object
Struct.Type<F> — decoded type of the struct
Struct.Encoded<F> — encoded type of the struct
Struct.MakeIn<F> — constructor input (optional/defaulted fields may be omitted)
Struct.DecodingServices<F> / Struct.EncodingServices<F> — required services
Type-level representation returned by
Struct
.
Struct<function (type parameter) F in <F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void, Error extends Schema.Top = Schema.Never>(itemSchema: Schema.Struct<F>, wire?: {
readonly success?: Success;
readonly error?: Error;
}): {
...;
}
F>,
wire: | {
readonly success?: Success
readonly error?: Error
}
| undefined
wire?: { readonly success?: Success | undefinedsuccess?: function (type parameter) Success in <F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void, Error extends Schema.Top = Schema.Never>(itemSchema: Schema.Struct<F>, wire?: {
readonly success?: Success;
readonly error?: Error;
}): {
...;
}
Success; readonly error?: Error | undefinederror?: function (type parameter) Error in <F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void, Error extends Schema.Top = Schema.Never>(itemSchema: Schema.Struct<F>, wire?: {
readonly success?: Success;
readonly error?: Error;
}): {
...;
}
Error },
) => {
// `add`/`prioritize`/`defer` take the item **directly**, and also accept a **batch** (the
// engine's `QueueEnqueue<T>` is `(item) | (items)`), so one call enqueues many — no N round
// trips over RPC. The payload is `item | item[]` (a single-schema union payload); the layer
// recovers the bare `itemSchema` from `add.payload.members[0]`.
const const itemOrItems: Schema.Union<
readonly [
Schema.Struct<F>,
Schema.$Array<Schema.Struct<F>>
]
>
const itemOrItems: {
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<F>, Schema.$Array<Schema.Struct<F>>]) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Union<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>> | ReadonlyArray<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeM…;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>> | ReadonlyArray<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMuta…;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>> | ReadonlyArray<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>>, ...ch…;
rebuild: (ast: Union<Arrays | Objects>) => Schema.Union<readonly [Schema.Struct<F>, Schema.$Array<Schema.Struct<F>>]>;
make: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>> | ReadonlyArray<Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKe…;
makeOption: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>> | ReadonlyArray<Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKe…;
makeEffect: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>> | ReadonlyArray<Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKe…;
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; <…;
}
itemOrItems = import SchemaSchema.function Union<readonly [Schema.Struct<F>, Schema.$Array<Schema.Struct<F>>]>(members: readonly [Schema.Struct<F>, Schema.$Array<Schema.Struct<F>>], options?: {
mode?: "anyOf" | "oneOf";
}): Schema.Union<readonly [Schema.Struct<F>, Schema.$Array<Schema.Struct<F>>]>
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([itemSchema: Schema.Struct<F>(parameter) itemSchema: {
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: F) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>, readonly []>) => Schema.Struct<F>;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>) => Schema.Struct<F>;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>, ...checks: Array<Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>…;
rebuild: (ast: Objects) => Schema.Struct<F>;
make: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMut…;
makeOption: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Option.Option<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
makeEffect: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Effect.Effect<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
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; <…;
}
itemSchema, import SchemaSchema.Array<Schema.Struct<F>>(self: Schema.Struct<F>): Schema.$Array<Schema.Struct<F>>
export Array
Defines a ReadonlyArray schema for a given element schema.
Example (Defining an array of strings)
import { Schema } from "effect"
const schema = Schema.Array(Schema.String)
const result = Schema.decodeUnknownSync(schema)(["a", "b", "c"])
console.log(result)
// [ 'a', 'b', 'c' ]
Array(itemSchema: Schema.Struct<F>(parameter) itemSchema: {
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: F) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>, readonly []>) => Schema.Struct<F>;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>) => Schema.Struct<F>;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>, ...checks: Array<Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>…;
rebuild: (ast: Objects) => Schema.Struct<F>;
make: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMut…;
makeOption: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Option.Option<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
makeEffect: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Effect.Effect<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
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; <…;
}
itemSchema)]);
const const eventSchema: Schema.Union<readonly [Schema.TaggedStruct<"Start", {
readonly key: Schema.String;
}>, Schema.TaggedStruct<"Enqueued", {
readonly entries: Schema.$Array<Schema.Struct<{
readonly item: Schema.Struct<F>;
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<...>;
}>;
readonly batchId: Schema.optional<...>;
readonly releaseId: Schema.optional<...>;
readonly sourceHyperlinkId: Schema.optional<...>;
readonly attributes: Schema.optional<...>;
}>>;
readonly priority: Schema.Literals<...>;
readonly batchId: Schema.optionalKey<...>;
}>, ... 12 more ..., Schema.TaggedStruct<...>]>
const eventSchema: {
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.TaggedStruct<'Start', { readonly key: Schema.String }>, Schema.TaggedStruct<'Enqueued', { readonly entries: Schema.$Array<Schema.Struct<{ readonly item: Schema.Struct<F>; readonly entryId: Schema.String; read…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Start'>; readonly key: Schema.String; }, 'Type'> | { readonly entries: ReadonlyArray<{ readonly item: Schema.Struct.View<F, 'Type', Schema.Stru…;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Start'>; readonly key: Schema.String }, 'Type'> | { readonly entries: ReadonlyArray<{ readonly item: Schema.Struct.View<F, 'Type', Schema.Struct.T…;
check: (checks_0: Check<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Start'>; readonly key: Schema.String }, 'Type'> | { readonly entries: ReadonlyArray<{ readonly item: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, …;
rebuild: (ast: Union<Objects>) => Schema.Union<readonly [Schema.TaggedStruct<'Start', { readonly key: Schema.String }>, Schema.TaggedStruct<'Enqueued', { readonly entries: Schema.$Array<Schema.Struct<{ readonly item: Schema.Struct<F>; readonly entr…;
make: (input: { readonly key: string; readonly _tag?: 'Start' | undefined } | { readonly entries: ReadonlyArray<{ readonly item: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>; read…;
makeOption: (input: { readonly key: string; readonly _tag?: 'Start' | undefined } | { readonly entries: ReadonlyArray<{ readonly item: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>; read…;
makeEffect: (input: { readonly key: string; readonly _tag?: 'Start' | undefined } | { readonly entries: ReadonlyArray<{ readonly item: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>; read…;
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; <…;
}
eventSchema = const buildQueueEvent: <Schema.Struct<F>, Success, Error>(itemSchema: Schema.Struct<F>, successSchema: Success, errorSchema: Error) => Schema.Union<readonly [Schema.TaggedStruct<"Start", {
readonly key: Schema.String;
}>, Schema.TaggedStruct<"Enqueued", {
readonly entries: Schema.$Array<Schema.Struct<{
readonly item: Schema.Struct<F>;
readonly entryId: Schema.String;
readonly key: Schema.optional<Schema.String>;
readonly priority: Schema.Literals<readonly ["high", "normal", "low"]>;
readonly attempts: Schema.Number;
... 4 more ...;
readonly attributes: Schema.optional<...>;
}>>;
readonly priority: Schema.Literals<...>;
readonly batchId: Schema.optionalKey<...>;
}>, ... 12 more ..., Schema.TaggedStruct<...>]>
Build the events union schema with concrete success / error wire schemas (no defaulting
??, so Completed.success is exactly Success, no | void widening). This is the concrete
builder the spec / store / engine consume so their decoded .Type reduces; the defaulting
queueEvent
overloads wrap it.
buildQueueEvent(
itemSchema: Schema.Struct<F>(parameter) itemSchema: {
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: F) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>, readonly []>) => Schema.Struct<F>;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>) => Schema.Struct<F>;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>, ...checks: Array<Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>…;
rebuild: (ast: Objects) => Schema.Struct<F>;
make: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMut…;
makeOption: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Option.Option<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
makeEffect: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Effect.Effect<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
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; <…;
}
itemSchema,
function withVoidDefault<Success>(
schema: Success | undefined
): Success
Resolve an optional wire success schema to its
Schema.Void
default while keeping the
decoded type clean: the public overload returns the caller's Success (not the
Success | typeof Schema.Void union a bare ?? Schema.Void yields, whose ["Type"] is a deferred
indexed access that stops buildQueueEvent's Completed.success from reducing under a generic
Success). Sound: a caller whose Success is not typeof Schema.Void always supplies the schema
(the type param is inferred from it), so the ?? Schema.Void branch only runs when Success really
is typeof Schema.Void. A function-overload narrowing — no cast.
withVoidDefault(wire: | {
readonly success?: Success
readonly error?: Error
}
| undefined
wire?.success?: Success | undefinedsuccess),
function withNeverDefault<Error>(
schema: Error | undefined
): Error
Mirror of
withVoidDefault
for the wire error schema (default
Schema.Never
). The
Error | typeof Schema.Never union's ["Type"] would fold never away, but the schema-value
union still defers, so the same clean-narrowing keeps Failed.cause a concrete Cause<Error>.
withNeverDefault(wire: | {
readonly success?: Success
readonly error?: Error
}
| undefined
wire?.error?: Error | undefinederror),
);
return {
...const queueControlSpec: {
status: any
size: any
isEmpty: any
start: any
pause: any
resume: any
shutdown: any
clear: any
metrics: {
stream: any
query: any
}
}
The queue control + observation contract: the fixed-schema verbs of a queue handle,
shared by every queue instance. The data-plane (item-typed) verbs are added in a later
slice. Mirrors the matching members of QueueHyperlink's QueueHandleApi.
queueControlSpec,
add: anyadd: import HyperlinkHyperlink.unsafeEffectFn<{
(item: Hyperlink.Decoded<Schema.Struct<F>>item: import HyperlinkHyperlink.type Hyperlink.Decoded = /*unresolved*/ anyDecoded<typeof itemSchema: Schema.Struct<F>(parameter) itemSchema: {
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: F) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>, readonly []>) => Schema.Struct<F>;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>) => Schema.Struct<F>;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>, ...checks: Array<Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>…;
rebuild: (ast: Objects) => Schema.Struct<F>;
make: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMut…;
makeOption: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Option.Option<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
makeEffect: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Effect.Effect<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
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; <…;
}
itemSchema>): import EffectEffect.interface Effect<out A, out E = never, out R = never>The Effect interface defines a value that lazily describes a workflow or
job. The workflow requires some context R, and may fail with an error of
type E, or succeed with a value of type A.
When to use
Use when you need to represent a lazy, composable workflow that can require
services, fail with a typed error, or succeed with a typed value.
Details
Effect values model resourceful interaction with the outside world,
including synchronous, asynchronous, concurrent, and parallel interaction.
They use a fiber-based concurrency model, with built-in support for
scheduling, fine-grained interruption, structured concurrency, and high
scalability.
To run an Effect value, you need a Runtime, which is a type that is
capable of executing Effect values.
Effect<void>;
(items: readonly Hyperlink.Decoded<
Schema.Struct<F>
>[]
items: readonly import HyperlinkHyperlink.type Hyperlink.Decoded = /*unresolved*/ anyDecoded<typeof itemSchema: Schema.Struct<F>(parameter) itemSchema: {
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: F) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>, readonly []>) => Schema.Struct<F>;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>) => Schema.Struct<F>;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>, ...checks: Array<Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>…;
rebuild: (ast: Objects) => Schema.Struct<F>;
make: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMut…;
makeOption: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Option.Option<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
makeEffect: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Effect.Effect<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
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; <…;
}
itemSchema>[]): import EffectEffect.interface Effect<out A, out E = never, out R = never>The Effect interface defines a value that lazily describes a workflow or
job. The workflow requires some context R, and may fail with an error of
type E, or succeed with a value of type A.
When to use
Use when you need to represent a lazy, composable workflow that can require
services, fail with a typed error, or succeed with a typed value.
Details
Effect values model resourceful interaction with the outside world,
including synchronous, asynchronous, concurrent, and parallel interaction.
They use a fiber-based concurrency model, with built-in support for
scheduling, fine-grained interruption, structured concurrency, and high
scalability.
To run an Effect value, you need a Runtime, which is a type that is
capable of executing Effect values.
Effect<void>;
(itemOrItems: anyitemOrItems: import HyperlinkHyperlink.type Hyperlink.Decoded = /*unresolved*/ anyDecoded<typeof itemSchema: Schema.Struct<F>(parameter) itemSchema: {
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: F) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>, readonly []>) => Schema.Struct<F>;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>) => Schema.Struct<F>;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>, ...checks: Array<Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>…;
rebuild: (ast: Objects) => Schema.Struct<F>;
make: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMut…;
makeOption: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Option.Option<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
makeEffect: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Effect.Effect<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
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; <…;
}
itemSchema> | readonly import HyperlinkHyperlink.type Hyperlink.Decoded = /*unresolved*/ anyDecoded<typeof itemSchema: Schema.Struct<F>(parameter) itemSchema: {
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: F) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>, readonly []>) => Schema.Struct<F>;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>) => Schema.Struct<F>;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>, ...checks: Array<Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>…;
rebuild: (ast: Objects) => Schema.Struct<F>;
make: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMut…;
makeOption: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Option.Option<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
makeEffect: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Effect.Effect<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
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; <…;
}
itemSchema>[]): import EffectEffect.interface Effect<out A, out E = never, out R = never>The Effect interface defines a value that lazily describes a workflow or
job. The workflow requires some context R, and may fail with an error of
type E, or succeed with a value of type A.
When to use
Use when you need to represent a lazy, composable workflow that can require
services, fail with a typed error, or succeed with a typed value.
Details
Effect values model resourceful interaction with the outside world,
including synchronous, asynchronous, concurrent, and parallel interaction.
They use a fiber-based concurrency model, with built-in support for
scheduling, fine-grained interruption, structured concurrency, and high
scalability.
To run an Effect value, you need a Runtime, which is a type that is
capable of executing Effect values.
Effect<void>;
}>()(const itemOrItems: Schema.Union<
readonly [
Schema.Struct<F>,
Schema.$Array<Schema.Struct<F>>
]
>
const itemOrItems: {
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<F>, Schema.$Array<Schema.Struct<F>>]) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Union<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>> | ReadonlyArray<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeM…;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>> | ReadonlyArray<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMuta…;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>> | ReadonlyArray<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>>, ...ch…;
rebuild: (ast: Union<Arrays | Objects>) => Schema.Union<readonly [Schema.Struct<F>, Schema.$Array<Schema.Struct<F>>]>;
make: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>> | ReadonlyArray<Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKe…;
makeOption: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>> | ReadonlyArray<Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKe…;
makeEffect: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>> | ReadonlyArray<Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKe…;
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; <…;
}
itemOrItems).annotate({
description: stringdescription: "Enqueue an item (or a batch) at normal priority.",
}),
prioritize: anyprioritize: import HyperlinkHyperlink.unsafeEffectFn<{
(item: Hyperlink.Decoded<Schema.Struct<F>>item: import HyperlinkHyperlink.type Hyperlink.Decoded = /*unresolved*/ anyDecoded<typeof itemSchema: Schema.Struct<F>(parameter) itemSchema: {
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: F) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>, readonly []>) => Schema.Struct<F>;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>) => Schema.Struct<F>;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>, ...checks: Array<Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>…;
rebuild: (ast: Objects) => Schema.Struct<F>;
make: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMut…;
makeOption: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Option.Option<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
makeEffect: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Effect.Effect<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
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; <…;
}
itemSchema>): import EffectEffect.interface Effect<out A, out E = never, out R = never>The Effect interface defines a value that lazily describes a workflow or
job. The workflow requires some context R, and may fail with an error of
type E, or succeed with a value of type A.
When to use
Use when you need to represent a lazy, composable workflow that can require
services, fail with a typed error, or succeed with a typed value.
Details
Effect values model resourceful interaction with the outside world,
including synchronous, asynchronous, concurrent, and parallel interaction.
They use a fiber-based concurrency model, with built-in support for
scheduling, fine-grained interruption, structured concurrency, and high
scalability.
To run an Effect value, you need a Runtime, which is a type that is
capable of executing Effect values.
Effect<void>;
(items: readonly Hyperlink.Decoded<
Schema.Struct<F>
>[]
items: readonly import HyperlinkHyperlink.type Hyperlink.Decoded = /*unresolved*/ anyDecoded<typeof itemSchema: Schema.Struct<F>(parameter) itemSchema: {
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: F) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>, readonly []>) => Schema.Struct<F>;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>) => Schema.Struct<F>;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>, ...checks: Array<Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>…;
rebuild: (ast: Objects) => Schema.Struct<F>;
make: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMut…;
makeOption: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Option.Option<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
makeEffect: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Effect.Effect<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
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; <…;
}
itemSchema>[]): import EffectEffect.interface Effect<out A, out E = never, out R = never>The Effect interface defines a value that lazily describes a workflow or
job. The workflow requires some context R, and may fail with an error of
type E, or succeed with a value of type A.
When to use
Use when you need to represent a lazy, composable workflow that can require
services, fail with a typed error, or succeed with a typed value.
Details
Effect values model resourceful interaction with the outside world,
including synchronous, asynchronous, concurrent, and parallel interaction.
They use a fiber-based concurrency model, with built-in support for
scheduling, fine-grained interruption, structured concurrency, and high
scalability.
To run an Effect value, you need a Runtime, which is a type that is
capable of executing Effect values.
Effect<void>;
(itemOrItems: anyitemOrItems: import HyperlinkHyperlink.type Hyperlink.Decoded = /*unresolved*/ anyDecoded<typeof itemSchema: Schema.Struct<F>(parameter) itemSchema: {
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: F) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>, readonly []>) => Schema.Struct<F>;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>) => Schema.Struct<F>;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>, ...checks: Array<Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>…;
rebuild: (ast: Objects) => Schema.Struct<F>;
make: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMut…;
makeOption: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Option.Option<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
makeEffect: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Effect.Effect<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
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; <…;
}
itemSchema> | readonly import HyperlinkHyperlink.type Hyperlink.Decoded = /*unresolved*/ anyDecoded<typeof itemSchema: Schema.Struct<F>(parameter) itemSchema: {
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: F) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>, readonly []>) => Schema.Struct<F>;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>) => Schema.Struct<F>;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>, ...checks: Array<Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>…;
rebuild: (ast: Objects) => Schema.Struct<F>;
make: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMut…;
makeOption: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Option.Option<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
makeEffect: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Effect.Effect<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
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; <…;
}
itemSchema>[]): import EffectEffect.interface Effect<out A, out E = never, out R = never>The Effect interface defines a value that lazily describes a workflow or
job. The workflow requires some context R, and may fail with an error of
type E, or succeed with a value of type A.
When to use
Use when you need to represent a lazy, composable workflow that can require
services, fail with a typed error, or succeed with a typed value.
Details
Effect values model resourceful interaction with the outside world,
including synchronous, asynchronous, concurrent, and parallel interaction.
They use a fiber-based concurrency model, with built-in support for
scheduling, fine-grained interruption, structured concurrency, and high
scalability.
To run an Effect value, you need a Runtime, which is a type that is
capable of executing Effect values.
Effect<void>;
}>()(const itemOrItems: Schema.Union<
readonly [
Schema.Struct<F>,
Schema.$Array<Schema.Struct<F>>
]
>
const itemOrItems: {
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<F>, Schema.$Array<Schema.Struct<F>>]) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Union<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>> | ReadonlyArray<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeM…;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>> | ReadonlyArray<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMuta…;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>> | ReadonlyArray<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>>, ...ch…;
rebuild: (ast: Union<Arrays | Objects>) => Schema.Union<readonly [Schema.Struct<F>, Schema.$Array<Schema.Struct<F>>]>;
make: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>> | ReadonlyArray<Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKe…;
makeOption: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>> | ReadonlyArray<Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKe…;
makeEffect: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>> | ReadonlyArray<Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKe…;
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; <…;
}
itemOrItems).annotate({
description: stringdescription:
"Enqueue an item (or a batch) at high priority (processed before normal and low).",
}),
defer: anydefer: import HyperlinkHyperlink.unsafeEffectFn<{
(item: Hyperlink.Decoded<Schema.Struct<F>>item: import HyperlinkHyperlink.type Hyperlink.Decoded = /*unresolved*/ anyDecoded<typeof itemSchema: Schema.Struct<F>(parameter) itemSchema: {
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: F) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>, readonly []>) => Schema.Struct<F>;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>) => Schema.Struct<F>;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>, ...checks: Array<Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>…;
rebuild: (ast: Objects) => Schema.Struct<F>;
make: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMut…;
makeOption: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Option.Option<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
makeEffect: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Effect.Effect<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
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; <…;
}
itemSchema>): import EffectEffect.interface Effect<out A, out E = never, out R = never>The Effect interface defines a value that lazily describes a workflow or
job. The workflow requires some context R, and may fail with an error of
type E, or succeed with a value of type A.
When to use
Use when you need to represent a lazy, composable workflow that can require
services, fail with a typed error, or succeed with a typed value.
Details
Effect values model resourceful interaction with the outside world,
including synchronous, asynchronous, concurrent, and parallel interaction.
They use a fiber-based concurrency model, with built-in support for
scheduling, fine-grained interruption, structured concurrency, and high
scalability.
To run an Effect value, you need a Runtime, which is a type that is
capable of executing Effect values.
Effect<void>;
(items: readonly Hyperlink.Decoded<
Schema.Struct<F>
>[]
items: readonly import HyperlinkHyperlink.type Hyperlink.Decoded = /*unresolved*/ anyDecoded<typeof itemSchema: Schema.Struct<F>(parameter) itemSchema: {
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: F) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>, readonly []>) => Schema.Struct<F>;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>) => Schema.Struct<F>;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>, ...checks: Array<Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>…;
rebuild: (ast: Objects) => Schema.Struct<F>;
make: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMut…;
makeOption: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Option.Option<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
makeEffect: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Effect.Effect<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
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; <…;
}
itemSchema>[]): import EffectEffect.interface Effect<out A, out E = never, out R = never>The Effect interface defines a value that lazily describes a workflow or
job. The workflow requires some context R, and may fail with an error of
type E, or succeed with a value of type A.
When to use
Use when you need to represent a lazy, composable workflow that can require
services, fail with a typed error, or succeed with a typed value.
Details
Effect values model resourceful interaction with the outside world,
including synchronous, asynchronous, concurrent, and parallel interaction.
They use a fiber-based concurrency model, with built-in support for
scheduling, fine-grained interruption, structured concurrency, and high
scalability.
To run an Effect value, you need a Runtime, which is a type that is
capable of executing Effect values.
Effect<void>;
(itemOrItems: anyitemOrItems: import HyperlinkHyperlink.type Hyperlink.Decoded = /*unresolved*/ anyDecoded<typeof itemSchema: Schema.Struct<F>(parameter) itemSchema: {
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: F) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>, readonly []>) => Schema.Struct<F>;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>) => Schema.Struct<F>;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>, ...checks: Array<Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>…;
rebuild: (ast: Objects) => Schema.Struct<F>;
make: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMut…;
makeOption: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Option.Option<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
makeEffect: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Effect.Effect<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
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; <…;
}
itemSchema> | readonly import HyperlinkHyperlink.type Hyperlink.Decoded = /*unresolved*/ anyDecoded<typeof itemSchema: Schema.Struct<F>(parameter) itemSchema: {
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: F) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>, readonly []>) => Schema.Struct<F>;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>) => Schema.Struct<F>;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>, ...checks: Array<Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>…;
rebuild: (ast: Objects) => Schema.Struct<F>;
make: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMut…;
makeOption: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Option.Option<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
makeEffect: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Effect.Effect<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
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; <…;
}
itemSchema>[]): import EffectEffect.interface Effect<out A, out E = never, out R = never>The Effect interface defines a value that lazily describes a workflow or
job. The workflow requires some context R, and may fail with an error of
type E, or succeed with a value of type A.
When to use
Use when you need to represent a lazy, composable workflow that can require
services, fail with a typed error, or succeed with a typed value.
Details
Effect values model resourceful interaction with the outside world,
including synchronous, asynchronous, concurrent, and parallel interaction.
They use a fiber-based concurrency model, with built-in support for
scheduling, fine-grained interruption, structured concurrency, and high
scalability.
To run an Effect value, you need a Runtime, which is a type that is
capable of executing Effect values.
Effect<void>;
}>()(const itemOrItems: Schema.Union<
readonly [
Schema.Struct<F>,
Schema.$Array<Schema.Struct<F>>
]
>
const itemOrItems: {
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<F>, Schema.$Array<Schema.Struct<F>>]) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Union<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>> | ReadonlyArray<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeM…;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>> | ReadonlyArray<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMuta…;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>> | ReadonlyArray<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>>, ...ch…;
rebuild: (ast: Union<Arrays | Objects>) => Schema.Union<readonly [Schema.Struct<F>, Schema.$Array<Schema.Struct<F>>]>;
make: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>> | ReadonlyArray<Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKe…;
makeOption: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>> | ReadonlyArray<Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKe…;
makeEffect: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>> | ReadonlyArray<Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKe…;
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; <…;
}
itemOrItems).annotate({
description: stringdescription: "Enqueue an item (or a batch) at low priority (processed after high and normal).",
}),
// `enqueue` takes the entry array directly (same shape `events`/`release` produce).
enqueue: anyenqueue: import HyperlinkHyperlink.effectFn(import SchemaSchema.Array<Schema.Struct<{
readonly item: Schema.Struct<F>;
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<...>;
}>>(self: Schema.Struct<...>): Schema.$Array<...>
export Array
Defines a ReadonlyArray schema for a given element schema.
Example (Defining an array of strings)
import { Schema } from "effect"
const schema = Schema.Array(Schema.String)
const result = Schema.decodeUnknownSync(schema)(["a", "b", "c"])
console.log(result)
// [ 'a', 'b', 'c' ]
Array(const queueEntry: <Schema.Struct<F>>(itemSchema: Schema.Struct<F>) => Schema.Struct<{
readonly item: Schema.Struct<F>;
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<...>;
}>;
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(itemSchema: Schema.Struct<F>(parameter) itemSchema: {
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: F) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>, readonly []>) => Schema.Struct<F>;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>) => Schema.Struct<F>;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>, ...checks: Array<Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>…;
rebuild: (ast: Objects) => Schema.Struct<F>;
make: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMut…;
makeOption: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Option.Option<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
makeEffect: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Effect.Effect<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
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; <…;
}
itemSchema))).annotate({
description: stringdescription:
"Re-inject existing entries (e.g. off the events stream / a release) — each re-enters " +
"at its own priority with its attempts preserved. The handoff / round-trip primitive.",
}),
release: anyrelease: import HyperlinkHyperlink.effectFn(
{ options: Schema.optionalKey<
Schema.Struct<{
readonly scope: Schema.optionalKey<
Schema.Literal<"pendingOnly">
>
readonly releaseId: Schema.optionalKey<Schema.String>
readonly attributes: Schema.optionalKey<
Schema.$Record<
Schema.String,
Schema.Codec<
JsonValue,
JsonValue,
never,
never
>
>
>
}>
>
(property) options: {
Type: S["Type"];
Encoded: S["Encoded"];
DecodingServices: S["DecodingServices"];
EncodingServices: S["EncodingServices"];
Iso: S["Iso"];
schema: S;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: JsonValue; } | undefined; readonly scope?: 'pendingOnly' | undefined; }, readonly []>) => Schema.optionalKey<S…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: JsonValue } | undefined; readonly scope?: 'pendingOnly' | undefined }>) => Schema.optionalKey<Schema.Struct<{ rea…;
check: (checks_0: Check<{ readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: JsonValue } | undefined; readonly scope?: 'pendingOnly' | undefined }>, ...checks: Array<Check<{ readonly releaseId?: string | undefi…;
rebuild: (ast: Objects) => Schema.optionalKey<Schema.Struct<{ readonly scope: Schema.optionalKey<Schema.Literal<'pendingOnly'>>; readonly releaseId: Schema.optionalKey<Schema.String>; readonly attributes: Schema.optionalKey<Schema.$Record<Schema.St…;
make: (input: { readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: unknown } | undefined; readonly scope?: 'pendingOnly' | undefined }, options?: Schema.MakeOptions) => { readonly releaseId?: string | undefine…;
makeOption: (input: { readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: unknown } | undefined; readonly scope?: 'pendingOnly' | undefined }, options?: Schema.MakeOptions) => Option.Option<{ readonly releaseId?: str…;
makeEffect: (input: { readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: unknown } | undefined; readonly scope?: 'pendingOnly' | undefined }, options?: Schema.MakeOptions) => Effect.Effect<{ readonly releaseId?: str…;
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; <…;
}
options: import SchemaSchema.const optionalKey: optionalKeyLambda
<Schema.Struct<{
readonly scope: Schema.optionalKey<Schema.Literal<"pendingOnly">>;
readonly releaseId: Schema.optionalKey<Schema.String>;
readonly attributes: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<JsonValue, JsonValue, never, never>>>;
}>>(self: Schema.Struct<{
readonly scope: Schema.optionalKey<Schema.Literal<"pendingOnly">>;
readonly releaseId: Schema.optionalKey<Schema.String>;
readonly attributes: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<JsonValue, JsonValue, never, never>>>;
}>) => Schema.optionalKey<...>
Type-level representation returned by
optionalKey
.
Creates an exact optional key schema for struct fields. Unlike optional,
this creates exact optional properties (not | undefined) that can be
completely omitted from the object.
Example (Creating a struct with optional key)
import { Schema } from "effect"
const schema = Schema.Struct({
name: Schema.String,
age: Schema.optionalKey(Schema.Number)
})
// Type: { readonly name: string; readonly age?: number }
type Person = typeof schema["Type"]
optionalKey(const queueReleaseOptions: Schema.Struct<{
readonly scope: Schema.optionalKey<
Schema.Literal<"pendingOnly">
>
readonly releaseId: Schema.optionalKey<Schema.String>
readonly attributes: Schema.optionalKey<
Schema.$Record<
Schema.String,
Schema.Codec<
JsonValue,
JsonValue,
never,
never
>
>
>
}>
const queueReleaseOptions: {
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 scope: Schema.optionalKey<Schema.Literal<'pendingOnly'>>; readonly releaseId: Schema.optionalKey<Schema.String>; readonly attributes: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<JsonValue, JsonValu…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: JsonValue; } | undefined; readonly scope?: 'pendingOnly' | undefined; }, readonly []>) => Schema.Struct<{ read…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: JsonValue } | undefined; readonly scope?: 'pendingOnly' | undefined }>) => Schema.Struct<{ readonly scope: Schema…;
check: (checks_0: Check<{ readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: JsonValue } | undefined; readonly scope?: 'pendingOnly' | undefined }>, ...checks: Array<Check<{ readonly releaseId?: string | undefi…;
rebuild: (ast: Objects) => Schema.Struct<{ readonly scope: Schema.optionalKey<Schema.Literal<'pendingOnly'>>; readonly releaseId: Schema.optionalKey<Schema.String>; readonly attributes: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<…;
make: (input: { readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: unknown } | undefined; readonly scope?: 'pendingOnly' | undefined }, options?: Schema.MakeOptions) => { readonly releaseId?: string | undefine…;
makeOption: (input: { readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: unknown } | undefined; readonly scope?: 'pendingOnly' | undefined }, options?: Schema.MakeOptions) => Option.Option<{ readonly releaseId?: str…;
makeEffect: (input: { readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: unknown } | undefined; readonly scope?: 'pendingOnly' | undefined }, options?: Schema.MakeOptions) => Effect.Effect<{ readonly releaseId?: str…;
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; <…;
}
Options for release / releaseEncoded (wire form of QueueReleaseOptions).
queueReleaseOptions) },
import SchemaSchema.Array<Schema.Struct<{
readonly item: Schema.Struct<F>;
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<...>;
}>>(self: Schema.Struct<...>): Schema.$Array<...>
export Array
Defines a ReadonlyArray schema for a given element schema.
Example (Defining an array of strings)
import { Schema } from "effect"
const schema = Schema.Array(Schema.String)
const result = Schema.decodeUnknownSync(schema)(["a", "b", "c"])
console.log(result)
// [ 'a', 'b', 'c' ]
Array(const queueEntry: <Schema.Struct<F>>(itemSchema: Schema.Struct<F>) => Schema.Struct<{
readonly item: Schema.Struct<F>;
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<...>;
}>;
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(itemSchema: Schema.Struct<F>(parameter) itemSchema: {
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: F) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>, readonly []>) => Schema.Struct<F>;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>) => Schema.Struct<F>;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>, ...checks: Array<Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>…;
rebuild: (ast: Objects) => Schema.Struct<F>;
make: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMut…;
makeOption: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Option.Option<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
makeEffect: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Effect.Effect<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
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; <…;
}
itemSchema)),
).annotate({
description: stringdescription:
"Export pending entries for handoff and remove them from this queue; returns them decoded.",
destructive: booleandestructive: true,
}),
releaseEncoded: anyreleaseEncoded: import HyperlinkHyperlink.effectFn(
{ options: Schema.optionalKey<
Schema.Struct<{
readonly scope: Schema.optionalKey<
Schema.Literal<"pendingOnly">
>
readonly releaseId: Schema.optionalKey<Schema.String>
readonly attributes: Schema.optionalKey<
Schema.$Record<
Schema.String,
Schema.Codec<
JsonValue,
JsonValue,
never,
never
>
>
>
}>
>
(property) options: {
Type: S["Type"];
Encoded: S["Encoded"];
DecodingServices: S["DecodingServices"];
EncodingServices: S["EncodingServices"];
Iso: S["Iso"];
schema: S;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: JsonValue; } | undefined; readonly scope?: 'pendingOnly' | undefined; }, readonly []>) => Schema.optionalKey<S…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: JsonValue } | undefined; readonly scope?: 'pendingOnly' | undefined }>) => Schema.optionalKey<Schema.Struct<{ rea…;
check: (checks_0: Check<{ readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: JsonValue } | undefined; readonly scope?: 'pendingOnly' | undefined }>, ...checks: Array<Check<{ readonly releaseId?: string | undefi…;
rebuild: (ast: Objects) => Schema.optionalKey<Schema.Struct<{ readonly scope: Schema.optionalKey<Schema.Literal<'pendingOnly'>>; readonly releaseId: Schema.optionalKey<Schema.String>; readonly attributes: Schema.optionalKey<Schema.$Record<Schema.St…;
make: (input: { readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: unknown } | undefined; readonly scope?: 'pendingOnly' | undefined }, options?: Schema.MakeOptions) => { readonly releaseId?: string | undefine…;
makeOption: (input: { readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: unknown } | undefined; readonly scope?: 'pendingOnly' | undefined }, options?: Schema.MakeOptions) => Option.Option<{ readonly releaseId?: str…;
makeEffect: (input: { readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: unknown } | undefined; readonly scope?: 'pendingOnly' | undefined }, options?: Schema.MakeOptions) => Effect.Effect<{ readonly releaseId?: str…;
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; <…;
}
options: import SchemaSchema.const optionalKey: optionalKeyLambda
<Schema.Struct<{
readonly scope: Schema.optionalKey<Schema.Literal<"pendingOnly">>;
readonly releaseId: Schema.optionalKey<Schema.String>;
readonly attributes: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<JsonValue, JsonValue, never, never>>>;
}>>(self: Schema.Struct<{
readonly scope: Schema.optionalKey<Schema.Literal<"pendingOnly">>;
readonly releaseId: Schema.optionalKey<Schema.String>;
readonly attributes: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<JsonValue, JsonValue, never, never>>>;
}>) => Schema.optionalKey<...>
Type-level representation returned by
optionalKey
.
Creates an exact optional key schema for struct fields. Unlike optional,
this creates exact optional properties (not | undefined) that can be
completely omitted from the object.
Example (Creating a struct with optional key)
import { Schema } from "effect"
const schema = Schema.Struct({
name: Schema.String,
age: Schema.optionalKey(Schema.Number)
})
// Type: { readonly name: string; readonly age?: number }
type Person = typeof schema["Type"]
optionalKey(const queueReleaseOptions: Schema.Struct<{
readonly scope: Schema.optionalKey<
Schema.Literal<"pendingOnly">
>
readonly releaseId: Schema.optionalKey<Schema.String>
readonly attributes: Schema.optionalKey<
Schema.$Record<
Schema.String,
Schema.Codec<
JsonValue,
JsonValue,
never,
never
>
>
>
}>
const queueReleaseOptions: {
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 scope: Schema.optionalKey<Schema.Literal<'pendingOnly'>>; readonly releaseId: Schema.optionalKey<Schema.String>; readonly attributes: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<JsonValue, JsonValu…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: JsonValue; } | undefined; readonly scope?: 'pendingOnly' | undefined; }, readonly []>) => Schema.Struct<{ read…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: JsonValue } | undefined; readonly scope?: 'pendingOnly' | undefined }>) => Schema.Struct<{ readonly scope: Schema…;
check: (checks_0: Check<{ readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: JsonValue } | undefined; readonly scope?: 'pendingOnly' | undefined }>, ...checks: Array<Check<{ readonly releaseId?: string | undefi…;
rebuild: (ast: Objects) => Schema.Struct<{ readonly scope: Schema.optionalKey<Schema.Literal<'pendingOnly'>>; readonly releaseId: Schema.optionalKey<Schema.String>; readonly attributes: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<…;
make: (input: { readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: unknown } | undefined; readonly scope?: 'pendingOnly' | undefined }, options?: Schema.MakeOptions) => { readonly releaseId?: string | undefine…;
makeOption: (input: { readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: unknown } | undefined; readonly scope?: 'pendingOnly' | undefined }, options?: Schema.MakeOptions) => Option.Option<{ readonly releaseId?: str…;
makeEffect: (input: { readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: unknown } | undefined; readonly scope?: 'pendingOnly' | undefined }, options?: Schema.MakeOptions) => Effect.Effect<{ readonly releaseId?: str…;
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; <…;
}
Options for release / releaseEncoded (wire form of QueueReleaseOptions).
queueReleaseOptions) },
import SchemaSchema.Array<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<...>;
}>;
readonly batchId: Schema.optional<...>;
readonly releaseId: Schema.optional<...>;
readonly sourceHyperlinkId: Schema.optional<...>;
readonly attributes: Schema.optional<...>;
}>>(self: Schema.Struct<...>): Schema.$Array<...>
export Array
Defines a ReadonlyArray schema for a given element schema.
Example (Defining an array of strings)
import { Schema } from "effect"
const schema = Schema.Array(Schema.String)
const result = Schema.decodeUnknownSync(schema)(["a", "b", "c"])
console.log(result)
// [ 'a', 'b', 'c' ]
Array(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<...>;
}>;
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),
const queueReleaseEncodingError: Schema.Union<
readonly [any, any]
>
const queueReleaseEncodingError: {
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 [any, any]) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Union<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<any, readonly []>) => Schema.Union<readonly [any, any]>;
annotateKey: (annotations: Schema.Annotations.Key<any>) => Schema.Union<readonly [any, any]>;
check: (checks_0: Check<any>, ...checks: Array<Check<any>>) => Schema.Union<readonly [any, any]>;
rebuild: (ast: Union<any>) => Schema.Union<readonly [any, any]>;
make: (input: any, options?: Schema.MakeOptions) => any;
makeOption: (input: any, options?: Schema.MakeOptions) => Option.Option<any>;
makeEffect: (input: any, options?: Schema.MakeOptions) => Effect.Effect<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; <…;
}
The releaseEncoded failure channel — the wire-encodable union of the engine's encode
errors (now Schema.TaggedErrorClass, so they are both yieldable and RPC-encodable).
queueReleaseEncodingError,
).annotate({
description: stringdescription:
"Export pending entries in encoded/wire form for remote handoff (requires an itemSchema).",
destructive: booleandestructive: true,
}),
deadLetter: anydeadLetter: import HyperlinkHyperlink.effectFn(
{
selector: Schema.Struct<{
readonly entryId: Schema.optionalKey<Schema.String>
readonly key: Schema.optional<Schema.String>
readonly item: Schema.optionalKey<
Schema.Struct<F>
>
}>
(property) selector: {
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 entryId: Schema.optionalKey<Schema.String>; readonly key: Schema.optional<Schema.String>; readonly item: Schema.optionalKey<Schema.Struct<F>> }) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly key?: string | undefined; readonly item?: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>> | undefined; readonly entryId?: string | undefi…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly key?: string | undefined; readonly item?: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>> | undefined; readonly entryId?: string | undefined…;
check: (checks_0: Check<{ readonly key?: string | undefined; readonly item?: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>> | undefined; readonly entryId?: string | undefined }>, ...checks: Arra…;
rebuild: (ast: Objects) => Schema.Struct<{ readonly entryId: Schema.optionalKey<Schema.String>; readonly key: Schema.optional<Schema.String>; readonly item: Schema.optionalKey<Schema.Struct<F>> }>;
make: (input: { readonly key?: string | undefined; readonly item?: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>> | undefined; readonly entryId?: string | undefined }, options?: Sch…;
makeOption: (input: { readonly key?: string | undefined; readonly item?: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>> | undefined; readonly entryId?: string | undefined }, options?: Sch…;
makeEffect: (input: { readonly key?: string | undefined; readonly item?: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>> | undefined; readonly entryId?: string | undefined }, options?: Sch…;
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; <…;
}
selector: const queueEntrySelector: <Schema.Struct<F>>(itemSchema: Schema.Struct<F>) => Schema.Struct<{
readonly entryId: Schema.optionalKey<Schema.String>;
readonly key: Schema.optional<Schema.String>;
readonly item: Schema.optionalKey<Schema.Struct<F>>;
}>
Selector for the entry-routing verbs (deadLetter / drop), parameterized by itemSchema
(it can match on item). Mirrors the engine's QueueEntrySelector<T>. Over the wire a
selector (typically entryId) identifies the target — routing a full QueueEntry is a local
convenience that reduces to its entryId.
queueEntrySelector(itemSchema: Schema.Struct<F>(parameter) itemSchema: {
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: F) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>, readonly []>) => Schema.Struct<F>;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>) => Schema.Struct<F>;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>, ...checks: Array<Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>…;
rebuild: (ast: Objects) => Schema.Struct<F>;
make: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMut…;
makeOption: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Option.Option<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
makeEffect: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Effect.Effect<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
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; <…;
}
itemSchema),
options: Schema.Struct<{
readonly reason: Schema.String
readonly attributes: Schema.optionalKey<
Schema.$Record<
Schema.String,
Schema.Codec<
JsonValue,
JsonValue,
never,
never
>
>
>
}>
(property) options: {
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 reason: Schema.String; readonly attributes: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<JsonValue, JsonValue, never, never>>> }) => To, options?: { readonly unsafePreserveChecks?: boolean | undefin…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly reason: string; readonly attributes?: { readonly [x: string]: JsonValue; } | undefined; }, readonly []>) => Schema.Struct<{ readonly reason: Schema.String; readonly attributes: Schema.opti…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly reason: string; readonly attributes?: { readonly [x: string]: JsonValue } | undefined }>) => Schema.Struct<{ readonly reason: Schema.String; readonly attributes: Schema.optionalKey<Schema.$Re…;
check: (checks_0: Check<{ readonly reason: string; readonly attributes?: { readonly [x: string]: JsonValue } | undefined }>, ...checks: Array<Check<{ readonly reason: string; readonly attributes?: { readonly [x: string]: JsonValue } | undefined }…;
rebuild: (ast: Objects) => Schema.Struct<{ readonly reason: Schema.String; readonly attributes: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<JsonValue, JsonValue, never, never>>> }>;
make: (input: { readonly reason: string; readonly attributes?: { readonly [x: string]: unknown } | undefined }, options?: Schema.MakeOptions) => { readonly reason: string; readonly attributes?: { readonly [x: string]: JsonValue } | undefined };
makeOption: (input: { readonly reason: string; readonly attributes?: { readonly [x: string]: unknown } | undefined }, options?: Schema.MakeOptions) => Option.Option<{ readonly reason: string; readonly attributes?: { readonly [x: string]: JsonValue } |…;
makeEffect: (input: { readonly reason: string; readonly attributes?: { readonly [x: string]: unknown } | undefined }, options?: Schema.MakeOptions) => Effect.Effect<{ readonly reason: string; readonly attributes?: { readonly [x: string]: JsonValue } |…;
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; <…;
}
options: const queueRouteOptions: Schema.Struct<{
readonly reason: Schema.String
readonly attributes: Schema.optionalKey<
Schema.$Record<
Schema.String,
Schema.Codec<
JsonValue,
JsonValue,
never,
never
>
>
>
}>
const queueRouteOptions: {
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 reason: Schema.String; readonly attributes: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<JsonValue, JsonValue, never, never>>> }) => To, options?: { readonly unsafePreserveChecks?: boolean | undefin…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly reason: string; readonly attributes?: { readonly [x: string]: JsonValue; } | undefined; }, readonly []>) => Schema.Struct<{ readonly reason: Schema.String; readonly attributes: Schema.opti…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly reason: string; readonly attributes?: { readonly [x: string]: JsonValue } | undefined }>) => Schema.Struct<{ readonly reason: Schema.String; readonly attributes: Schema.optionalKey<Schema.$Re…;
check: (checks_0: Check<{ readonly reason: string; readonly attributes?: { readonly [x: string]: JsonValue } | undefined }>, ...checks: Array<Check<{ readonly reason: string; readonly attributes?: { readonly [x: string]: JsonValue } | undefined }…;
rebuild: (ast: Objects) => Schema.Struct<{ readonly reason: Schema.String; readonly attributes: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<JsonValue, JsonValue, never, never>>> }>;
make: (input: { readonly reason: string; readonly attributes?: { readonly [x: string]: unknown } | undefined }, options?: Schema.MakeOptions) => { readonly reason: string; readonly attributes?: { readonly [x: string]: JsonValue } | undefined };
makeOption: (input: { readonly reason: string; readonly attributes?: { readonly [x: string]: unknown } | undefined }, options?: Schema.MakeOptions) => Option.Option<{ readonly reason: string; readonly attributes?: { readonly [x: string]: JsonValue } |…;
makeEffect: (input: { readonly reason: string; readonly attributes?: { readonly [x: string]: unknown } | undefined }, options?: Schema.MakeOptions) => Effect.Effect<{ readonly reason: string; readonly attributes?: { readonly [x: string]: JsonValue } |…;
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; <…;
}
Options for deadLetter / drop (wire form of QueueRouteOptions).
queueRouteOptions,
},
import SchemaSchema.Array<Schema.Struct<{
readonly item: Schema.Struct<F>;
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<...>;
}>>(self: Schema.Struct<...>): Schema.$Array<...>
export Array
Defines a ReadonlyArray schema for a given element schema.
Example (Defining an array of strings)
import { Schema } from "effect"
const schema = Schema.Array(Schema.String)
const result = Schema.decodeUnknownSync(schema)(["a", "b", "c"])
console.log(result)
// [ 'a', 'b', 'c' ]
Array(const queueEntry: <Schema.Struct<F>>(itemSchema: Schema.Struct<F>) => Schema.Struct<{
readonly item: Schema.Struct<F>;
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<...>;
}>;
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(itemSchema: Schema.Struct<F>(parameter) itemSchema: {
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: F) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>, readonly []>) => Schema.Struct<F>;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>) => Schema.Struct<F>;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>, ...checks: Array<Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>…;
rebuild: (ast: Objects) => Schema.Struct<F>;
make: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMut…;
makeOption: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Option.Option<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
makeEffect: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Effect.Effect<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
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; <…;
}
itemSchema)),
).annotate({
description: stringdescription: "Remove pending entries matching the selector and route them to a dead letter.",
destructive: booleandestructive: true,
}),
drop: anydrop: import HyperlinkHyperlink.effectFn(
{
selector: Schema.Struct<{
readonly entryId: Schema.optionalKey<Schema.String>
readonly key: Schema.optional<Schema.String>
readonly item: Schema.optionalKey<
Schema.Struct<F>
>
}>
(property) selector: {
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 entryId: Schema.optionalKey<Schema.String>; readonly key: Schema.optional<Schema.String>; readonly item: Schema.optionalKey<Schema.Struct<F>> }) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly key?: string | undefined; readonly item?: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>> | undefined; readonly entryId?: string | undefi…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly key?: string | undefined; readonly item?: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>> | undefined; readonly entryId?: string | undefined…;
check: (checks_0: Check<{ readonly key?: string | undefined; readonly item?: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>> | undefined; readonly entryId?: string | undefined }>, ...checks: Arra…;
rebuild: (ast: Objects) => Schema.Struct<{ readonly entryId: Schema.optionalKey<Schema.String>; readonly key: Schema.optional<Schema.String>; readonly item: Schema.optionalKey<Schema.Struct<F>> }>;
make: (input: { readonly key?: string | undefined; readonly item?: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>> | undefined; readonly entryId?: string | undefined }, options?: Sch…;
makeOption: (input: { readonly key?: string | undefined; readonly item?: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>> | undefined; readonly entryId?: string | undefined }, options?: Sch…;
makeEffect: (input: { readonly key?: string | undefined; readonly item?: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>> | undefined; readonly entryId?: string | undefined }, options?: Sch…;
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; <…;
}
selector: const queueEntrySelector: <Schema.Struct<F>>(itemSchema: Schema.Struct<F>) => Schema.Struct<{
readonly entryId: Schema.optionalKey<Schema.String>;
readonly key: Schema.optional<Schema.String>;
readonly item: Schema.optionalKey<Schema.Struct<F>>;
}>
Selector for the entry-routing verbs (deadLetter / drop), parameterized by itemSchema
(it can match on item). Mirrors the engine's QueueEntrySelector<T>. Over the wire a
selector (typically entryId) identifies the target — routing a full QueueEntry is a local
convenience that reduces to its entryId.
queueEntrySelector(itemSchema: Schema.Struct<F>(parameter) itemSchema: {
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: F) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>, readonly []>) => Schema.Struct<F>;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>) => Schema.Struct<F>;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>, ...checks: Array<Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>…;
rebuild: (ast: Objects) => Schema.Struct<F>;
make: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMut…;
makeOption: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Option.Option<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
makeEffect: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Effect.Effect<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
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; <…;
}
itemSchema),
options: Schema.Struct<{
readonly reason: Schema.String
readonly attributes: Schema.optionalKey<
Schema.$Record<
Schema.String,
Schema.Codec<
JsonValue,
JsonValue,
never,
never
>
>
>
}>
(property) options: {
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 reason: Schema.String; readonly attributes: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<JsonValue, JsonValue, never, never>>> }) => To, options?: { readonly unsafePreserveChecks?: boolean | undefin…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly reason: string; readonly attributes?: { readonly [x: string]: JsonValue; } | undefined; }, readonly []>) => Schema.Struct<{ readonly reason: Schema.String; readonly attributes: Schema.opti…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly reason: string; readonly attributes?: { readonly [x: string]: JsonValue } | undefined }>) => Schema.Struct<{ readonly reason: Schema.String; readonly attributes: Schema.optionalKey<Schema.$Re…;
check: (checks_0: Check<{ readonly reason: string; readonly attributes?: { readonly [x: string]: JsonValue } | undefined }>, ...checks: Array<Check<{ readonly reason: string; readonly attributes?: { readonly [x: string]: JsonValue } | undefined }…;
rebuild: (ast: Objects) => Schema.Struct<{ readonly reason: Schema.String; readonly attributes: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<JsonValue, JsonValue, never, never>>> }>;
make: (input: { readonly reason: string; readonly attributes?: { readonly [x: string]: unknown } | undefined }, options?: Schema.MakeOptions) => { readonly reason: string; readonly attributes?: { readonly [x: string]: JsonValue } | undefined };
makeOption: (input: { readonly reason: string; readonly attributes?: { readonly [x: string]: unknown } | undefined }, options?: Schema.MakeOptions) => Option.Option<{ readonly reason: string; readonly attributes?: { readonly [x: string]: JsonValue } |…;
makeEffect: (input: { readonly reason: string; readonly attributes?: { readonly [x: string]: unknown } | undefined }, options?: Schema.MakeOptions) => Effect.Effect<{ readonly reason: string; readonly attributes?: { readonly [x: string]: JsonValue } |…;
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; <…;
}
options: const queueRouteOptions: Schema.Struct<{
readonly reason: Schema.String
readonly attributes: Schema.optionalKey<
Schema.$Record<
Schema.String,
Schema.Codec<
JsonValue,
JsonValue,
never,
never
>
>
>
}>
const queueRouteOptions: {
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 reason: Schema.String; readonly attributes: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<JsonValue, JsonValue, never, never>>> }) => To, options?: { readonly unsafePreserveChecks?: boolean | undefin…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly reason: string; readonly attributes?: { readonly [x: string]: JsonValue; } | undefined; }, readonly []>) => Schema.Struct<{ readonly reason: Schema.String; readonly attributes: Schema.opti…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly reason: string; readonly attributes?: { readonly [x: string]: JsonValue } | undefined }>) => Schema.Struct<{ readonly reason: Schema.String; readonly attributes: Schema.optionalKey<Schema.$Re…;
check: (checks_0: Check<{ readonly reason: string; readonly attributes?: { readonly [x: string]: JsonValue } | undefined }>, ...checks: Array<Check<{ readonly reason: string; readonly attributes?: { readonly [x: string]: JsonValue } | undefined }…;
rebuild: (ast: Objects) => Schema.Struct<{ readonly reason: Schema.String; readonly attributes: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<JsonValue, JsonValue, never, never>>> }>;
make: (input: { readonly reason: string; readonly attributes?: { readonly [x: string]: unknown } | undefined }, options?: Schema.MakeOptions) => { readonly reason: string; readonly attributes?: { readonly [x: string]: JsonValue } | undefined };
makeOption: (input: { readonly reason: string; readonly attributes?: { readonly [x: string]: unknown } | undefined }, options?: Schema.MakeOptions) => Option.Option<{ readonly reason: string; readonly attributes?: { readonly [x: string]: JsonValue } |…;
makeEffect: (input: { readonly reason: string; readonly attributes?: { readonly [x: string]: unknown } | undefined }, options?: Schema.MakeOptions) => Effect.Effect<{ readonly reason: string; readonly attributes?: { readonly [x: string]: JsonValue } |…;
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; <…;
}
Options for deadLetter / drop (wire form of QueueRouteOptions).
queueRouteOptions,
},
import SchemaSchema.Array<Schema.Struct<{
readonly item: Schema.Struct<F>;
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<...>;
}>>(self: Schema.Struct<...>): Schema.$Array<...>
export Array
Defines a ReadonlyArray schema for a given element schema.
Example (Defining an array of strings)
import { Schema } from "effect"
const schema = Schema.Array(Schema.String)
const result = Schema.decodeUnknownSync(schema)(["a", "b", "c"])
console.log(result)
// [ 'a', 'b', 'c' ]
Array(const queueEntry: <Schema.Struct<F>>(itemSchema: Schema.Struct<F>) => Schema.Struct<{
readonly item: Schema.Struct<F>;
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<...>;
}>;
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(itemSchema: Schema.Struct<F>(parameter) itemSchema: {
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: F) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>, readonly []>) => Schema.Struct<F>;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>) => Schema.Struct<F>;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>, ...checks: Array<Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>…;
rebuild: (ast: Objects) => Schema.Struct<F>;
make: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMut…;
makeOption: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Option.Option<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
makeEffect: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Effect.Effect<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
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; <…;
}
itemSchema)),
).annotate({
description: stringdescription: "Remove pending entries matching the selector without preserving them.",
destructive: booleandestructive: true,
}),
events: anyevents: import HyperlinkHyperlink.stream(const eventSchema: Schema.Union<readonly [Schema.TaggedStruct<"Start", {
readonly key: Schema.String;
}>, Schema.TaggedStruct<"Enqueued", {
readonly entries: Schema.$Array<Schema.Struct<{
readonly item: Schema.Struct<F>;
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<...>;
}>;
readonly batchId: Schema.optional<...>;
readonly releaseId: Schema.optional<...>;
readonly sourceHyperlinkId: Schema.optional<...>;
readonly attributes: Schema.optional<...>;
}>>;
readonly priority: Schema.Literals<...>;
readonly batchId: Schema.optionalKey<...>;
}>, ... 12 more ..., Schema.TaggedStruct<...>]>
const eventSchema: {
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.TaggedStruct<'Start', { readonly key: Schema.String }>, Schema.TaggedStruct<'Enqueued', { readonly entries: Schema.$Array<Schema.Struct<{ readonly item: Schema.Struct<F>; readonly entryId: Schema.String; read…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Start'>; readonly key: Schema.String; }, 'Type'> | { readonly entries: ReadonlyArray<{ readonly item: Schema.Struct.View<F, 'Type', Schema.Stru…;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Start'>; readonly key: Schema.String }, 'Type'> | { readonly entries: ReadonlyArray<{ readonly item: Schema.Struct.View<F, 'Type', Schema.Struct.T…;
check: (checks_0: Check<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Start'>; readonly key: Schema.String }, 'Type'> | { readonly entries: ReadonlyArray<{ readonly item: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, …;
rebuild: (ast: Union<Objects>) => Schema.Union<readonly [Schema.TaggedStruct<'Start', { readonly key: Schema.String }>, Schema.TaggedStruct<'Enqueued', { readonly entries: Schema.$Array<Schema.Struct<{ readonly item: Schema.Struct<F>; readonly entr…;
make: (input: { readonly key: string; readonly _tag?: 'Start' | undefined } | { readonly entries: ReadonlyArray<{ readonly item: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>; read…;
makeOption: (input: { readonly key: string; readonly _tag?: 'Start' | undefined } | { readonly entries: ReadonlyArray<{ readonly item: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>; read…;
makeEffect: (input: { readonly key: string; readonly _tag?: 'Start' | undefined } | { readonly entries: ReadonlyArray<{ readonly item: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>; read…;
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; <…;
}
eventSchema).annotate({
description: stringdescription: "Discrete entry / worker / queue lifecycle events.",
}),
};
};