{
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" }
>
get: Hyperlink.Method<
{ readonly id: Schema.String },
Schema.Option<
Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>
readonly startAt: Schema.DateTimeUtc
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>
}>
>,
Schema.Never,
false,
Hyperlink.MethodAnnotations & { description: string },
Hyperlink.Derive
>
has: Hyperlink.Method<
{ readonly id: Schema.String },
Schema.Boolean,
Schema.Never,
false,
Hyperlink.MethodAnnotations & { description: string },
Hyperlink.Derive
>
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
>
upsert: 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
>
remove: Hyperlink.Method<
{ readonly id: Schema.String },
Schema.Boolean,
Schema.Never,
false,
Hyperlink.MethodAnnotations & {
description: string
destructive: true
},
Hyperlink.Derive
>
removeMany: Hyperlink.Method<
Schema.$Array<Schema.String>,
Schema.Number,
Schema.Never,
false,
Hyperlink.MethodAnnotations & {
description: string
destructive: true
},
Hyperlink.Derive
>
clear: Hyperlink.Method<
undefined,
Schema.Void,
Schema.Never,
false,
Hyperlink.MethodAnnotations & {
description: string
destructive: true
},
Hyperlink.Derive
>
}The full CRUD contract of a standalone Schedule resource — the reusable window manager one or more daemons can be gated by. Mirrors the engine's DaemonScheduleService.
export const const scheduleHyperlinkSpec: {
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";
}>;
get: Hyperlink.Method<{
readonly id: Schema.String;
}, Schema.Option<Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>;
readonly startAt: Schema.DateTimeUtc;
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>;
}>>, Schema.Never, false, Hyperlink.MethodAnnotations & {
...;
}, Hyperlink.Derive>;
... 6 more ...;
clear: Hyperlink.Method<...>;
}
The full CRUD contract of a standalone
Schedule
resource — the reusable window manager
one or more daemons can be gated by. Mirrors the engine's
DaemonScheduleService
.
scheduleHyperlinkSpec = {
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: "All schedule entries (run windows), reactive.",
}),
get: Hyperlink.Method<
{ readonly id: Schema.String },
Schema.Option<
Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>
readonly startAt: Schema.DateTimeUtc
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>
}>
>,
Schema.Never,
false,
Hyperlink.MethodAnnotations & {
description: string
},
Hyperlink.Derive
>
(property) get: {
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; <…;
}
get: import HyperlinkHyperlink.function effectFn<{
readonly id: Schema.String;
}, Schema.Option<Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>;
readonly startAt: Schema.DateTimeUtc;
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>;
}>>>(payload: {
readonly id: Schema.String;
}, success: Schema.Option<Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>;
readonly startAt: Schema.DateTimeUtc;
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>;
}>>): 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({ id: Schema.String(property) id: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<string, readonly []>) => Schema.String;
annotateKey: (annotations: Schema.Annotations.Key<string>) => Schema.String;
check: (checks_0: Check<string>, ...checks: Array<Check<string>>) => Schema.String;
rebuild: (ast: String) => Schema.String;
make: (input: string, options?: MakeOptions) => string;
makeOption: (input: string, options?: MakeOptions) => Option_.Option<string>;
makeEffect: (input: string, options?: MakeOptions) => Effect.Effect<string, 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; <…;
}
id: import SchemaSchema.const String: Stringconst String: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<string, readonly []>) => Schema.String;
annotateKey: (annotations: Schema.Annotations.Key<string>) => Schema.String;
check: (checks_0: Check<string>, ...checks: Array<Check<string>>) => Schema.String;
rebuild: (ast: String) => Schema.String;
make: (input: string, options?: MakeOptions) => string;
makeOption: (input: string, options?: MakeOptions) => Option_.Option<string>;
makeEffect: (input: string, options?: MakeOptions) => Effect.Effect<string, SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Type-level representation of
String
.
Schema for string values. Validates that the input is typeof "string".
String }, import SchemaSchema.function Option<A extends Constraint>(
value: A
): Option<A>
Schema for Option<A> values.
Option(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<{ readonly id: String; }, Option<Struct<{ readonly id: optionalKey<String>; readonly startAt: DateTimeUtc; readonly stopAt: optionalKey<DateTimeUtc>; }>>, Never, false, MethodAnnotations, Derive>.annotate: <A extends MethodAnnotations>(annotations: A) => Method<P, Su, E, Str, Ann & A, Client>annotate({
description: stringdescription: "Look up a single entry by id (absent if none matches).",
}),
has: Hyperlink.Method<
{ readonly id: Schema.String },
Schema.Boolean,
Schema.Never,
false,
Hyperlink.MethodAnnotations & {
description: string
},
Hyperlink.Derive
>
(property) has: {
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; <…;
}
has: import HyperlinkHyperlink.function effectFn<{
readonly id: Schema.String;
}, Schema.Boolean>(payload: {
readonly id: Schema.String;
}, success: Schema.Boolean): Hyperlink.Method<{
readonly id: Schema.String;
}, Schema.Boolean, Schema.Never, false, Hyperlink.MethodAnnotations, 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({ id: Schema.String(property) id: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<string, readonly []>) => Schema.String;
annotateKey: (annotations: Schema.Annotations.Key<string>) => Schema.String;
check: (checks_0: Check<string>, ...checks: Array<Check<string>>) => Schema.String;
rebuild: (ast: String) => Schema.String;
make: (input: string, options?: MakeOptions) => string;
makeOption: (input: string, options?: MakeOptions) => Option_.Option<string>;
makeEffect: (input: string, options?: MakeOptions) => Effect.Effect<string, 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; <…;
}
id: import SchemaSchema.const String: Stringconst String: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<string, readonly []>) => Schema.String;
annotateKey: (annotations: Schema.Annotations.Key<string>) => Schema.String;
check: (checks_0: Check<string>, ...checks: Array<Check<string>>) => Schema.String;
rebuild: (ast: String) => Schema.String;
make: (input: string, options?: MakeOptions) => string;
makeOption: (input: string, options?: MakeOptions) => Option_.Option<string>;
makeEffect: (input: string, options?: MakeOptions) => Effect.Effect<string, SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Type-level representation of
String
.
Schema for string values. Validates that the input is typeof "string".
String }, 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).Method<{ readonly id: String; }, Boolean, Never, false, MethodAnnotations, Derive>.annotate: <A extends MethodAnnotations>(annotations: A) => Method<P, Su, E, Str, Ann & A, Client>annotate({
description: stringdescription: "Whether an entry with the given id exists.",
}),
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.",
}),
upsert: 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) upsert: {
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; <…;
}
upsert: 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: "Insert or replace an entry, keyed by its id.",
}),
remove: Hyperlink.Method<
{ readonly id: Schema.String },
Schema.Boolean,
Schema.Never,
false,
Hyperlink.MethodAnnotations & {
description: string
destructive: true
},
Hyperlink.Derive
>
(property) remove: {
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; <…;
}
remove: import HyperlinkHyperlink.function effectFn<{
readonly id: Schema.String;
}, Schema.Boolean>(payload: {
readonly id: Schema.String;
}, success: Schema.Boolean): Hyperlink.Method<{
readonly id: Schema.String;
}, Schema.Boolean, Schema.Never, false, Hyperlink.MethodAnnotations, 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({ id: Schema.String(property) id: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<string, readonly []>) => Schema.String;
annotateKey: (annotations: Schema.Annotations.Key<string>) => Schema.String;
check: (checks_0: Check<string>, ...checks: Array<Check<string>>) => Schema.String;
rebuild: (ast: String) => Schema.String;
make: (input: string, options?: MakeOptions) => string;
makeOption: (input: string, options?: MakeOptions) => Option_.Option<string>;
makeEffect: (input: string, options?: MakeOptions) => Effect.Effect<string, 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; <…;
}
id: import SchemaSchema.const String: Stringconst String: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<string, readonly []>) => Schema.String;
annotateKey: (annotations: Schema.Annotations.Key<string>) => Schema.String;
check: (checks_0: Check<string>, ...checks: Array<Check<string>>) => Schema.String;
rebuild: (ast: String) => Schema.String;
make: (input: string, options?: MakeOptions) => string;
makeOption: (input: string, options?: MakeOptions) => Option_.Option<string>;
makeEffect: (input: string, options?: MakeOptions) => Effect.Effect<string, SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Type-level representation of
String
.
Schema for string values. Validates that the input is typeof "string".
String }, 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).Method<{ readonly id: String; }, Boolean, Never, false, MethodAnnotations, Derive>.annotate: <A extends MethodAnnotations>(annotations: A) => Method<P, Su, E, Str, Ann & A, Client>annotate({
description: stringdescription: "Remove the entry with the given id; returns whether one was removed.",
destructive: truedestructive: true,
}),
removeMany: Hyperlink.Method<
Schema.$Array<Schema.String>,
Schema.Number,
Schema.Never,
false,
Hyperlink.MethodAnnotations & {
description: string
destructive: true
},
Hyperlink.Derive
>
(property) removeMany: {
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; <…;
}
removeMany: import HyperlinkHyperlink.function effectFn<Schema.$Array<Schema.String>, Schema.Number>(payload: Schema.$Array<Schema.String>, success: Schema.Number): Hyperlink.Method<Schema.$Array<Schema.String>, Schema.Number, Schema.Never, false, Hyperlink.MethodAnnotations, 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.String>(self: Schema.String): Schema.$Array<Schema.String>
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(import SchemaSchema.const String: Stringconst String: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<string, readonly []>) => Schema.String;
annotateKey: (annotations: Schema.Annotations.Key<string>) => Schema.String;
check: (checks_0: Check<string>, ...checks: Array<Check<string>>) => Schema.String;
rebuild: (ast: String) => Schema.String;
make: (input: string, options?: MakeOptions) => string;
makeOption: (input: string, options?: MakeOptions) => Option_.Option<string>;
makeEffect: (input: string, options?: MakeOptions) => Effect.Effect<string, SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Type-level representation of
String
.
Schema for string values. Validates that the input is typeof "string".
String), 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<$Array<String>, Number, Never, false, MethodAnnotations, Derive>.annotate: <A extends MethodAnnotations>(annotations: A) => Method<P, Su, E, Str, Ann & A, Client>annotate({
description: stringdescription: "Remove every entry whose id is listed; returns the count removed.",
destructive: truedestructive: true,
}),
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.",
destructive: truedestructive: true,
}),
};