import { Operation, OperationType } from "@myycontext/core";
import { IdempotencyLevel } from "@myycontext/core/src/types/operation-schema";
/**
 * Operation fingerprint: unique hash identifying an operation
 */
export interface OperationFingerprint {
    fingerprint: string;
    operationId: string;
    operationType: OperationType;
    paramsHash: string;
    timestamp: string;
    applied: boolean;
    appliedAt?: string;
    appliedBy?: string;
}
/**
 * Idempotency check result
 */
export interface IdempotencyCheck {
    isIdempotent: boolean;
    canRetry: boolean;
    canSkip: boolean;
    reason: string;
    level: IdempotencyLevel;
}
/**
 * Duplicate detection result
 */
export interface DuplicateDetection {
    isDuplicate: boolean;
    duplicateOf?: string;
    fingerprint: string;
    suggestion: string;
}
/**
 * OperationFingerprint Service
 * Provides deterministic hashing and idempotency checking for operations
 */
export declare class OperationFingerprintService {
    private baseDir;
    private fingerprintDbPath;
    private fingerprintDb;
    constructor(baseDir?: string);
    /**
     * Initialize: Load fingerprint database
     */
    init(): Promise<void>;
    /**
     * Generate fingerprint for an operation
     */
    generateFingerprint(op: Operation): string;
    /**
     * Record operation fingerprint
     */
    recordFingerprint(op: Operation, applied?: boolean): Promise<OperationFingerprint>;
    /**
     * Mark operation as applied
     */
    markApplied(op: Operation): Promise<void>;
    /**
     * Check if operation has been applied
     */
    isApplied(op: Operation): boolean;
    /**
     * Check idempotency
     */
    checkIdempotency(op: Operation): Promise<IdempotencyCheck>;
    /**
     * Detect duplicates
     */
    detectDuplicate(op: Operation, allOps: Operation[]): DuplicateDetection;
    /**
     * Get fingerprint record
     */
    getFingerprint(op: Operation): OperationFingerprint | undefined;
    /**
     * Get all fingerprints
     */
    getAllFingerprints(): OperationFingerprint[];
    /**
     * Check if operation can be safely skipped
     */
    canSkip(op: Operation): Promise<{
        skip: boolean;
        reason: string;
    }>;
    /**
     * Clear fingerprint database
     */
    clear(): Promise<void>;
    /**
     * Canonicalize operation for hashing
     */
    private canonicalize;
    /**
     * Sort object keys recursively
     */
    private sortObject;
    /**
     * Hash params
     */
    private hashParams;
    /**
     * Check conditional idempotency
     */
    private checkConditionalIdempotency;
    /**
     * Persist fingerprint database
     */
    private persist;
}
//# sourceMappingURL=OperationFingerprint.d.ts.map