-
Notifications
You must be signed in to change notification settings - Fork 123
/
types.ts
86 lines (81 loc) · 1.86 KB
/
types.ts
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import { Job } from './node-file-trace';
import { Node } from './utils/types';
export interface Stats {
isFile(): boolean;
isDirectory(): boolean;
isBlockDevice(): boolean;
isCharacterDevice(): boolean;
isSymbolicLink(): boolean;
isFIFO(): boolean;
isSocket(): boolean;
dev: number;
ino: number;
mode: number;
nlink: number;
uid: number;
gid: number;
rdev: number;
size: number;
blksize: number;
blocks: number;
atimeMs: number;
mtimeMs: number;
ctimeMs: number;
birthtimeMs: number;
atime: Date;
mtime: Date;
ctime: Date;
birthtime: Date;
}
export interface NodeFileTraceOptions {
base?: string;
processCwd?: string;
exports?: string[];
conditions?: string[];
exportsOnly?: boolean;
ignore?: string | string[] | ((path: string) => boolean);
analysis?:
| boolean
| {
emitGlobs?: boolean;
computeFileReferences?: boolean;
evaluatePureExpressions?: boolean;
transformAST?: (path: string, node: Node) => Promise<void>;
};
cache?: any;
paths?: Record<string, string>;
ts?: boolean;
log?: boolean;
mixedModules?: boolean;
readFile?: (path: string) => Promise<Buffer | string | null>;
stat?: (path: string) => Promise<Stats | null>;
readlink?: (path: string) => Promise<string | null>;
resolve?: (
id: string,
parent: string,
job: Job,
cjsResolve: boolean,
) => Promise<string | string[]>;
fileIOConcurrency?: number;
}
export type NodeFileTraceReasonType =
| 'initial'
| 'resolve'
| 'dependency'
| 'asset'
| 'sharedlib';
export interface NodeFileTraceReasons
extends Map<
string,
{
type: NodeFileTraceReasonType[];
ignored: boolean;
parents: Set<string>;
}
> {}
export interface NodeFileTraceResult {
fileList: Set<string>;
esmFileList: Set<string>;
reasons: NodeFileTraceReasons;
warnings: Set<Error>;
}