import * as Component from './Component'; import { Command } from './Command'; import { Typer } from 'cqes-type'; export declare type commandHandler = (commmand: Command) => Promise; export declare class ConcurencyError extends Error { retry: boolean; constructor(e: Error); } export interface Subscription { abort: () => Promise; } export interface CommandTypes { [name: string]: Typer; } export interface Transport { start: () => Promise; listen: (channel: string, handler: commandHandler) => Promise; send: (command: Command) => Promise; stop: () => Promise; } export interface props extends Component.props { transport: string; channel: string; commands: CommandTypes; } export declare class CommandBus extends Component.Component { protected commands: CommandTypes; protected transport: Transport; protected channel: string; protected category: string; constructor(props: props); start(): Promise; listen(handler: commandHandler): Promise; send(id: string, order: string, data: any, meta?: any): Promise; sendCommand(command: Command): Promise; stop(): Promise; }