import type { CoreRuntime } from '../core/runtime.js'; import type { CoreTerminal } from '../core/terminal.js'; import type { TerminalBufferState } from '../core/types.js'; import type { RetainedRowChanges, XtermCompatibilityRow } from './xterm-compatibility.js'; /** * Reads the retained rows of a main-thread terminal on demand, in the packed xterm cell format. * * @remarks * Ghostty only reads the active screen. While the alternate screen is active, the normal screen * is read from a clone that is created on first use and dropped by {@link RetainedBuffer.changed}. * The owner calls {@link RetainedBuffer.changed} after every state change, which also notifies * listeners. * @internal */ export declare class RetainedBuffer { private readonly runtime; private readonly terminal; private readonly listeners; private normalClone; private disposed; constructor(runtime: CoreRuntime, terminal: CoreTerminal); /** Active-screen metadata. */ state(): TerminalBufferState; /** Active-screen rows in `[start, end)`. */ rows(start: number, end: number): readonly XtermCompatibilityRow[]; /** How the active screen's rows moved and changed since the previous call. */ changes(): RetainedRowChanges; /** Normal-screen metadata, also while the alternate screen is active. */ normalState(): TerminalBufferState; /** Normal-screen rows in `[start, end)`, also while the alternate screen is active. */ normalRows(start: number, end: number): readonly XtermCompatibilityRow[]; /** Calls `listener` after every change reported to {@link RetainedBuffer.changed}. */ onChange(listener: () => void): { readonly dispose: () => void; }; /** Drops the normal-screen clone and notifies listeners that the terminal changed. */ changed(): void; dispose(): void; private normalTerminal; private dropClone; } //# sourceMappingURL=retained-buffer.d.ts.map