{
entries: Hyperlink.Marked<
Hyperlink.Method<
undefined,
Schema.$Array<
Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>
readonly startAt: Schema.DateTimeUtc
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>
}>
>,
Schema.Never,
true,
Hyperlink.MethodAnnotations & { description: string },
Hyperlink.Derive
>,
{ readonly _tag: "ref" }
>
set: Hyperlink.Method<
Schema.$Array<
Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>
readonly startAt: Schema.DateTimeUtc
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>
}>
>,
Schema.Void,
Schema.Never,
false,
Hyperlink.MethodAnnotations & { description: string },
Hyperlink.Derive
>
add: Hyperlink.Method<
Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>
readonly startAt: Schema.DateTimeUtc
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>
}>,
Schema.Void,
Schema.Never,
false,
Hyperlink.MethodAnnotations & { description: string },
Hyperlink.Derive
>
clear: Hyperlink.Method<
undefined,
Schema.Void,
Schema.Never,
false,
Hyperlink.MethodAnnotations & {
description: string
destructive: true
},
Hyperlink.Derive
>
}The schedule mutation verbs a daemon gains when it owns an inline schedule.
Reading is entries (reactive); mutation is set / add / clear. This is how you arm/disarm:
armed is derived from the entries, so arming is done by mutating them.
export const const scheduleGroupSpec: {
entries: Hyperlink.Marked<Hyperlink.Method<undefined, Schema.$Array<Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>;
readonly startAt: Schema.DateTimeUtc;
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>;
}>>, Schema.Never, true, Hyperlink.MethodAnnotations & {
description: string;
}, Hyperlink.Derive>, {
readonly _tag: "ref";
}>;
set: Hyperlink.Method<Schema.$Array<Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>;
readonly startAt: Schema.DateTimeUtc;
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>;
}>>, ... 4 more ..., Hyperlink.Derive>;
add: Hyperlink.Method<...>;
clear: Hyperlink.Method<...>;
}
The schedule mutation verbs a daemon gains when it
schedule
.
Reading is entries (reactive); mutation is set / add / clear. This is how you arm/disarm:
armed is derived from the entries, so arming is done by mutating them.
scheduleGroupSpec = {
entries: Hyperlink.Marked<
Hyperlink.Method<
undefined,
Schema.$Array<
Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>
readonly startAt: Schema.DateTimeUtc
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>
}>
>,
Schema.Never,
true,
Hyperlink.MethodAnnotations & {
description: string
},
Hyperlink.Derive
>,
{ readonly _tag: "ref" }
>
entries: 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.Array<Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>;
readonly startAt: Schema.DateTimeUtc;
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>;
}>>(self: Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>;
readonly startAt: Schema.DateTimeUtc;
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>;
}>): Schema.$Array<Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>;
readonly startAt: Schema.DateTimeUtc;
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>;
}>>
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 daemonScheduleEntry: Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>
readonly startAt: Schema.DateTimeUtc
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>
}>
const daemonScheduleEntry: {
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 id: Schema.optionalKey<Schema.String>; readonly startAt: Schema.DateTimeUtc; readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc> }) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | unde…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?: DateTime.Utc | undefined; }, readonly []>) => Schema.Struct<{ readonly id: Schema.optionalKey<Schema.String>; rea…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?: DateTime.Utc | undefined }>) => Schema.Struct<{ readonly id: Schema.optionalKey<Schema.String>; readonly startAt: Sc…;
check: (checks_0: Check<{ readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?: DateTime.Utc | undefined }>, ...checks: Array<Check<{ readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?…;
rebuild: (ast: Objects) => Schema.Struct<{ readonly id: Schema.optionalKey<Schema.String>; readonly startAt: Schema.DateTimeUtc; readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc> }>;
make: (input: { readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?: DateTime.Utc | undefined }, options?: MakeOptions) => { readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?: DateT…;
makeOption: (input: { readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?: DateTime.Utc | undefined }, options?: MakeOptions) => Option_.Option<{ readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly…;
makeEffect: (input: { readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?: DateTime.Utc | undefined }, options?: MakeOptions) => Effect.Effect<{ readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly …;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
One scheduled run window on the wire — the wire form of the engine's
DaemonScheduleEntry
.
The engine models id / stopAt as Option and the times as Date; the toolkit standard is
DateTime.Utc and optionalKey, so the runtime maps between them. startAt is when the run
instance triggers; stopAt (absent = open-ended) is when it stops.
daemonScheduleEntry)).annotate: <A extends MethodAnnotations>(
a: A
) => Marked<
Method<
M["payload"],
M["success"],
M["error"],
M["stream"],
M["annotations"] & A
>,
Mark
>
annotate({
description: stringdescription: "The daemon's current schedule entries (run windows), reactive.",
}),
set: Hyperlink.Method<
Schema.$Array<
Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>
readonly startAt: Schema.DateTimeUtc
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>
}>
>,
Schema.Void,
Schema.Never,
false,
Hyperlink.MethodAnnotations & {
description: string
},
Hyperlink.Derive
>
(property) set: {
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; <…;
}
set: import HyperlinkHyperlink.function effectFn<Schema.$Array<Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>;
readonly startAt: Schema.DateTimeUtc;
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>;
}>>>(payload: Schema.$Array<Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>;
readonly startAt: Schema.DateTimeUtc;
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>;
}>>): Hyperlink.Method<Schema.$Array<Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>;
readonly startAt: Schema.DateTimeUtc;
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>;
}>>, ... 4 more ..., Hyperlink.Derive> (+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(import SchemaSchema.Array<Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>;
readonly startAt: Schema.DateTimeUtc;
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>;
}>>(self: Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>;
readonly startAt: Schema.DateTimeUtc;
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>;
}>): Schema.$Array<Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>;
readonly startAt: Schema.DateTimeUtc;
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>;
}>>
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 daemonScheduleEntry: Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>
readonly startAt: Schema.DateTimeUtc
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>
}>
const daemonScheduleEntry: {
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 id: Schema.optionalKey<Schema.String>; readonly startAt: Schema.DateTimeUtc; readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc> }) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | unde…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?: DateTime.Utc | undefined; }, readonly []>) => Schema.Struct<{ readonly id: Schema.optionalKey<Schema.String>; rea…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?: DateTime.Utc | undefined }>) => Schema.Struct<{ readonly id: Schema.optionalKey<Schema.String>; readonly startAt: Sc…;
check: (checks_0: Check<{ readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?: DateTime.Utc | undefined }>, ...checks: Array<Check<{ readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?…;
rebuild: (ast: Objects) => Schema.Struct<{ readonly id: Schema.optionalKey<Schema.String>; readonly startAt: Schema.DateTimeUtc; readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc> }>;
make: (input: { readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?: DateTime.Utc | undefined }, options?: MakeOptions) => { readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?: DateT…;
makeOption: (input: { readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?: DateTime.Utc | undefined }, options?: MakeOptions) => Option_.Option<{ readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly…;
makeEffect: (input: { readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?: DateTime.Utc | undefined }, options?: MakeOptions) => Effect.Effect<{ readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly …;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
One scheduled run window on the wire — the wire form of the engine's
DaemonScheduleEntry
.
The engine models id / stopAt as Option and the times as Date; the toolkit standard is
DateTime.Utc and optionalKey, so the runtime maps between them. startAt is when the run
instance triggers; stopAt (absent = open-ended) is when it stops.
daemonScheduleEntry)).Method<$Array<Struct<{ readonly id: optionalKey<String>; readonly startAt: DateTimeUtc; readonly stopAt: optionalKey<DateTimeUtc>; }>>, ... 4 more ..., Derive>.annotate: <A extends MethodAnnotations>(annotations: A) => Method<P, Su, E, Str, Ann & A, Client>annotate({
description: stringdescription: "Replace all schedule entries.",
}),
add: Hyperlink.Method<
Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>
readonly startAt: Schema.DateTimeUtc
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>
}>,
Schema.Void,
Schema.Never,
false,
Hyperlink.MethodAnnotations & {
description: string
},
Hyperlink.Derive
>
(property) add: {
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; <…;
}
add: import HyperlinkHyperlink.function effectFn<Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>;
readonly startAt: Schema.DateTimeUtc;
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>;
}>>(payload: Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>;
readonly startAt: Schema.DateTimeUtc;
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>;
}>): Hyperlink.Method<Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>;
readonly startAt: Schema.DateTimeUtc;
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>;
}>, ... 4 more ..., Hyperlink.Derive> (+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 daemonScheduleEntry: Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>
readonly startAt: Schema.DateTimeUtc
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>
}>
const daemonScheduleEntry: {
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 id: Schema.optionalKey<Schema.String>; readonly startAt: Schema.DateTimeUtc; readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc> }) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | unde…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?: DateTime.Utc | undefined; }, readonly []>) => Schema.Struct<{ readonly id: Schema.optionalKey<Schema.String>; rea…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?: DateTime.Utc | undefined }>) => Schema.Struct<{ readonly id: Schema.optionalKey<Schema.String>; readonly startAt: Sc…;
check: (checks_0: Check<{ readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?: DateTime.Utc | undefined }>, ...checks: Array<Check<{ readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?…;
rebuild: (ast: Objects) => Schema.Struct<{ readonly id: Schema.optionalKey<Schema.String>; readonly startAt: Schema.DateTimeUtc; readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc> }>;
make: (input: { readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?: DateTime.Utc | undefined }, options?: MakeOptions) => { readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?: DateT…;
makeOption: (input: { readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?: DateTime.Utc | undefined }, options?: MakeOptions) => Option_.Option<{ readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly…;
makeEffect: (input: { readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?: DateTime.Utc | undefined }, options?: MakeOptions) => Effect.Effect<{ readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly …;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
One scheduled run window on the wire — the wire form of the engine's
DaemonScheduleEntry
.
The engine models id / stopAt as Option and the times as Date; the toolkit standard is
DateTime.Utc and optionalKey, so the runtime maps between them. startAt is when the run
instance triggers; stopAt (absent = open-ended) is when it stops.
daemonScheduleEntry).Method<Struct<{ readonly id: optionalKey<String>; readonly startAt: DateTimeUtc; readonly stopAt: optionalKey<DateTimeUtc>; }>, ... 4 more ..., Derive>.annotate: <A extends MethodAnnotations>(annotations: A) => Method<P, Su, E, Str, Ann & A, Client>annotate({
description: stringdescription: "Append one schedule entry.",
}),
clear: Hyperlink.Method<
undefined,
Schema.Void,
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.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: "Remove all schedule entries (disarms until new entries are added).",
destructive: truedestructive: true,
}),
};