@gorpacrate/core-graphics
Version:
A core library for creating shape-based graphic editors
33 lines • 1.57 kB
JavaScript
;
exports.__esModule = true;
var EditorActionType;
(function (EditorActionType) {
EditorActionType[EditorActionType["PushHistoryEvent"] = 0] = "PushHistoryEvent";
EditorActionType[EditorActionType["UpdateHistoryEvent"] = 1] = "UpdateHistoryEvent";
EditorActionType[EditorActionType["DeleteHistoryEvent"] = 2] = "DeleteHistoryEvent";
})(EditorActionType = exports.EditorActionType || (exports.EditorActionType = {}));
function isPushHistoryEventAction(base) {
return base && (base.type === EditorActionType.PushHistoryEvent);
}
exports.isPushHistoryEventAction = isPushHistoryEventAction;
function isUpdateHistoryEventAction(base) {
return base && (base.type === EditorActionType.UpdateHistoryEvent);
}
exports.isUpdateHistoryEventAction = isUpdateHistoryEventAction;
function isDeleteHistoryEventAction(base) {
return base && (base.type === EditorActionType.DeleteHistoryEvent);
}
exports.isDeleteHistoryEventAction = isDeleteHistoryEventAction;
function pushHistoryEventAction(ev) {
return { type: EditorActionType.PushHistoryEvent, payload: { ev: ev } };
}
exports.pushHistoryEventAction = pushHistoryEventAction;
function updateHistoryEventAction(id, ev) {
return { type: EditorActionType.UpdateHistoryEvent, payload: { id: id, ev: ev } };
}
exports.updateHistoryEventAction = updateHistoryEventAction;
function deleteHistoryEventAction(id) {
return { type: EditorActionType.DeleteHistoryEvent, payload: { id: id } };
}
exports.deleteHistoryEventAction = deleteHistoryEventAction;
//# sourceMappingURL=editor-action.js.map