forked from depcheck/depcheck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.tmpl
59 lines (51 loc) · 1.4 KB
/
index.d.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
declare function depcheck(rootDir: string, options: depcheck.Options): Promise<depcheck.Results>;
declare function depcheck<T>(
rootDir: string,
options: depcheck.Options,
callback: (results: depcheck.Results) => T
): Promise<T>;
declare namespace depcheck {
interface Node {
[key: string]: any;
}
type Parser = (content: string, filePath: string, deps: ReadonlyArray<string>, rootDir: string) => Node;
type Detector = (node: Node) => ReadonlyArray<string> | string;
interface PackageDependencies {
[dependencyName: string]: string;
}
interface Options {
ignoreBinPackage?: boolean;
skipMissing?: boolean;
ignoreDirs?: ReadonlyArray<string>;
ignoreMatches?: ReadonlyArray<string>;
package?: {
dependencies?: PackageDependencies;
devDependencies?: PackageDependencies;
peerDependencies?: PackageDependencies;
optionalDependencies?: PackageDependencies;
};
parsers?: {
[match: string]: Parser;
};
detectors?: ReadonlyArray<Detector>;
specials?: ReadonlyArray<Parser>;
}
interface Results {
dependencies: string[];
devDependencies: string[];
using: {
[dependencyName: string]: string[];
};
missing: {
[dependencyName: string]: string[];
};
invalidFiles: {
[filePath: string]: any;
};
invalidDirs: {
[filePath: string]: any;
};
}
«Components»
}
export = depcheck;