picocog-ts
Version:
A tiny code generation library.
41 lines (40 loc) • 1.48 kB
TypeScript
interface IPicoWriterItem {
}
export declare class PicoWriter implements IPicoWriterItem {
protected _indents: number;
protected _numLines: number;
protected _generateIfEmpty: boolean;
protected _generate: boolean;
protected _normalizeAdjacentBlankRows: boolean;
protected _isDirty: boolean;
protected _textBuffer: string;
protected _ic: string;
protected _rows: string[][];
protected _content: IPicoWriterItem[];
constructor(initialIndent: number, indentText: string);
indentRight(): void;
indentLeft(): void;
append(inner: PicoWriter): this;
writeln(text: string): this;
writeln_r(text: string): this;
writeln_l(text: string): this;
writeln_lr(text: string): this;
writeRow(strings: string[]): this;
createWriter(): PicoWriter;
createInnerBlockWriter(startLine: string, endLine: string): PicoWriter;
isEmpty(): boolean;
write(text: string): void;
isMethodBodyEmpty(): boolean;
isGenerateIfEmpty(): boolean;
setGenerateIfEmpty(generateIfEmpty: boolean): void;
isGenerate(): boolean;
setGenerate(generate: boolean): void;
setNormalizeAdjacentBlankRows(normalizeAdjacentBlankRows: boolean): void;
toString(): string;
adjustIndents(inner: PicoWriter, indents: number, ic: string): void;
toStringWithIndent(indentBase: number): string;
private flush;
private flushRows;
private render;
}
export {};