Skip to content

Commit e6e688b

Browse files
feat: add clearHistory() to MindElixirInstance type declaration
1 parent cb4d6a0 commit e6e688b

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/types/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,13 @@ export interface MindElixirInstance extends Omit<Required<Options>, 'markdown' |
121121
history: Operation[]
122122
undo: () => void
123123
redo: () => void
124+
/**
125+
* Reset the undo/redo stack and update the internal baseline snapshot to the
126+
* current diagram state. Call this after loading new data into an existing
127+
* instance (e.g. after `refresh()`) to prevent users from undoing back into
128+
* a previously loaded diagram.
129+
*/
130+
clearHistory: () => void
124131

125132
selection: SelectionArea
126133
dragMoveHelper: ReturnType<typeof createDragMoveHelper>

0 commit comments

Comments
 (0)