Interfaces
Import these from @grafloria/engine.
Interfaces
CommandContext
tsinterface CommandContext
Properties
| Name | Type | Default | Description |
|---|---|---|---|
diagram | any | ||
eventBus | any | ||
store? | any | ||
engine? | any |
CommandHistoryEntry
tsinterface CommandHistoryEntry
Properties
| Name | Type | Default | Description |
|---|---|---|---|
command | Command | ||
timestamp | number | ||
duration | number | ||
success | boolean | History only ever records commands that EXECUTED successfully, so this is always true and error is never set. Both fields survive purely for API compatibility — a command that throws (or fails strict validation) no longer enters history at all, because canUndo()/undo() never consulted these flags and would happily "undo" a mutation that never happened. | |
error? | Error |
CutCommandOptions
tsinterface CutCommandOptions
Properties
| Name | Type | Default | Description |
|---|---|---|---|
includeGroups? | boolean | Include groups containing selected nodes in the clipboard payload (default: false) | |
includeLinks? | boolean | Include links between copied nodes in the clipboard payload (default: true) | |
deleteChildren? | boolean | Delete child nodes recursively (default: true) | |
deleteLinks? | boolean | Delete links connected to the deleted nodes (default: true) |
GroupFrameMove
One (nested) group frame's move.
tsinterface GroupFrameMove
Properties
| Name | Type | Default | Description |
|---|---|---|---|
groupId | string | ||
from | GroupFrameSnapshot | ||
to | GroupFrameSnapshot |
GroupFrameSnapshot
A group frame's restorable geometry (matches GroupModel.restoreGeometry).
tsinterface GroupFrameSnapshot
Properties
| Name | Type | Default | Description |
|---|---|---|---|
position | { x: number; y: number } | ||
size? | { width: number; height: number; depth: number } | ||
bounds? | { x: number; y: number; width: number; height: number } |
GroupNodeMove
One member node's absolute move.
tsinterface GroupNodeMove
Properties
| Name | Type | Default | Description |
|---|---|---|---|
nodeId | string | ||
from | Point | ||
to | Point |
MacroStep
tsinterface MacroStep
Properties
| Name | Type | Default | Description |
|---|---|---|---|
command | Command | ||
delay? | number |
MoveNodeCommandOptions
tsinterface MoveNodeCommandOptions
Properties
| Name | Type | Default | Description |
|---|---|---|---|
mergeable? | boolean | Whether CommandManager may MERGE this move into the previous one for the same node (default: true, preserving the historic behaviour). |
RotateNodeCommandOptions
tsinterface RotateNodeCommandOptions
Properties
| Name | Type | Default | Description |
|---|---|---|---|
mergeable? | boolean | Whether CommandManager may MERGE this rotation into the previous one for the same node (default: false). |
SerializedCommand
tsinterface SerializedCommand
Properties
| Name | Type | Default | Description |
|---|---|---|---|
id | string | ||
name | string | ||
timestamp | number | ||
data | any |
Was this page helpful?