/** The installable package name behind a module specifier, or null if not a bare package. */ export declare function packageRoot(specifier: string): string | null; /** All bare package roots imported/required/re-exported in a file's source. */ export declare function extractImportedPackages(code: string): Set; /** Walk a source tree and collect every imported package root (node_modules excluded). */ export declare function collectImportedPackages(root: string, opts?: { maxFiles?: number; }): Set; export type ReachabilityStatus = "imported" | "not_imported"; export interface ReachabilityResult { reachable: boolean; status: ReachabilityStatus; } /** * Annotate each package name with whether it is imported anywhere under `root`. * Pass `importedOverride` (a precomputed set) to avoid a filesystem walk (used in tests * and to share one walk across many packages). */ export declare function analyzeReachability(packageNames: string[], root: string, importedOverride?: Set): Map;