<Self>(): {
<D>(
key: string,
options: {
readonly description?: string
readonly node?: NodeKey<unknown>
readonly defaults: DefaultsInput<D>
}
): TagWithDefaults<
HyperlinkTag<
Self,
S,
Simplify<{
readonly [K in keyof S]: S[K] extends FromLocalMethod<infer M>
? InjectLocal<M, Self>
: S[K] extends LocalMethod<infer T>
? LocalEffect<T, never, Self>
: S[K] extends DefaultMethod<infer F>
? F
: S[K] extends { readonly _tag: "value" }
? SuccessOf<AsMethod<S[K]>>
: S[K] extends { readonly _tag: "ref" }
? Subscribable<SuccessOf<AsMethod<S[K]>>>
: S[K] extends { readonly kind: MethodKind }
? ClientMethod<AsMethod<S[K]>, ClientOverrideOf<S[K]>>
: S[K] extends Spec
? Simplify<{
readonly [K in keyof S[K]]: S[K][K] extends FromLocalMethod<
infer M
>
? InjectLocal<M, Self>
: S[K][K] extends LocalMethod<infer T>
? LocalEffect<T, never, Self>
: S[K][K] extends DefaultMethod<infer F>
? F
: S[K][K] extends { readonly _tag: "value" }
? SuccessOf<AsMethod<S[K][K]>>
: S[K][K] extends { readonly _tag: "ref" }
? Subscribable<SuccessOf<AsMethod<S[K][K]>>>
: S[K][K] extends { readonly kind: MethodKind }
? ClientMethod<
AsMethod<S[K][K]>,
ClientOverrideOf<S[K][K]>
>
: S[K][K] extends Spec
? Simplify<{
readonly [K in keyof S[K][K]]: S[K][K][K] extends FromLocalMethod<
infer M
>
? InjectLocal<M, Self>
: S[K][K][K] extends LocalMethod<infer T>
? LocalEffect<T, never, Self>
: S[K][K][K] extends DefaultMethod<infer F>
? F
: S[K][K][K] extends { readonly _tag: "value" }
? SuccessOf<AsMethod<S[K][K][K]>>
: S[K][K][K] extends { readonly _tag: "ref" }
? Subscribable<SuccessOf<AsMethod<S[K][K][K]>>>
: S[K][K][K] extends { readonly kind: MethodKind }
? ClientMethod<
AsMethod<S[K][K][K]>,
ClientOverrideOf<S[K][K][K]>
>
: S[K][K][K] extends Spec
? Simplify<{
readonly [K in keyof S[K][K][K]]: S[K][K][K][K] extends FromLocalMethod<
infer M
>
? InjectLocal<M, Self>
: S[K][K][K][K] extends LocalMethod<infer T>
? LocalEffect<T, never, Self>
: S[K][K][K][K] extends DefaultMethod<infer F>
? F
: S[K][K][K][K] extends {
readonly _tag: "value"
}
? SuccessOf<AsMethod<S[K][K][K][K]>>
: S[K][K][K][K] extends {
readonly _tag: "ref"
}
? Subscribable<
SuccessOf<AsMethod<S[K][K][K][K]>>
>
: S[K][K][K][K] extends {
readonly kind: MethodKind
}
? ClientMethod<
AsMethod<S[K][K][K][K]>,
ClientOverrideOf<S[K][K][K][K]>
>
: S[K][K][K][K] extends Spec
? Simplify<{
readonly [K in keyof S[K][K][K][K]]: S[K][K][K][K][K] extends FromLocalMethod<
infer M
>
? InjectLocal<M, Self>
: S[K][K][K][K][K] extends LocalMethod<
infer T
>
? LocalEffect<T, never, Self>
: S[K][K][K][K][K] extends DefaultMethod<
infer F
>
? F
: S[K][K][K][K][K] extends {
readonly _tag: "value"
}
? SuccessOf<AsMethod<S[K][K][K][K][K]>>
: S[K][K][K][K][K] extends {
readonly _tag: "ref"
}
? Subscribable<
SuccessOf<
AsMethod<S[K][K][K][K][K]>
>
>
: S[K][K][K][K][K] extends {
readonly kind: MethodKind
}
? ClientMethod<
AsMethod<S[K][K][K][K][K]>,
ClientOverrideOf<S[K][K][K][K][K]>
>
: S[K][K][K][K][K] extends Spec
? Simplify<{
readonly [K in keyof S[K][K][K][K][K]]: S[K][K][K][K][K][K] extends FromLocalMethod<
infer M
>
? InjectLocal<M, Self>
: S[K][K][K][K][K][K] extends LocalMethod<
infer T
>
? LocalEffect<T, never, Self>
: S[K][K][K][K][K][K] extends DefaultMethod<
infer F
>
? F
: S[K][K][K][K][K][K] extends {
readonly _tag: "value"
}
? SuccessOf<
AsMethod<S[K][K][K][K][K][K]>
>
: S[K][K][K][K][K][K] extends {
readonly _tag: "ref"
}
? Subscribable<
SuccessOf<
AsMethod<
S[K][K][K][K][K][K]
>
>
>
: S[K][K][K][K][K][K] extends {
readonly kind: MethodKind
}
? ClientMethod<
AsMethod<S[K][K][K][K][K][K]>,
ClientOverrideOf<
S[K][K][K][K][K][K]
>
>
: S[K][K][K][K][K][K] extends Spec
? Simplify<{
readonly [K in keyof S[K][K][K][K][K][K]]: S[K][K][K][K][K][K][K] extends FromLocalMethod<
infer M
>
? InjectLocal<M, Self>
: S[K][K][K][K][K][K][K] extends LocalMethod<
infer T
>
? LocalEffect<
T,
never,
Self
>
: S[K][K][K][K][K][K][K] extends DefaultMethod<
infer F
>
? F
: S[K][K][K][K][K][K][K] extends {
readonly _tag: "value"
}
? SuccessOf<
AsMethod<
S[K][K][K][K][K][K][K]
>
>
: S[K][K][K][K][K][K][K] extends {
readonly _tag: "ref"
}
? Subscribable<
SuccessOf<
AsMethod<
S[K][K][K][K][K][K][K]
>
>
>
: S[K][K][K][K][K][K][K] extends {
readonly kind: MethodKind
}
? ClientMethod<
AsMethod<
S[K][K][K][K][K][K][K]
>,
ClientOverrideOf<
S[K][K][K][K][K][K][K]
>
>
: S[K][K][K][K][K][K][K] extends Spec
? Simplify<{
readonly [K in keyof S[K][K][K][K][K][K][K]]: S[K][K][K][K][K][K][K][K] extends FromLocalMethod<
infer M
>
? InjectLocal<M, Self>
: S[K][K][K][K][K][K][K][K] extends LocalMethod<
infer T
>
? LocalEffect<
T,
never,
Self
>
: S[K][K][K][K][K][K][K][K] extends DefaultMethod<
infer F
>
? F
: S[K][K][K][K][K][K][K][K] extends {
readonly _tag: "value"
}
? SuccessOf<
AsMethod<
S[K][K][K][K][K][K][K][K]
>
>
: S[K][K][K][K][K][K][K][K] extends {
readonly _tag: "ref"
}
? Subscribable<
SuccessOf<
AsMethod<
S[K][K][K][K][K][K][K][K]
>
>
>
: S[K][K][K][K][K][K][K][K] extends {
readonly kind: MethodKind
}
? ClientMethod<
AsMethod<
S[K][K][K][K][K][K][K][K]
>,
ClientOverrideOf<
S[K][K][K][K][K][K][K][K]
>
>
: S[K][K][K][K][K][K][K][K] extends Spec
? Simplify<{
readonly [K in keyof S[K][K][K][K][K][K][K][K]]: S[K][K][K][K][K][K][K][K][K] extends FromLocalMethod<
infer M
>
? InjectLocal<
M,
Self
>
: S[K][K][K][K][K][K][K][K][K] extends LocalMethod<
infer T
>
? LocalEffect<
T,
never,
Self
>
: S[K][K][K][K][K][K][K][K][K] extends DefaultMethod<
infer F
>
? F
: S[K][K][K][K][K][K][K][K][K] extends {
readonly _tag: "value"
}
? SuccessOf<
AsMethod<
S[K][K][K][K][K][K][K][K][K]
>
>
: S[K][K][K][K][K][K][K][K][K] extends {
readonly _tag: "ref"
}
? Subscribable<
SuccessOf<
AsMethod<
S[K][K][K][K][K][K][K][K][K]
>
>
>
: S[K][K][K][K][K][K][K][K][K] extends {
readonly kind: MethodKind
}
? ClientMethod<
AsMethod<
S[K][K][K][K][K][K][K][K][K]
>,
ClientOverrideOf<
S[K][K][K][K][K][K][K][K][K]
>
>
: S[K][K][K][K][K][K][K][K][K] extends Spec
? Simplify<{
readonly [K in keyof S[K][K][K][K][K][K][K][K][K]]: S[K][K][K][K][K][K][K][K][K][K] extends FromLocalMethod<
infer M
>
? InjectLocal<
M,
Self
>
: S[K][K][K][K][K][K][K][K][K][K] extends LocalMethod<
infer T
>
? LocalEffect<
T,
never,
Self
>
: S[K][K][K][K][K][K][K][K][K][K] extends DefaultMethod<
infer F
>
? F
: S[K][K][K][K][K][K][K][K][K][K] extends {
readonly _tag: "value"
}
? SuccessOf<
AsMethod<
S[K][K][K][K][K][K][K][K][K][K]
>
>
: S[K][K][K][K][K][K][K][K][K][K] extends {
readonly _tag: "ref"
}
? Subscribable<
SuccessOf<
AsMethod<
S[K][K][K][K][K][K][K][K][K][K]
>
>
>
: S[K][K][K][K][K][K][K][K][K][K] extends {
readonly kind: MethodKind
}
? ClientMethod<
AsMethod<
S[K][K][K][K][K][K][K][K][K][K]
>,
ClientOverrideOf<
S[K][K][K][K][K][K][K][K][K][K]
>
>
: S[K][K][K][K][K][K][K][K][K][K] extends Spec
? Simplify<{
readonly [K in keyof S[K][K][K][K][K][K][K][K][K][K]]: S[K][K][K][K][K][K][K][K][K][K][K] extends FromLocalMethod<
infer M
>
? InjectLocal<
M,
Self
>
: S[K][K][K][K][K][K][K][K][K][K][K] extends LocalMethod<
infer T
>
? LocalEffect<
T,
never,
Self
>
: S[K][K][K][K][K][K][K][K][K][K][K] extends DefaultMethod<
infer F
>
? F
: S[K][K][K][K][K][K][K][K][K][K][K] extends {
readonly _tag: "value"
}
? SuccessOf<
AsMethod<
S[K][K][K][K][K][K][K][K][K][K][K]
>
>
: S[K][K][K][K][K][K][K][K][K][K][K] extends {
readonly _tag: "ref"
}
? Subscribable<
SuccessOf<
AsMethod<
S[K][K][K][K][K][K][K][K][K][K][K]
>
>
>
: S[K][K][K][K][K][K][K][K][K][K][K] extends {
readonly kind: MethodKind
}
? ClientMethod<
AsMethod<
S[K][K][K][K][K][K][K][K][K][K][K]
>,
ClientOverrideOf<
S[K][K][K][K][K][K][K][K][K][K][K]
>
>
: S[K][K][K][K][K][K][K][K][K][K][K] extends Spec
? Simplify<any>
: never
}>
: never
}>
: never
}>
: never
}>
: never
}>
: never
}>
: never
}>
: never
}>
: never
}>
: never
}>
: never
}>
>,
D
>
(
key: string,
options?: {
readonly description?: string
readonly node?: NodeKey<unknown>
}
): HyperlinkTag<
Self,
S,
Simplify<{
readonly [K in keyof S]: S[K] extends FromLocalMethod<infer M>
? InjectLocal<M, Self>
: S[K] extends LocalMethod<infer T>
? LocalEffect<T, never, Self>
: S[K] extends DefaultMethod<infer F>
? F
: S[K] extends { readonly _tag: "value" }
? SuccessOf<AsMethod<S[K]>>
: S[K] extends { readonly _tag: "ref" }
? Subscribable<SuccessOf<AsMethod<S[K]>>>
: S[K] extends { readonly kind: MethodKind }
? ClientMethod<AsMethod<S[K]>, ClientOverrideOf<S[K]>>
: S[K] extends Spec
? Simplify<{
readonly [K in keyof S[K]]: S[K][K] extends FromLocalMethod<
infer M
>
? InjectLocal<M, Self>
: S[K][K] extends LocalMethod<infer T>
? LocalEffect<T, never, Self>
: S[K][K] extends DefaultMethod<infer F>
? F
: S[K][K] extends { readonly _tag: "value" }
? SuccessOf<AsMethod<S[K][K]>>
: S[K][K] extends { readonly _tag: "ref" }
? Subscribable<SuccessOf<AsMethod<S[K][K]>>>
: S[K][K] extends { readonly kind: MethodKind }
? ClientMethod<AsMethod<S[K][K]>, ClientOverrideOf<S[K][K]>>
: S[K][K] extends Spec
? Simplify<{
readonly [K in keyof S[K][K]]: S[K][K][K] extends FromLocalMethod<
infer M
>
? InjectLocal<M, Self>
: S[K][K][K] extends LocalMethod<infer T>
? LocalEffect<T, never, Self>
: S[K][K][K] extends DefaultMethod<infer F>
? F
: S[K][K][K] extends { readonly _tag: "value" }
? SuccessOf<AsMethod<S[K][K][K]>>
: S[K][K][K] extends { readonly _tag: "ref" }
? Subscribable<SuccessOf<AsMethod<S[K][K][K]>>>
: S[K][K][K] extends { readonly kind: MethodKind }
? ClientMethod<
AsMethod<S[K][K][K]>,
ClientOverrideOf<S[K][K][K]>
>
: S[K][K][K] extends Spec
? Simplify<{
readonly [K in keyof S[K][K][K]]: S[K][K][K][K] extends FromLocalMethod<
infer M
>
? InjectLocal<M, Self>
: S[K][K][K][K] extends LocalMethod<infer T>
? LocalEffect<T, never, Self>
: S[K][K][K][K] extends DefaultMethod<infer F>
? F
: S[K][K][K][K] extends {
readonly _tag: "value"
}
? SuccessOf<AsMethod<S[K][K][K][K]>>
: S[K][K][K][K] extends { readonly _tag: "ref" }
? Subscribable<
SuccessOf<AsMethod<S[K][K][K][K]>>
>
: S[K][K][K][K] extends {
readonly kind: MethodKind
}
? ClientMethod<
AsMethod<S[K][K][K][K]>,
ClientOverrideOf<S[K][K][K][K]>
>
: S[K][K][K][K] extends Spec
? Simplify<{
readonly [K in keyof S[K][K][K][K]]: S[K][K][K][K][K] extends FromLocalMethod<
infer M
>
? InjectLocal<M, Self>
: S[K][K][K][K][K] extends LocalMethod<
infer T
>
? LocalEffect<T, never, Self>
: S[K][K][K][K][K] extends DefaultMethod<
infer F
>
? F
: S[K][K][K][K][K] extends {
readonly _tag: "value"
}
? SuccessOf<AsMethod<S[K][K][K][K][K]>>
: S[K][K][K][K][K] extends {
readonly _tag: "ref"
}
? Subscribable<
SuccessOf<AsMethod<S[K][K][K][K][K]>>
>
: S[K][K][K][K][K] extends {
readonly kind: MethodKind
}
? ClientMethod<
AsMethod<S[K][K][K][K][K]>,
ClientOverrideOf<S[K][K][K][K][K]>
>
: S[K][K][K][K][K] extends Spec
? Simplify<{
readonly [K in keyof S[K][K][K][K][K]]: S[K][K][K][K][K][K] extends FromLocalMethod<
infer M
>
? InjectLocal<M, Self>
: S[K][K][K][K][K][K] extends LocalMethod<
infer T
>
? LocalEffect<T, never, Self>
: S[K][K][K][K][K][K] extends DefaultMethod<
infer F
>
? F
: S[K][K][K][K][K][K] extends {
readonly _tag: "value"
}
? SuccessOf<
AsMethod<S[K][K][K][K][K][K]>
>
: S[K][K][K][K][K][K] extends {
readonly _tag: "ref"
}
? Subscribable<
SuccessOf<
AsMethod<S[K][K][K][K][K][K]>
>
>
: S[K][K][K][K][K][K] extends {
readonly kind: MethodKind
}
? ClientMethod<
AsMethod<S[K][K][K][K][K][K]>,
ClientOverrideOf<
S[K][K][K][K][K][K]
>
>
: S[K][K][K][K][K][K] extends Spec
? Simplify<{
readonly [K in keyof S[K][K][K][K][K][K]]: S[K][K][K][K][K][K][K] extends FromLocalMethod<
infer M
>
? InjectLocal<M, Self>
: S[K][K][K][K][K][K][K] extends LocalMethod<
infer T
>
? LocalEffect<T, never, Self>
: S[K][K][K][K][K][K][K] extends DefaultMethod<
infer F
>
? F
: S[K][K][K][K][K][K][K] extends {
readonly _tag: "value"
}
? SuccessOf<
AsMethod<
S[K][K][K][K][K][K][K]
>
>
: S[K][K][K][K][K][K][K] extends {
readonly _tag: "ref"
}
? Subscribable<
SuccessOf<
AsMethod<
S[K][K][K][K][K][K][K]
>
>
>
: S[K][K][K][K][K][K][K] extends {
readonly kind: MethodKind
}
? ClientMethod<
AsMethod<
S[K][K][K][K][K][K][K]
>,
ClientOverrideOf<
S[K][K][K][K][K][K][K]
>
>
: S[K][K][K][K][K][K][K] extends Spec
? Simplify<{
readonly [K in keyof S[K][K][K][K][K][K][K]]: S[K][K][K][K][K][K][K][K] extends FromLocalMethod<
infer M
>
? InjectLocal<M, Self>
: S[K][K][K][K][K][K][K][K] extends LocalMethod<
infer T
>
? LocalEffect<
T,
never,
Self
>
: S[K][K][K][K][K][K][K][K] extends DefaultMethod<
infer F
>
? F
: S[K][K][K][K][K][K][K][K] extends {
readonly _tag: "value"
}
? SuccessOf<
AsMethod<
S[K][K][K][K][K][K][K][K]
>
>
: S[K][K][K][K][K][K][K][K] extends {
readonly _tag: "ref"
}
? Subscribable<
SuccessOf<
AsMethod<
S[K][K][K][K][K][K][K][K]
>
>
>
: S[K][K][K][K][K][K][K][K] extends {
readonly kind: MethodKind
}
? ClientMethod<
AsMethod<
S[K][K][K][K][K][K][K][K]
>,
ClientOverrideOf<
S[K][K][K][K][K][K][K][K]
>
>
: S[K][K][K][K][K][K][K][K] extends Spec
? Simplify<{
readonly [K in keyof S[K][K][K][K][K][K][K][K]]: S[K][K][K][K][K][K][K][K][K] extends FromLocalMethod<
infer M
>
? InjectLocal<
M,
Self
>
: S[K][K][K][K][K][K][K][K][K] extends LocalMethod<
infer T
>
? LocalEffect<
T,
never,
Self
>
: S[K][K][K][K][K][K][K][K][K] extends DefaultMethod<
infer F
>
? F
: S[K][K][K][K][K][K][K][K][K] extends {
readonly _tag: "value"
}
? SuccessOf<
AsMethod<
S[K][K][K][K][K][K][K][K][K]
>
>
: S[K][K][K][K][K][K][K][K][K] extends {
readonly _tag: "ref"
}
? Subscribable<
SuccessOf<
AsMethod<
S[K][K][K][K][K][K][K][K][K]
>
>
>
: S[K][K][K][K][K][K][K][K][K] extends {
readonly kind: MethodKind
}
? ClientMethod<
AsMethod<
S[K][K][K][K][K][K][K][K][K]
>,
ClientOverrideOf<
S[K][K][K][K][K][K][K][K][K]
>
>
: S[K][K][K][K][K][K][K][K][K] extends Spec
? Simplify<{
readonly [K in keyof S[K][K][K][K][K][K][K][K][K]]: S[K][K][K][K][K][K][K][K][K][K] extends FromLocalMethod<
infer M
>
? InjectLocal<
M,
Self
>
: S[K][K][K][K][K][K][K][K][K][K] extends LocalMethod<
infer T
>
? LocalEffect<
T,
never,
Self
>
: S[K][K][K][K][K][K][K][K][K][K] extends DefaultMethod<
infer F
>
? F
: S[K][K][K][K][K][K][K][K][K][K] extends {
readonly _tag: "value"
}
? SuccessOf<
AsMethod<
S[K][K][K][K][K][K][K][K][K][K]
>
>
: S[K][K][K][K][K][K][K][K][K][K] extends {
readonly _tag: "ref"
}
? Subscribable<
SuccessOf<
AsMethod<
S[K][K][K][K][K][K][K][K][K][K]
>
>
>
: S[K][K][K][K][K][K][K][K][K][K] extends {
readonly kind: MethodKind
}
? ClientMethod<
AsMethod<
S[K][K][K][K][K][K][K][K][K][K]
>,
ClientOverrideOf<
S[K][K][K][K][K][K][K][K][K][K]
>
>
: S[K][K][K][K][K][K][K][K][K][K] extends Spec
? Simplify<{
readonly [K in keyof S[K][K][K][K][K][K][K][K][K][K]]: S[K][K][K][K][K][K][K][K][K][K][K] extends FromLocalMethod<
infer M
>
? InjectLocal<
M,
Self
>
: S[K][K][K][K][K][K][K][K][K][K][K] extends LocalMethod<
infer T
>
? LocalEffect<
T,
never,
Self
>
: S[K][K][K][K][K][K][K][K][K][K][K] extends DefaultMethod<
infer F
>
? F
: S[K][K][K][K][K][K][K][K][K][K][K] extends {
readonly _tag: "value"
}
? SuccessOf<
AsMethod<
S[K][K][K][K][K][K][K][K][K][K][K]
>
>
: S[K][K][K][K][K][K][K][K][K][K][K] extends {
readonly _tag: "ref"
}
? Subscribable<
SuccessOf<
AsMethod<
S[K][K][K][K][K][K][K][K][K][K][K]
>
>
>
: S[K][K][K][K][K][K][K][K][K][K][K] extends {
readonly kind: MethodKind
}
? ClientMethod<
AsMethod<
S[K][K][K][K][K][K][K][K][K][K][K]
>,
ClientOverrideOf<
S[K][K][K][K][K][K][K][K][K][K][K]
>
>
: S[K][K][K][K][K][K][K][K][K][K][K] extends Spec
? Simplify<any>
: never
}>
: never
}>
: never
}>
: never
}>
: never
}>
: never
}>
: never
}>
: never
}>
: never
}>
: never
}>
: never
}>
>
}Shared-Spec factory from Tag(wireKey, spec). Mint instances with the Effect-shaped
double call: Factory<Self>()(instanceKey).
export interface interface SharedTagFactory<S extends Spec>Shared-Spec factory from
Tag
(wireKey, spec). Mint instances with the Effect-shaped
double call: Factory<Self>()(instanceKey).
SharedTagFactory<function (type parameter) S in SharedTagFactory<S extends Spec>S extends Spec> {
<function (type parameter) Self in <Self>(): {
<const D extends DefaultsBag>(key: string, options: {
readonly description?: string;
readonly node?: NodeKey<unknown>;
readonly defaults: DefaultsInput<D>;
}): TagWithDefaults<HyperlinkTag<Self, S>, D>;
(key: string, options?: {
readonly description?: string;
readonly node?: NodeKey<unknown>;
}): HyperlinkTag<Self, S>;
}
Self>(): {
<const function (type parameter) D in <const D extends DefaultsBag>(key: string, options: {
readonly description?: string;
readonly node?: NodeKey<unknown>;
readonly defaults: DefaultsInput<D>;
}): TagWithDefaults<HyperlinkTag<Self, S>, D>
D extends type DefaultsBag = {
readonly [key: string]: unknown
}
A bag of Tag-baked defaults for
defaults
.
DefaultsBag>(
key: stringkey: string,
options: {
readonly description?: string
readonly node?: NodeKey<unknown>
readonly defaults: DefaultsInput<D>
}
options: {
readonly description?: string | undefineddescription?: string;
readonly node?: NodeKey<unknown>node?: type NodeKey<HSelf> = Context.Key<HSelf, NodeProtocol>The Context key of a
Node
(HSelf = its identity): a service whose value is the
transport
NodeProtocol
. Stored on a node-bearing tag under
nodeSym
; read by
Hyperlink.client
to resolve where to connect (its requirement channel).
NodeKey<unknown>;
readonly defaults: DefaultsInput<D>defaults: type DefaultsInput<
D extends DefaultsBag
> = { readonly [K in keyof D]: SyncDefault<D[K]> }
Input bag for
defaults
/ Tag { defaults } — sync values only (Promise-returning
fns are a type error).
DefaultsInput<function (type parameter) D in <const D extends DefaultsBag>(key: string, options: {
readonly description?: string;
readonly node?: NodeKey<unknown>;
readonly defaults: DefaultsInput<D>;
}): TagWithDefaults<HyperlinkTag<Self, S>, D>
D>;
},
): type TagWithDefaults<
T,
D extends DefaultsBag
> = T & {
readonly Service: ServiceOfTag<T> &
MergedDefaultsBag<T, D>
readonly [defaultsSym]: MergedDefaultsBag<T, D>
} & Effect.Effect<
ServiceOfTag<T> & PriorDefaults<T> & D,
never,
never
>
Tag after
defaults
(pipe or factory { defaults } sugar).
Keeps T (shallow
PipeableTag
pipe — no HyperlinkTag<Self,…> rebuild,
so class X extends Tag<X>().pipe(defaults) does not recurse on X). Widens
what yield* Tag /
Shape
see by intersecting a covariant
Effect<Svc & Bag> and a widened Service property. Soundness:
test/defaults-handle.test-d.ts.
TagWithDefaults<interface HyperlinkTag<Self, S extends Spec, Svc = Simplify<{ readonly [K in keyof S]: S[K] extends FromLocalMethod<infer M> ? InjectLocal<M, Self> : S[K] extends LocalMethod<infer T> ? LocalEffect<...> : S[K] extends DefaultMethod<...> ? F : S[K] extends { ...; } ? SuccessOf<...> : S[K] extends { ...; } ? Subscribable<...> : S[K] extends { ...; } ? ClientMethod<...> : S[K] extends Spec ? Simplify<...> : never; }>>The type of a HyperService tag carrying spec S — what
Hyperlink.Tag
produces
(and what you extend). Lets a consumer write
<S extends Spec>(tag: HyperlinkTag<Self, S>) and read the spec through named types
(
specOf
/
groupOf
) instead of a Parameters<typeof specOf> workaround.
HyperlinkTag<function (type parameter) Self in <Self>(): {
<const D extends DefaultsBag>(key: string, options: {
readonly description?: string;
readonly node?: NodeKey<unknown>;
readonly defaults: DefaultsInput<D>;
}): TagWithDefaults<HyperlinkTag<Self, S>, D>;
(key: string, options?: {
readonly description?: string;
readonly node?: NodeKey<unknown>;
}): HyperlinkTag<Self, S>;
}
Self, function (type parameter) S in SharedTagFactory<S extends Spec>S>, function (type parameter) D in <const D extends DefaultsBag>(key: string, options: {
readonly description?: string;
readonly node?: NodeKey<unknown>;
readonly defaults: DefaultsInput<D>;
}): TagWithDefaults<HyperlinkTag<Self, S>, D>
D>;
(
key: stringkey: string,
options: {
readonly description?: string
readonly node?: NodeKey<unknown>
}
options?: {
readonly description?: string | undefineddescription?: string;
readonly node?: NodeKey<unknown>node?: type NodeKey<HSelf> = Context.Key<HSelf, NodeProtocol>The Context key of a
Node
(HSelf = its identity): a service whose value is the
transport
NodeProtocol
. Stored on a node-bearing tag under
nodeSym
; read by
Hyperlink.client
to resolve where to connect (its requirement channel).
NodeKey<unknown>;
},
): interface HyperlinkTag<Self, S extends Spec, Svc = Simplify<{ readonly [K in keyof S]: S[K] extends FromLocalMethod<infer M> ? InjectLocal<M, Self> : S[K] extends LocalMethod<infer T> ? LocalEffect<...> : S[K] extends DefaultMethod<...> ? F : S[K] extends { ...; } ? SuccessOf<...> : S[K] extends { ...; } ? Subscribable<...> : S[K] extends { ...; } ? ClientMethod<...> : S[K] extends Spec ? Simplify<...> : never; }>>The type of a HyperService tag carrying spec S — what
Hyperlink.Tag
produces
(and what you extend). Lets a consumer write
<S extends Spec>(tag: HyperlinkTag<Self, S>) and read the spec through named types
(
specOf
/
groupOf
) instead of a Parameters<typeof specOf> workaround.
HyperlinkTag<function (type parameter) Self in <Self>(): {
<const D extends DefaultsBag>(key: string, options: {
readonly description?: string;
readonly node?: NodeKey<unknown>;
readonly defaults: DefaultsInput<D>;
}): TagWithDefaults<HyperlinkTag<Self, S>, D>;
(key: string, options?: {
readonly description?: string;
readonly node?: NodeKey<unknown>;
}): HyperlinkTag<Self, S>;
}
Self, function (type parameter) S in SharedTagFactory<S extends Spec>S>;
};
/** Wire / kind key — RpcGroup prefix for every instance. */
readonly SharedTagFactory<S extends Spec>.wireKey: stringWire / kind key — RpcGroup prefix for every instance.
wireKey: string;
readonly SharedTagFactory<S extends Spec>.kind: stringkind: string;
readonly SharedTagFactory<S extends Spec>.description: string | undefineddescription: string | undefined;
readonly [const specSym: typeof specSymWhere the contract spec is stowed on a Tag (hidden from the value surface). Exported so
the public
HyperlinkTag
type is nameable across modules.
specSym]: type FlatSpec = {
[x: string]:
| AnyMethod
| AnyLocalMethod
| AnyDefaultMethod
}
A flat spec — a path-keyed record of leaves (no nested groups). The wire machinery runs on this;
a (possibly nested)
Spec
flattens to it via
flattenSpec
.
FlatSpec;
readonly [const specTypeSym: typeof specTypeSymPhantom carrier of a tag's (possibly nested) spec type S, so functions can infer S from a tag —
specSym
holds the flat spec at runtime and can't carry the nested S. Type-only, never set at
runtime.
specTypeSym]?: function (type parameter) S in SharedTagFactory<S extends Spec>S;
readonly [const groupSym: typeof groupSymWhere the built RPC group is stowed on a Tag.
groupSym]: type RpcGroupOf<S extends Spec> =
RpcGroup.RpcGroup<RpcUnionOf<S, "">>
The precisely-typed RPC contract group for a
Spec
. Carrying this exact type
(rather than a loose Rpc<string, …>) is what keeps the remote client's requirement
channel honest: concrete schemas declare never encoding/decoding services, so
RpcClient.make infers a real R (just the transport Protocol) instead of any.
RpcGroupOf<function (type parameter) S in SharedTagFactory<S extends Spec>S>;
}