{
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
>
}
}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 the engine handle API (QueueHandleApi).
export const const queueControlSpec: {
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>, {
...;
}>;
... 7 more ...;
metrics: {
...;
};
}
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 the engine handle API (QueueHandleApi).
queueControlSpec = {
// ── live current state — one SubscriptionRef-backed source of truth ──
// `status` is the whole snapshot; the scalars are `Stream.map` derivations of it (SSOT). All are
// plain reads (`p.size`) and subscribable (`Hyperlink.changes(p, (s) => s.size)`).
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" }
>
status: import HyperlinkHyperlink.const ref: <Su extends Schema.Top>(
success: Su
) => RefField<
Method<undefined, Su, typeof Schema.Never, true>
>
Define a ref field — reactive state surfaced as a
Subscribable
(get + changes),
uniform local and remote. The impl owns a SubscriptionRef (writes it) and provides it via
subscribable
; consumers read (yield* svc.x.get) and observe (svc.x.changes) — a read
is an honest Effect, not a synchronous peek. For values fixed at acquire use
value
; for
on-demand calls use
effect
.
ref(const queueStatus: 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"]
>
}>
const queueStatus: {
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 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.Numb…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.ReadonlySide<{ readonly sizes: Schema.Struct<{ readonly high: Schema.Number; readonly normal: Schema.Number; readonly low: Schema.Number; }>; readonly paused: Schema.Boolean; readonly i…;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.ReadonlySide<{ readonly sizes: Schema.Struct<{ readonly high: Schema.Number; readonly normal: Schema.Number; readonly low: Schema.Number }>; readonly paused: Schema.Boolean; readonly inFli…;
check: (checks_0: Check<Schema.Struct.ReadonlySide<{ readonly sizes: Schema.Struct<{ readonly high: Schema.Number; readonly normal: Schema.Number; readonly low: Schema.Number }>; readonly paused: Schema.Boolean; readonly inFlight: Schema.Number; …;
rebuild: (ast: Objects) => 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 com…;
make: (input: Struct.ReadonlyMakeIn<{ readonly sizes: Struct<{ readonly high: Number; readonly normal: Number; readonly low: Number }>; readonly paused: Boolean; readonly inFlight: Number; readonly completed: Number; readonly phase: Literals<rea…;
makeOption: (input: Struct.ReadonlyMakeIn<{ readonly sizes: Struct<{ readonly high: Number; readonly normal: Number; readonly low: Number }>; readonly paused: Boolean; readonly inFlight: Number; readonly completed: Number; readonly phase: Literals<rea…;
makeEffect: (input: Struct.ReadonlyMakeIn<{ readonly sizes: Struct<{ readonly high: Number; readonly normal: Number; readonly low: Number }>; readonly paused: Boolean; readonly inFlight: Number; readonly completed: Number; readonly phase: Literals<rea…;
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's current-state snapshot — the element of the status stream. Instantaneous
truth (what is), kept small and encodable (it crosses RPC). One snapshot a dashboard
atom / CLI --watch / TUI renders. Distinct from events (discrete facts) and metrics
(windowed aggregates).
queueStatus).annotate: <A extends MethodAnnotations>(
a: A
) => Marked<
Method<
M["payload"],
M["success"],
M["error"],
M["stream"],
M["annotations"] & A
>,
Mark
>
annotate({
description: stringdescription:
"Live current-state snapshot: per-priority sizes, paused, in-flight, completed, phase.",
}),
size: Hyperlink.Marked<
Hyperlink.Method<
undefined,
Schema.Number,
Schema.Never,
true,
Hyperlink.MethodAnnotations & {
description: string
},
Hyperlink.Derive
>,
{ readonly _tag: "ref" }
>
size: import HyperlinkHyperlink.const ref: <Su extends Schema.Top>(
success: Su
) => RefField<
Method<undefined, Su, typeof Schema.Never, true>
>
Define a ref field — reactive state surfaced as a
Subscribable
(get + changes),
uniform local and remote. The impl owns a SubscriptionRef (writes it) and provides it via
subscribable
; consumers read (yield* svc.x.get) and observe (svc.x.changes) — a read
is an honest Effect, not a synchronous peek. For values fixed at acquire use
value
; for
on-demand calls use
effect
.
ref(import SchemaSchema.const Number: Numberconst Number: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<number, readonly []>) => Schema.Number;
annotateKey: (annotations: Schema.Annotations.Key<number>) => Schema.Number;
check: (checks_0: Check<number>, ...checks: Array<Check<number>>) => Schema.Number;
rebuild: (ast: Number) => Schema.Number;
make: (input: number, options?: MakeOptions) => number;
makeOption: (input: number, options?: MakeOptions) => Option_.Option<number>;
makeEffect: (input: number, options?: MakeOptions) => Effect.Effect<number, SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Type-level representation of
Number
.
Schema for number values, including NaN, Infinity, and -Infinity.
Details
Default JSON serializer:
- Finite numbers are serialized as numbers.
- Non-finite values are serialized as strings (
"NaN", "Infinity", "-Infinity").
Number).annotate: <A extends MethodAnnotations>(
a: A
) => Marked<
Method<
M["payload"],
M["success"],
M["error"],
M["stream"],
M["annotations"] & A
>,
Mark
>
annotate({
description: stringdescription: "Total pending items across all priority lanes.",
}),
isEmpty: Hyperlink.Marked<
Hyperlink.Method<
undefined,
Schema.Boolean,
Schema.Never,
true,
Hyperlink.MethodAnnotations & {
description: string
},
Hyperlink.Derive
>,
{ readonly _tag: "ref" }
>
isEmpty: import HyperlinkHyperlink.const ref: <Su extends Schema.Top>(
success: Su
) => RefField<
Method<undefined, Su, typeof Schema.Never, true>
>
Define a ref field — reactive state surfaced as a
Subscribable
(get + changes),
uniform local and remote. The impl owns a SubscriptionRef (writes it) and provides it via
subscribable
; consumers read (yield* svc.x.get) and observe (svc.x.changes) — a read
is an honest Effect, not a synchronous peek. For values fixed at acquire use
value
; for
on-demand calls use
effect
.
ref(import SchemaSchema.const Boolean: Booleanconst Boolean: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<boolean, readonly []>) => Schema.Boolean;
annotateKey: (annotations: Schema.Annotations.Key<boolean>) => Schema.Boolean;
check: (checks_0: Check<boolean>, ...checks: Array<Check<boolean>>) => Schema.Boolean;
rebuild: (ast: Boolean) => Schema.Boolean;
make: (input: boolean, options?: MakeOptions) => boolean;
makeOption: (input: boolean, options?: MakeOptions) => Option_.Option<boolean>;
makeEffect: (input: boolean, options?: MakeOptions) => Effect.Effect<boolean, 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
Boolean
.
Schema for boolean values. Validates that the input is typeof "boolean".
When to use
Use to validate values that are already JavaScript booleans.
Boolean).annotate: <A extends MethodAnnotations>(
a: A
) => Marked<
Method<
M["payload"],
M["success"],
M["error"],
M["stream"],
M["annotations"] & A
>,
Mark
>
annotate({
description: stringdescription: "Whether all priority queues are empty.",
}),
// ── lifecycle commands ──
start: Hyperlink.Method<
undefined,
Schema.Void,
Schema.Never,
false,
Hyperlink.MethodAnnotations & {
description: string
},
Hyperlink.Derive
>
(property) start: {
kind: MethodKind;
payload: P;
success: Su;
error: E;
stream: Str;
annotations: Ann;
annotate: <A extends MethodAnnotations>(annotations: A) => Method<P, Su, E, Str, Ann & A, Client>;
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; <…;
}
start: import HyperlinkHyperlink.function effect<Schema.Void>(success: Schema.Void): Hyperlink.Method<undefined, Schema.Void, Schema.Never, false, Hyperlink.MethodAnnotations, Hyperlink.Derive> (+3 overloads)Two-stage
effect
— override the client-facing type with a Client (an Effect type;
a read surfaces as Effect<Success>) that must narrow the schema-derived shape:
effect<Client>()(success). Widening the success fails to compile. For a free override, see
unsafeEffect
.
effect(import SchemaSchema.const Void: 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?: MakeOptions) => void;
makeOption: (input: void, options?: MakeOptions) => Option_.Option<void>;
makeEffect: (input: void, options?: MakeOptions) => Effect.Effect<void, 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).Method<undefined, Void, Never, false, MethodAnnotations, Derive>.annotate: <A extends MethodAnnotations>(annotations: A) => Method<P, Su, E, Str, Ann & A, Client>annotate({
description: stringdescription:
"Fork the worker pool + lifecycle monitor (idempotent; no-op after shutdown).",
}),
pause: Hyperlink.Method<
undefined,
Schema.Void,
Schema.Never,
false,
Hyperlink.MethodAnnotations & {
description: string
},
Hyperlink.Derive
>
(property) pause: {
kind: MethodKind;
payload: P;
success: Su;
error: E;
stream: Str;
annotations: Ann;
annotate: <A extends MethodAnnotations>(annotations: A) => Method<P, Su, E, Str, Ann & A, Client>;
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; <…;
}
pause: import HyperlinkHyperlink.function effect<Schema.Void>(success: Schema.Void): Hyperlink.Method<undefined, Schema.Void, Schema.Never, false, Hyperlink.MethodAnnotations, Hyperlink.Derive> (+3 overloads)Two-stage
effect
— override the client-facing type with a Client (an Effect type;
a read surfaces as Effect<Success>) that must narrow the schema-derived shape:
effect<Client>()(success). Widening the success fails to compile. For a free override, see
unsafeEffect
.
effect(import SchemaSchema.const Void: 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?: MakeOptions) => void;
makeOption: (input: void, options?: MakeOptions) => Option_.Option<void>;
makeEffect: (input: void, options?: MakeOptions) => Effect.Effect<void, 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).Method<undefined, Void, Never, false, MethodAnnotations, Derive>.annotate: <A extends MethodAnnotations>(annotations: A) => Method<P, Su, E, Str, Ann & A, Client>annotate({
description: stringdescription: "Pause processing; items can still be enqueued and accumulate.",
}),
resume: Hyperlink.Method<
undefined,
Schema.Void,
Schema.Never,
false,
Hyperlink.MethodAnnotations & {
description: string
},
Hyperlink.Derive
>
(property) resume: {
kind: MethodKind;
payload: P;
success: Su;
error: E;
stream: Str;
annotations: Ann;
annotate: <A extends MethodAnnotations>(annotations: A) => Method<P, Su, E, Str, Ann & A, Client>;
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; <…;
}
resume: import HyperlinkHyperlink.function effect<Schema.Void>(success: Schema.Void): Hyperlink.Method<undefined, Schema.Void, Schema.Never, false, Hyperlink.MethodAnnotations, Hyperlink.Derive> (+3 overloads)Two-stage
effect
— override the client-facing type with a Client (an Effect type;
a read surfaces as Effect<Success>) that must narrow the schema-derived shape:
effect<Client>()(success). Widening the success fails to compile. For a free override, see
unsafeEffect
.
effect(import SchemaSchema.const Void: 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?: MakeOptions) => void;
makeOption: (input: void, options?: MakeOptions) => Option_.Option<void>;
makeEffect: (input: void, options?: MakeOptions) => Effect.Effect<void, 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).Method<undefined, Void, Never, false, MethodAnnotations, Derive>.annotate: <A extends MethodAnnotations>(annotations: A) => Method<P, Su, E, Str, Ann & A, Client>annotate({
description: stringdescription: "Resume processing after a pause.",
}),
shutdown: Hyperlink.Method<
undefined,
Schema.Void,
Schema.Never,
false,
Hyperlink.MethodAnnotations & {
description: string
destructive: true
},
Hyperlink.Derive
>
(property) shutdown: {
kind: MethodKind;
payload: P;
success: Su;
error: E;
stream: Str;
annotations: Ann;
annotate: <A extends MethodAnnotations>(annotations: A) => Method<P, Su, E, Str, Ann & A, Client>;
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; <…;
}
shutdown: import HyperlinkHyperlink.function effect<Schema.Void>(success: Schema.Void): Hyperlink.Method<undefined, Schema.Void, Schema.Never, false, Hyperlink.MethodAnnotations, Hyperlink.Derive> (+3 overloads)Two-stage
effect
— override the client-facing type with a Client (an Effect type;
a read surfaces as Effect<Success>) that must narrow the schema-derived shape:
effect<Client>()(success). Widening the success fails to compile. For a free override, see
unsafeEffect
.
effect(import SchemaSchema.const Void: 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?: MakeOptions) => void;
makeOption: (input: void, options?: MakeOptions) => Option_.Option<void>;
makeEffect: (input: void, options?: MakeOptions) => Effect.Effect<void, 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).Method<undefined, Void, Never, false, MethodAnnotations, Derive>.annotate: <A extends MethodAnnotations>(annotations: A) => Method<P, Su, E, Str, Ann & A, Client>annotate({
description: stringdescription:
"Permanently stop the queue (graceful): phase → draining, later enqueues dropped, " +
"in-flight finishes, queued items drained or discarded per shutdownMode, then phase → off.",
destructive: truedestructive: true,
}),
clear: Hyperlink.Method<
undefined,
Schema.Number,
Schema.Never,
false,
Hyperlink.MethodAnnotations & {
description: string
destructive: true
},
Hyperlink.Derive
>
(property) clear: {
kind: MethodKind;
payload: P;
success: Su;
error: E;
stream: Str;
annotations: Ann;
annotate: <A extends MethodAnnotations>(annotations: A) => Method<P, Su, E, Str, Ann & A, Client>;
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; <…;
}
clear: import HyperlinkHyperlink.function effect<Schema.Number>(success: Schema.Number): Hyperlink.Method<undefined, Schema.Number, Schema.Never, false, Hyperlink.MethodAnnotations, Hyperlink.Derive> (+3 overloads)Two-stage
effect
— override the client-facing type with a Client (an Effect type;
a read surfaces as Effect<Success>) that must narrow the schema-derived shape:
effect<Client>()(success). Widening the success fails to compile. For a free override, see
unsafeEffect
.
effect(import SchemaSchema.const Number: Numberconst Number: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<number, readonly []>) => Schema.Number;
annotateKey: (annotations: Schema.Annotations.Key<number>) => Schema.Number;
check: (checks_0: Check<number>, ...checks: Array<Check<number>>) => Schema.Number;
rebuild: (ast: Number) => Schema.Number;
make: (input: number, options?: MakeOptions) => number;
makeOption: (input: number, options?: MakeOptions) => Option_.Option<number>;
makeEffect: (input: number, options?: MakeOptions) => Effect.Effect<number, SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Type-level representation of
Number
.
Schema for number values, including NaN, Infinity, and -Infinity.
Details
Default JSON serializer:
- Finite numbers are serialized as numbers.
- Non-finite values are serialized as strings (
"NaN", "Infinity", "-Infinity").
Number).Method<undefined, Number, Never, false, MethodAnnotations, Derive>.annotate: <A extends MethodAnnotations>(annotations: A) => Method<P, Su, E, Str, Ann & A, Client>annotate({
description: stringdescription:
"Drain all pending items and reset the completed counter; returns the count cleared.",
destructive: truedestructive: true,
}),
// ── observability — stream + query, paired by nesting ──
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 avgExecutionMillis: Schema.optionalKey<...>;
readonly avgTotalMillis: Schema.optionalKey<...>;
}>, Schema.Never, true, Hyperlink.MethodAnnotations & {
...;
}, Hyperlink.Derive>;
query: Hyperlink.Method<...>;
}
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
>
(property) stream: {
kind: MethodKind;
payload: P;
success: Su;
error: E;
stream: Str;
annotations: Ann;
annotate: <A extends MethodAnnotations>(annotations: A) => Method<P, Su, E, Str, Ann & A, Client>;
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; <…;
}
stream: import HyperlinkHyperlink.function stream<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 avgExecutionMillis: Schema.optionalKey<...>;
readonly avgTotalMillis: Schema.optionalKey<...>;
}>>(success: Schema.Struct<...>): Hyperlink.Method<...> (+5 overloads)
Define a stream (a live, idempotent push source) whose elements are success. The
service member surfaces as a Stream<Success, Error> (a property, or (payload) => Stream
when a payload is declared) rather than an Effect — drive dashboard atoms, a CLI
--watch, or a TUI from it. Conventionally named changes when it carries a HyperService's
whole observable state (a snapshot stream); back it with a SubscriptionRef's .changes.
Counts as a query for tools (an idempotent read). success is the element schema and
error (if any) is the stream error schema; both must be encodable (they cross RPC).
payload is a single schema or struct fields — same as Effect's Rpc.make.
changes: Hyperlink.stream(QueueSnapshot).annotate({ description: "Live queue state." }),
tail: Hyperlink.stream(LogLine, { payload: Schema.Struct({ since: Schema.Number }) }),
stream(const queueMetrics: 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>
}>
const queueMetrics: {
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 windowStart: Schema.DateTimeUtc; readonly windowEnd: Schema.DateTimeUtc; readonly windowMillis: Schema.Number; readonly enqueued: Schema.Number; readonly started: Schema.Number; readonly completed: Schema.Number; re…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly inFlight: number; readonly completed: number; readonly avgWaitMillis: { readonly high?: number | undefined; readonly normal?: number | undefined; readonly low?: number | undefined; }; read…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly inFlight: number; readonly completed: number; readonly avgWaitMillis: { readonly high?: number | undefined; readonly normal?: number | undefined; readonly low?: number | undefined }; readonly…;
check: (checks_0: Check<{ readonly inFlight: number; readonly completed: number; readonly avgWaitMillis: { readonly high?: number | undefined; readonly normal?: number | undefined; readonly low?: number | undefined }; readonly windowStart: DateTi…;
rebuild: (ast: Objects) => Schema.Struct<{ readonly windowStart: Schema.DateTimeUtc; readonly windowEnd: Schema.DateTimeUtc; readonly windowMillis: Schema.Number; readonly enqueued: Schema.Number; readonly started: Schema.Number; readonly completed…;
make: (input: { readonly inFlight: number; readonly completed: number; readonly avgWaitMillis: { readonly high?: number | undefined; readonly normal?: number | undefined; readonly low?: number | undefined }; readonly windowStart: DateTime.Utc; r…;
makeOption: (input: { readonly inFlight: number; readonly completed: number; readonly avgWaitMillis: { readonly high?: number | undefined; readonly normal?: number | undefined; readonly low?: number | undefined }; readonly windowStart: DateTime.Utc; r…;
makeEffect: (input: { readonly inFlight: number; readonly completed: number; readonly avgWaitMillis: { readonly high?: number | undefined; readonly normal?: number | undefined; readonly low?: number | undefined }; readonly windowStart: DateTime.Utc; r…;
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; <…;
}
Windowed queue metrics — the element of the metrics stream, emitted once per window.
Counts are per-window deltas; gauges/derived values are as-of the window end. Separate from
status (instantaneous) and events (discrete) because aggregates are inherently
time-bucketed.
queueMetrics).Method<undefined, Struct<{ readonly windowStart: DateTimeUtc; readonly windowEnd: DateTimeUtc; readonly windowMillis: Number; readonly enqueued: Number; ... 11 more ...; readonly avgTotalMillis: optionalKey<...>; }>, Never, true, MethodAnnotations, Derive>.annotate: <A extends MethodAnnotations>(annotations: A) => Method<P, Su, E, Str, Ann & A, Client>annotate({
description: stringdescription:
"Windowed metrics (per-window counts + throughput/latency) emitted once per window.",
}),
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
>
(property) query: {
kind: MethodKind;
payload: P;
success: Su;
error: E;
stream: Str;
annotations: Ann;
annotate: <A extends MethodAnnotations>(annotations: A) => Method<P, Su, E, Str, Ann & A, Client>;
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; <…;
}
query: import HyperlinkHyperlink.function effectFn<{
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;
... 7 more ...;
readonly avgTotalMillis: Schema.optionalKey<...>;
}>>>(payload: {
limit: Schema.optionalKey<Schema.Number>;
since: Schema.optionalKey<Schema.DateTimeUtc>;
until: Schema.optionalKey<Schema.DateTimeUtc>;
}, success: Schema.$Array<...>): Hyperlink.Method<...> (+7 overloads)
Two-stage
effectFn
— override the client-facing type with a Client that must narrow
the schema-derived shape: effectFn<Client>()(payload). Reshape freely (e.g. add overloads), but a
Client that would accept payloads the wire rejects fails to compile (payload resolves to never).
For an override that can't be a narrowing (a generic library), use
unsafeEffectFn
.
effectFn(const historyQuery: {
limit: Schema.optionalKey<Schema.Number>
since: Schema.optionalKey<Schema.DateTimeUtc>
until: Schema.optionalKey<Schema.DateTimeUtc>
}
Payload fields for the metrics.query history read — newest limit entries within an optional
[since, until] window.
historyQuery, import SchemaSchema.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 avgExecutionMillis: Schema.optionalKey<...>;
readonly avgTotalMillis: Schema.optionalKey<...>;
}>>(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 queueMetrics: 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>
}>
const queueMetrics: {
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 windowStart: Schema.DateTimeUtc; readonly windowEnd: Schema.DateTimeUtc; readonly windowMillis: Schema.Number; readonly enqueued: Schema.Number; readonly started: Schema.Number; readonly completed: Schema.Number; re…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly inFlight: number; readonly completed: number; readonly avgWaitMillis: { readonly high?: number | undefined; readonly normal?: number | undefined; readonly low?: number | undefined; }; read…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly inFlight: number; readonly completed: number; readonly avgWaitMillis: { readonly high?: number | undefined; readonly normal?: number | undefined; readonly low?: number | undefined }; readonly…;
check: (checks_0: Check<{ readonly inFlight: number; readonly completed: number; readonly avgWaitMillis: { readonly high?: number | undefined; readonly normal?: number | undefined; readonly low?: number | undefined }; readonly windowStart: DateTi…;
rebuild: (ast: Objects) => Schema.Struct<{ readonly windowStart: Schema.DateTimeUtc; readonly windowEnd: Schema.DateTimeUtc; readonly windowMillis: Schema.Number; readonly enqueued: Schema.Number; readonly started: Schema.Number; readonly completed…;
make: (input: { readonly inFlight: number; readonly completed: number; readonly avgWaitMillis: { readonly high?: number | undefined; readonly normal?: number | undefined; readonly low?: number | undefined }; readonly windowStart: DateTime.Utc; r…;
makeOption: (input: { readonly inFlight: number; readonly completed: number; readonly avgWaitMillis: { readonly high?: number | undefined; readonly normal?: number | undefined; readonly low?: number | undefined }; readonly windowStart: DateTime.Utc; r…;
makeEffect: (input: { readonly inFlight: number; readonly completed: number; readonly avgWaitMillis: { readonly high?: number | undefined; readonly normal?: number | undefined; readonly low?: number | undefined }; readonly windowStart: DateTime.Utc; r…;
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; <…;
}
Windowed queue metrics — the element of the metrics stream, emitted once per window.
Counts are per-window deltas; gauges/derived values are as-of the window end. Separate from
status (instantaneous) and events (discrete) because aggregates are inherently
time-bucketed.
queueMetrics)).Method<{ limit: optionalKey<Number>; since: optionalKey<DateTimeUtc>; until: optionalKey<DateTimeUtc>; }, ... 4 more ..., Derive>.annotate: <A extends MethodAnnotations>(annotations: A) => Method<P, Su, E, Str, Ann & A, Client>annotate({
description: stringdescription:
"Past windowed metrics from the HistoryStore (newest `limit` within `since`/`until`); " +
"empty unless a HistoryStore layer is provided.",
}),
},
};