protoc-gen-grpc
Version:
Protocol Buffers Compiler (protoc) plugin for generating grpc interfaces in TypeScript..
31 lines (23 loc) • 582 B
text/typescript
import {Utility} from './Utility';
export class Printer {
indentStr: string;
output: string = '';
constructor(indentLevel: number) {
this.indentStr = Utility.generateIndent(indentLevel);
}
printLn(str: string) {
this.output += this.indentStr + str + '\n';
}
print(str: string) {
this.output += str;
}
printEmptyLn() {
this.output += '\n';
}
printIndentedLn(str: string) {
this.output += this.indentStr + ' ' + str + '\n';
}
getOutput(): string {
return this.output;
}
}