/**
 * EventBus - Global event bus singleton and convenience functions
 *
 * Provides centralized event management for the application.
 */
import { TypedEventEmitter } from './typed-emitter.js';
/**
 * EventBus - A global event bus for application-wide events
 */
export class EventBus extends TypedEventEmitter {
    // Using unknown to allow flexible typing for singleton pattern
    static instance = null;
    /**
     * Get the singleton instance
     */
    static getInstance() {
        if (!EventBus.instance) {
            EventBus.instance = new EventBus();
        }
        return EventBus.instance;
    }
    /**
     * Reset the singleton instance (mainly for testing)
     */
    static resetInstance() {
        if (EventBus.instance) {
            EventBus.instance.dispose();
            EventBus.instance = null;
        }
    }
}
// ============================================================================
// Global Event Bus (Unified)
// ============================================================================
/**
 * Get the global typed event bus with all events
 */
export function getGlobalEventBus() {
    return EventBus.getInstance();
}
// Export a default event bus instance (backward compatible)
export function getEventBus() {
    return EventBus.getInstance();
}
// Export convenience function to reset the event bus (for testing)
export function resetEventBus() {
    EventBus.resetInstance();
}
//# sourceMappingURL=event-bus.js.map