/**
 * BaseObservabilityEventBus - Generic event bus for observability events.
 *
 * Provides a synchronous pub/sub mechanism:
 * - Events are dispatched to subscribers immediately on emit()
 * - Graceful error handling (handler errors don't break other handlers)
 * - flush() awaits any in-flight async subscriber promises
 * - Clean shutdown flushes then clears subscribers
 *
 * Buffering/batching is intentionally NOT done here — individual exporters
 * own their own batching strategy.
 */
import { MastraBase } from '@mastra/core/base';
import type { ObservabilityEventBus } from '@mastra/core/observability';
export declare class BaseObservabilityEventBus<TEvent> extends MastraBase implements ObservabilityEventBus<TEvent> {
    private subscribers;
    /** In-flight async subscriber promises. Self-cleaning via .finally(). */
    private pendingSubscribers;
    constructor({ name }?: {
        name?: string;
    });
    /**
     * Dispatch an event to all subscribers synchronously.
     * Async handler promises are tracked internally and drained by {@link flush}.
     *
     * @param event - The event to broadcast to subscribers.
     */
    emit(event: TEvent): void;
    /**
     * Register a handler to receive future events.
     *
     * @param handler - Callback invoked synchronously on each {@link emit}.
     * @returns An unsubscribe function that removes the handler.
     */
    subscribe(handler: (event: TEvent) => void): () => void;
    /** Max flush drain iterations before bailing — prevents infinite loops when handlers re-emit. */
    private static readonly MAX_FLUSH_ITERATIONS;
    /** Await all in-flight async subscriber promises, draining until empty. */
    flush(): Promise<void>;
    /** Flush pending promises, then clear all subscribers. */
    shutdown(): Promise<void>;
}
//# sourceMappingURL=base.d.ts.map