import type { IMastraLogger } from '@mastra/core/logger';
import type { SourceMap } from 'rollup';
import type { WorkspacePackageInfo } from '../../bundler/workspaceDependencies.js';
import type { DependencyMetadata } from '../types.js';
/**
 * Analyzes the entry file to identify external dependencies and their imports. This allows us to treeshake all code that is not used.
 *
 * @param entryConfig - Configuration object for the entry file
 * @param entryConfig.entry - The entry file path or content
 * @param entryConfig.isVirtualFile - Whether the entry is a virtual file (content string) or a file path
 * @param mastraEntry - The mastra entry point
 * @param options - Configuration options for the analysis
 * @param options.logger - Logger instance for debugging
 * @param options.sourcemapEnabled - Whether sourcemaps are enabled
 * @param options.workspaceMap - Map of workspace packages
 * @param options.shouldCheckTransitiveDependencies - Whether to recursively analyze transitive workspace dependencies (default: false)
 * @returns A promise that resolves to an object containing the analyzed dependencies and generated output
 */
/** Return type of {@link analyzeEntry} */
export type AnalyzeEntryResult = {
    dependencies: Map<string, DependencyMetadata>;
    output: {
        code: string;
        map: SourceMap | null;
    };
};
export declare function analyzeEntry({ entry, isVirtualFile, }: {
    entry: string;
    isVirtualFile: boolean;
}, mastraEntry: string, { logger, sourcemapEnabled, workspaceMap, projectRoot, initialDepsToOptimize, // used to avoid infinite recursion
shouldCheckTransitiveDependencies, analyzeCache, }: {
    logger: IMastraLogger;
    sourcemapEnabled: boolean;
    workspaceMap: Map<string, WorkspacePackageInfo>;
    projectRoot: string;
    initialDepsToOptimize?: Map<string, DependencyMetadata>;
    shouldCheckTransitiveDependencies?: boolean;
    /** Shared cache to avoid re-analyzing the same entry across recursive calls */
    analyzeCache?: Map<string, AnalyzeEntryResult>;
}): Promise<AnalyzeEntryResult>;
//# sourceMappingURL=analyzeEntry.d.ts.map