import type { IBackupService } from "./backup.js";
import type { ILogger } from "../logging/index.js";
/**
 * Transaction wrapper for atomic operations
 * Provides init → execute → cleanup/rollback pattern
 */
export declare class Transaction {
    private readonly backupService;
    private readonly logger;
    private initialized;
    /**
     * Initialize transaction with backup and logging services
     * @param backupService - Service for backup operations
     * @param logger - Logger instance for transaction events
     */
    constructor(backupService: IBackupService, logger: ILogger);
    /**
     * Initialize the transaction
     * @param destDir - Destination directory to protect during transaction
     */
    init(destDir: string): Promise<void>;
    /**
     * Execute an operation within the transaction context
     *
     * Automatically rolls back on failure
     * @param operation - Async operation to execute atomically
     * @returns Promise resolving to operation result
     */
    execute<T>(operation: () => Promise<T>): Promise<T>;
    /**
     * Create a backup of a file within this transaction
     * @param absolutePath - Absolute path to file to backup
     */
    backup(absolutePath: string): Promise<void>;
}
/**
 * No-op transaction for dry-run mode
 */
export declare class DryRunTransaction {
    /**
     * Initialize dry-run transaction (no-op)
     * @param _destDir - Destination directory (unused)
     */
    init(_destDir: string): Promise<void>;
    /**
     * Execute operation without backup/rollback (no-op)
     * @param operation - Operation to execute
     * @returns Promise resolving to operation result
     */
    execute<T>(operation: () => Promise<T>): Promise<T>;
    /**
     * Backup file (no-op)
     * @param _absolutePath - Absolute path (unused)
     */
    backup(_absolutePath: string): Promise<void>;
}
//# sourceMappingURL=transaction.d.ts.map