| 2 | import { Writer } from './Writer' |
| 3 | |
| 4 | export class DocComment implements BasicBuilder { |
| 5 | readonly lines: string[] = [] |
| 6 | |
| 7 | constructor(startingText?: string) { |
| 8 | if (startingText) { |
| 9 | this.addText(startingText) |
| 10 | } |
| 11 | } |
| 12 | |
| 13 | addText(text: string): this { |
| 14 | this.lines.push(...text.split('\n')) |
| 15 | return this |
| 16 | } |
| 17 | |
| 18 | write(writer: Writer) { |
| 19 | writer.writeLine('/**') |
| 20 | for (const line of this.lines) { |
| 21 | writer.writeLine(` * ${line}`) |
| 22 | } |
| 23 | writer.writeLine(' */') |
| 24 | return writer |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | function docComment(strings: TemplateStringsArray, ...args: string[]): DocComment |
| 29 | function docComment(startingText?: string): DocComment |
nothing calls this directly
no outgoing calls
no test coverage detected