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 getEventId: (event: EventBase) => string | null; protected readonly subscriptions: Subscription[]; private _publisher; private readonly _logger; constructor(commandBus: CommandBus, moduleRef: ModuleRef); get publisher(): IEventPublisher; set publisher(_publisher: IEventPublisher); onModuleDestroy(): void; publish(event: T): any; publishAll(events: T[]): any; bind(handler: IEventHandler, id: string): void; registerSagas(types?: Type[]): void; register(handlers?: EventHandlerType[]): void; protected registerHandler(handler: EventHandlerType): void; protected ofEventId(id: string): Observable; protected registerSaga(saga: ISaga): void; private reflectEvents; private useDefaultPublisher; }