Skip to content

Commit 149151f

Browse files
author
Noah Hummel
committed
chore: add type definitions
1 parent 9dc8387 commit 149151f

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

index.d.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
declare namespace dependencyTree {
2+
interface TreeInnerNode {
3+
[parent: string]: TreeInnerNode | string;
4+
}
5+
type Tree = TreeInnerNode | string;
6+
7+
interface Options {
8+
filename: string;
9+
directory: string;
10+
visited?: Tree;
11+
nonExistent?: string[];
12+
isListForm?: boolean;
13+
requireConfig?: string;
14+
webpackConfig?: string;
15+
nodeModulesConfig?: any;
16+
detectiveConfig?: any;
17+
tsConfig?: string | Record<string, any>;
18+
noTypeDefinitions?: boolean;
19+
filter?: (path: string) => boolean;
20+
}
21+
22+
interface Config extends Options {
23+
clone: () => Config;
24+
}
25+
26+
function toList (options: Options): string[];
27+
function _getDependencies (config: Config): string[];
28+
}
29+
30+
declare function dependencyTree (options: dependencyTree.Options): dependencyTree.Tree;
31+
32+
export = dependencyTree;

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "8.0.0",
44
"description": "Get the dependency tree of a module",
55
"main": "index.js",
6+
"types": "index.d.ts",
67
"scripts": {
78
"test": "jscs index.js test/test.js && ./node_modules/.bin/mocha --require esm test/test.js"
89
},

0 commit comments

Comments
 (0)