import { AggregateRootId } from '../AggregateRootId'; import { AggregateRootVersion } from '../AggregateRootVersion'; import { EventSourceId, EventSourceIdLike } from '../EventSourceId'; import { UncommittedAggregateEvent } from './UncommittedAggregateEvent'; /** * Represents a sequence of {@link UncommittedAggregateEvent}s that have not been committed to the Event Store. */ export declare class UncommittedAggregateEvents implements Iterable { readonly eventSourceId: EventSourceId; readonly aggregateRootId: AggregateRootId; readonly expectedAggregateRootVersion: AggregateRootVersion; private _events; /** * Initialises a new instance of the {@link UncommittedAggregateEvents} class. * @param {EventSourceId} eventSourceId - The event source id. * @param {AggregateRootId} aggregateRootId - The aggreagate root type id. * @param {AggregateRootVersion} expectedAggregateRootVersion - The aggregate root version. * @param {...any} events - The events. */ constructor(eventSourceId: EventSourceId, aggregateRootId: AggregateRootId, expectedAggregateRootVersion: AggregateRootVersion, ...events: UncommittedAggregateEvent[]); /** * 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; /** * Adds an {@link UncommittedAggregateEvent} to the uncommitted events. * @param {UncommittedAggregateEvent} event - The event to add. */ add(event: UncommittedAggregateEvent): void; /** * Creates uncommitted aggregate events from the provided events and metadata. * @param {EventSourceIdLike} eventSourceId - The event source id that the uncommitted events will be applied to. * @param {AggregateRootId} aggregateRootId - The aggregate root id that the uncommitted events will be applied to. * @param {AggregateRootVersion} expectedAggregateRootVersion - The previous aggregate root version that was used to produce the uncommitted events. * @param {UncommittedAggregateEvent[]} events - The uncommitted events to apply. * @returns {UncommittedAggregateEvents} Uncommitted aggregate events. */ static from(eventSourceId: EventSourceIdLike, aggregateRootId: AggregateRootId, expectedAggregateRootVersion: AggregateRootVersion, ...events: UncommittedAggregateEvent[]): UncommittedAggregateEvents; /** * Convert uncommitted aggregate events to an array. * @returns {UncommittedAggregateEvent[]} Array of committed events. */ toArray(): UncommittedAggregateEvent[]; private throwIfEventContentIsNullOrUndefined; } //# sourceMappingURL=UncommittedAggregateEvents.d.ts.map