import { OnModuleDestroy, Type } from '@nestjs/common'; import { ModuleRef } from '@nestjs/core'; import { Observable, Subscription } from 'rxjs'; import { CommandBus } from './command-bus'; import { IEvent, IEventBus, IEventHandler, IEventPublisher, ISaga } from './interfaces'; import { ObservableBus } from './utils'; export declare type EventHandlerType = Type>; export declare class EventBus extends ObservableBus implements IEventBus, OnModuleDestroy { private readonly commandBus; private readonly moduleRef; protected getEventName: (event: EventBase) => string; protected readonly subscriptions: Subscription[]; private _publisher; constructor(commandBus: CommandBus, moduleRef: ModuleRef); get publisher(): IEventPublisher; set publisher(_publisher: IEventPublisher); onModuleDestroy(): void; publish(event: T): Promise; publishAll(events: T[]): Promise; bind(handler: IEventHandler, name: string): void; registerSagas(types?: Type[]): void; register(handlers?: EventHandlerType[]): void; protected registerHandler(handler: EventHandlerType): void; protected ofEventName(name: string): Observable; protected registerSaga(saga: ISaga): void; private reflectEventsNames; private useDefaultPublisher; }