import { PureContainer } from '@worktif/utils';
import type { LambdaDefinition } from '../../../lib/runtime-web/types';
import type { DependencyMetadata } from '../metadata/dependency-metadata.types';
import type { ContainerInitializationState } from '../di/container-lifecycle-manager';
import { ContainerDiagnostics } from '../di/di-errors';
/**
 * Service registration information for diagnostics.
 */
export interface ServiceRegistrationInfo {
    /** Service name */
    name: string;
    /** Hash key used for registration */
    hashKey: string;
    /** Service type (singleton, transient, constant) */
    type: 'singleton' | 'transient' | 'constant';
    /** Registration timestamp */
    registeredAt: number;
    /** Dependencies of this service */
    dependencies: string[];
    /** Whether service is currently resolvable */
    isResolvable: boolean;
}
/**
 * Lambda handler information for diagnostics.
 */
export interface LambdaHandlerInfo {
    /** Lambda ID */
    id: string;
    /** Service name */
    service?: string;
    /** Required dependencies */
    requiredDependencies: Array<{
        name: string;
        hashKey: string;
        isAvailable: boolean;
    }>;
    /** Whether handler can be created */
    canBeCreated: boolean;
    /** Handler creation errors if any */
    creationErrors: string[];
}
/**
 * Hash key mapping information for debugging.
 */
export interface HashKeyMapping {
    /** Original class name */
    className: string;
    /** Computed hash key */
    hashKey: string;
    /** Class code used for hash computation */
    classCode: string;
    /** Whether hash computation was successful */
    isValid: boolean;
    /** Hash computation error if any */
    error?: string;
}
/**
 * Container diagnostics manager provides comprehensive introspection and debugging
 * capabilities for the DI container lifecycle.
 *
 * Enables developers to inspect container state, debug dependency resolution issues,
 * and understand the container initialization process.
 */
export declare class ContainerDiagnosticsManager {
    private performanceMetrics;
    /**
     * Generate comprehensive container diagnostics.
     *
     * @param container - Container to analyze
     * @param initializationState - Container initialization state
     * @param lambdaDefinitions - Lambda definitions for handler analysis
     * @param metadata - Dependency metadata for hash key analysis
     * @returns Comprehensive diagnostics information
     */
    generateDiagnostics(container: PureContainer<string>, initializationState: ContainerInitializationState, lambdaDefinitions?: LambdaDefinition[], metadata?: DependencyMetadata[]): ContainerDiagnostics;
    /**
     * Get detailed service registration information.
     *
     * @param container - Container to analyze
     * @param metadata - Dependency metadata for additional information
     * @returns Array of service registration information
     */
    getServiceRegistrationInfo(container: PureContainer<string>, metadata?: DependencyMetadata[]): ServiceRegistrationInfo[];
    /**
     * Get detailed Lambda handler information.
     *
     * @param container - Container to analyze
     * @param lambdaDefinitions - Lambda definitions to analyze
     * @returns Array of Lambda handler information
     */
    getLambdaHandlerInfo(container: PureContainer<string>, lambdaDefinitions: LambdaDefinition[]): LambdaHandlerInfo[];
    /**
     * Get hash key mappings for debugging.
     *
     * @param classes - Classes to analyze
     * @param metadata - Optional metadata for comparison
     * @returns Array of hash key mappings
     */
    getHashKeyMappings(classes: Array<{
        name: string;
        toString(): string;
    }>, metadata?: DependencyMetadata[]): HashKeyMapping[];
    /**
     * Generate detailed error message with diagnostic information.
     *
     * @param error - Original error
     * @param container - Container for context
     * @param context - Additional context information
     * @returns Enhanced error message with diagnostics
     */
    generateDetailedErrorMessage(error: Error, container?: PureContainer<string>, context?: {
        phase?: string;
        serviceName?: string;
        hashKey?: string;
        lambdaId?: string;
    }): string;
    /**
     * Record performance metric.
     *
     * @param metric - Metric name
     * @param value - Metric value in milliseconds
     */
    recordPerformanceMetric(metric: keyof ContainerDiagnostics['performanceMetrics'], value: number): void;
    /**
     * Get available services from container.
     *
     * @param container - Container to inspect
     * @returns Array of available service names
     */
    private getAvailableServices;
    /**
     * Generate warnings for potential issues.
     *
     * @param container - Container to analyze
     * @param initializationState - Container initialization state
     * @param lambdaDefinitions - Lambda definitions
     * @returns Array of warning messages
     */
    private generateWarnings;
    /**
     * Get Lambda ID from definition.
     *
     * @param lambdaDef - Lambda definition
     * @returns Lambda ID string
     */
    private getLambdaId;
    /**
     * Find similar service names for suggestions.
     *
     * @param targetName - Target service name
     * @param availableNames - Available service names
     * @returns Array of similar names
     */
    private findSimilarServiceNames;
}
