import type { EnvironmentContext, TiesInstance } from '../../../lib/runtime-web/types';
import { ContainerLifecycleManager } from '../di/container-lifecycle-manager';
import { PureContainer } from '@worktif/utils';
/**
 * Runtime environment detector for Runtime Web Core.
 *
 * Automatically detects the execution environment (browser, Lambda, or CDK)
 * and provides appropriate metadata for each context. This enables the
 * unified runtime() entry point to route execution to the correct pipeline.
 *
 * **Container Lifecycle Integration**:
 * - Lambda environments trigger container initialization before handler export
 * - Lambda metadata configures container logging and error reporting
 * - Non-Lambda environments skip Lambda-specific initialization
 * - Environment context adapts container behavior accordingly
 *
 * **Detection Priority**:
 * 1. Browser: Check for `window` object
 * 2. Lambda: Check for `AWS_LAMBDA_FUNCTION_NAME` environment variable
 * 3. CDK: Check for explicit mode, CDK env vars, or process arguments
 *
 * @example
 * ```typescript
 * const detector = new RuntimeDetector();
 * const context = detector.detect();
 *
 * switch (context.type) {
 *   case 'browser':
 *     // Execute browser pipeline
 *     break;
 *   case 'lambda':
 *     // Execute Lambda pipeline with container initialization
 *     break;
 *   case 'cdk':
 *     // Execute CDK pipeline
 *     break;
 * }
 * ```
 */
export declare class RuntimeDetector {
    private containerLifecycleManager;
    constructor(containerLifecycleManager?: ContainerLifecycleManager);
    /**
     * Detect the current runtime environment.
     *
     * Uses a series of checks to determine the execution context:
     * - Browser: Presence of `window` object
     * - Lambda: AWS Lambda environment variables
     * - CDK: Explicit mode or CDK-specific indicators
     *
     * @returns Environment context with type and metadata
     * @throws Error if environment cannot be determined
     */
    detect(): EnvironmentContext;
    /**
     * Detect environment and initialize container if appropriate.
     *
     * This method combines environment detection with container lifecycle management.
     * For Lambda environments, it ensures container initialization happens before
     * handler export. For non-Lambda environments, it skips Lambda-specific initialization.
     *
     * @param coreTiesClasses - Core service Ties classes
     * @param microserviceTiesClasses - Microservice Ties classes
     * @returns Environment context and initialized container (if Lambda)
     */
    detectAndInitializeContainer(coreTiesClasses?: TiesInstance[], microserviceTiesClasses?: TiesInstance[]): Promise<{
        context: EnvironmentContext;
        container?: PureContainer<string>;
    }>;
    /**
     * Initialize container specifically for Lambda environment.
     *
     * Uses Lambda metadata to configure container logging and error reporting.
     * Ensures all dependencies are available before handler execution.
     *
     * @param coreTiesClasses - Core service Ties classes
     * @param microserviceTiesClasses - Microservice Ties classes
     * @param lambdaContext - Lambda environment context
     * @returns Initialized container
     */
    initializeLambdaContainer(coreTiesClasses: TiesInstance[], microserviceTiesClasses: TiesInstance[], lambdaContext: EnvironmentContext): Promise<PureContainer<string>>;
    /**
     * Configure Lambda-specific container initialization.
     *
     * Uses Lambda metadata to configure logging, error reporting, and
     * performance optimizations specific to the Lambda environment.
     *
     * @param lambdaContext - Lambda environment context
     */
    private configureLambdaContainerInitialization;
    /**
     * Configure container settings specific to Lambda environment.
     *
     * @param lambdaContext - Lambda environment context
     */
    private configureLambdaContainerSettings;
    /**
     * Validate that container is ready for Lambda handler execution.
     *
     * @param container - Initialized container
     * @param lambdaContext - Lambda environment context
     */
    private validateLambdaContainerReadiness;
    /**
     * Configure logging for Lambda environment.
     *
     * @param functionName - Lambda function name
     */
    private configureLambdaLogging;
    /**
     * Configure error reporting for Lambda environment.
     *
     * @param region - AWS region
     */
    private configureLambdaErrorReporting;
    /**
     * Configure performance optimizations for Lambda environment.
     *
     * @param lambdaMetadata - Lambda metadata
     */
    private configureLambdaPerformanceOptimizations;
    /**
     * Adjust container caching based on Lambda memory size.
     *
     * @param memorySize - Lambda memory size in MB
     */
    private adjustContainerCachingForMemory;
    /**
     * Configure container timeouts based on Lambda timeout.
     *
     * @param timeout - Lambda timeout in seconds
     */
    private configureContainerTimeouts;
    /**
     * Check if environment context has changed and adapt container behavior.
     *
     * @param previousContext - Previous environment context
     * @param currentContext - Current environment context
     * @returns True if context changed and container was adapted
     */
    adaptContainerForEnvironmentChange(previousContext: EnvironmentContext, currentContext: EnvironmentContext): boolean;
    /**
     * Cleanup Lambda-specific container configuration.
     */
    private cleanupLambdaContainerConfiguration;
    /**
     * Set or update the container lifecycle manager.
     *
     * @param manager - Container lifecycle manager
     */
    setContainerLifecycleManager(manager: ContainerLifecycleManager): void;
    /**
     * Get the current container lifecycle manager.
     *
     * @returns Container lifecycle manager or null if not set
     */
    getContainerLifecycleManager(): ContainerLifecycleManager | null;
    /**
     * Check if running in browser environment.
     *
     * @returns True if `window` object exists
     */
    private isBrowser;
    /**
     * Check if running in AWS Lambda environment.
     *
     * @returns True if AWS Lambda environment variable is present
     */
    private isLambda;
    /**
     * Check if running in CDK environment.
     *
     * Uses multiple detection methods in priority order:
     * 1. Explicit mode: RUNTIME_MODE=cdk (recommended)
     * 2. CDK environment variables: CDK_DEFAULT_ACCOUNT or CDK_DEFAULT_REGION
     * 3. Process arguments: contains 'cdk' or 'synth'
     *
     * @returns True if CDK environment is detected
     */
    private isCDK;
}
