ImplWithDefaultOverrides<S>Impl for layer / serve: wire ImplOf plus optional overrides for Spec default leaves and piped defaults bag keys (extra keys are structural — Spec leaf values stay precise via excess-property checks on known keys when inlined at the call site).
Overrides apply at the provide site only (local handle / co-located serve grant). Clients always install Tag-baked Spec defaults + the piped bag — they do not see the server's override. Use Layer.updateService for post-hoc local patches.
export type type ImplWithDefaultOverrides<
S extends Spec
> = ImplOf<S> & Partial<DefaultsBag>
Impl for
layer
/
serve
: wire
ImplOf
plus optional overrides for
Spec
default
leaves and piped
defaults
bag keys (extra keys are
structural — Spec leaf values stay precise via excess-property checks on known keys
when inlined at the call site).
Overrides apply at the provide site only (local handle / co-located serve grant).
Clients always install Tag-baked Spec defaults + the piped bag — they do not see the
server's override. Use
Layer.updateService
for post-hoc local patches.
ImplWithDefaultOverrides<function (type parameter) S in type ImplWithDefaultOverrides<S extends Spec>S extends Spec> = type ImplOf<S extends Spec> = {
readonly [K in keyof S as S[K] extends AnyDefaultMethod
? never
: K]: S[K] extends FromLocalMethod<infer M>
? M
: S[K] extends LocalMethod<infer T>
? T
: S[K] extends {
readonly _tag: "ref"
}
? Subscribable<SuccessOf<AsMethod<S[K]>>>
: S[K] extends {
readonly kind: MethodKind
}
? ServiceMethod<AsMethod<S[K]>>
: S[K] extends Spec
? ImplOf<S[K]>
: never
}
The implementation a
localLayer
/
serve
expects: wire members are their
Effect/Stream/function, and each
LocalMethod
is its raw value T (the toolkit wraps
it to require the
Local
). When an impl needs a capability (e.g.
peers
) to
build, provide it via the Effect form of
Hyperlink.layer
/
Hyperlink.serve
— resolve it once, and the members close over it.
A
value
field's impl is the Effect<A, E> resolved once at acquire — that differs from how
it surfaces in
ServiceOf
(a plain A), so annotate an impl with ImplOf, not
ServiceOf. A
ref
's impl is the
Subscribable
(not the consumer shape alone).
default
members are Tag-baked — omitted from the impl. A nested group that is only
default members still appears as {} (pass an empty object). Piped
defaults
keys may
be overridden via
ImplWithDefaultOverrides
.
ImplOf<function (type parameter) S in type ImplWithDefaultOverrides<S extends Spec>S> & type Partial<T> = {
[P in keyof T]?: T[P] | undefined
}
Make all properties in T optional
Partial<type DefaultsBag = {
readonly [key: string]: unknown
}
A bag of Tag-baked defaults for
defaults
.
DefaultsBag>;