/// import { TtyRenderWindowRow } from './TtyRenderWindowRow.js'; export interface TtyRenderWindowOptions { disableWordWrap?: boolean; fps?: number; stream?: NodeJS.WriteStream; } export declare class TtyRenderWindow { private readonly _requestRender; private readonly disableWordWrap; private readonly rows; private readonly stream; private readonly unsubscribes; private deletedRowsSinceLastRender; private ended; /** * Whether this instance is connected to a TTY. If not, only interrupts will * be rendered. */ get enabled(): boolean; /** * Get the number of rows in this window. */ get height(): number; /** * The height of the terminal in characters, if available. */ get windowHeight(): number; /** * The width of the terminal in characters, if available. */ get windowWidth(): number; /** * Create a new instance. */ constructor({ disableWordWrap, fps, stream, }?: TtyRenderWindowOptions); /** * Add a new row to the current instance. * @param row The row to add * @param index The index to insert the row at. Defaults to the end of the * list. If negative, insert this many rows from the end. */ add(row: TtyRenderWindowRow, index?: number): void; /** * Stop rendering all rows. * @param clear True to remove all the output. */ close(clear?: boolean): void; /** * Interrupt the render window to log a line out to the underlying stream. * @param text The text to output to the stream. */ interrupt(text: string): void; /** * Remove the specified row (or row index), optionally replacing it with given * text. The replacement text, if given, will always be logged first, followed * by the remaining rows in the window on the next render. If no replacement * text is given, the last line of the output will be blanked. * @param row The row instance, or index to remove. * @param replace Optional text to output in place of the row. */ remove(row: TtyRenderWindowRow | number, replace?: string): void; /** * Request a render. This will be throttled to the FPS value given in the * constructor. */ render(): void; /** * Log the given text and deal with clearing any existing render window * output. * @param text The text to log. */ private _interruptNoRenderTrigger; /** * Remove the specified row (or row index), optionally replacing it with given * text. The replacement text, if given, will always be logged first, followed * by the remaining rows in the window on the next render. If no replacement * text is given, the last line of the output will be blanked. * @param row The row instance, or index to remove. * @param replace Optional text to output in place of the row. */ private _removeNoRenderTrigger; /** * Output the row data to the underlying stream, if it is a TTY. * @param noResetCursor True to skip resetting the cursor to the start of the * window. */ private _render; } //# sourceMappingURL=TtyRenderWindow.d.ts.map