Hyperlinkv0.9.0-beta.0

Hyperlink

Hyperlink.ImplOftypesrc/Hyperlink.ts:2353
ImplOf<S>

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.

Source src/Hyperlink.ts:235315 lines
export type ImplOf<S extends Spec> = {
  readonly [K in keyof S as S[K] extends AnyDefaultMethod ? never : K]: S[K] extends FromLocalMethod<
    infer M
  >
    ? M // interface-Tag local: the impl provides the interface member itself
    : S[K] extends LocalMethod<infer T>
      ? T
      : S[K] extends { readonly _tag: "ref" }
        ? Subscribable<SuccessOf<AsMethod<S[K]>>> // impl owns the SubscriptionRef, provided via subscribable()
        : S[K] extends { readonly kind: MethodKind }
          ? ServiceMethod<AsMethod<S[K]>>
          : S[K] extends Spec
            ? ImplOf<S[K]> // nested group → nested impl
            : never;
};
Referenced by 9 symbols