/** * In-app scroll buffer. * * Covers cavekit-fullscreen-viewport R5 (buffer semantics), R6 (scroll controls). * The buffer owns the session transcript; the TUI renders whatever slice the * buffer exposes for the current viewport. */ export type ScrollMode = "tail" | "paused"; export interface ScrollBufferOptions { maxLines?: number; wrap?: boolean; } /** * Session transcript with viewport and follow-tail semantics. * * The buffer stores raw "logical" lines as appended. For rendering, lines are * soft-wrapped to the current viewport width producing "display" lines. The * viewport is defined in display lines, so the scroll math operates on the * post-wrap stream and stays consistent after resize. */ export declare class ScrollBuffer { private logical; private wrapEnabled; private readonly maxLines; private wrappedCache; private cachedWidth; private viewportWidth; private viewportHeight; /** Offset from the top of the wrapped stream (display-line index of viewport top). */ private topOffset; private _mode; private _unseen; constructor(opts?: ScrollBufferOptions); append(lines: string[]): void; /** * Replace the last `count` logical lines with `lines`. Used for streaming * updates to a single message that grows in-place. Tail/paused behavior * mirrors append(). */ replaceTail(count: number, lines: string[]): void; replaceAll(lines: string[]): void; clear(): void; setViewportHeight(rows: number): void; setViewportWidth(cols: number): void; get totalLines(): number; get viewHeight(): number; get viewWidth(): number; scrollBy(delta: number): void; pageUp(): void; pageDown(): void; halfPageUp(): void; halfPageDown(): void; jumpToTop(): void; jumpToTail(): void; get isAtTail(): boolean; get mode(): ScrollMode; unseenCount(): number; /** Returns exactly viewportHeight display lines (pads with "" when short). */ render(): string[]; private setMode; private snapToTail; private clampTopOffset; private trimToMax; private invalidateCache; private getWrapped; private countDisplayLines; } //# sourceMappingURL=scroll-buffer.d.ts.map