/** * [WHO]: StdinBuffer class - buffers input and emits complete sequences * [FROM]: Depends on node:events * [TO]: Consumed by core/lib/tui/src/index.ts, TUI input handling * [HERE]: core/lib/tui/src/stdin-buffer.ts - input buffering for terminal sequences * * Buffers stdin data events that arrive in partial chunks, especially for * escape sequences like mouse events. Based on OpenTUI. */ import { EventEmitter } from "events"; export type StdinBufferOptions = { /** * Maximum time to wait for sequence completion (default: 10ms) * After this time, the buffer is flushed even if incomplete */ timeout?: number; }; export type StdinBufferEventMap = { data: [string]; paste: [string]; }; /** * Buffers stdin input and emits complete sequences via the 'data' event. * Handles partial escape sequences that arrive across multiple chunks. */ export declare class StdinBuffer extends EventEmitter { private buffer; private timeout; private readonly timeoutMs; private pasteMode; private pasteBuffer; constructor(options?: StdinBufferOptions); process(data: string | Buffer): void; flush(): string[]; clear(): void; getBuffer(): string; destroy(): void; }