-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtypes.ts
54 lines (50 loc) · 1.09 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
/**
* @author: lencx
* @create_at: Jun 14, 2020
*/
export interface GetFilesOptions {
// root directory
root: string;
include?: string[];
exclude?: string[];
ignore?: string[];
// default: false
hasInfo?: boolean;
}
export interface FindFileOptions {
path: string;
collect: any[];
exclude?: string[];
ignore?: string[];
hasInfo?: boolean;
isFirst?: boolean;
}
export interface FileInfoDetail {
// true if this is info for a regular file
isFile: boolean;
// true if this is info for a regular directory
isDirectory: boolean;
// true if this is info for a symlink
isSymlink: boolean;
// the size of the file, in bytes
size: number;
// format file size
fmtSzie: string;
// the last modification time of the file
mtime: Date | null;
// the last access time of the file
atime: Date | null;
// the creation time of the file
birthtime: Date | null;
}
export interface FileInfo {
path: string;
// file name
name: string;
// file extension
ext: string;
// current working directory
realPath: string;
// file info
info?: FileInfoDetail;
}