Printer
sourceA Printer which prints to a file.
Constructors
new Printer(fs: __module, path: string, options: Partial<PrinterOptions>): Printersource
Properties
buffer: stringsource
currentIndent: stringsource
finalised: booleansource
fs: __modulesource
options: PrinterOptionssource
path: stringsource
storedBlockIndent: stringsource
instances: Set<Printer>source
Methods
Static methods
addImportPathMap(this: HasImportPathMap, from: string, to: string): voidsource
finaliseAll(): voidsource
rewriteImportPath(this: HasImportPathMap, pathOfSourceFile: string, pathOfImport: string): stringsource
Instance methods
beforeFinalise(): voidsource
continueLastBlockIndent(): voidsource
decreaseIndent(): voidsource
finalise(): voidsource
getAndClearBuffer(): stringsource
getIndent(): stringsource
getIndentLevel(): numbersource
increaseIndent(): voidsource
print(s: string): voidsource
printBlock(block: string): voidsource
printDocComment(doc: string): voidsource
printLine(s: string = ""): voidsource
printLines(lines: readonly string[], options: PrintLinesOptions): voidsource
printNewline(): voidsource
printWrapped(text: string, options: PrintLinesOptions): voidsource
printYamlText(text: string): voidsource
resetIndent(indent: string = ""): voidsource
withIndent(then: Function): voidsource
withOutdent(then: Function): voidsource
wrapText(text: string, offsetLength: number = 0): string[]source