import EventEmitter from 'node:events'; import type { IMastraLogger } from '../../logger/index.js'; import { PubSub } from '../pubsub.js'; import type { PubSubDeliveryMode } from '../pubsub.js'; import type { Event, EventCallback, SubscribeOptions } from '../types.js'; export interface EventEmitterPubSubOptions { /** * Optional logger for surfacing batched-delivery errors. Falls back to * `console.error` when not provided. */ logger?: IMastraLogger; } export declare class EventEmitterPubSub extends PubSub { get supportedModes(): ReadonlyArray; /** * `EventEmitterPubSub` is strictly in-process, so the `AckHandleBuffer` * queue it uses for batching shares the same lifetime as everything * else here. Nothing more durable is promised, and nothing less is * needed. */ get supportsNativeBatching(): boolean; private emitter; private groups; private groupCounters; private groupListeners; private pendingNacks; private deliveryAttempts; private fanoutWrappers; private batchBuffers; private readonly logger?; constructor(existingEmitter?: EventEmitter, options?: EventEmitterPubSubOptions); /** * Debug-hostile silent failures are the default for emitter listeners. * Surface buffer-side errors on a single channel so they're at least visible. */ private logBufferError; publish(topic: string, event: Omit, _options?: { localOnly?: boolean; }): Promise; subscribe(topic: string, cb: EventCallback, options?: SubscribeOptions): Promise; unsubscribe(topic: string, cb: EventCallback): Promise; flush(): Promise; /** * Clean up all listeners during graceful shutdown. */ close(): Promise; private subscribeWithGroup; private deliverToGroup; } //# sourceMappingURL=index.d.ts.map