/**
 * ObservabilityBus - Unified event bus for all observability signals.
 *
 * Routes events to registered exporters and an optional bridge based on event
 * type. Each handler declares which signals it supports by implementing the
 * corresponding method (onTracingEvent, onLogEvent, onMetricEvent,
 * onScoreEvent, onFeedbackEvent).
 *
 * Handler presence = signal support. If a handler does not implement a method,
 * events of that type are silently skipped for that handler.
 */
import type { ObservabilityExporter, ObservabilityBridge, ObservabilityEvent, ObservabilityDropEvent, SerializationOptions } from '@mastra/core/observability';
import { BaseObservabilityEventBus } from './base.js';
/**
 * Unified event bus for all observability signals (tracing, logs, metrics, scores, feedback).
 * Routes events to registered exporters and an optional bridge.
 */
export declare class ObservabilityBus extends BaseObservabilityEventBus<ObservabilityEvent> {
    private exporters;
    private bridge?;
    /** In-flight handler promises from routeToHandler. Self-cleaning via .finally(). */
    private pendingHandlers;
    private handlerBufferFlushDepth;
    private dropEventsEmittedDuringHandlerFlush;
    /** Resolved deepClean options applied to non-tracing events before fan-out. */
    private deepCleanOptions;
    constructor(opts?: {
        serializationOptions?: SerializationOptions;
    });
    /**
     * Register an exporter to receive routed events.
     * Duplicate registrations (same instance) are silently ignored.
     *
     * @param exporter - The exporter to register.
     */
    registerExporter(exporter: ObservabilityExporter): void;
    /**
     * Unregister an exporter.
     *
     * @param exporter - The exporter instance to remove.
     * @returns `true` if the exporter was found and removed, `false` otherwise.
     */
    unregisterExporter(exporter: ObservabilityExporter): boolean;
    /**
     * Get registered exporters (read-only snapshot).
     */
    getExporters(): readonly ObservabilityExporter[];
    /**
     * Register a bridge to receive all routed events alongside exporters.
     * Only one bridge can be registered at a time; replacing an existing bridge
     * logs a warning.
     *
     * @param bridge - The bridge to register.
     */
    registerBridge(bridge: ObservabilityBridge): void;
    /**
     * Unregister the bridge.
     *
     * @returns `true` if a bridge was registered and removed, `false` otherwise.
     */
    unregisterBridge(): boolean;
    /**
     * Get the registered bridge, if any.
     */
    getBridge(): ObservabilityBridge | undefined;
    /**
     * Emit an event: route to exporter/bridge handlers, then forward to base
     * class for subscriber delivery.
     *
     * emit() is synchronous — async handler promises are tracked internally
     * and can be drained via flush().
     */
    emit(event: ObservabilityEvent): void;
    /**
     * Emit exporter pipeline drop events to exporters and the bridge.
     *
     * Drop events describe exporter health, not user observability data, so they
     * are intentionally not delivered to generic event-bus subscribers.
     */
    emitDropEvent(event: ObservabilityDropEvent): void;
    /**
     * Track an async handler promise so flush() can await it.
     * No-ops for sync (void) results.
     */
    private trackPromise;
    /** Await in-flight routed handler promises, draining until empty. */
    private drainPendingHandlers;
    /** Drain exporter and bridge SDK-internal buffers. */
    private flushHandlerBuffers;
    /**
     * Multi-phase flush to ensure all observability data is fully exported.
     *
     * **Phase 1 — Delivery:** Await all in-flight handler promises (exporters,
     * bridge, and base-class subscribers). After this resolves, all event data
     * has been delivered to handler methods.
     *
     * **Phase 2 — Buffer drain:** Call flush() on each exporter and bridge to
     * drain their SDK-internal buffers (e.g., OTEL BatchSpanProcessor, Langfuse
     * client queue). Phases are sequential — buffer drains must not start until
     * delivery completes, otherwise exporters would flush empty buffers.
     *
     * Exporter flushes can emit drop events. When that happens, flush loops
     * through delivery and buffer drain again so alerting integrations that buffer
     * drop notifications are drained before returning.
     */
    flush(): Promise<void>;
    /** Flush all pending events and exporter buffers, then clear subscribers. */
    shutdown(): Promise<void>;
}
//# sourceMappingURL=observability-bus.d.ts.map