UNPKG

895 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var util_1 = require("./util");
4var CodePrinter = (function () {
5 function CodePrinter(depth, printer) {
6 this.depth = depth;
7 this.printer = printer;
8 this.indentation = util_1.generateIndent(1);
9 }
10 CodePrinter.prototype.indent = function () {
11 this.depth++;
12 return this;
13 };
14 CodePrinter.prototype.dedent = function () {
15 this.depth--;
16 return this;
17 };
18 CodePrinter.prototype.printLn = function (line) {
19 this.printer.printLn(new Array(this.depth + 1).join(this.indentation) + line);
20 return this;
21 };
22 CodePrinter.prototype.printEmptyLn = function () {
23 this.printer.printEmptyLn();
24 return this;
25 };
26 return CodePrinter;
27}());
28exports.CodePrinter = CodePrinter;
29//# sourceMappingURL=CodePrinter.js.map
\No newline at end of file