/** * Pre-handshake / reconnect outbox. * * Buffers frames produced while the WebSocket isn't OPEN and replays them * in FIFO order on `flush(send)`. Capped to defend against OOM if the * bridge is unreachable for an extended period. * * `sticky` marks frames that must survive eviction even when the outbox * is full — currently used for rrweb chunks containing a FullSnapshot * (type:2) baseline. Without this protection, the FullSnapshot — being * the oldest frame in the outbox — was always the first to be FIFO- * evicted under load, leaving the session permanently unreplayable. * Eviction only touches sticky frames as a last resort (all remaining * frames are sticky and we still exceed cap). */ export declare class Outbox { private readonly maxFrames; private readonly maxBytes; private entries; private bytes; constructor(maxFrames: number, maxBytes: number); /** Current buffered frame count. */ get size(): number; /** Current buffered byte size. */ get byteSize(): number; /** Inspect entries without exposing the underlying mutable array. */ snapshot(): ReadonlyArray<{ payload: string; sticky: boolean; }>; enqueue(payload: string, sticky: boolean): void; /** * Drain FIFO into `send`. If `send` throws (or returns false), keep the * frame in the queue and bail — caller will retry on next flush. */ flush(send: (payload: string) => boolean | void): void; }