import { type PackageSnapshots, type ProjectSnapshot } from '@pnpm/lockfile.fs'; import { type DepTypes } from '@pnpm/lockfile.detect-dep-types'; import { type Finder, type Registries } from '@pnpm/types'; import { type DependencyGraph } from './buildDependencyGraph.js'; import { type DependencyNode } from './DependencyNode.js'; import { type TreeNodeId } from './TreeNodeId.js'; export interface BaseTreeOpts { include: { dependencies?: boolean; devDependencies?: boolean; optionalDependencies?: boolean; }; excludePeerDependencies?: boolean; lockfileDir: string; onlyProjects?: boolean; search?: Finder; skipped: Set; registries: Registries; depTypes: DepTypes; storeDir?: string; virtualStoreDir?: string; virtualStoreDirMaxLength: number; modulesDir?: string; showDedupedSearchMatches?: boolean; graph: DependencyGraph; materializationCache: MaterializationCache; } interface GetTreeOpts extends BaseTreeOpts { maxDepth: number; rewriteLinkVersionDir: string; importers: Record; currentPackages: PackageSnapshots; wantedPackages: PackageSnapshots; parentDir?: string; } interface CachedSubtree { /** Total number of DependencyNode objects in the subtree (recursive). */ count: number; /** Whether any node in this subtree matched the search. */ hasSearchMatch: boolean; /** Search match messages (string-typed matches) found in this subtree. */ searchMessages: string[]; } /** * Caches already-materialized subtrees. When a subtree is encountered a * second time (cache hit), an empty array is returned and the node is marked * as deduped — bounding the total output to O(N) nodes. */ export type MaterializationCache = Map; export declare function getTree(opts: GetTreeOpts, parentId: TreeNodeId): DependencyNode[]; export {};