/** * LogicalBuffer: A buffer where each row can have arbitrary length. * This is the core abstraction for content that may wrap at terminal edges. */ import { type Cell, type Style } from "./cell.js"; /** * A logical row is a variable-length array of cells. */ export interface LogicalRow { cells: Cell[]; } /** * LogicalBuffer stores content as logical rows (arbitrary length). * Terminal wrapping is handled at render time, not storage time. */ export declare class LogicalBuffer { private rows; readonly height: number; constructor(height: number); /** * Get a cell at logical position (x, y). * Returns EMPTY_CELL if out of bounds. */ get(x: number, y: number): Cell; /** * Set a cell at logical position (x, y). * Extends the row if needed. */ set(x: number, y: number, cell: Cell): void; /** * Set a cell at logical position (x, y), merging style with existing cell. * Preserves background color if the new style doesn't specify one. */ setMerge(x: number, y: number, cell: Cell): void; /** * Get the length of a logical row. */ rowLength(y: number): number; /** * Get a logical row. */ getRow(y: number): LogicalRow | undefined; /** * Write a string starting at (x, y). * The row extends as needed - no clipping. */ writeString(x: number, y: number, text: string, style?: Style): void; /** * Write a string, merging style with existing cells. */ writeStringMerge(x: number, y: number, text: string, style?: Style): void; /** * Clear a row. */ clearRow(y: number): void; /** * Clear the entire buffer. */ clear(): void; /** * Transform logical rows to visual rows based on terminal width. * Returns an array of visual rows and a mapping from logical row to starting visual row. */ toVisualRows(terminalWidth: number): { visualRows: Cell[][]; logicalToVisual: number[]; }; /** * Check if two logical buffers are equal. */ equals(other: LogicalBuffer): boolean; /** * Clone this buffer. */ clone(): LogicalBuffer; /** * Debug string representation. */ toDebugString(): string; } //# sourceMappingURL=logical-buffer.d.ts.map