import { type IEvent, type IEventSet, type IMessageHandler, type IObservable, type IEventStream, type IEventStore, type EventQueryAfter, type EventQueryBefore, type Identifier, type IEventBus, type IContainer, type AggregateEventsQueryParams } from './interfaces/index.ts'; export declare class EventStore implements IEventStore { #private; readonly eventBus: IEventBus; constructor({ eventStorage, eventStorageReader, identifierProvider, snapshotStorage, eventBus, eventDispatcher, eventDispatchPipeline, eventDispatchPipelines, tracerFactory, logger }: Pick); /** * Generates and returns a new unique identifier using the configured identifier provider. * * @returns A promise resolving to a unique identifier suitable for aggregates, sagas, and events. */ getNewId(): Promise; getEventsByTypes(eventTypes: Readonly, options?: EventQueryAfter): IEventStream; /** Retrieve all events of specific Aggregate */ getAggregateEvents(aggregateId: Identifier, options?: AggregateEventsQueryParams): IEventStream; /** Retrieve events of specific Saga */ getSagaEvents(sagaId: Identifier, filter: EventQueryBefore): AsyncGenerator, void, any>; /** * Validate events, commit to storage and publish to eventBus, if needed * * @param events - a set of events to commit * @returns Signed and committed events */ dispatch(events: IEventSet, meta?: Record): Promise; /** Get a promise that resolves when all in-flight fire-and-forget event bus publishes have settled */ drain(): Promise; on(messageType: string, handler: IMessageHandler): void; off(messageType: string, handler: IMessageHandler): void; queue(name: string): IObservable; /** Creates one-time subscription for one or multiple events that match a filter */ once(messageTypes: string | string[], handler?: IMessageHandler, filter?: (e: IEvent) => boolean): Promise; }