import type { IContainer } from 'node-cqrs'; import type { CommandOptions, ICommand, ICommandBus, IMessageHandler, IMessageMeta } from '../interfaces/index.ts'; import { type Subscription } from './RabbitMqGateway.ts'; export type RabbitMqCommandBusConfig = Partial>; /** * RabbitMQ-backed command bus: delivers each message to exactly * one consumer via a durable named queue. * * Used for point-to-point command delivery or durable event processing. */ export declare class RabbitMqCommandBus implements ICommandBus { #private; static DEFAULT_EXCHANGE: string; static DEFAULT_QUEUE_NAME: string; constructor({ rabbitMqGateway, rabbitMqCommandBusConfig }: Pick); /** * Format and send a command for execution */ send(commandType: string, aggregateId?: string, options?: CommandOptions): Promise; /** * Sends a pre-built command to the exchange, routed to the durable queue. * Exactly one consumer will process it. */ send(command: ICommand, meta?: IMessageMeta): Promise; /** @deprecated Use {@link send} */ sendRaw(command: ICommand, meta?: IMessageMeta): Promise; /** * Registers a message handler for a specific message type on the durable queue. * Only one consumer receives each message. */ on(messageType: string, handler: IMessageHandler): Promise; /** * Removes a previously registered message handler. */ off(messageType: string, handler: IMessageHandler): Promise; }