//#region src/stream.d.ts export type SlowSubscriberPolicy = "disconnect" | "drop-oldest"; export type FanoutEvent = { type: "subscriber-overflow"; subscriberId: string; droppedBytes: number; policy: SlowSubscriberPolicy; } | { type: "subscriber-closed"; subscriberId: string; reason?: string; }; export type TerminalSubscription = AsyncIterable & { readonly id: string; close(reason?: string): void; }; export declare class BoundedReplayBuffer { readonly maxBytes: number; private chunks; private storedBytes; constructor(maxBytes?: number); get byteLength(): number; append(bytes: Uint8Array): void; snapshot(): Uint8Array[]; clear(): void; private trim; } export type TerminalFanoutOptions = { replayBytes?: number; subscriberBufferBytes?: number; slowSubscriberPolicy?: SlowSubscriberPolicy; onEvent?: (event: FanoutEvent) => void; }; export declare class TerminalFanout { private readonly replay; private readonly subscriberBufferBytes; private readonly slowSubscriberPolicy; private readonly onEvent?; private readonly subscribers; private closed; constructor(options?: TerminalFanoutOptions); get subscriberCount(): number; publish(bytes: Uint8Array): void; subscribe(id: string, options?: { replay?: boolean; }): TerminalSubscription; close(reason?: string): void; private removeSubscriber; } export type BatchPublisherOptions = { maxBatchBytes?: number; flushIntervalMs?: number; signal?: AbortSignal; onError?: (error: unknown) => void; }; export declare class BatchPublisher { private readonly sink; private readonly maxBatchBytes; private readonly flushIntervalMs; private readonly onError?; private chunks; private bytes; private timer; private pending; private failure; private stopped; private abortSignal?; private abortHandler?; constructor(sink: (bytes: Uint8Array) => Promise, options?: BatchPublisherOptions); write(bytes: Uint8Array): void; flush(): Promise; stop(): Promise; private dropBufferedChunks; private clearTimer; private detachAbort; } //#endregion