<Self>(key: string): 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 { readonly _tag: "constant" }
? 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 { readonly _tag: "constant" }
? 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 { readonly _tag: "constant" }
? 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 {
readonly _tag: "constant"
}
? 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 {
readonly _tag: "constant"
}
? 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 {
readonly _tag: "constant"
}
? 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 {
readonly _tag: "constant"
}
? 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 {
readonly _tag: "constant"
}
? 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 {
readonly _tag: "constant"
}
? 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 {
readonly _tag: "constant"
}
? 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 {
readonly _tag: "constant"
}
? 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
}>
>A tagFor factory: <Self>(key) => tag, plus the shared family metadata
(groupId / description / spec / group) that serveInstances reads without an
instance.
export interface interface TagFactory<S extends Spec>A
tagFor
factory: <Self>(key) => tag, plus the shared family metadata
(groupId / description / spec / group) that
serveInstances
reads without an
instance.
TagFactory<function (type parameter) S in TagFactory<S extends Spec>S extends Spec> {
<function (type parameter) Self in <Self>(key: string): HyperlinkTag<Self, S>Self>(key: stringkey: string): 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 { ...; } ? SuccessOf<...> : S[K] extends { ...; } ? Subscribable<...> : S[K] extends { ...; } ? ClientMethod<...> : S[K] extends Spec ? Simplify<...> : never; }>>The type of a resource tag carrying spec S — what
Hyperlink.Tag
/ a
Hyperlink.tagFor
factory produce (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>(key: string): HyperlinkTag<Self, S>Self, function (type parameter) S in TagFactory<S extends Spec>S>;
readonly TagFactory<S extends Spec>.groupId: stringgroupId: string;
readonly TagFactory<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
}
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 TagFactory<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 TagFactory<S extends Spec>S>;
}