import type { FrontMcpLogger } from '../../common'; import type { ChannelInstance } from '../channel.instance'; type EventHandler = (payload: unknown) => void; /** * In-process event bus for app-event channel sources. * * Applications can emit events to this bus, and channels subscribed * to matching event names will receive them and push notifications. * * @example * ```typescript * // In your application code: * const eventBus = scope.channelEventBus; * eventBus.emit('error', { message: 'Connection failed', level: 'critical' }); * eventBus.emit('deploy', { version: '1.2.3', status: 'success' }); * ``` */ export declare class ChannelEventBus { private readonly handlers; private readonly logger; constructor(logger: FrontMcpLogger); /** * Subscribe to events of a specific name. * * @param event - The event name to subscribe to * @param handler - The handler function called with the event payload * @returns Unsubscribe function */ on(event: string, handler: EventHandler): () => void; /** * Emit an event to all subscribed handlers. * * @param event - The event name * @param payload - The event payload */ emit(event: string, payload: unknown): void; /** * Remove all handlers. */ clear(): void; /** * Get the number of registered event types. */ get eventCount(): number; } /** * Wires an app-event channel source to the ChannelEventBus. * * @param channel - The channel instance to push notifications to * @param eventName - The event name to subscribe to * @param eventBus - The event bus instance * @param logger - Logger instance * @returns Unsubscribe function */ export declare function wireAppEventSource(channel: ChannelInstance, eventName: string, eventBus: ChannelEventBus, logger: FrontMcpLogger): () => void; export {}; //# sourceMappingURL=app-event.source.d.ts.map