import { ResultType } from './constants';
import { ICommandHandler } from './interfaces/commandHandler.interface';
import { IType } from './interfaces/type.interface';
import { CommandType } from './models/command';
import { CommandBusOptions } from './models/commandBusOptions';
import { CommandContext } from './models/context';
export declare type HandlerType = IType<ICommandHandler>;
export declare abstract class CommandBus {
    protected handlers: Map<string, ICommandHandler<CommandType<any>, CommandContext>>;
    protected plugins: any;
    protected name: string;
    protected injectionResolver: CommandBusOptions['injectionResolver'];
    constructor(options?: CommandBusOptions);
    protected bind<T extends CommandType = CommandType>(handlerInstance: ICommandHandler<T>, commandName: string): void;
    registerHandlerInstance(handlerInstance: ICommandHandler): void;
    registerHandlersInstances(handlersInstances?: ICommandHandler[]): void;
    registerHandlerFactory(Handler: IType<ICommandHandler>, injectionResolver?: CommandBusOptions['injectionResolver']): void;
    registerHandlersFactories(handlersFactories?: Array<IType<ICommandHandler>>, injectionResolver?: CommandBusOptions['injectionResolver']): void;
    execute<T extends CommandType = CommandType>(command: T): T[ResultType];
    protected executeByName<T extends CommandType = CommandType>(commandName: string, data: T): T[ResultType];
}
