import { Buffer } from "node:buffer"; import { EventEmitter } from "node:events"; export interface StdinBufferOptions { timeout?: number; /** * Flush timeout used specifically when the buffer contains only a lone ESC. * * Terminals send many escape sequences (CSI/OSC/SGR mouse) that start with ESC, * but stream chunking can split the leading ESC from the rest of the sequence. * Using a slightly longer timeout for a lone ESC reduces cases where ESC is * emitted as a standalone key and the remaining bytes leak as literal input. */ escTimeout?: number; } export interface StdinBufferEventMap { data: [string]; paste: [string]; } export declare class StdinBuffer extends EventEmitter { private buffer; private timeout; private readonly timeoutMs; private readonly escTimeoutMs; private pendingEscContinuation; private pasteMode; private pasteBuffer; constructor(options?: StdinBufferOptions); process(data: string | Buffer): void; flush(): string[]; clear(): void; getBuffer(): string; destroy(): void; }