/** * Async FIFO queue with `for await` support. * * Replaces the ad-hoc `eventQueue + resolveWaiting` single-slot pattern that * the streaming direct turn used to manage run events. The previous pattern was * lossy if two pushes landed before the single waiter resumed; this queue buffers * until consumed, supports an explicit bound, and drains cleanly on close. */ export interface AsyncQueueOptions { /** Maximum buffer size. Lossy events are evicted; critical-only overflow fails fast. */ maxBuffered?: number; isDroppable?: (value: T) => boolean; } export declare class AsyncQueueOverflowError extends Error { readonly maxBuffered: number; constructor(maxBuffered: number); } export declare class AsyncQueue implements AsyncIterable { private readonly options; private readonly buffer; private readonly waiters; private closed; private dropped; constructor(options?: AsyncQueueOptions); /** Push a value to the queue. No-op when the queue is closed. */ push(value: T): boolean; get droppedCount(): number; /** Close the queue. Pending iterators drain any buffered values and then complete. */ close(): void; /** True if the queue is closed and the internal buffer is drained. */ get isDrained(): boolean; [Symbol.asyncIterator](): AsyncIterator; }