import { Result } from "../common/result"; export interface ConcurrencyControl { checkVersionConflict(aggregateId: string, expectedVersion: number, currentVersion: number): Promise>; resolveVersionConflict(aggregateId: string, expectedVersion: number, currentVersion: number): Promise>; getCurrentVersion(aggregateId: string): Promise>; incrementVersion(aggregateId: string): Promise>; } export declare class VersionConflictError extends Error { readonly aggregateId: string; readonly expectedVersion: number; readonly currentVersion: number; constructor(aggregateId: string, expectedVersion: number, currentVersion: number); } export interface OptimisticLock { acquire(aggregateId: string, timeout?: number): Promise>; release(aggregateId: string): Promise>; isLocked(aggregateId: string): Promise>; getLockInfo(aggregateId: string): Promise>; } export interface LockInfo { readonly aggregateId: string; readonly acquiredAt: Date; readonly timeout: number; readonly acquiredBy?: string; } export declare abstract class BaseConcurrencyControl implements ConcurrencyControl { checkVersionConflict(aggregateId: string, expectedVersion: number, currentVersion: number): Promise>; resolveVersionConflict(aggregateId: string, expectedVersion: number, currentVersion: number): Promise>; abstract getCurrentVersion(aggregateId: string): Promise>; abstract incrementVersion(aggregateId: string): Promise>; }