mobile-cli-lib
Version:
common lib used by different CLI
55 lines (54 loc) • 1.63 kB
JavaScript
;
(function (CodeEntityType) {
CodeEntityType[CodeEntityType["Line"] = 0] = "Line";
CodeEntityType[CodeEntityType["Block"] = 1] = "Block";
})(exports.CodeEntityType || (exports.CodeEntityType = {}));
var CodeEntityType = exports.CodeEntityType;
var Line = (function () {
function Line(content) {
this.content = content;
}
Object.defineProperty(Line.prototype, "codeEntityType", {
get: function () {
return CodeEntityType.Line;
},
enumerable: true,
configurable: true
});
Line.create = function (content) {
return new Line(content);
};
return Line;
}());
exports.Line = Line;
$injector.register("swaggerLine", Line);
var Block = (function () {
function Block(opener) {
this.opener = opener;
this.codeEntities = [];
}
Object.defineProperty(Block.prototype, "codeEntityType", {
get: function () {
return CodeEntityType.Block;
},
enumerable: true,
configurable: true
});
Block.prototype.addBlock = function (block) {
this.codeEntities.push(block);
};
Block.prototype.addLine = function (line) {
this.codeEntities.push(line);
};
Block.prototype.addBlocks = function (blocks) {
var _this = this;
_.each(blocks, function (block) { return _this.addBlock(block); });
};
Block.prototype.writeLine = function (content) {
var line = Line.create(content);
this.codeEntities.push(line);
};
return Block;
}());
exports.Block = Block;
$injector.register("swaggerBlock", Block);