@aurigma/design-atoms
Version:
Design Atoms is a part of Customer's Canvas SDK which allows for manipulating individual design elements through your code.
35 lines • 1.55 kB
JavaScript
import { NotImplementedException } from "@aurigma/design-atoms-model/Exception";
import { BaseCommand } from "./BaseCommand";
export class ModelUpdateCommand extends BaseCommand {
constructor(args, _historyArgs) {
super(args);
this._historyArgs = _historyArgs;
if (this._historyArgs == null)
this._historyArgs = {};
this._historyUpdateMode = this._historyArgs.historyUpdateMode != null ? this._historyArgs.historyUpdateMode : HistoryUpdateMode.Update;
}
async execute() {
if (this._historyArgs.history != null)
this._historyArgs.history.pause();
const result = await this._executeCommandBody();
if (this._historyArgs.history != null)
this._historyArgs.history.resume(this._historyUpdateMode !== HistoryUpdateMode.NotUpdate, this._historyArgs.historyUpdateMode === HistoryUpdateMode.ForceUpdate);
return result;
}
_executeCommandBody() {
throw new NotImplementedException();
}
redo() {
throw new NotImplementedException();
}
undo() {
throw new NotImplementedException();
}
}
export var HistoryUpdateMode;
(function (HistoryUpdateMode) {
HistoryUpdateMode[HistoryUpdateMode["NotUpdate"] = 0] = "NotUpdate";
HistoryUpdateMode[HistoryUpdateMode["Update"] = 1] = "Update";
HistoryUpdateMode[HistoryUpdateMode["ForceUpdate"] = 2] = "ForceUpdate";
})(HistoryUpdateMode || (HistoryUpdateMode = {}));
//# sourceMappingURL=ModelUpdateCommand.js.map