/**
 * @author eric.wittmann@gmail.com
 * @class
 */
var OtCommand = /** @class */ (function () {
    function OtCommand() {
        if (this.author === undefined)
            this.author = null;
        if (this.contentVersion === undefined)
            this.contentVersion = 0;
        if (this.command === undefined)
            this.command = null;
        if (this.local === undefined)
            this.local = false;
        if (this.reverted === undefined)
            this.reverted = false;
    }
    /**
     * Executes the command against the given document.  Skips execution if the command
     * has been reverted/undone.
     * @param {Document} document
     */
    OtCommand.prototype.execute = function (document) {
        if (!this.reverted) {
            this.command.execute(document);
        }
    };
    /**
     * Invokes 'undo' on the underlying ICommand but only if it hasn't already been reverted.
     * Any command already reverted will simply be skipped.
     * @param {Document} document
     */
    OtCommand.prototype.undo = function (document) {
        if (this.reverted) {
        }
        else {
            this.command.undo(document);
            this.reverted = true;
        }
    };
    /**
     * Invokes 'redo' on the underlying ICommand but only if it hasn't already been reverted.
     * Any command already reverted will simply be skipped.
     * @param {Document} document
     */
    OtCommand.prototype.redo = function (document) {
        if (!this.reverted) {
        }
        else {
            this.command.execute(document);
            this.reverted = false;
        }
    };
    return OtCommand;
}());
export { OtCommand };
OtCommand["__class"] = "io.apicurio.datamodels.cmd.ot.OtCommand";
//# sourceMappingURL=OtCommand.js.map