feat(ts-protoc-gen): initial commit, broken

This commit is contained in:
41666 2020-10-11 18:34:46 -04:00
parent 9823670084
commit 291ec9576f
20 changed files with 1887 additions and 0 deletions

View file

@ -0,0 +1,26 @@
import {Printer} from "./Printer";
import {generateIndent} from "./util";
export class CodePrinter {
private indentation: string;
constructor(private depth: number, private printer: Printer) {
this.indentation = generateIndent(1);
}
indent() {
this.depth++;
return this;
}
dedent() {
this.depth--;
return this;
}
printLn(line: string) {
this.printer.printLn(new Array(this.depth + 1).join(this.indentation) + line);
return this;
}
printEmptyLn() {
this.printer.printEmptyLn();
return this;
}
}