rune-langium / visual-editor/src / RuneTypeGraphCallbacks
Interface: RuneTypeGraphCallbacks
Defined in: packages/visual-editor/src/types.ts:459
Event callbacks for the RuneTypeGraph component.
Remarks
All callbacks are optional. onModelChanged fires after every committed edit with the full serialized model as a Map<namespace, rosettaSource>. Use it to persist model state.
Pitfalls
onModelChangedmay fire frequently during drag operations — debounce it before persisting to disk or a backend.onValidationChangefires synchronously after each model mutation and may deliver validation errors before the UI has fully re-rendered.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
onContextMenu? | (position) => void | - | packages/visual-editor/src/types.ts:469 |
onEdgeSelect? | (edgeId, data) => void | - | packages/visual-editor/src/types.ts:467 |
onInspectType? | NavigateToNodeCallback | Reveal a declaration's complete details from a summarized graph card. | packages/visual-editor/src/types.ts:464 |
onLayoutEngineChange? | (engine) => void | Called when the user switches layout engine from the graph context menu. | packages/visual-editor/src/types.ts:466 |
onModelChanged? | (serialized) => void | Promise<void> | Fires when the graph serializes the model — i.e. on an explicit exportRosetta() call. For automatic source synchronization on every editor-store edit (regardless of whether the graph view is mounted), consumers should mount the exported useModelSourceSync hook in an always-mounted parent (as EditorPage does). RuneTypeGraph intentionally no longer holds that subscription internally, so source-sync is not coupled to the graph pane's mount lifecycle. May return a Promise — the hook does NOT await it (fire-and-forget). | packages/visual-editor/src/types.ts:483 |
onNavigateToType? | NavigateToNodeCallback | Called when a type reference is clicked within a graph node (e.g., attribute type name). | packages/visual-editor/src/types.ts:462 |
onNodeDoubleClick? | (nodeId, data) => void | - | packages/visual-editor/src/types.ts:460 |
onSelectionClear? | () => void | - | packages/visual-editor/src/types.ts:468 |
onTypeCreated? | (nodeId, kind, name) => void | - | packages/visual-editor/src/types.ts:470 |
onTypeDeleted? | (nodeId) => void | - | packages/visual-editor/src/types.ts:471 |
onValidationChange? | (errors) => void | - | packages/visual-editor/src/types.ts:484 |