export interface TerminalScreenOptions { readonly cols?: number; readonly rows?: number; readonly scrollback?: number; } export interface TerminalScreenSnapshot { readonly cols: number; readonly rows: number; readonly visibleGrid: readonly string[]; readonly scrollback: readonly string[]; readonly cursor: { readonly x: number; readonly y: number; }; } /** * Headless xterm screen model with serialized, flow-controlled writes. * * Every terminal mutation (feed, resize, backlog replay) runs through one * FIFO queue that awaits xterm's parse callback before issuing the next * write, so xterm's pending-write watermark can never be exceeded. When the * queued backlog outgrows {@link MAX_PENDING_WRITE_CHARS}, the queued writes * collapse into a single bounded history replay that reconstructs the same * screen state. After {@link TerminalScreen.dispose}, queued and future * operations settle as resolved no-ops; a terminal is never created after * disposal. */ export declare class TerminalScreen { private terminal; private readonly history; private historyLength; private readonly operations; private pendingChars; private draining; private disposed; private notifyDisposed; private readonly whenDisposed; private readonly maxReplayHistoryLength; private readonly scrollback; constructor(options?: TerminalScreenOptions); feed(data: string | Uint8Array): Promise; resize(cols: number, rows: number): Promise; /** * Resolves once everything fed before this call has been parsed. Attaches * to the queue tail instead of enqueueing a marker so a flush can never * split a tail replay (which would let over-cap feeds mint unbounded new * replay operations); only an empty queue enqueues a zero-length write. */ flush(): Promise; snapshot(): TerminalScreenSnapshot; dispose(): void; private createTerminal; private enqueue; /** * Route an over-cap feed to the queue's tail replay instead of enqueueing * another write. Replay payloads are owned snapshot strings (immune to * history trimming) bounded to the replay budget, and every coalesced feed * shares the tail's memoized promise, so a flood cannot grow the queue, * its payload memory, or its settler memory past the configured bounds. */ private coalesceFeedIntoReplay; /** * A resize whose snapshot would push the queued payload past the cap * collapses the whole queue into one resize at the latest dimensions: * every dropped operation's payload is already covered by the bounded * history snapshot, and their settlers settle with this operation. */ private coalesceQueueIntoResize; private boundReplayPayload; private drain; private run; /** A disposed terminal may never invoke its parse callback; do not hang. */ private raceDisposal; private write; private appendHistory; private trimHistory; } //# sourceMappingURL=screen.d.ts.map