import { PureContainer } from '@worktif/utils';
import type { TiesInstance } from '../../../lib/runtime-web/types';
import { TiesRegistrar } from './ties-registrar';
import type { DependencyMetadata, DependencyMetadataCollection, HashCollision } from '../metadata/dependency-metadata.types';
/**
 * Enhanced Ties registrar that uses hash-based keys for stable dependency registration.
 *
 * Extends the base TiesRegistrar to support hash-based service keys that survive
 * minification and build processes. Integrates with the dependency metadata system
 * to ensure stable service registration and resolution.
 *
 * @example
 * ```typescript
 * const registrar = new EnhancedTiesRegistrar();
 * const container = new PureContainer<string>({ defaultScope: 'Singleton' });
 * const metadata = metadataManager.generateBuildTimeMetadata([PaymentsTies]);
 *
 * registrar.registerTiesWithHashes(container, [PaymentsTies], metadata.dependencies);
 *
 * // Services are now registered with stable hash keys
 * const service = container.run(hashKey);
 * ```
 */
export declare class EnhancedTiesRegistrar extends TiesRegistrar {
    private readonly metadataManager;
    constructor();
    /**
     * Register Ties classes with hash-based keys using dependency metadata.
     *
     * Uses pre-computed hash keys from metadata to register services with stable
     * identifiers that survive minification. Falls back to runtime hash computation
     * if metadata is not available.
     *
     * @param container - PureContainer instance to register services with
     * @param tiesClasses - Array of Ties class constructors
     * @param metadata - Array of dependency metadata for hash-based registration
     * @throws TiesRegistrationError if registration fails
     * @throws Error if hash collisions are detected
     *
     * @example
     * ```typescript
     * const metadata = metadataManager.generateBuildTimeMetadata([PaymentsTies]);
     * registrar.registerTiesWithHashes(container, [PaymentsTies], metadata.dependencies);
     * ```
     */
    registerTiesWithHashes(container: PureContainer<string>, tiesClasses: TiesInstance[], metadata: DependencyMetadata[]): void;
    /**
     * Validate that all required services are registered using hash-based keys.
     *
     * Checks that all services referenced by hash keys are properly registered
     * in the container. Provides detailed error information for missing services.
     *
     * @param container - PureContainer to validate
     * @param expectedServices - Array of hash keys that should be registered
     * @throws MissingServiceError if any required service is not registered
     *
     * @example
     * ```typescript
     * const hashKeys = metadata.dependencies.map(d => d.hashKey);
     * registrar.validateRegistrations(container, hashKeys);
     * ```
     */
    validateRegistrations(container: PureContainer<string>, expectedServices: string[]): void;
    /**
     * Detect hash collisions in dependency metadata.
     *
     * Validates that all hash keys are unique and throws detailed error
     * information if collisions are found.
     *
     * @param metadata - Array of dependency metadata to validate
     * @throws Error if hash collisions are detected
     *
     * @example
     * ```typescript
     * registrar.detectHashCollisions(metadata.dependencies);
     * ```
     */
    detectHashCollisions(metadata: DependencyMetadata[]): void;
    /**
     * Generate service discovery report for validation and debugging.
     *
     * Creates a comprehensive report of all discovered services, their hash keys,
     * and registration status for troubleshooting and validation purposes.
     *
     * @param tiesClasses - Array of Ties class constructors
     * @param metadata - Dependency metadata collection
     * @returns Service discovery report
     *
     * @example
     * ```typescript
     * const report = registrar.generateServiceDiscoveryReport(tiesClasses, metadata);
     * console.log(`Discovered ${report.totalServices} services`);
     * ```
     */
    generateServiceDiscoveryReport(tiesClasses: TiesInstance[], metadata: DependencyMetadataCollection): ServiceDiscoveryReport;
    /**
     * Create mapping from hash keys to class constructors.
     *
     * @private
     */
    private createHashToClassMap;
    /**
     * Create a container proxy that uses hash keys for service registration.
     *
     * @private
     */
    private createHashBasedContainerProxy;
    /**
     * Generate a hash key for a specific service within a Ties class.
     *
     * @private
     */
    private generateServiceHashKey;
}
/**
 * Information about a discovered service.
 */
export interface ServiceInfo {
    className: string;
    hashKey: string;
    hasMetadata: boolean;
    serviceType: 'singleton' | 'transient' | 'constant';
    dependencies: string[];
}
/**
 * Service discovery report for validation and debugging.
 */
export interface ServiceDiscoveryReport {
    totalServices: number;
    servicesWithMetadata: number;
    servicesWithoutMetadata: number;
    hashCollisions: number;
    discoveredServices: ServiceInfo[];
    missingMetadata: string[];
    collisions: HashCollision[];
    isValid: boolean;
}
