import * as Component from './Component'; import { Repository } from './Repository'; import { CommandBus } from './CommandBus'; import * as Command from './CommandHandlers'; import { EventBus } from './EventBus'; import { Command as C } from './Command'; import { Event as E } from './Event'; import { State as S } from './State'; export { Command }; export declare type emitter = Command.emitter; export interface CommandBuses { [name: string]: CommandBus; } export interface Subscription { abort: () => Promise; } export interface props extends Component.props { commandBuses?: CommandBuses; repository?: Repository; commandHandlers?: Command.Handlers; eventBus?: EventBus; } export declare class Aggregate extends Component.Component { protected commandBuses: CommandBuses; protected repository: Repository; protected commandHandlers: Command.Handlers; protected eventBus: EventBus; protected channels: Array; protected queues: Map void>>; constructor(props: props); start(): Promise; protected lock(key: string): Promise; protected getCommandHandler(command: C): Command.handler; protected handleAggregateCommand(command: C): Promise; protected handleCommand(state: S, command: C): Promise>; protected alignEvents(events: Array, version: number): void; protected unlock(key: string): void; stop(): Promise; }