import type { CommandOptions, ICommand, ICommandBus, IEvent, IEventBus, IMessageHandler, IMessageMeta, IObservable, IObservableQueueProvider } from '../interfaces/index.ts'; /** * Default implementation of the message bus. * Keeps all subscriptions and messages in memory. */ export declare class InMemoryMessageBus implements IEventBus, ICommandBus, IObservableQueueProvider { protected handlers: Map>; protected uniqueEventHandlers: boolean; protected queueName: string | undefined; protected queues: Map; constructor({ queueName, uniqueEventHandlers }?: { queueName?: string; uniqueEventHandlers?: boolean; }); /** * Subscribe to message type */ on(messageType: string, handler: IMessageHandler): void; /** * Get or create a named queue. * Named queues support only one handler per event type. */ queue(queueName: string): IObservable; /** * Remove subscription */ off(messageType: string, handler: IMessageHandler): void; /** * Send command to exactly 1 command handler */ send(commandType: string, aggregateId?: string, options?: CommandOptions): Promise; /** * Send pre-built command to exactly 1 command handler */ send(command: ICommand, meta?: IMessageMeta): Promise; /** @deprecated Use {@link send} */ sendRaw(command: ICommand): Promise; /** * Publish event to all subscribers (if any) */ publish(event: IEvent, meta?: Record): Promise; }