ResolveLocals<C, I>Resolve a fromService contract C into a runnable Spec: each bare local
becomes a FromLocalMethod carrying the service interface's type at that key, so the impl
(ImplOf) and service (ServiceOf) both derive from I. Wired methods and explicit
local<T>()s pass through unchanged.
export type type ResolveLocals<C, I> = {
readonly [K in keyof C]: C[K] extends BareLocal
? FromLocalMethod<
K extends keyof I ? I[K] : unknown
>
: C[K] extends Spec
? K extends keyof I
? ResolveLocals<C[K], I[K]>
: C[K]
: C[K]
}
Resolve a
fromService
contract C into a runnable
Spec
: each bare
local
becomes a
FromLocalMethod
carrying the service interface's type at that key, so the impl
(
ImplOf
) and service (
ServiceOf
) both derive from I. Wired methods and explicit
local<T>()s pass through unchanged.
ResolveLocals<function (type parameter) C in type ResolveLocals<C, I>C, function (type parameter) I in type ResolveLocals<C, I>I> = {
readonly [function (type parameter) KK in keyof function (type parameter) C in type ResolveLocals<C, I>C]: function (type parameter) C in type ResolveLocals<C, I>C[function (type parameter) KK] extends BareLocal
? interface FromLocalMethod<M>A
fromService
local member as it sits in the resolved spec: a
LocalMethod
that
additionally carries the service interface's member type M, so
ServiceOf
surfaces it via
InjectLocal
(its own Effect/function + Local) instead of the value-obtain
LocalEffect
a plain local<T>() gets. Type-only; at runtime it's an ordinary bare
local
.
FromLocalMethod<function (type parameter) KK extends keyof function (type parameter) I in type ResolveLocals<C, I>I ? function (type parameter) I in type ResolveLocals<C, I>I[function (type parameter) KK] : unknown>
: function (type parameter) C in type ResolveLocals<C, I>C[function (type parameter) KK] extends Spec
? function (type parameter) KK extends keyof function (type parameter) I in type ResolveLocals<C, I>I
? type ResolveLocals<C, I> = {
readonly [K in keyof C]: C[K] extends BareLocal
? FromLocalMethod<
K extends keyof I ? I[K] : unknown
>
: C[K] extends Spec
? K extends keyof I
? ResolveLocals<C[K], I[K]>
: C[K]
: C[K]
}
Resolve a
fromService
contract C into a runnable
Spec
: each bare
local
becomes a
FromLocalMethod
carrying the service interface's type at that key, so the impl
(
ImplOf
) and service (
ServiceOf
) both derive from I. Wired methods and explicit
local<T>()s pass through unchanged.
ResolveLocals<function (type parameter) C in type ResolveLocals<C, I>C[function (type parameter) KK], function (type parameter) I in type ResolveLocals<C, I>I[function (type parameter) KK]>
: function (type parameter) C in type ResolveLocals<C, I>C[function (type parameter) KK]
: function (type parameter) C in type ResolveLocals<C, I>C[function (type parameter) KK];
};