forked from depcheck/depcheck
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.tmpl
72 lines (63 loc) · 1.95 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
60
61
62
63
64
65
66
67
68
69
70
71
72
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 {
type Node = Record<string, any>;
type Parser = (filePath: string, deps: ReadonlyArray<string>, rootDir: string) => Node | string[];
type Detector = (node: Node) => ReadonlyArray<string> | string;
interface PackageDependencies {
[dependencyName: string]: string;
}
interface Options {
ignoreBinPackage?: boolean;
skipMissing?: boolean;
ignoreMatches?: ReadonlyArray<string>;
ignoreDirs?: ReadonlyArray<string>;
ignorePath?: string;
ignorePatterns?: ReadonlyArray<string>;
package?: {
dependencies?: PackageDependencies;
devDependencies?: PackageDependencies;
peerDependencies?: PackageDependencies;
optionalDependencies?: PackageDependencies;
};
parsers?: {
[match: string]: Parser;
};
detectors?: ReadonlyArray<Detector>;
specials?: ReadonlyArray<Parser>;
}
interface Config {
ignoreBinPackage?: Options['ignoreBinPackage'];
skipMissing?: Options['skipMissing'];
json?: boolean;
ignores?: Options['ignoreMatches'];
ignoreDirs?: Options['ignoreDirs'];
ignorePath?: Options['ignorePath'];
ignorePatterns?: Options['ignorePatterns']
parsers?: { [match: string]: (keyof typeof parser) | ReadonlyArray<keyof typeof parser> };
detectors?: ReadonlyArray<keyof typeof detector>;
specials?: ReadonlyArray<keyof typeof special>;
}
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;