import { StashedMessage } from "./actor.js"; export type MailboxOverflowStrategy = "drop-newest" | "drop-oldest" | "error"; export interface MailboxConfig { /** Maximum number of messages. undefined = unbounded (default, backwards-compatible) */ maxSize?: number; /** What to do when mailbox is full. Default: "drop-newest" */ overflowStrategy?: MailboxOverflowStrategy; } export declare const DEFAULT_MAILBOX_CONFIG: MailboxConfig; /** * Ring-buffer backed mailbox with O(1) enqueue and dequeue. * * The buffer grows dynamically (doubles) when full, avoiding the O(n) * cost of Array.shift() that dominated the previous implementation. * For bounded mailboxes, the ring never exceeds maxSize. */ export declare class BoundedMailbox { private readonly maxSize?; private readonly overflowStrategy; private buf; private head; private tail; private size; private droppedCount; constructor(config?: MailboxConfig); get length(): number; get dropped(): number; get isFull(): boolean; get capacity(): number | undefined; enqueue(msg: StashedMessage): boolean; dequeue(): StashedMessage | undefined; unshift(...msgs: StashedMessage[]): void; clear(): void; drain(): StashedMessage[]; toArray(): StashedMessage[]; replaceWith(msgs: StashedMessage[]): void; [Symbol.iterator](): Iterator; /** Double the internal buffer, preserving element order. */ private grow; } //# sourceMappingURL=mailbox.d.ts.map