forked from mihneadb/node-directory-tree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
54 lines (51 loc) · 1.18 KB
/
index.d.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
declare const directoryTree: (
path: string,
options?: {
normalizePath?: boolean;
exclude?: RegExp | RegExp[];
attributes?: string[];
extensions?: RegExp;
},
onEachFile?: (item: DirectoryTree, path: string, stats: Stats) => void,
onEachDirectory?: (item: DirectoryTree, path: string, stats: Stats) => void,
) => DirectoryTree;
declare class DirectoryTree {
path: string;
name: string;
size: number;
type: "directory" | "file";
children?: DirectoryTree[];
extension?: string;
}
/*
* Node.js fs.Stats from
* https://github.com/DefinitelyTyped/DefinitelyTyped/blob/fbe90f14d5f6b6d65c4aa78284f212c736078d19/types/node/index.d.ts#L3696
*/
declare class 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 = directoryTree;