<Su extends Schema.Top>(success: Su): ConstantField<
Method<undefined, Su, typeof Schema.Never>
>Define a constant field — a value resolved once when the resource is acquired, surfaced as a
plain property (p.x: A, no yield*), identical local and remote. For values fixed after startup.
The impl supplies the value as an Effect<A> (run once at acquire; use Effect.succeed for a literal).
Live values are value; on-demand reads are effect. See docs/handoffs/archive/2026-07/features/service-shape-redesign.md.
export const const constant: <Su extends Schema.Top>(
success: Su
) => ConstantField<
Method<undefined, Su, typeof Schema.Never>
>
Define a constant field — a value resolved once when the resource is acquired, surfaced as a
plain property (p.x: A, no yield*), identical local and remote. For values fixed after startup.
The impl supplies the value as an Effect<A> (run once at acquire; use Effect.succeed for a literal).
Live values are value; on-demand reads are effect. See docs/handoffs/archive/2026-07/features/service-shape-redesign.md.
constant = <function (type parameter) Su in <Su extends Schema.Top>(success: Su): ConstantField<Method<undefined, Su, typeof Schema.Never>>Su extends import SchemaSchema.Top>(
success: Su extends Schema.Topsuccess: function (type parameter) Su in <Su extends Schema.Top>(success: Su): ConstantField<Method<undefined, Su, typeof Schema.Never>>Su,
): type ConstantField<M extends AnyMethod> =
Omit<M, "annotate"> & {
readonly _tag: "constant"
} & {
readonly annotate: <
A extends MethodAnnotations
>(
a: A
) => Marked<
Method<
M["payload"],
M["success"],
M["error"],
M["stream"],
M["annotations"] & A,
Derive
>,
{
readonly _tag: "constant"
}
>
}
A
Method
marked as a constant field (via
constant
) — resolved once at acquire,
surfaced as a plain value. Tagged with a readable _tag: "constant".
ConstantField<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 resource 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 <Su extends Schema.Top>(success: Su): ConstantField<Method<undefined, Su, typeof Schema.Never>>Su, typeof import SchemaSchema.const Never: Schema.Neverconst Never: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<never, readonly []>) => Schema.Never;
annotateKey: (annotations: Schema.Annotations.Key<never>) => Schema.Never;
check: (checks_0: Check<never>, ...checks: Array<Check<never>>) => Schema.Never;
rebuild: (ast: Never) => Schema.Never;
make: (input: never, options?: Schema.MakeOptions) => never;
makeOption: (input: never, options?: Schema.MakeOptions) => Option.Option<never>;
makeEffect: (input: never, options?: Schema.MakeOptions) => Effect.Effect<never, Schema.SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Type-level representation of
Never
.
Schema for the never type. Always fails validation — no value satisfies it.
Never>> =>
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<Su>(success: Su): Method<undefined, Su, Schema.Never, 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: Su extends Schema.Topsuccess), { _tag: "constant"_tag: "constant" as type const = "constant"const });