/**
 * Unit of Work Implementation
 *
 * This module provides the Unit of Work pattern implementation for
 * managing batch operations with atomicity guarantees.
 *
 * @module declarative-api/infrastructure-context/unit-of-work
 */
import type { IResourceEntity, IUnitOfWork, UnitOfWorkStatus, UnitOfWorkOperation, UnitOfWorkCommitResult, UnitOfWorkRollbackResult, IResourceRepository, IEventBusMediator } from '../../../lib/runtime-web/types/declarative-api';
/**
 * Error thrown when a Unit of Work operation is invalid.
 */
export declare class UnitOfWorkError extends Error {
    readonly unitOfWorkId: string;
    readonly status: UnitOfWorkStatus;
    readonly code = "UNIT_OF_WORK_ERROR";
    constructor(message: string, unitOfWorkId: string, status: UnitOfWorkStatus);
}
/**
 * Type guard for UnitOfWorkError.
 */
export declare function isUnitOfWorkError(error: unknown): error is UnitOfWorkError;
/**
 * Unit of Work implementation.
 *
 * Manages batch operations with atomicity guarantees. Either all
 * operations succeed and are committed, or all operations are
 * rolled back.
 *
 * Implements: Unit of Work Pattern
 * Validates: Requirements 1.6
 */
export declare class UnitOfWork implements IUnitOfWork {
    private readonly repository;
    private readonly mediator;
    readonly id: string;
    private _status;
    private _operations;
    private _executedOperations;
    constructor(repository: IResourceRepository, mediator: IEventBusMediator, id?: string);
    /**
     * Get the current status.
     */
    get status(): UnitOfWorkStatus;
    /**
     * Get all operations.
     */
    get operations(): readonly UnitOfWorkOperation[];
    /**
     * Register a resource creation operation.
     */
    registerCreate(resource: IResourceEntity): void;
    /**
     * Register a resource modification operation.
     */
    registerModify(resource: IResourceEntity): void;
    /**
     * Register a resource deletion operation.
     */
    registerDelete(resourceId: string): void;
    /**
     * Check if there are pending operations.
     */
    hasPendingOperations(): boolean;
    /**
     * Get the count of pending operations.
     */
    getPendingCount(): number;
    /**
     * Commit all registered operations.
     */
    commit(): UnitOfWorkCommitResult;
    /**
     * Rollback all executed operations.
     */
    rollback(): UnitOfWorkRollbackResult;
    /**
     * Clear all pending operations.
     */
    clear(): void;
    /**
     * Ensure the unit of work is in active status.
     */
    private ensureActive;
    /**
     * Execute a single operation.
     */
    private executeOperation;
    /**
     * Rollback a single operation.
     */
    private rollbackOperation;
}
