<Su extends Schema.Top>(success: Su): ValueField<
Method<undefined, Su, typeof Schema.Never>
>
<Su extends Schema.Top, E extends Schema.Top>(
success: Su,
error: E
): ValueField<Method<undefined, Su, E>>Define a value field — materialize a plain property (p.x: A, no yield*) once when the
resource is acquired, identical local and remote. The impl supplies an Effect<A, E> (run once at
acquire; use Effect.succeed for a literal). A non-never error schema fails layer/client
acquire (all-or-nothing) — after a successful acquire every value leaf is plain A. Live state
is ref; on-demand reads are effect.
maxSize: Hyperlink.value(Schema.Number),
name: Hyperlink.value(Schema.String, Schema.String), // fallible at acquireexport function function value<Su extends Schema.Top>(success: Su): ValueField<Method<undefined, Su, typeof Schema.Never>> (+1 overload)Define a value field — materialize a plain property (p.x: A, no yield*) once when the
resource is acquired, identical local and remote. The impl supplies an Effect<A, E> (run once at
acquire; use Effect.succeed for a literal). A non-never error schema fails layer/client
acquire (all-or-nothing) — after a successful acquire every value leaf is plain A. Live state
is
ref
; on-demand reads are
effect
.
maxSize: Hyperlink.value(Schema.Number),
name: Hyperlink.value(Schema.String, Schema.String), // fallible at acquire
value<function (type parameter) Su in value<Su extends Schema.Top>(success: Su): ValueField<Method<undefined, Su, typeof Schema.Never>>Su extends import SchemaSchema.Top>(
success: Su extends Schema.Topsuccess: function (type parameter) Su in value<Su extends Schema.Top>(success: Su): ValueField<Method<undefined, Su, typeof Schema.Never>>Su,
): type ValueField<M extends AnyMethod> =
Omit<M, "annotate"> & {
readonly _tag: "value"
} & {
readonly annotate: <
A extends MethodAnnotations
>(
a: A
) => Marked<
Method<
M["payload"],
M["success"],
M["error"],
M["stream"],
M["annotations"] & A,
Derive
>,
{
readonly _tag: "value"
}
>
}
A
Method
marked as a value field (via
value
) — resolved once at acquire,
surfaced as a plain value. Tagged with a readable _tag: "value".
ValueField<interface Method<P extends Schema.Struct.Fields | Schema.Top | undefined, Su extends Schema.Top, E extends Schema.Top, Str extends boolean = false, Ann extends MethodAnnotations = MethodAnnotations, Client = Derive>One method of a HyperService contract — built by
effect
/
effectFn
/
Hyperlink.stream
. Carries its kind, schemas
(payload / success / error), whether it's a stream (a push source vs a one-shot
read), and tool annotations. .annotate({...}) returns a copy with merged annotations,
mirroring Effect's schema idiom.
For a streaming method, success is the element schema and error is the stream
error schema — they become an RpcSchema.Stream on the wire, and the service member
surfaces as a Stream rather than an Effect.
Method<undefined, function (type parameter) Su in value<Su extends Schema.Top>(success: Su): ValueField<Method<undefined, Su, typeof Schema.Never>>Su, typeof import SchemaSchema.const Never: Neverconst Never: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<never, readonly []>) => Schema.Never;
annotateKey: (annotations: Schema.Annotations.Key<never>) => Schema.Never;
check: (checks_0: Check<never>, ...checks: Array<Check<never>>) => Schema.Never;
rebuild: (ast: Never) => Schema.Never;
make: (input: never, options?: MakeOptions) => never;
makeOption: (input: never, options?: MakeOptions) => Option_.Option<never>;
makeEffect: (input: never, options?: MakeOptions) => Effect.Effect<never, SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Type-level representation of
Never
.
Schema for the never type. Always fails validation — no value satisfies it.
Never>>;
export function function value<Su extends Schema.Top, E extends Schema.Top>(success: Su, error: E): ValueField<Method<undefined, Su, E>> (+1 overload)Define a value field — materialize a plain property (p.x: A, no yield*) once when the
resource is acquired, identical local and remote. The impl supplies an Effect<A, E> (run once at
acquire; use Effect.succeed for a literal). A non-never error schema fails layer/client
acquire (all-or-nothing) — after a successful acquire every value leaf is plain A. Live state
is
ref
; on-demand reads are
effect
.
maxSize: Hyperlink.value(Schema.Number),
name: Hyperlink.value(Schema.String, Schema.String), // fallible at acquire
value<function (type parameter) Su in value<Su extends Schema.Top, E extends Schema.Top>(success: Su, error: E): ValueField<Method<undefined, Su, E>>Su extends import SchemaSchema.Top, function (type parameter) E in value<Su extends Schema.Top, E extends Schema.Top>(success: Su, error: E): ValueField<Method<undefined, Su, E>>E extends import SchemaSchema.Top>(
success: Su extends Schema.Topsuccess: function (type parameter) Su in value<Su extends Schema.Top, E extends Schema.Top>(success: Su, error: E): ValueField<Method<undefined, Su, E>>Su,
error: E extends Schema.Toperror: function (type parameter) E in value<Su extends Schema.Top, E extends Schema.Top>(success: Su, error: E): ValueField<Method<undefined, Su, E>>E,
): type ValueField<M extends AnyMethod> =
Omit<M, "annotate"> & {
readonly _tag: "value"
} & {
readonly annotate: <
A extends MethodAnnotations
>(
a: A
) => Marked<
Method<
M["payload"],
M["success"],
M["error"],
M["stream"],
M["annotations"] & A,
Derive
>,
{
readonly _tag: "value"
}
>
}
A
Method
marked as a value field (via
value
) — resolved once at acquire,
surfaced as a plain value. Tagged with a readable _tag: "value".
ValueField<interface Method<P extends Schema.Struct.Fields | Schema.Top | undefined, Su extends Schema.Top, E extends Schema.Top, Str extends boolean = false, Ann extends MethodAnnotations = MethodAnnotations, Client = Derive>One method of a HyperService contract — built by
effect
/
effectFn
/
Hyperlink.stream
. Carries its kind, schemas
(payload / success / error), whether it's a stream (a push source vs a one-shot
read), and tool annotations. .annotate({...}) returns a copy with merged annotations,
mirroring Effect's schema idiom.
For a streaming method, success is the element schema and error is the stream
error schema — they become an RpcSchema.Stream on the wire, and the service member
surfaces as a Stream rather than an Effect.
Method<undefined, function (type parameter) Su in value<Su extends Schema.Top, E extends Schema.Top>(success: Su, error: E): ValueField<Method<undefined, Su, E>>Su, function (type parameter) E in value<Su extends Schema.Top, E extends Schema.Top>(success: Su, error: E): ValueField<Method<undefined, Su, E>>E>>;
export function function value<Su extends Schema.Top>(success: Su): ValueField<Method<undefined, Su, typeof Schema.Never>> (+1 overload)Define a value field — materialize a plain property (p.x: A, no yield*) once when the
resource is acquired, identical local and remote. The impl supplies an Effect<A, E> (run once at
acquire; use Effect.succeed for a literal). A non-never error schema fails layer/client
acquire (all-or-nothing) — after a successful acquire every value leaf is plain A. Live state
is
ref
; on-demand reads are
effect
.
maxSize: Hyperlink.value(Schema.Number),
name: Hyperlink.value(Schema.String, Schema.String), // fallible at acquire
value(
success: Schema.Top(parameter) success: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<unknown, any>) => Schema.Top;
annotateKey: (annotations: Schema.Annotations.Key<unknown>) => Schema.Top;
check: (checks_0: Check<unknown>, ...checks: Array<Check<unknown>>) => Schema.Top;
rebuild: (ast: AST) => Schema.Top;
make: (input: unknown, options?: MakeOptions) => unknown;
makeOption: (input: unknown, options?: MakeOptions) => Option_.Option<unknown>;
makeEffect: (input: unknown, options?: MakeOptions) => Effect.Effect<unknown, 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; <…;
}
success: import SchemaSchema.Top,
error: Schema.Top(parameter) error: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<unknown, any>) => Schema.Top;
annotateKey: (annotations: Schema.Annotations.Key<unknown>) => Schema.Top;
check: (checks_0: Check<unknown>, ...checks: Array<Check<unknown>>) => Schema.Top;
rebuild: (ast: AST) => Schema.Top;
make: (input: unknown, options?: MakeOptions) => unknown;
makeOption: (input: unknown, options?: MakeOptions) => Option_.Option<unknown>;
makeEffect: (input: unknown, options?: MakeOptions) => Effect.Effect<unknown, 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; <…;
}
error: import SchemaSchema.Top = import SchemaSchema.const Never: Neverconst Never: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<never, readonly []>) => Schema.Never;
annotateKey: (annotations: Schema.Annotations.Key<never>) => Schema.Never;
check: (checks_0: Check<never>, ...checks: Array<Check<never>>) => Schema.Never;
rebuild: (ast: Never) => Schema.Never;
make: (input: never, options?: MakeOptions) => never;
makeOption: (input: never, options?: MakeOptions) => Option_.Option<never>;
makeEffect: (input: never, options?: MakeOptions) => Effect.Effect<never, SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Type-level representation of
Never
.
Schema for the never type. Always fails validation — no value satisfies it.
Never,
): type ValueField<M extends AnyMethod> =
Omit<M, "annotate"> & {
readonly _tag: "value"
} & {
readonly annotate: <
A extends MethodAnnotations
>(
a: A
) => Marked<
Method<
M["payload"],
M["success"],
M["error"],
M["stream"],
M["annotations"] & A,
Derive
>,
{
readonly _tag: "value"
}
>
}
A
Method
marked as a value field (via
value
) — resolved once at acquire,
surfaced as a plain value. Tagged with a readable _tag: "value".
ValueField<type AnyMethod = Method<
Schema.Top | Schema.Struct.Fields | undefined,
Schema.Top,
Schema.Top,
boolean,
MethodAnnotations,
never
>
Any
Method
, erased — the element type of a
Spec
.
AnyMethod> {
return const marked: <
M extends AnyMethod,
Mark extends object
>(
method: M,
mark: Mark
) => Marked<M, Mark>
Attach a shape marker whose .annotate() preserves it (rebuilds the marker after annotating).
marked(function effect<Schema.Top, Schema.Top>(success: Schema.Top, error: Schema.Top): Method<undefined, Schema.Top, Schema.Top, false, MethodAnnotations, 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(success: Schema.Top(parameter) success: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<unknown, any>) => Schema.Top;
annotateKey: (annotations: Schema.Annotations.Key<unknown>) => Schema.Top;
check: (checks_0: Check<unknown>, ...checks: Array<Check<unknown>>) => Schema.Top;
rebuild: (ast: AST) => Schema.Top;
make: (input: unknown, options?: MakeOptions) => unknown;
makeOption: (input: unknown, options?: MakeOptions) => Option_.Option<unknown>;
makeEffect: (input: unknown, options?: MakeOptions) => Effect.Effect<unknown, 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; <…;
}
success, error: Schema.Top(parameter) error: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<unknown, any>) => Schema.Top;
annotateKey: (annotations: Schema.Annotations.Key<unknown>) => Schema.Top;
check: (checks_0: Check<unknown>, ...checks: Array<Check<unknown>>) => Schema.Top;
rebuild: (ast: AST) => Schema.Top;
make: (input: unknown, options?: MakeOptions) => unknown;
makeOption: (input: unknown, options?: MakeOptions) => Option_.Option<unknown>;
makeEffect: (input: unknown, options?: MakeOptions) => Effect.Effect<unknown, 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; <…;
}
error), { _tag: "value"_tag: "value" as type const = "value"const });
}