Printer

source

A Printer which prints to a file.

Constructors

new Printer(fs: __module, path: string, options: Partial<PrinterOptions>): Printersource

Properties

buffer: stringsource

currentIndent: stringsource

finalised: booleansource

readonlyfs: __modulesource

options: PrinterOptionssource

readonlypath: stringsource

storedBlockIndent: stringsource

staticinstances: Set<Printer>source

Methods

Static methods

staticaddImportPathMap(this: HasImportPathMap, from: string, to: string): voidsource

staticfinaliseAll(): voidsource

staticrewriteImportPath(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