rune-langium / visual-editor/src / NodeRepository
Interface: NodeRepository
Defined in: packages/visual-editor/src/store/node-repository.ts:28
Typed, read-only lookup surface over the editor's nodes. Built as a PURE derived snapshot from the nodesById Map-as-SoT — never a second source of truth. byId keys on node.id (= makeNodeId(ns, name, $type)).
Declared standalone (not extends Repository<TypeGraphNode>): byType narrows its K constraint to AnyDomain['$type'], which is a contravariant narrowing the generic byType<K extends string> cannot be widened to — the generated DomainRepository is standalone for the same reason.
STATUS — byNamespace drives the NamespaceExplorer tree; byType drives the kind-pill counts; byId backs the read-path lookups (see Phase 4 consumer cutover).
Methods
all()
all(): readonly TypeGraphNode[];Defined in: packages/visual-editor/src/store/node-repository.ts:35
Returns
readonly TypeGraphNode[]
byId()
byId(id): TypeGraphNode | undefined;Defined in: packages/visual-editor/src/store/node-repository.ts:29
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
TypeGraphNode | undefined
byNamespace()
byNamespace(ns): readonly TypeGraphNode[];Defined in: packages/visual-editor/src/store/node-repository.ts:32
Nodes grouped by meta.namespace (the editor's namespace axis). Empty for an unknown ns.
Parameters
| Parameter | Type |
|---|---|
ns | string |
Returns
readonly TypeGraphNode[]
byType()
byType<K>(type): readonly NodeOf<K>[];Defined in: packages/visual-editor/src/store/node-repository.ts:30
Type Parameters
| Type Parameter |
|---|
K extends | "Data" | "Choice" | "RosettaEnumeration" | "RosettaFunction" | "Annotation" | "RosettaTypeAlias" | "RosettaBasicType" | "RosettaRecordType" |
Parameters
| Parameter | Type |
|---|---|
type | K |
Returns
readonly NodeOf<K>[]
namespaces()
namespaces(): readonly string[];Defined in: packages/visual-editor/src/store/node-repository.ts:34
Each distinct namespace once, in first-seen order.
Returns
readonly string[]