import { TmpDir } from "builder-util";
import { Lazy } from "lazy-val";
import { ModuleManager } from "./moduleManager";
import { PM } from "./packageManager";
import type { Dependency, DependencyGraph, NodeModuleInfo, PackageJson } from "./types";
export declare abstract class NodeModulesCollector<ProdDepType extends Dependency<ProdDepType, OptionalDepType>, OptionalDepType> {
    protected readonly rootDir: string;
    private readonly tempDirManager;
    private readonly nodeModules;
    protected readonly allDependencies: Map<string, ProdDepType>;
    protected readonly productionGraph: DependencyGraph;
    protected readonly cache: ModuleManager;
    protected isHoisted: Lazy<boolean>;
    constructor(rootDir: string, tempDirManager: TmpDir);
    getNodeModules({ packageName }: {
        packageName: string;
    }): Promise<NodeModuleInfo[]>;
    abstract readonly installOptions: {
        manager: PM;
        lockfile: string;
    };
    protected abstract getArgs(): string[];
    protected abstract parseDependenciesTree(jsonBlob: string): Promise<ProdDepType>;
    protected abstract extractProductionDependencyGraph(tree: Dependency<ProdDepType, OptionalDepType>, dependencyId: string): Promise<void>;
    protected abstract collectAllDependencies(tree: Dependency<ProdDepType, OptionalDepType>, appPackageName: string): Promise<void>;
    protected getDependenciesTree(pm: PM): Promise<ProdDepType>;
    protected cacheKey(pkg: Pick<ProdDepType, "name" | "version" | "path">): string;
    protected packageVersionString(pkg: Pick<ProdDepType, "name" | "version">): string;
    protected isProdDependency(depName: string, pkg: ProdDepType): boolean;
    protected locatePackageWithVersion(depTree: Pick<ProdDepType, "name" | "version" | "path">): Promise<{
        packageDir: string;
        packageJson: PackageJson;
    } | null>;
    /**
     * Parse a dependency identifier like "@scope/pkg@1.2.3" or "pkg@1.2.3"
     */
    protected parseNameVersion(identifier: string): {
        name: string;
        version: string;
    };
    protected getTreeFromWorkspaces(tree: ProdDepType, packageName: string): Promise<ProdDepType>;
    private transformToHoisterTree;
    private _getNodeModules;
    asyncExec(command: string, args: string[], cwd?: string): Promise<{
        stdout: string | undefined;
        stderr: string | undefined;
    }>;
    streamCollectorCommandToFile(command: string, args: string[], cwd: string, tempOutputFile: string): Promise<void>;
}
