import { PureContainer } from '@worktif/utils';
import type { TiesInstance } from '../../../lib/runtime-web/types';
import { ErrorRecoveryOptions, HashComputationError, DependencyResolutionError } from '../di/di-errors';
/**
 * Recovery attempt result.
 */
export interface RecoveryAttemptResult {
    /** Whether recovery was successful */
    success: boolean;
    /** Error message if recovery failed */
    error?: string;
    /** Recovery method used */
    method: string;
    /** Additional context about the recovery attempt */
    context?: Record<string, any>;
}
/**
 * Service registration attempt result.
 */
export interface ServiceRegistrationAttempt {
    /** Service name */
    serviceName: string;
    /** Whether registration was successful */
    success: boolean;
    /** Registration method used */
    method: 'hash-key' | 'class-name' | 'fallback';
    /** Key used for registration */
    registrationKey: string;
    /** Error if registration failed */
    error?: string;
}
/**
 * Error recovery manager provides fallback mechanisms and error recovery
 * strategies for container lifecycle failures.
 *
 * Implements graceful degradation when services fail to register or resolve,
 * with configurable retry logic and fallback strategies.
 */
export declare class ErrorRecoveryManager {
    private readonly options;
    private recoveryAttempts;
    constructor(options?: Partial<ErrorRecoveryOptions>);
    /**
     * Attempt to recover from hash computation failure.
     *
     * @param error - Hash computation error
     * @param classRef - Class reference that failed
     * @returns Recovery attempt result
     */
    recoverFromHashComputationFailure(error: HashComputationError, classRef: TiesInstance): Promise<RecoveryAttemptResult>;
    /**
     * Attempt to recover from dependency resolution failure.
     *
     * @param error - Dependency resolution error
     * @param container - Container to attempt resolution with
     * @param classRef - Class reference that failed to resolve
     * @returns Recovery attempt result
     */
    recoverFromDependencyResolutionFailure(error: DependencyResolutionError, container: PureContainer<string>, classRef: TiesInstance): Promise<RecoveryAttemptResult>;
    /**
     * Attempt to register services with fallback mechanisms.
     *
     * @param container - Container to register services with
     * @param tiesClasses - Ties classes to register
     * @returns Array of registration attempt results
     */
    registerServicesWithFallback(container: PureContainer<string>, tiesClasses: TiesInstance[]): Promise<ServiceRegistrationAttempt[]>;
    /**
     * Get recovery statistics.
     *
     * @returns Recovery attempt statistics
     */
    getRecoveryStatistics(): {
        totalAttempts: number;
        attemptsByType: Record<string, number>;
        successfulRecoveries: number;
    };
    /**
     * Reset recovery attempt counters.
     */
    resetRecoveryAttempts(): void;
    /**
     * Try simple string hash as alternative.
     *
     * @param classRef - Class reference
     * @returns Recovery attempt result
     */
    private trySimpleStringHash;
    /**
     * Try class name hash as alternative.
     *
     * @param classRef - Class reference
     * @returns Recovery attempt result
     */
    private tryClassNameHash;
    /**
     * Try fallback to class name without hashing.
     *
     * @param classRef - Class reference
     * @returns Recovery attempt result
     */
    private tryFallbackToClassName;
    /**
     * Try alternative hash key for dependency resolution.
     *
     * @param container - Container to test with
     * @param classRef - Class reference
     * @returns Recovery attempt result
     */
    private tryAlternativeHashKey;
    /**
     * Try class name resolution.
     *
     * @param container - Container to test with
     * @param classRef - Class reference
     * @returns Recovery attempt result
     */
    private tryClassNameResolution;
    /**
     * Try fuzzy service name matching.
     *
     * @param container - Container to test with
     * @param targetService - Target service name
     * @param availableServices - Available service names
     * @returns Recovery attempt result
     */
    private tryFuzzyServiceMatch;
    /**
     * Register service with specific key.
     *
     * @param container - Container to register with
     * @param TiesClass - Ties class to register
     * @param key - Registration key
     */
    private registerServiceWithKey;
    /**
     * Delay execution for specified milliseconds.
     *
     * @param ms - Milliseconds to delay
     */
    private delay;
}
