/** * Alternate-screen mode for full-screen modal views (the `/traces` viewer). * * The dev TUI's transcript deliberately streams into native scrollback (see * `live-region.ts`), but a modal viewer wants the whole terminal without * fighting the transcript's repaint cycle. Entering the alternate buffer * gives the viewer a blank screen it fully owns; leaving restores the * transcript exactly where the user left it. * * Like {@link LiveRegion}, writes go through the terminal's original `write` * captured at construction so foreign-output capture never sees the paints. */ export interface AltScreenOutput { write(chunk: string): boolean; } export declare class AltScreen { #private; constructor(output: AltScreenOutput); get active(): boolean; /** Switches to the alternate buffer, hides the cursor, enables SGR mouse. */ enter(): void; /** * Paints a full-screen frame. Each row must already be styled and fit * within the terminal width (one row == one screen line); rows beyond the * terminal height are dropped. The screen is erased before the rows are * written — terminals only erase via explicit sequences, so a shrinking * frame would otherwise leave stale text behind. * * Rows are placed with absolute cursor positions rather than `\n`: a row * filling the last column leaves terminals in an autowrap-pending state * whose interaction with `\n` varies (immediate-wrap terminals insert a * phantom line). Absolute positioning is immune to all of it. */ paint(rows: readonly string[], height: number): void; /** * Writes an out-of-band sequence (e.g. an OSC 52 clipboard write) through * the same captured write the paints use, bypassing foreign-output capture. */ writeRaw(chunk: string): void; /** Restores the main screen, cursor, and mouse reporting. */ exit(): void; }