taskbuffer/dist/taskbuffer.classes.js
2016-02-18 22:26:18 +01:00

53 lines
4.4 KiB
JavaScript

#!/usr/bin/env node
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
/// <reference path="./typings/main.d.ts" />
var plugins = require("./taskbuffer.plugins");
var Task = (function () {
function Task(taskArg, optionsArg) {
this.task = taskArg;
}
Task.prototype.trigger = function () {
this.preTask.task()
.then(this.task)
.then(this.afterTask.task);
};
;
Task.prototype.triggerBuffered = function () {
var done = plugins.Q.defer();
};
Object.defineProperty(Task.prototype, "state", {
get: function () {
return this._state;
},
set: function (stateArg) {
if (stateArg == "locked") {
this._state = "locked";
}
else {
plugins.beautylog.error("state type");
}
},
enumerable: true,
configurable: true
});
return Task;
})();
exports.Task = Task;
var TaskChain = (function (_super) {
__extends(TaskChain, _super);
function TaskChain(taskArrayArg) {
_super.call(this, {
task: function () { }
});
}
return TaskChain;
})(Task);
exports.TaskChain = TaskChain;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhc2tidWZmZXIuY2xhc3Nlcy50cyJdLCJuYW1lcyI6WyJUYXNrIiwiVGFzay5jb25zdHJ1Y3RvciIsIlRhc2sudHJpZ2dlciIsIlRhc2sudHJpZ2dlckJ1ZmZlcmVkIiwiVGFzay5zdGF0ZSIsIlRhc2tDaGFpbiIsIlRhc2tDaGFpbi5jb25zdHJ1Y3RvciJdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSw0Q0FBNEM7QUFDNUMsSUFBTyxPQUFPLFdBQVcsc0JBQXNCLENBQUMsQ0FBQztBQUNqRDtJQVVJQSxjQUFZQSxPQUFPQSxFQUFDQSxVQUEyQ0E7UUFDM0RDLElBQUlBLENBQUNBLElBQUlBLEdBQUdBLE9BQU9BLENBQUNBO0lBQ3hCQSxDQUFDQTt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