/**
 * Registry pattern for managing debug adapters
 *
 * The AdapterRegistry provides centralized management of language-specific
 * debug adapters, including registration, discovery, and lifecycle management.
 *
 * @since 2.0.0
 */
import { IDebugAdapter, AdapterConfig } from './debug-adapter-interface.js';
/**
 * Registry for managing debug adapters across multiple languages
 */
export interface IAdapterRegistry {
    /**
     * Register a new adapter factory for a language
     * @param language Language identifier (e.g., 'python', 'node')
     * @param factory Factory to create adapter instances
     * @throws Error if language is already registered
     */
    register(language: string, factory: IAdapterFactory): void;
    /**
     * Unregister an adapter factory
     * @param language Language identifier
     * @returns true if unregistered, false if not found
     */
    unregister(language: string): boolean;
    /**
     * Create a new adapter instance for the specified language
     * @param language Language identifier
     * @param config Adapter configuration
     * @returns Initialized adapter instance
     * @throws AdapterNotFoundError if language not registered
     */
    create(language: string, config: AdapterConfig): Promise<IDebugAdapter>;
    /**
     * Get list of all supported languages
     * @returns Array of registered language identifiers
     */
    getSupportedLanguages(): string[];
    /**
     * Check if a language is supported
     * @param language Language identifier
     * @returns true if language has a registered adapter
     */
    isLanguageSupported(language: string): boolean;
    /**
     * Get metadata about a registered adapter
     * @param language Language identifier
     * @returns Adapter metadata or undefined if not found
     */
    getAdapterInfo(language: string): AdapterInfo | undefined;
    /**
     * Get all registered adapter information
     * @returns Map of language to adapter info
     */
    getAllAdapterInfo(): Map<string, AdapterInfo>;
    /**
     * Dispose all created adapters and clear registry
     */
    disposeAll(): Promise<void>;
    /**
     * Get count of active adapter instances
     * @returns Number of adapters currently in use
     */
    getActiveAdapterCount(): number;
}
/**
 * Factory interface for creating debug adapter instances
 */
export interface IAdapterFactory {
    /**
     * Create a new adapter instance with dependencies
     * @param dependencies Required dependencies for the adapter
     * @returns New adapter instance
     */
    createAdapter(dependencies: AdapterDependencies): IDebugAdapter;
    /**
     * Get metadata about this adapter type
     * @returns Adapter metadata
     */
    getMetadata(): AdapterMetadata;
    /**
     * Validate that the factory can create adapters in current environment
     * @returns Validation result with any warnings or errors
     */
    validate(): Promise<FactoryValidationResult>;
}
/**
 * Dependencies injected into adapters
 */
export interface AdapterDependencies {
    fileSystem: IFileSystem;
    logger: ILogger;
    environment: IEnvironment;
    processLauncher: IProcessLauncher;
    networkManager?: INetworkManager;
}
/**
 * Metadata about an adapter
 */
export interface AdapterMetadata {
    /** Language identifier */
    language: string;
    /** Display name for UI */
    displayName: string;
    /** Adapter version */
    version: string;
    /** Author/maintainer */
    author: string;
    /** Description of adapter capabilities */
    description: string;
    /** URL to documentation */
    documentationUrl?: string;
    /** Minimum debugger version required */
    minimumDebuggerVersion?: string;
    /** File extensions supported */
    fileExtensions?: string[];
    /** Icon for UI (base64 or URL) */
    icon?: string;
}
/**
 * Combined adapter information (metadata + runtime info)
 */
export interface AdapterInfo extends AdapterMetadata {
    /** Whether adapter is currently available */
    available: boolean;
    /** Number of active instances */
    activeInstances: number;
    /** Last validation result */
    lastValidation?: FactoryValidationResult;
    /** Registration timestamp */
    registeredAt: Date;
}
/**
 * Factory validation result
 */
export interface FactoryValidationResult {
    /** Whether factory is valid and can create adapters */
    valid: boolean;
    /** Any errors preventing adapter creation */
    errors: string[];
    /** Warnings that don't prevent creation */
    warnings: string[];
    /** Additional validation details */
    details?: Record<string, unknown>;
}
/**
 * Base class for adapter factories (optional helper)
 */
export declare abstract class BaseAdapterFactory implements IAdapterFactory {
    protected metadata: AdapterMetadata;
    constructor(metadata: AdapterMetadata);
    getMetadata(): AdapterMetadata;
    validate(): Promise<FactoryValidationResult>;
    abstract createAdapter(dependencies: AdapterDependencies): IDebugAdapter;
}
/**
 * Registry configuration options
 */
export interface AdapterRegistryConfig {
    /** Whether to validate factories on registration */
    validateOnRegister?: boolean;
    /** Whether to allow re-registration of languages */
    allowOverride?: boolean;
    /** Maximum number of adapter instances per language */
    maxInstancesPerLanguage?: number;
    /** Whether to auto-dispose unused adapters */
    autoDispose?: boolean;
    /** Auto-dispose timeout in milliseconds */
    autoDisposeTimeout?: number;
}
/**
 * Error thrown when requested adapter is not found
 */
export declare class AdapterNotFoundError extends Error {
    language: string;
    availableLanguages: string[];
    constructor(language: string, availableLanguages: string[]);
}
/**
 * Error thrown when factory validation fails
 */
export declare class FactoryValidationError extends Error {
    language: string;
    validationResult: FactoryValidationResult;
    constructor(language: string, validationResult: FactoryValidationResult);
}
/**
 * Error thrown when trying to register duplicate language
 */
export declare class DuplicateRegistrationError extends Error {
    language: string;
    constructor(language: string);
}
/**
 * Check if an object implements IAdapterFactory
 */
export declare function isAdapterFactory(obj: unknown): obj is IAdapterFactory;
/**
 * Check if an object implements IAdapterRegistry
 */
export declare function isAdapterRegistry(obj: unknown): obj is IAdapterRegistry;
/**
 * Map of language to adapter factory
 */
export type AdapterFactoryMap = Map<string, IAdapterFactory>;
/**
 * Map of language to active adapter instances
 */
export type ActiveAdapterMap = Map<string, Set<IDebugAdapter>>;
import type { IFileSystem } from '../interfaces/external-dependencies.js';
import type { ILogger } from '../interfaces/external-dependencies.js';
import type { IEnvironment } from '../interfaces/external-dependencies.js';
import type { IProcessLauncher } from '../interfaces/process-interfaces.js';
import type { INetworkManager } from '../interfaces/external-dependencies.js';
