UNPKG

1.45 kBTypeScriptView Raw
1import * as types from '../core/types';
2export { depTreeToGraph, graphToDepTree, DepTree };
3interface DepTreeDep {
4 name?: string;
5 version?: string;
6 versionProvenance?: types.VersionProvenance;
7 dependencies?: {
8 [depName: string]: DepTreeDep;
9 };
10 labels?: {
11 [key: string]: string | undefined;
12 scope?: 'dev' | 'prod';
13 pruned?: 'cyclic' | 'true';
14 };
15}
16/**
17 * @deprecated Use {@link DepGraph} instead of DepTree. You can construct a
18 * graph with {@link DepGraphBuilder}
19 */
20interface DepTree extends DepTreeDep {
21 type?: string;
22 packageFormatVersion?: string;
23 targetOS?: {
24 name: string;
25 version: string;
26 };
27}
28/**
29 * @deprecated Don't use dep trees as an intermediate step, because they are
30 * large structures, resulting in high memory usage and high CPU costs from
31 * serializing / deserializing. Instead, create a graph directly with
32 * {@link DepGraphBuilder}
33 */
34declare function depTreeToGraph(depTree: DepTree, pkgManagerName: string): Promise<types.DepGraph>;
35export interface GraphToTreeOptions {
36 deduplicateWithinTopLevelDeps: boolean;
37}
38/**
39 * @deprecated Don't use dep trees. You should adapt your code to use graphs,
40 * and enhance the dep-graph library if there is missing functionality from
41 * the graph structure
42 */
43declare function graphToDepTree(depGraphInterface: types.DepGraph, pkgType: string, opts?: GraphToTreeOptions): Promise<DepTree>;