UNPKG

core-cde

Version:

76 lines 2.77 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RemoveCoverAction = exports.CreateCoverAction = exports.RenamePageAction = exports.RemovePageAction = exports.CreatePageAction = exports.SelectPageAction = exports.EPageActions = void 0; const Action_1 = require("./Action"); var EPageActions; (function (EPageActions) { EPageActions["createPage"] = "createPage"; EPageActions["removePage"] = "removePage"; EPageActions["selectPage"] = "selectPage"; EPageActions["renamePage"] = "renamePage"; EPageActions["createCover"] = "createCover"; EPageActions["removeCover"] = "removeCover"; })(EPageActions = exports.EPageActions || (exports.EPageActions = {})); class SelectPageAction extends Action_1.Action { constructor() { super(...arguments); this.type = EPageActions.selectPage; } } exports.SelectPageAction = SelectPageAction; class CreatePageAction extends Action_1.Action { constructor(props, documentId, pageId, prev_guid, next_guid) { super(props, documentId, pageId); this.prev_guid = prev_guid; this.next_guid = next_guid; this.type = EPageActions.createPage; } /** * Получить объект для сериализации * @returns Объект для сериализации */ toJSON() { return Object.assign({}, null, { props: this.props, documentId: this.documentId, pageId: this.pageId, widgetId: this.widgetId, type: this.type, prev_guid: this.prev_guid, next_guid: this.next_guid, user: this.user, }); } } exports.CreatePageAction = CreatePageAction; class RemovePageAction extends Action_1.Action { constructor(props, documentId, pageId, prev_guid, next_guid) { super(props, documentId, pageId); this.prev_guid = prev_guid; this.next_guid = next_guid; this.type = EPageActions.removePage; } } exports.RemovePageAction = RemovePageAction; class RenamePageAction extends Action_1.Action { constructor() { super(...arguments); this.type = EPageActions.renamePage; } } exports.RenamePageAction = RenamePageAction; class CreateCoverAction extends Action_1.Action { constructor() { super(...arguments); this.type = EPageActions.createCover; } } exports.CreateCoverAction = CreateCoverAction; class RemoveCoverAction extends Action_1.Action { constructor() { super(...arguments); this.type = EPageActions.removeCover; } } exports.RemoveCoverAction = RemoveCoverAction; //# sourceMappingURL=Page.actions.js.map