import { AggregateRoot } from './aggregate-root'; import { EventBus } from './event-bus'; import { IEvent } from './interfaces'; import { AsyncContext } from './scopes'; export interface Constructor { new (...args: any[]): T; } /** * @publicApi */ export declare class EventPublisher { private readonly eventBus; constructor(eventBus: EventBus); /** * Merge the event publisher into the provided class. * This is required to make `publish` and `publishAll` available on the `AggregateRoot` class. * @param metatype The class to merge into. * @param asyncContext The async context (if scoped). */ mergeClassContext>>(metatype: T, asyncContext?: AsyncContext): T; /** * Merge the event publisher into the provided object. * This is required to make `publish` and `publishAll` available on the `AggregateRoot` class instance. * @param object The object to merge into. * @param asyncContext The async context (if scoped). */ mergeObjectContext>(object: T, asyncContext?: AsyncContext): T; }