/** * Generic StringTemplate output writer filter. *
* Literals and the elements of expressions are emitted via {@link #write(String)}. * Separators are emitted via {@link #writeSeparator(String)} because they must be * handled specially when wrapping lines (we don't want to wrap * in between an element and it's separator).
*/ export interface STWriter { pushIndentation(indent: string): void; popIndentation(): string | null; pushAnchorPoint(): void; popAnchorPoint(): void; setLineWidth(lineWidth: number): void; /** * Write the string and return how many actual characters were written. * With auto-indentation and wrapping, more chars than {@code str.length()} * can be emitted. No wrapping is done. */ write(str: string): number; /** * Same as write, but wrap lines using the indicated string as the * wrap character (such as {@code "\n"}). */ write(str: string, wrap: string): number; /** * Because we evaluate ST instance by invoking * {@link Interpreter#exec(STWriter, InstanceScope)} again, we can't pass options in. * So the {@link Bytecode#INSTR_WRITE} instruction of an applied template * (such as when we wrap in between template applications like * {@code