Skip to content

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&lt;TypeGraphNode&gt;): 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() ​

ts
all(): readonly TypeGraphNode[];

Defined in: packages/visual-editor/src/store/node-repository.ts:35

Returns ​

readonly TypeGraphNode[]


byId() ​

ts
byId(id): TypeGraphNode | undefined;

Defined in: packages/visual-editor/src/store/node-repository.ts:29

Parameters ​

ParameterType
idstring

Returns ​

TypeGraphNode | undefined


byNamespace() ​

ts
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 ​

ParameterType
nsstring

Returns ​

readonly TypeGraphNode[]


byType() ​

ts
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 ​

ParameterType
typeK

Returns ​

readonly NodeOf<K>[]


namespaces() ​

ts
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[]

Core packages released under MIT. Studio app released under FSL-1.1-ALv2.