import type { IContainer } from 'node-cqrs'; import type { EventQueryAfter, AggregateEventsQueryParams, DispatchPipelineBatch, IDispatchPipelineProcessor, IEvent, IEventSet, IEventStorageReader, IEventStream, IIdentifierProvider, Identifier } from '../interfaces/index.ts'; /** * MongoDB-backed event storage for node-cqrs. * Implements IEventStorageReader, IIdentifierProvider, and IDispatchPipelineProcessor. */ export declare class MongoEventStorage implements IEventStorageReader, IIdentifierProvider, IDispatchPipelineProcessor { #private; static readonly EVENTS_COLLECTION = "events"; constructor({ mongoDbFactory, mongoEventStorageConfig, process }: Pick); getNewId(): string; commitEvents(events: IEventSet, options?: { ignoreConcurrencyError?: boolean; }): Promise; getAggregateEvents(aggregateId: Identifier, options?: AggregateEventsQueryParams): IEventStream; getSagaEvents(sagaId: Identifier, { beforeEvent }: { beforeEvent: IEvent; }): IEventStream; getEventsByTypes(eventTypes: Readonly, options?: EventQueryAfter): IEventStream; /** * Processes a batch of dispatch pipeline items, commits the events to MongoDB, * and returns the original batch. * * This method is part of the `IDispatchPipelineProcessor` interface. */ process(batch: DispatchPipelineBatch): Promise; }