import { Guid } from '@cratis/fundamentals'; import { AppendError } from '../eventSequences/AppendError.js'; import { AppendResult } from '../eventSequences/AppendResult.js'; import { ConcurrencyViolation } from '../eventSequences/ConcurrencyViolation.js'; import { ConstraintViolation } from '../eventSequences/ConstraintViolation.js'; import { EventSequenceId } from '../eventSequences/EventSequenceId.js'; import { IEventStore } from '../IEventStore.js'; import type { TransactionalAppendOptions } from './TransactionalAppendOptions.js'; import { IUnitOfWork } from './IUnitOfWork.js'; /** * Represents a unit of work that buffers events and commits them as transaction-like append operations. */ export declare class UnitOfWork implements IUnitOfWork { readonly correlationId: Guid; private readonly _eventStore; private _events; private _concurrencyScopes; private _appendResults; private _isCommitted; private _isRolledBack; private _onCompleted; constructor(correlationId: Guid, onCompleted: (unitOfWork: IUnitOfWork) => void, _eventStore: IEventStore); /** @inheritdoc */ get isCompleted(): boolean; /** @inheritdoc */ get isSuccess(): boolean; /** @inheritdoc */ addEvent(eventSequenceId: EventSequenceId, eventSourceId: string, event: object, options?: TransactionalAppendOptions): void; /** @inheritdoc */ getEvents(): ReadonlyArray; /** @inheritdoc */ getAppendResults(): ReadonlyArray; /** @inheritdoc */ getConstraintViolations(): ReadonlyArray; /** @inheritdoc */ getConcurrencyViolations(): ReadonlyArray; /** @inheritdoc */ getAppendErrors(): ReadonlyArray; /** @inheritdoc */ commit(): Promise; /** @inheritdoc */ rollback(): Promise; /** @inheritdoc */ onCompleted(callback: (unitOfWork: IUnitOfWork) => void): void; private throwIfCompleted; } //# sourceMappingURL=UnitOfWork.d.ts.map