<HSelf>(nodeSet: readonly [AddressedNode<HSelf>]): <
T extends PipeableTag
>(
tag: T
) => SoleNodeBind<T, AddressedNode<HSelf>>
<HSelf>(nodeSet: readonly [NodeKey<HSelf>]): <T extends PipeableTag>(
tag: T
) => SoleNodeBind<T, NodeKey<HSelf>>
<T extends PipeableTag>(nodeSet: ReadonlyArray<AnyNode>): (tag: T) => T
<Self, S extends Spec, HSelf>(
tag: HyperlinkTag<Self, S> | NodeBoundTag<Self, S, HSelf>,
nodeSet: readonly [AddressedNode<HSelf>]
): SoleNodeBind<NodeBoundTag<Self, S, HSelf>, AddressedNode<HSelf>>
<Self, S extends Spec, HSelf>(
tag: HyperlinkTag<Self, S> | NodeBoundTag<Self, S, HSelf>,
nodeSet: readonly [NodeKey<HSelf>]
): SoleNodeBind<NodeBoundTag<Self, S, HSelf>, NodeKey<HSelf>>
<Self, S extends Spec, HSelf>(
tag: NodeBoundTag<Self, S, HSelf>,
nodeSet: ReadonlyArray<AnyNode>
): NodeBoundTag<Self, S, HSelf>
<Self, S extends Spec>(
tag: HyperlinkTag<Self, S>,
nodeSet: ReadonlyArray<AnyNode>
): HyperlinkTag<Self, S>Stamp a Tag's Node set (C1) — overwrites. Size 1 also syncs nodeSym so
client(Tag) works; size ≠ 1 clears nodeSym (use client(Tag, node)). Identity Tags
may only carry ≤ 1 Node (IdentityMultiNode). Empty nodes([]) is discoverable
membership (same as bare distributed); peersLayer reads Lookup directory.
A size-1 tuple of an AddressedNode narrows like { node: X } on the Tag ctor —
client(Tag) is fully wired. andNode(X) from an empty set is the same bind.
class Mail extends Hyperlink.Tag<Mail>()("app/Mail", spec).pipe(
Hyperlink.nodes([WorkerA]), // or Hyperlink.andNode(WorkerA)
) {}
class Pool extends Hyperlink.Tag<Pool>()("app/Pool", spec).pipe(
Hyperlink.nodes([A, B, C]),
) {}export const const nodes: {
<HSelf>(
nodeSet: readonly [AddressedNode<HSelf>]
): <T extends PipeableTag>(
tag: T
) => SoleNodeBind<T, AddressedNode<HSelf>>
<HSelf>(nodeSet: readonly [NodeKey<HSelf>]): <
T extends PipeableTag
>(
tag: T
) => SoleNodeBind<T, NodeKey<HSelf>>
<T extends PipeableTag>(
nodeSet: ReadonlyArray<AnyNode>
): (tag: T) => T
<Self, S extends Spec, HSelf>(
tag:
| HyperlinkTag<Self, S>
| NodeBoundTag<Self, S, HSelf>,
nodeSet: readonly [AddressedNode<HSelf>]
): SoleNodeBind<
NodeBoundTag<Self, S, HSelf>,
AddressedNode<HSelf>
>
<Self, S extends Spec, HSelf>(
tag:
| HyperlinkTag<Self, S>
| NodeBoundTag<Self, S, HSelf>,
nodeSet: readonly [NodeKey<HSelf>]
): SoleNodeBind<
NodeBoundTag<Self, S, HSelf>,
NodeKey<HSelf>
>
<Self, S extends Spec, HSelf>(
tag: NodeBoundTag<Self, S, HSelf>,
nodeSet: ReadonlyArray<AnyNode>
): NodeBoundTag<Self, S, HSelf>
<Self, S extends Spec>(
tag: HyperlinkTag<Self, S>,
nodeSet: ReadonlyArray<AnyNode>
): HyperlinkTag<Self, S>
}
Stamp a Tag's Node set (C1) — overwrites. Size 1 also syncs
nodeSym
so
client
(Tag) works; size ≠ 1 clears nodeSym (use client(Tag, node)). Identity Tags
may only carry ≤ 1 Node (
IdentityMultiNode
). Empty nodes([]) is discoverable
membership (same as bare
distributed
);
peersLayer
reads Lookup directory.
A size-1 tuple of an
AddressedNode
narrows like { node: X } on the Tag ctor —
client(Tag) is fully wired.
andNode
(X) from an empty set is the same bind.
class Mail extends Hyperlink.Tag<Mail>()("app/Mail", spec).pipe(
Hyperlink.nodes([WorkerA]), // or Hyperlink.andNode(WorkerA)
) {}
class Pool extends Hyperlink.Tag<Pool>()("app/Pool", spec).pipe(
Hyperlink.nodes([A, B, C]),
) {}
nodes: {
// data-last — addressed sole node (before bare NodeKey; AddressedNode ⊆ NodeKey)
<function (type parameter) HSelf in <HSelf>(nodeSet: readonly [AddressedNode<HSelf>]): <T extends PipeableTag>(tag: T) => SoleNodeBind<T, AddressedNode<HSelf>>HSelf>(
nodeSet: readonly [AddressedNode<HSelf>](parameter) nodeSet: {
0: AddressedNode<HSelf>;
length: 1;
toString: () => string;
toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string };
concat: { (...items: Array<ConcatArray<AddressedNode<HSelf>>>): Array<AddressedNode<HSelf>>; (...items: Array<any>): Array<AddressedNode<HSelf>> };
join: (separator?: string) => string;
slice: (start?: number, end?: number) => Array<AddressedNode<HSelf>>;
indexOf: (searchElement: AddressedNode<HSelf>, fromIndex?: number) => number;
lastIndexOf: (searchElement: AddressedNode<HSelf>, fromIndex?: number) => number;
every: { (predicate: (value: AddressedNode<HSelf>, index: number, array: ReadonlyArray<AddressedNode<HSelf>>) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: AddressedNode<HSelf>, index: number, array: ReadonlyArray<Addre…;
some: (predicate: (value: AddressedNode<HSelf>, index: number, array: ReadonlyArray<AddressedNode<HSelf>>) => unknown, thisArg?: any) => boolean;
forEach: (callbackfn: (value: AddressedNode<HSelf>, index: number, array: ReadonlyArray<AddressedNode<HSelf>>) => void, thisArg?: any) => void;
map: (callbackfn: (value: AddressedNode<HSelf>, index: number, array: ReadonlyArray<AddressedNode<HSelf>>) => U, thisArg?: any) => Array<U>;
filter: { (predicate: (value: AddressedNode<HSelf>, index: number, array: ReadonlyArray<AddressedNode<HSelf>>) => value is S, thisArg?: any): Array<S>; (predicate: (value: AddressedNode<HSelf>, index: number, array: ReadonlyArray<AddressedNode<HSe…;
reduce: { (callbackfn: (previousValue: AddressedNode<HSelf>, currentValue: AddressedNode<HSelf>, currentIndex: number, array: ReadonlyArray<AddressedNode<HSelf>>) => AddressedNode<HSelf>): AddressedNode<HSelf>; (callbackfn: (previousValue: Address…;
reduceRight: { (callbackfn: (previousValue: AddressedNode<HSelf>, currentValue: AddressedNode<HSelf>, currentIndex: number, array: ReadonlyArray<AddressedNode<HSelf>>) => AddressedNode<HSelf>): AddressedNode<HSelf>; (callbackfn: (previousValue: Address…;
find: { (predicate: (value: AddressedNode<HSelf>, index: number, obj: ReadonlyArray<AddressedNode<HSelf>>) => value is S, thisArg?: any): S | undefined; (predicate: (value: AddressedNode<HSelf>, index: number, obj: ReadonlyArray<AddressedNode<HS…;
findIndex: (predicate: (value: AddressedNode<HSelf>, index: number, obj: ReadonlyArray<AddressedNode<HSelf>>) => unknown, thisArg?: any) => number;
entries: () => ArrayIterator<[number, AddressedNode<HSelf>]>;
keys: () => ArrayIterator<number>;
values: () => ArrayIterator<AddressedNode<HSelf>>;
includes: (searchElement: AddressedNode<HSelf>, fromIndex?: number) => boolean;
flatMap: (callback: (this: This, value: AddressedNode<HSelf>, index: number, array: Array<AddressedNode<HSelf>>) => U | ReadonlyArray<U>, thisArg?: This | undefined) => Array<U>;
flat: (this: A, depth?: D | undefined) => Array<FlatArray<A, D>>;
at: (index: number) => any;
findLast: { (predicate: (value: AddressedNode<HSelf>, index: number, array: ReadonlyArray<AddressedNode<HSelf>>) => value is S, thisArg?: any): S | undefined; (predicate: (value: AddressedNode<HSelf>, index: number, array: ReadonlyArray<AddressedNod…;
findLastIndex: (predicate: (value: AddressedNode<HSelf>, index: number, array: ReadonlyArray<AddressedNode<HSelf>>) => unknown, thisArg?: any) => number;
toReversed: () => Array<AddressedNode<HSelf>>;
toSorted: (compareFn?: ((a: AddressedNode<HSelf>, b: AddressedNode<HSelf>) => number) | undefined) => Array<AddressedNode<HSelf>>;
toSpliced: { (start: number, deleteCount: number, ...items: Array<AddressedNode<HSelf>>): Array<AddressedNode<HSelf>>; (start: number, deleteCount?: number): Array<AddressedNode<HSelf>> };
with: (index: number, value: AddressedNode<HSelf>) => Array<AddressedNode<HSelf>>;
}
nodeSet: readonly [import AddressedNodeAddressedNode<function (type parameter) HSelf in <HSelf>(nodeSet: readonly [AddressedNode<HSelf>]): <T extends PipeableTag>(tag: T) => SoleNodeBind<T, AddressedNode<HSelf>>HSelf>],
): <function (type parameter) T in <T extends PipeableTag>(tag: T): SoleNodeBind<T, AddressedNode<HSelf>>T extends type PipeableTag = {
readonly [specSym]: FlatSpec
}
PipeableTag>(tag: T extends PipeableTagtag: function (type parameter) T in <T extends PipeableTag>(tag: T): SoleNodeBind<T, AddressedNode<HSelf>>T) => type SoleNodeBind<T, N> = T & {
readonly [nodeSym]: N
readonly [nodesSym]: readonly [N]
}
Sole-node bind stamped by
nodes
([n]) /
andNode
(n) from an empty set —
enough for
client
(Tag) to see an
AddressedNode
and auto-connect.
SoleNodeBind<function (type parameter) T in <T extends PipeableTag>(tag: T): SoleNodeBind<T, AddressedNode<HSelf>>T, import AddressedNodeAddressedNode<function (type parameter) HSelf in <HSelf>(nodeSet: readonly [AddressedNode<HSelf>]): <T extends PipeableTag>(tag: T) => SoleNodeBind<T, AddressedNode<HSelf>>HSelf>>;
<function (type parameter) HSelf in <HSelf>(nodeSet: readonly [NodeKey<HSelf>]): <T extends PipeableTag>(tag: T) => SoleNodeBind<T, NodeKey<HSelf>>HSelf>(
nodeSet: readonly [NodeKey<HSelf>](parameter) nodeSet: {
0: NodeKey<HSelf>;
length: 1;
toString: () => string;
toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string };
concat: { (...items: Array<ConcatArray<NodeKey<HSelf>>>): Array<NodeKey<HSelf>>; (...items: Array<any>): Array<NodeKey<HSelf>> };
join: (separator?: string) => string;
slice: (start?: number, end?: number) => Array<NodeKey<HSelf>>;
indexOf: (searchElement: NodeKey<HSelf>, fromIndex?: number) => number;
lastIndexOf: (searchElement: NodeKey<HSelf>, fromIndex?: number) => number;
every: { (predicate: (value: NodeKey<HSelf>, index: number, array: ReadonlyArray<NodeKey<HSelf>>) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: NodeKey<HSelf>, index: number, array: ReadonlyArray<NodeKey<HSelf>>) => unk…;
some: (predicate: (value: NodeKey<HSelf>, index: number, array: ReadonlyArray<NodeKey<HSelf>>) => unknown, thisArg?: any) => boolean;
forEach: (callbackfn: (value: NodeKey<HSelf>, index: number, array: ReadonlyArray<NodeKey<HSelf>>) => void, thisArg?: any) => void;
map: (callbackfn: (value: NodeKey<HSelf>, index: number, array: ReadonlyArray<NodeKey<HSelf>>) => U, thisArg?: any) => Array<U>;
filter: { (predicate: (value: NodeKey<HSelf>, index: number, array: ReadonlyArray<NodeKey<HSelf>>) => value is S, thisArg?: any): Array<S>; (predicate: (value: NodeKey<HSelf>, index: number, array: ReadonlyArray<NodeKey<HSelf>>) => unknown, thisAr…;
reduce: { (callbackfn: (previousValue: NodeKey<HSelf>, currentValue: NodeKey<HSelf>, currentIndex: number, array: ReadonlyArray<NodeKey<HSelf>>) => NodeKey<HSelf>): NodeKey<HSelf>; (callbackfn: (previousValue: NodeKey<HSelf>, currentValue: NodeKey…;
reduceRight: { (callbackfn: (previousValue: NodeKey<HSelf>, currentValue: NodeKey<HSelf>, currentIndex: number, array: ReadonlyArray<NodeKey<HSelf>>) => NodeKey<HSelf>): NodeKey<HSelf>; (callbackfn: (previousValue: NodeKey<HSelf>, currentValue: NodeKey…;
find: { (predicate: (value: NodeKey<HSelf>, index: number, obj: ReadonlyArray<NodeKey<HSelf>>) => value is S, thisArg?: any): S | undefined; (predicate: (value: NodeKey<HSelf>, index: number, obj: ReadonlyArray<NodeKey<HSelf>>) => unknown, thisA…;
findIndex: (predicate: (value: NodeKey<HSelf>, index: number, obj: ReadonlyArray<NodeKey<HSelf>>) => unknown, thisArg?: any) => number;
entries: () => ArrayIterator<[number, NodeKey<HSelf>]>;
keys: () => ArrayIterator<number>;
values: () => ArrayIterator<NodeKey<HSelf>>;
includes: (searchElement: NodeKey<HSelf>, fromIndex?: number) => boolean;
flatMap: (callback: (this: This, value: NodeKey<HSelf>, index: number, array: Array<NodeKey<HSelf>>) => U | ReadonlyArray<U>, thisArg?: This | undefined) => Array<U>;
flat: (this: A, depth?: D | undefined) => Array<FlatArray<A, D>>;
at: (index: number) => any;
findLast: { (predicate: (value: NodeKey<HSelf>, index: number, array: ReadonlyArray<NodeKey<HSelf>>) => value is S, thisArg?: any): S | undefined; (predicate: (value: NodeKey<HSelf>, index: number, array: ReadonlyArray<NodeKey<HSelf>>) => unknown, t…;
findLastIndex: (predicate: (value: NodeKey<HSelf>, index: number, array: ReadonlyArray<NodeKey<HSelf>>) => unknown, thisArg?: any) => number;
toReversed: () => Array<NodeKey<HSelf>>;
toSorted: (compareFn?: ((a: NodeKey<HSelf>, b: NodeKey<HSelf>) => number) | undefined) => Array<NodeKey<HSelf>>;
toSpliced: { (start: number, deleteCount: number, ...items: Array<NodeKey<HSelf>>): Array<NodeKey<HSelf>>; (start: number, deleteCount?: number): Array<NodeKey<HSelf>> };
with: (index: number, value: NodeKey<HSelf>) => Array<NodeKey<HSelf>>;
}
nodeSet: readonly [import NodeKeyNodeKey<function (type parameter) HSelf in <HSelf>(nodeSet: readonly [NodeKey<HSelf>]): <T extends PipeableTag>(tag: T) => SoleNodeBind<T, NodeKey<HSelf>>HSelf>],
): <function (type parameter) T in <T extends PipeableTag>(tag: T): SoleNodeBind<T, NodeKey<HSelf>>T extends type PipeableTag = {
readonly [specSym]: FlatSpec
}
PipeableTag>(tag: T extends PipeableTagtag: function (type parameter) T in <T extends PipeableTag>(tag: T): SoleNodeBind<T, NodeKey<HSelf>>T) => type SoleNodeBind<T, N> = T & {
readonly [nodeSym]: N
readonly [nodesSym]: readonly [N]
}
Sole-node bind stamped by
nodes
([n]) /
andNode
(n) from an empty set —
enough for
client
(Tag) to see an
AddressedNode
and auto-connect.
SoleNodeBind<function (type parameter) T in <T extends PipeableTag>(tag: T): SoleNodeBind<T, NodeKey<HSelf>>T, import NodeKeyNodeKey<function (type parameter) HSelf in <HSelf>(nodeSet: readonly [NodeKey<HSelf>]): <T extends PipeableTag>(tag: T) => SoleNodeBind<T, NodeKey<HSelf>>HSelf>>;
<function (type parameter) T in <T extends PipeableTag>(nodeSet: ReadonlyArray<AnyNode>): (tag: T) => TT extends type PipeableTag = {
readonly [specSym]: FlatSpec
}
PipeableTag>(
nodeSet: readonly AnyNode[]nodeSet: interface ReadonlyArray<T>ReadonlyArray<import AnyNodeAnyNode>,
): (tag: T extends PipeableTagtag: function (type parameter) T in <T extends PipeableTag>(nodeSet: ReadonlyArray<AnyNode>): (tag: T) => TT) => function (type parameter) T in <T extends PipeableTag>(nodeSet: ReadonlyArray<AnyNode>): (tag: T) => TT;
// data-first
<function (type parameter) Self in <Self, S extends Spec, HSelf>(tag: HyperlinkTag<Self, S> | NodeBoundTag<Self, S, HSelf>, nodeSet: readonly [AddressedNode<HSelf>]): SoleNodeBind<NodeBoundTag<Self, S, HSelf>, AddressedNode<HSelf>>Self, function (type parameter) S in <Self, S extends Spec, HSelf>(tag: HyperlinkTag<Self, S> | NodeBoundTag<Self, S, HSelf>, nodeSet: readonly [AddressedNode<HSelf>]): SoleNodeBind<NodeBoundTag<Self, S, HSelf>, AddressedNode<HSelf>>S extends Spec, function (type parameter) HSelf in <Self, S extends Spec, HSelf>(tag: HyperlinkTag<Self, S> | NodeBoundTag<Self, S, HSelf>, nodeSet: readonly [AddressedNode<HSelf>]): SoleNodeBind<NodeBoundTag<Self, S, HSelf>, AddressedNode<HSelf>>HSelf>(
tag: | HyperlinkTag<Self, S>
| NodeBoundTag<Self, S, HSelf>
tag: 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, S extends Spec, HSelf>(tag: HyperlinkTag<Self, S> | NodeBoundTag<Self, S, HSelf>, nodeSet: readonly [AddressedNode<HSelf>]): SoleNodeBind<NodeBoundTag<Self, S, HSelf>, AddressedNode<HSelf>>Self, function (type parameter) S in <Self, S extends Spec, HSelf>(tag: HyperlinkTag<Self, S> | NodeBoundTag<Self, S, HSelf>, nodeSet: readonly [AddressedNode<HSelf>]): SoleNodeBind<NodeBoundTag<Self, S, HSelf>, AddressedNode<HSelf>>S> | interface NodeBoundTag<Self, S extends Spec, HSelf, 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; }>>A
HyperlinkTag
bound to a concrete
Node
— its [nodeSym] narrowed to that node's
NodeKey<HSelf>, which is how
Hyperlink.client
discriminates the node-aware path. Returned
by the node-bearing tag constructors. It's a named type (not an inline & { [nodeSym] }) so a
consumer can export a node-bearing tag without leaking the internal symbol (TS4020).
NodeBoundTag<function (type parameter) Self in <Self, S extends Spec, HSelf>(tag: HyperlinkTag<Self, S> | NodeBoundTag<Self, S, HSelf>, nodeSet: readonly [AddressedNode<HSelf>]): SoleNodeBind<NodeBoundTag<Self, S, HSelf>, AddressedNode<HSelf>>Self, function (type parameter) S in <Self, S extends Spec, HSelf>(tag: HyperlinkTag<Self, S> | NodeBoundTag<Self, S, HSelf>, nodeSet: readonly [AddressedNode<HSelf>]): SoleNodeBind<NodeBoundTag<Self, S, HSelf>, AddressedNode<HSelf>>S, function (type parameter) HSelf in <Self, S extends Spec, HSelf>(tag: HyperlinkTag<Self, S> | NodeBoundTag<Self, S, HSelf>, nodeSet: readonly [AddressedNode<HSelf>]): SoleNodeBind<NodeBoundTag<Self, S, HSelf>, AddressedNode<HSelf>>HSelf>,
nodeSet: readonly [AddressedNode<HSelf>](parameter) nodeSet: {
0: AddressedNode<HSelf>;
length: 1;
toString: () => string;
toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string };
concat: { (...items: Array<ConcatArray<AddressedNode<HSelf>>>): Array<AddressedNode<HSelf>>; (...items: Array<any>): Array<AddressedNode<HSelf>> };
join: (separator?: string) => string;
slice: (start?: number, end?: number) => Array<AddressedNode<HSelf>>;
indexOf: (searchElement: AddressedNode<HSelf>, fromIndex?: number) => number;
lastIndexOf: (searchElement: AddressedNode<HSelf>, fromIndex?: number) => number;
every: { (predicate: (value: AddressedNode<HSelf>, index: number, array: ReadonlyArray<AddressedNode<HSelf>>) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: AddressedNode<HSelf>, index: number, array: ReadonlyArray<Addre…;
some: (predicate: (value: AddressedNode<HSelf>, index: number, array: ReadonlyArray<AddressedNode<HSelf>>) => unknown, thisArg?: any) => boolean;
forEach: (callbackfn: (value: AddressedNode<HSelf>, index: number, array: ReadonlyArray<AddressedNode<HSelf>>) => void, thisArg?: any) => void;
map: (callbackfn: (value: AddressedNode<HSelf>, index: number, array: ReadonlyArray<AddressedNode<HSelf>>) => U, thisArg?: any) => Array<U>;
filter: { (predicate: (value: AddressedNode<HSelf>, index: number, array: ReadonlyArray<AddressedNode<HSelf>>) => value is S, thisArg?: any): Array<S>; (predicate: (value: AddressedNode<HSelf>, index: number, array: ReadonlyArray<AddressedNode<HSe…;
reduce: { (callbackfn: (previousValue: AddressedNode<HSelf>, currentValue: AddressedNode<HSelf>, currentIndex: number, array: ReadonlyArray<AddressedNode<HSelf>>) => AddressedNode<HSelf>): AddressedNode<HSelf>; (callbackfn: (previousValue: Address…;
reduceRight: { (callbackfn: (previousValue: AddressedNode<HSelf>, currentValue: AddressedNode<HSelf>, currentIndex: number, array: ReadonlyArray<AddressedNode<HSelf>>) => AddressedNode<HSelf>): AddressedNode<HSelf>; (callbackfn: (previousValue: Address…;
find: { (predicate: (value: AddressedNode<HSelf>, index: number, obj: ReadonlyArray<AddressedNode<HSelf>>) => value is S, thisArg?: any): S | undefined; (predicate: (value: AddressedNode<HSelf>, index: number, obj: ReadonlyArray<AddressedNode<HS…;
findIndex: (predicate: (value: AddressedNode<HSelf>, index: number, obj: ReadonlyArray<AddressedNode<HSelf>>) => unknown, thisArg?: any) => number;
entries: () => ArrayIterator<[number, AddressedNode<HSelf>]>;
keys: () => ArrayIterator<number>;
values: () => ArrayIterator<AddressedNode<HSelf>>;
includes: (searchElement: AddressedNode<HSelf>, fromIndex?: number) => boolean;
flatMap: (callback: (this: This, value: AddressedNode<HSelf>, index: number, array: Array<AddressedNode<HSelf>>) => U | ReadonlyArray<U>, thisArg?: This | undefined) => Array<U>;
flat: (this: A, depth?: D | undefined) => Array<FlatArray<A, D>>;
at: (index: number) => any;
findLast: { (predicate: (value: AddressedNode<HSelf>, index: number, array: ReadonlyArray<AddressedNode<HSelf>>) => value is S, thisArg?: any): S | undefined; (predicate: (value: AddressedNode<HSelf>, index: number, array: ReadonlyArray<AddressedNod…;
findLastIndex: (predicate: (value: AddressedNode<HSelf>, index: number, array: ReadonlyArray<AddressedNode<HSelf>>) => unknown, thisArg?: any) => number;
toReversed: () => Array<AddressedNode<HSelf>>;
toSorted: (compareFn?: ((a: AddressedNode<HSelf>, b: AddressedNode<HSelf>) => number) | undefined) => Array<AddressedNode<HSelf>>;
toSpliced: { (start: number, deleteCount: number, ...items: Array<AddressedNode<HSelf>>): Array<AddressedNode<HSelf>>; (start: number, deleteCount?: number): Array<AddressedNode<HSelf>> };
with: (index: number, value: AddressedNode<HSelf>) => Array<AddressedNode<HSelf>>;
}
nodeSet: readonly [import AddressedNodeAddressedNode<function (type parameter) HSelf in <Self, S extends Spec, HSelf>(tag: HyperlinkTag<Self, S> | NodeBoundTag<Self, S, HSelf>, nodeSet: readonly [AddressedNode<HSelf>]): SoleNodeBind<NodeBoundTag<Self, S, HSelf>, AddressedNode<HSelf>>HSelf>],
): type SoleNodeBind<T, N> = T & {
readonly [nodeSym]: N
readonly [nodesSym]: readonly [N]
}
Sole-node bind stamped by
nodes
([n]) /
andNode
(n) from an empty set —
enough for
client
(Tag) to see an
AddressedNode
and auto-connect.
SoleNodeBind<
interface NodeBoundTag<Self, S extends Spec, HSelf, 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; }>>A
HyperlinkTag
bound to a concrete
Node
— its [nodeSym] narrowed to that node's
NodeKey<HSelf>, which is how
Hyperlink.client
discriminates the node-aware path. Returned
by the node-bearing tag constructors. It's a named type (not an inline & { [nodeSym] }) so a
consumer can export a node-bearing tag without leaking the internal symbol (TS4020).
NodeBoundTag<function (type parameter) Self in <Self, S extends Spec, HSelf>(tag: HyperlinkTag<Self, S> | NodeBoundTag<Self, S, HSelf>, nodeSet: readonly [AddressedNode<HSelf>]): SoleNodeBind<NodeBoundTag<Self, S, HSelf>, AddressedNode<HSelf>>Self, function (type parameter) S in <Self, S extends Spec, HSelf>(tag: HyperlinkTag<Self, S> | NodeBoundTag<Self, S, HSelf>, nodeSet: readonly [AddressedNode<HSelf>]): SoleNodeBind<NodeBoundTag<Self, S, HSelf>, AddressedNode<HSelf>>S, function (type parameter) HSelf in <Self, S extends Spec, HSelf>(tag: HyperlinkTag<Self, S> | NodeBoundTag<Self, S, HSelf>, nodeSet: readonly [AddressedNode<HSelf>]): SoleNodeBind<NodeBoundTag<Self, S, HSelf>, AddressedNode<HSelf>>HSelf>,
import AddressedNodeAddressedNode<function (type parameter) HSelf in <Self, S extends Spec, HSelf>(tag: HyperlinkTag<Self, S> | NodeBoundTag<Self, S, HSelf>, nodeSet: readonly [AddressedNode<HSelf>]): SoleNodeBind<NodeBoundTag<Self, S, HSelf>, AddressedNode<HSelf>>HSelf>
>;
<function (type parameter) Self in <Self, S extends Spec, HSelf>(tag: HyperlinkTag<Self, S> | NodeBoundTag<Self, S, HSelf>, nodeSet: readonly [NodeKey<HSelf>]): SoleNodeBind<NodeBoundTag<Self, S, HSelf>, NodeKey<HSelf>>Self, function (type parameter) S in <Self, S extends Spec, HSelf>(tag: HyperlinkTag<Self, S> | NodeBoundTag<Self, S, HSelf>, nodeSet: readonly [NodeKey<HSelf>]): SoleNodeBind<NodeBoundTag<Self, S, HSelf>, NodeKey<HSelf>>S extends Spec, function (type parameter) HSelf in <Self, S extends Spec, HSelf>(tag: HyperlinkTag<Self, S> | NodeBoundTag<Self, S, HSelf>, nodeSet: readonly [NodeKey<HSelf>]): SoleNodeBind<NodeBoundTag<Self, S, HSelf>, NodeKey<HSelf>>HSelf>(
tag: | HyperlinkTag<Self, S>
| NodeBoundTag<Self, S, HSelf>
tag: 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, S extends Spec, HSelf>(tag: HyperlinkTag<Self, S> | NodeBoundTag<Self, S, HSelf>, nodeSet: readonly [NodeKey<HSelf>]): SoleNodeBind<NodeBoundTag<Self, S, HSelf>, NodeKey<HSelf>>Self, function (type parameter) S in <Self, S extends Spec, HSelf>(tag: HyperlinkTag<Self, S> | NodeBoundTag<Self, S, HSelf>, nodeSet: readonly [NodeKey<HSelf>]): SoleNodeBind<NodeBoundTag<Self, S, HSelf>, NodeKey<HSelf>>S> | interface NodeBoundTag<Self, S extends Spec, HSelf, 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; }>>A
HyperlinkTag
bound to a concrete
Node
— its [nodeSym] narrowed to that node's
NodeKey<HSelf>, which is how
Hyperlink.client
discriminates the node-aware path. Returned
by the node-bearing tag constructors. It's a named type (not an inline & { [nodeSym] }) so a
consumer can export a node-bearing tag without leaking the internal symbol (TS4020).
NodeBoundTag<function (type parameter) Self in <Self, S extends Spec, HSelf>(tag: HyperlinkTag<Self, S> | NodeBoundTag<Self, S, HSelf>, nodeSet: readonly [NodeKey<HSelf>]): SoleNodeBind<NodeBoundTag<Self, S, HSelf>, NodeKey<HSelf>>Self, function (type parameter) S in <Self, S extends Spec, HSelf>(tag: HyperlinkTag<Self, S> | NodeBoundTag<Self, S, HSelf>, nodeSet: readonly [NodeKey<HSelf>]): SoleNodeBind<NodeBoundTag<Self, S, HSelf>, NodeKey<HSelf>>S, function (type parameter) HSelf in <Self, S extends Spec, HSelf>(tag: HyperlinkTag<Self, S> | NodeBoundTag<Self, S, HSelf>, nodeSet: readonly [NodeKey<HSelf>]): SoleNodeBind<NodeBoundTag<Self, S, HSelf>, NodeKey<HSelf>>HSelf>,
nodeSet: readonly [NodeKey<HSelf>](parameter) nodeSet: {
0: NodeKey<HSelf>;
length: 1;
toString: () => string;
toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string };
concat: { (...items: Array<ConcatArray<NodeKey<HSelf>>>): Array<NodeKey<HSelf>>; (...items: Array<any>): Array<NodeKey<HSelf>> };
join: (separator?: string) => string;
slice: (start?: number, end?: number) => Array<NodeKey<HSelf>>;
indexOf: (searchElement: NodeKey<HSelf>, fromIndex?: number) => number;
lastIndexOf: (searchElement: NodeKey<HSelf>, fromIndex?: number) => number;
every: { (predicate: (value: NodeKey<HSelf>, index: number, array: ReadonlyArray<NodeKey<HSelf>>) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: NodeKey<HSelf>, index: number, array: ReadonlyArray<NodeKey<HSelf>>) => unk…;
some: (predicate: (value: NodeKey<HSelf>, index: number, array: ReadonlyArray<NodeKey<HSelf>>) => unknown, thisArg?: any) => boolean;
forEach: (callbackfn: (value: NodeKey<HSelf>, index: number, array: ReadonlyArray<NodeKey<HSelf>>) => void, thisArg?: any) => void;
map: (callbackfn: (value: NodeKey<HSelf>, index: number, array: ReadonlyArray<NodeKey<HSelf>>) => U, thisArg?: any) => Array<U>;
filter: { (predicate: (value: NodeKey<HSelf>, index: number, array: ReadonlyArray<NodeKey<HSelf>>) => value is S, thisArg?: any): Array<S>; (predicate: (value: NodeKey<HSelf>, index: number, array: ReadonlyArray<NodeKey<HSelf>>) => unknown, thisAr…;
reduce: { (callbackfn: (previousValue: NodeKey<HSelf>, currentValue: NodeKey<HSelf>, currentIndex: number, array: ReadonlyArray<NodeKey<HSelf>>) => NodeKey<HSelf>): NodeKey<HSelf>; (callbackfn: (previousValue: NodeKey<HSelf>, currentValue: NodeKey…;
reduceRight: { (callbackfn: (previousValue: NodeKey<HSelf>, currentValue: NodeKey<HSelf>, currentIndex: number, array: ReadonlyArray<NodeKey<HSelf>>) => NodeKey<HSelf>): NodeKey<HSelf>; (callbackfn: (previousValue: NodeKey<HSelf>, currentValue: NodeKey…;
find: { (predicate: (value: NodeKey<HSelf>, index: number, obj: ReadonlyArray<NodeKey<HSelf>>) => value is S, thisArg?: any): S | undefined; (predicate: (value: NodeKey<HSelf>, index: number, obj: ReadonlyArray<NodeKey<HSelf>>) => unknown, thisA…;
findIndex: (predicate: (value: NodeKey<HSelf>, index: number, obj: ReadonlyArray<NodeKey<HSelf>>) => unknown, thisArg?: any) => number;
entries: () => ArrayIterator<[number, NodeKey<HSelf>]>;
keys: () => ArrayIterator<number>;
values: () => ArrayIterator<NodeKey<HSelf>>;
includes: (searchElement: NodeKey<HSelf>, fromIndex?: number) => boolean;
flatMap: (callback: (this: This, value: NodeKey<HSelf>, index: number, array: Array<NodeKey<HSelf>>) => U | ReadonlyArray<U>, thisArg?: This | undefined) => Array<U>;
flat: (this: A, depth?: D | undefined) => Array<FlatArray<A, D>>;
at: (index: number) => any;
findLast: { (predicate: (value: NodeKey<HSelf>, index: number, array: ReadonlyArray<NodeKey<HSelf>>) => value is S, thisArg?: any): S | undefined; (predicate: (value: NodeKey<HSelf>, index: number, array: ReadonlyArray<NodeKey<HSelf>>) => unknown, t…;
findLastIndex: (predicate: (value: NodeKey<HSelf>, index: number, array: ReadonlyArray<NodeKey<HSelf>>) => unknown, thisArg?: any) => number;
toReversed: () => Array<NodeKey<HSelf>>;
toSorted: (compareFn?: ((a: NodeKey<HSelf>, b: NodeKey<HSelf>) => number) | undefined) => Array<NodeKey<HSelf>>;
toSpliced: { (start: number, deleteCount: number, ...items: Array<NodeKey<HSelf>>): Array<NodeKey<HSelf>>; (start: number, deleteCount?: number): Array<NodeKey<HSelf>> };
with: (index: number, value: NodeKey<HSelf>) => Array<NodeKey<HSelf>>;
}
nodeSet: readonly [import NodeKeyNodeKey<function (type parameter) HSelf in <Self, S extends Spec, HSelf>(tag: HyperlinkTag<Self, S> | NodeBoundTag<Self, S, HSelf>, nodeSet: readonly [NodeKey<HSelf>]): SoleNodeBind<NodeBoundTag<Self, S, HSelf>, NodeKey<HSelf>>HSelf>],
): type SoleNodeBind<T, N> = T & {
readonly [nodeSym]: N
readonly [nodesSym]: readonly [N]
}
Sole-node bind stamped by
nodes
([n]) /
andNode
(n) from an empty set —
enough for
client
(Tag) to see an
AddressedNode
and auto-connect.
SoleNodeBind<interface NodeBoundTag<Self, S extends Spec, HSelf, 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; }>>A
HyperlinkTag
bound to a concrete
Node
— its [nodeSym] narrowed to that node's
NodeKey<HSelf>, which is how
Hyperlink.client
discriminates the node-aware path. Returned
by the node-bearing tag constructors. It's a named type (not an inline & { [nodeSym] }) so a
consumer can export a node-bearing tag without leaking the internal symbol (TS4020).
NodeBoundTag<function (type parameter) Self in <Self, S extends Spec, HSelf>(tag: HyperlinkTag<Self, S> | NodeBoundTag<Self, S, HSelf>, nodeSet: readonly [NodeKey<HSelf>]): SoleNodeBind<NodeBoundTag<Self, S, HSelf>, NodeKey<HSelf>>Self, function (type parameter) S in <Self, S extends Spec, HSelf>(tag: HyperlinkTag<Self, S> | NodeBoundTag<Self, S, HSelf>, nodeSet: readonly [NodeKey<HSelf>]): SoleNodeBind<NodeBoundTag<Self, S, HSelf>, NodeKey<HSelf>>S, function (type parameter) HSelf in <Self, S extends Spec, HSelf>(tag: HyperlinkTag<Self, S> | NodeBoundTag<Self, S, HSelf>, nodeSet: readonly [NodeKey<HSelf>]): SoleNodeBind<NodeBoundTag<Self, S, HSelf>, NodeKey<HSelf>>HSelf>, import NodeKeyNodeKey<function (type parameter) HSelf in <Self, S extends Spec, HSelf>(tag: HyperlinkTag<Self, S> | NodeBoundTag<Self, S, HSelf>, nodeSet: readonly [NodeKey<HSelf>]): SoleNodeBind<NodeBoundTag<Self, S, HSelf>, NodeKey<HSelf>>HSelf>>;
<function (type parameter) Self in <Self, S extends Spec, HSelf>(tag: NodeBoundTag<Self, S, HSelf>, nodeSet: ReadonlyArray<AnyNode>): NodeBoundTag<Self, S, HSelf>Self, function (type parameter) S in <Self, S extends Spec, HSelf>(tag: NodeBoundTag<Self, S, HSelf>, nodeSet: ReadonlyArray<AnyNode>): NodeBoundTag<Self, S, HSelf>S extends Spec, function (type parameter) HSelf in <Self, S extends Spec, HSelf>(tag: NodeBoundTag<Self, S, HSelf>, nodeSet: ReadonlyArray<AnyNode>): NodeBoundTag<Self, S, HSelf>HSelf>(
tag: NodeBoundTag<Self, S, HSelf>(parameter) tag: {
groupId: string;
description: string | undefined;
key: Identifier;
of: (this: void, self: 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…;
context: (self: 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[…;
use: (f: (service: 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<AsMe…;
useSync: (f: (service: 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<AsMe…;
Identifier: Identifier;
Service: Shape;
stack: string | undefined;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
tag: interface NodeBoundTag<Self, S extends Spec, HSelf, 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; }>>A
HyperlinkTag
bound to a concrete
Node
— its [nodeSym] narrowed to that node's
NodeKey<HSelf>, which is how
Hyperlink.client
discriminates the node-aware path. Returned
by the node-bearing tag constructors. It's a named type (not an inline & { [nodeSym] }) so a
consumer can export a node-bearing tag without leaking the internal symbol (TS4020).
NodeBoundTag<function (type parameter) Self in <Self, S extends Spec, HSelf>(tag: NodeBoundTag<Self, S, HSelf>, nodeSet: ReadonlyArray<AnyNode>): NodeBoundTag<Self, S, HSelf>Self, function (type parameter) S in <Self, S extends Spec, HSelf>(tag: NodeBoundTag<Self, S, HSelf>, nodeSet: ReadonlyArray<AnyNode>): NodeBoundTag<Self, S, HSelf>S, function (type parameter) HSelf in <Self, S extends Spec, HSelf>(tag: NodeBoundTag<Self, S, HSelf>, nodeSet: ReadonlyArray<AnyNode>): NodeBoundTag<Self, S, HSelf>HSelf>,
nodeSet: readonly AnyNode[]nodeSet: interface ReadonlyArray<T>ReadonlyArray<import AnyNodeAnyNode>,
): interface NodeBoundTag<Self, S extends Spec, HSelf, 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; }>>A
HyperlinkTag
bound to a concrete
Node
— its [nodeSym] narrowed to that node's
NodeKey<HSelf>, which is how
Hyperlink.client
discriminates the node-aware path. Returned
by the node-bearing tag constructors. It's a named type (not an inline & { [nodeSym] }) so a
consumer can export a node-bearing tag without leaking the internal symbol (TS4020).
NodeBoundTag<function (type parameter) Self in <Self, S extends Spec, HSelf>(tag: NodeBoundTag<Self, S, HSelf>, nodeSet: ReadonlyArray<AnyNode>): NodeBoundTag<Self, S, HSelf>Self, function (type parameter) S in <Self, S extends Spec, HSelf>(tag: NodeBoundTag<Self, S, HSelf>, nodeSet: ReadonlyArray<AnyNode>): NodeBoundTag<Self, S, HSelf>S, function (type parameter) HSelf in <Self, S extends Spec, HSelf>(tag: NodeBoundTag<Self, S, HSelf>, nodeSet: ReadonlyArray<AnyNode>): NodeBoundTag<Self, S, HSelf>HSelf>;
<function (type parameter) Self in <Self, S extends Spec>(tag: HyperlinkTag<Self, S>, nodeSet: ReadonlyArray<AnyNode>): HyperlinkTag<Self, S>Self, function (type parameter) S in <Self, S extends Spec>(tag: HyperlinkTag<Self, S>, nodeSet: ReadonlyArray<AnyNode>): HyperlinkTag<Self, S>S extends Spec>(
tag: HyperlinkTag<Self, S>(parameter) tag: {
groupId: string;
description: string | undefined;
key: Identifier;
of: (this: void, self: 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…;
context: (self: 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[…;
use: (f: (service: 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<AsMe…;
useSync: (f: (service: 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<AsMe…;
Identifier: Identifier;
Service: Shape;
stack: string | undefined;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
tag: 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, S extends Spec>(tag: HyperlinkTag<Self, S>, nodeSet: ReadonlyArray<AnyNode>): HyperlinkTag<Self, S>Self, function (type parameter) S in <Self, S extends Spec>(tag: HyperlinkTag<Self, S>, nodeSet: ReadonlyArray<AnyNode>): HyperlinkTag<Self, S>S>,
nodeSet: readonly AnyNode[]nodeSet: interface ReadonlyArray<T>ReadonlyArray<import AnyNodeAnyNode>,
): 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, S extends Spec>(tag: HyperlinkTag<Self, S>, nodeSet: ReadonlyArray<AnyNode>): HyperlinkTag<Self, S>Self, function (type parameter) S in <Self, S extends Spec>(tag: HyperlinkTag<Self, S>, nodeSet: ReadonlyArray<AnyNode>): HyperlinkTag<Self, S>S>;
} = import FnFn.const dual: <(...args: Array<any>) => any, <T extends HyperlinkTag<any, any, any>>(tag: T, nodeSet: ReadonlyArray<AnyNode>) => T>(arity: 2, body: <T extends HyperlinkTag<any, any, any>>(tag: T, nodeSet: ReadonlyArray<AnyNode>) => T) => ((...args: Array<any>) => any) & (<T extends HyperlinkTag<any, any, any>>(tag: T, nodeSet: ReadonlyArray<AnyNode>) => T) (+1 overload)Creates a function that can be called in data-first style or data-last
(pipe-friendly) style.
When to use
Use to expose one implementation through both direct and pipe-friendly
call styles.
Details
Pass either the arity of the uncurried function or a predicate that decides
whether the current call is data-first. Arity is the common case. Use a
predicate when optional arguments make arity ambiguous.
Example (Selecting data-first or data-last style by arity)
import { Function, pipe } from "effect"
const sum = Function.dual<
(that: number) => (self: number) => number,
(self: number, that: number) => number
>(2, (self, that) => self + that)
console.log(sum(2, 3)) // 5
console.log(pipe(2, sum(3))) // 5
Example (Defining overloads with call signatures)
import { Function, pipe } from "effect"
const sum: {
(that: number): (self: number) => number
(self: number, that: number): number
} = Function.dual(2, (self: number, that: number): number => self + that)
console.log(sum(2, 3)) // 5
console.log(pipe(2, sum(3))) // 5
Example (Selecting data-first or data-last style with a predicate)
import { Function, pipe } from "effect"
const sum = Function.dual<
(that: number) => (self: number) => number,
(self: number, that: number) => number
>(
(args) => args.length === 2,
(self, that) => self + that
)
console.log(sum(2, 3)) // 5
console.log(pipe(2, sum(3))) // 5
dual(
2,
<function (type parameter) T in <T extends HyperlinkTag<any, any, any>>(tag: T, nodeSet: ReadonlyArray<AnyNode>): TT extends 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<any, any, any>>(
tag: T extends HyperlinkTag<any, any, any>tag: function (type parameter) T in <T extends HyperlinkTag<any, any, any>>(tag: T, nodeSet: ReadonlyArray<AnyNode>): TT,
nodeSet: readonly AnyNode[]nodeSet: interface ReadonlyArray<T>ReadonlyArray<import AnyNodeAnyNode>,
): function (type parameter) T in <T extends HyperlinkTag<any, any, any>>(tag: T, nodeSet: ReadonlyArray<AnyNode>): TT => {
if (const isIdentity: (
tag: unknown
) => boolean
True when tag was piped through
identity
.
isIdentity(tag: T extends HyperlinkTag<any, any, any>tag)) {
const assertIdentityNodeCount: (
tag: {
readonly key: string
},
nodes: ReadonlyArray<AnyNode>
) => void
Throw when an identity Tag would carry more than one fleet Node.
assertIdentityNodeCount(tag: T extends HyperlinkTag<any, any, any>tag, nodeSet: readonly AnyNode[]nodeSet);
}
// Size 1 → client(Tag); otherwise nodeless for client (explicit node / ambient Protocol).
const const node: anynode =
nodeSet: readonly AnyNode[]nodeSet.ReadonlyArray<AnyNode>.length: numberGets the length of the array. This is a number one higher than the highest element defined in an array.
length === 1 ? (nodeSet: readonly AnyNode[]nodeSet[0] as import NodeKeyNodeKey<unknown>) : var undefinedundefined;
return var Object: ObjectConstructorProvides functionality common to all JavaScript objects.
Object.ObjectConstructor.assign<T, {
[nodesSym]: readonly AnyNode[];
[nodeSym]: any;
}>(target: T, source: {
[nodesSym]: readonly AnyNode[];
[nodeSym]: any;
}): T & {
[nodesSym]: readonly AnyNode[];
[nodeSym]: any;
} (+3 overloads)
Copy the values of all of the enumerable own properties from one or more source objects to a
target object. Returns the target object.
assign(tag: T extends HyperlinkTag<any, any, any>tag, {
[const nodesSym: typeof nodesSymHolds a tag's distributed set (the fleet).
nodesSym]: nodeSet: readonly AnyNode[]nodeSet,
[const nodeSym: typeof nodeSymWhere the resource's
Node
(if any) is stowed on a Tag.
nodeSym]: const node: anynode,
});
},
);