History tool can be used to undo/redo, get/load editor state, add current editor state to history and more.
var pixie = new Pixie({
onLoad: function() {
pixie.tools.history.add('my history item', 'some icon');
}
});
Undo last canvas operation.
undo(): Promise
Redo last canvas operation.
redo(): Promise
Check if there are any actions to undo.
canUndo(): boolean
Check if there are any actions to redo.
canRedo(): boolean
Reload current history state, undoing any actions that were not yet applied.
reload(): Promise
Replace current history item with current canvas state.
replaceCurrent(): void
Create a new history item from current canvas state.
addHistoryItem(params: { name: HistoryName; state?: SerializedPixieState }): void
Replace current canvas state with specified history item.
load(item: HistoryItem): Promise