import { AggregateRootId } from '../AggregateRootId'; import { AggregateRootVersion } from '../AggregateRootVersion'; import { EventSourceId } from '../EventSourceId'; import { CommittedAggregateEvent } from './CommittedAggregateEvent'; import { CommittedEvent } from './CommittedEvent'; /** * Represents a collection of committed events. * * @summary This type implements Iterable and can be used for iterations directly. */ export declare class CommittedAggregateEvents implements Iterable { readonly eventSourceId: EventSourceId; readonly aggregateRootId: AggregateRootId; private _events; private _nextAggregateRootVersion; /** * Creates an instance of {@link CommittedAggregateEvents}. * @param {EventSourceId} eventSourceId - The event source id. * @param {AggregateRootId} aggregateRootId - The aggregate root type id. * @param {...CommittedEvent[]} events - Events to initialize with. */ constructor(eventSourceId: EventSourceId, aggregateRootId: AggregateRootId, ...events: CommittedAggregateEvent[]); /** * Gets whether or not there are events. */ get hasEvents(): boolean; /** * Gets the length of the committed events array. */ get length(): number; /** @inheritdoc */ [Symbol.iterator](): Iterator; /** * Convert committed events to an array. * @returns {CommittedEvent[]} Array of committed events. */ toArray(): CommittedEvent[]; /** * Gets the {@link AggregateRootVersion} of the aggregate root after all the events was applied. */ get aggregateRootVersion(): AggregateRootVersion; private throwIfEventLogVersionIsOutOfOrder; private throwIfAggregateRootVersionIsOutOfOrder; private throwIfEventWasAppliedByOtherAggreateRoot; private throwIfEventWasAppliedToOtherEventSource; private throwIfEventContentIsNullOrUndefined; } //# sourceMappingURL=CommittedAggregateEvents.d.ts.map