/** * @license * Copyright 2023 Nuraly, Laabidi Aymen * SPDX-License-Identifier: MIT */ /** * Simple event bus for internal event management * Used by the core controller to emit events for plugins and internal communication */ export declare class EventBus { private listeners; /** * Subscribe to an event * @param event - Event name to subscribe to * @param handler - Function to call when event is emitted * @returns Unsubscribe function */ on(event: string, handler: Function): () => void; /** * Subscribe to an event only once * @param event - Event name to subscribe to * @param handler - Function to call when event is emitted */ once(event: string, handler: Function): void; /** * Unsubscribe from an event * @param event - Event name to unsubscribe from * @param handler - Handler to remove */ off(event: string, handler: Function): void; /** * Emit an event * @param event - Event name to emit * @param data - Data to pass to handlers */ emit(event: string, data?: any): void; /** * Remove all listeners for an event or all events * @param event - Optional event name. If not provided, removes all listeners */ removeAllListeners(event?: string): void; /** * Get the number of listeners for an event * @param event - Event name * @returns Number of listeners */ listenerCount(event: string): number; /** * Get all event names that have listeners * @returns Array of event names */ eventNames(): string[]; } //# sourceMappingURL=event-bus.d.ts.map