import { Command } from './Command';
import { ICommandHandler } from './CommandHandler';
import { CommandResponse } from './CommandResponse';
export type CommandHandlerType = ICommandHandler<Command<CommandResponse>>;
export interface ICommandBus<T extends CommandResponse> {
    execute<X extends T>(command: Command<X>): Promise<X>;
    bind<X extends T>(handler: ICommandHandler<Command<X>>, id: string): void;
}
export declare class CommandBus<T extends CommandResponse = CommandResponse> implements ICommandBus<T> {
    handlers: Map<string, {
        execute(command: Command<T>): Promise<T>;
    }>;
    constructor();
    execute<X extends T>(command: Command<X>): Promise<X>;
    bind<X extends T>(handler: ICommandHandler<Command<X>>, id: string): void;
    private getCommandId;
    protected registerHandlers(handlers: CommandHandlerType[]): void;
    private reflectCommandId;
}
