UNPKG

c8osdkjscore

Version:
152 lines 4.9 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var c8oFullSyncTranslator_1 = require("./c8oFullSyncTranslator"); var C8oProgress = (function () { function C8oProgress(progress) { this._changed = false; this._continuous = false; this._finished = false; this._pull = true; this._current = -1; this._total = -1; this._status = ""; this._taskInfo = ""; if (progress instanceof C8oProgress) { this._changed = false; this._continuous = progress._continuous; this._finished = progress._finished; this._pull = progress._pull; this._current = progress._current; this._total = progress._total; this._status = progress._status; this._taskInfo = progress._taskInfo; this._raw = progress._raw; } else { if (progress === undefined) { this._raw = null; } else { throw new Error("Expected C8oProgress or empty constructor, got '" + progress + "'."); } } } Object.defineProperty(C8oProgress.prototype, "changed", { get: function () { return this._changed; }, set: function (value) { this._changed = value; }, enumerable: true, configurable: true }); Object.defineProperty(C8oProgress.prototype, "continuous", { get: function () { return this._continuous; }, set: function (value) { this._continuous = value; this._changed = true; }, enumerable: true, configurable: true }); Object.defineProperty(C8oProgress.prototype, "finished", { get: function () { return this._finished; }, set: function (value) { this._finished = value; this._changed = true; }, enumerable: true, configurable: true }); Object.defineProperty(C8oProgress.prototype, "pull", { get: function () { return this._pull; }, set: function (value) { this._pull = value; this._changed = true; }, enumerable: true, configurable: true }); Object.defineProperty(C8oProgress.prototype, "push", { get: function () { return !this._pull; }, enumerable: true, configurable: true }); Object.defineProperty(C8oProgress.prototype, "current", { get: function () { return this._current; }, set: function (value) { this._current = value; this._changed = true; }, enumerable: true, configurable: true }); Object.defineProperty(C8oProgress.prototype, "total", { get: function () { return this._total; }, set: function (value) { this._total = value; this._changed = true; }, enumerable: true, configurable: true }); Object.defineProperty(C8oProgress.prototype, "direction", { get: function () { return this._pull ? c8oFullSyncTranslator_1.C8oFullSyncTranslator.FULL_SYNC_RESPONSE_VALUE_DIRECTION_PULL : c8oFullSyncTranslator_1.C8oFullSyncTranslator.FULL_SYNC_RESPONSE_VALUE_DIRECTION_PUSH; }, enumerable: true, configurable: true }); Object.defineProperty(C8oProgress.prototype, "status", { get: function () { return this._status; }, set: function (value) { this._changed = true; this._status = value; }, enumerable: true, configurable: true }); Object.defineProperty(C8oProgress.prototype, "taskInfo", { get: function () { return this._taskInfo; }, set: function (value) { this._changed = true; this._taskInfo = value; }, enumerable: true, configurable: true }); Object.defineProperty(C8oProgress.prototype, "raw", { get: function () { return this._raw; }, set: function (value) { this._changed = true; this._raw = value; }, enumerable: true, configurable: true }); C8oProgress.prototype.toString = function () { return this.direction + ": " + this.current + "/" + this.total + " (" + (this.finished ? (this.continuous ? "live" : "done") : "running") + ")"; }; return C8oProgress; }()); exports.C8oProgress = C8oProgress; //# sourceMappingURL=c8oProgress.js.map