import type { MicroserviceDefinition } from '../../../lib/runtime-web/types/microservice.types';
/**
 * Error class for runtime loading failures.
 */
export declare class RuntimeLoadError extends Error {
    readonly cause?: Error | undefined;
    readonly hint?: string | undefined;
    constructor(message: string, cause?: Error | undefined, hint?: string | undefined);
}
/**
 * Configuration for RuntimeLoader.
 */
export interface RuntimeLoaderConfig {
    /** Path to the React entry point (e.g., 'src/index.tsx') */
    readonly reactEntry: string;
    /** Project root directory */
    readonly projectRoot: string;
    /** Enable verbose logging */
    readonly verbose?: boolean;
}
/**
 * Result of loading runtime configuration.
 */
export interface RuntimeLoadResult {
    /** Loaded microservice definitions */
    readonly microservices: Record<string, MicroserviceDefinition>;
    /** Number of microservices loaded */
    readonly microserviceCount: number;
    /** Names of loaded microservices */
    readonly microserviceNames: string[];
    /** Whether SSR is enabled (router and app are defined) */
    readonly ssrEnabled: boolean;
    /** Source file path */
    readonly sourcePath: string;
    /** @deprecated Use microserviceCount instead */
    readonly count: number;
    /** @deprecated Use microserviceNames instead */
    readonly names: string[];
}
/**
 * Runtime Loader for Pre-CDK Build Phase.
 *
 * Loads runtime configuration from the user's application entry point
 * by executing the entry file and extracting the configuration
 * from the `runtimeThreads` export.
 *
 * @example
 * ```typescript
 * const loader = new RuntimeLoader({
 *   reactEntry: 'src/index.tsx',
 *   projectRoot: process.cwd(),
 * });
 *
 * const result = await loader.load();
 * console.log('Loaded microservices:', result.microserviceNames);
 * console.log('SSR enabled:', result.ssrEnabled);
 * ```
 */
export declare class RuntimeLoader {
    private readonly config;
    constructor(config: RuntimeLoaderConfig);
    /**
     * Load runtime configuration from the user's entry point.
     *
     * Uses esbuild to transpile the entry point, handling CSS/SVG/TSX imports.
     *
     * @returns Loaded runtime configuration
     * @throws RuntimeLoadError if loading fails
     */
    load(): Promise<RuntimeLoadResult>;
    /**
     * Find runtimeThreads in require cache.
     */
    private findRuntimeThreads;
    /**
     * Transpile entry point with esbuild to handle CSS/SVG/TSX imports.
     *
     * Creates a CommonJS bundle in cdk/cdk.out/microservice-bundles/register/ directory.
     *
     * @param entryPath - Absolute path to the entry point
     * @returns Path to the transpiled bundle
     */
    private transpileEntryPoint;
    /**
     * Clear require cache for the entry point and related modules.
     * This ensures a fresh load of user's code and the runtime module.
     */
    private clearRequireCache;
    /**
     * Log message if verbose mode is enabled.
     */
    private log;
}
/**
 * Load runtime configuration from the user's entry point.
 *
 * Convenience function for loading runtime configuration without creating a loader instance.
 *
 * @param reactEntry - Path to the React entry point
 * @param projectRoot - Project root directory
 * @param verbose - Enable verbose logging
 * @returns Loaded runtime configuration
 */
export declare function loadRuntimeConfig(reactEntry: string, projectRoot: string, verbose?: boolean): Promise<RuntimeLoadResult>;
export { RuntimeLoadError as MicroserviceLoadError, RuntimeLoaderConfig as MicroserviceLoaderConfig, };
/** @deprecated Use RuntimeLoader instead */
export declare const MicroserviceLoader: typeof RuntimeLoader;
/** @deprecated Use RuntimeLoadResult instead */
export type MicroserviceLoadResult = RuntimeLoadResult;
/** @deprecated Use loadRuntimeConfig instead */
export declare const loadMicroservices: typeof loadRuntimeConfig;
