-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocs.js
116 lines (100 loc) · 2.59 KB
/
docs.js
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/**
Creates an object which can iterate through the types and names of files in a
directory. It calls {@link https://linux.die.net/man/2/getdents64|getdents64}
with a configurable buffer size.
@param {integer} size - Size of buffer to use when calling `getdents64`.
@param {integer} [fd] - Open file descriptor to directory (e.g. from `fs.open`). If you don't specfify this here, you'll need to call {@link Getdents#reset|reset}. Note you'll need to close `fd` yourself - it won't be closed when iteration is complete.
*/
class Getdents
{
constructor(size, fd)
{
}
/**
Set the directory to iterate.
@param {integer} fd - Open file descriptor to directory.
*/
reset(fd)
{
}
/**
Synchronously iterate over the entries in the directory (e.g. using
`for-of`). The value of each iteration is always `undefined`. You'll need
to read {@link Getdents#type|type} and/or {@link Getdents#name|name} at
each iteration in order to extract information from the entry as required.
*/
*[Symbol.iterator]()
{
}
/**
Asynchronously iterate over the entries in the directory (e.g. using
`for-await-of`). The value of each iteration is always `undefined`.
You'll need to read {@link Getdents#type|type} and/or
{@link Getdents#name|name} at each iteration in order to extract
information from the entry as required.
*/
async *[Symbol.asyncIterator]()
{
}
/**
@returns {integer} The type of the current entry. You can use the
`Getdents.DT_*` properties to check against the type.
*/
get type()
{
}
/**
@returns {string} The filename of the current entry.
*/
get name()
{
}
/**
@returns {integer} Type value of block devices.
*/
static get DT_BLK()
{
}
/**
@returns {integer} Type value of character devices.
*/
static get DT_CHR()
{
}
/**
@returns {integer} Type value of directories.
*/
static get DT_DIR()
{
}
/**
@returns {integer} Type value of named pipes.
*/
static get DT_FIFO()
{
}
/**
@returns {integer} Type value of symbolic links.
*/
static get DT_LNK()
{
}
/**
@returns {integer} Type value of regular files.
*/
static get DT_REG()
{
}
/**
@returns {integer} Type value of UNIX domain sockets.
*/
static get DT_SOCK()
{
}
/**
@returns {integer} Type value of files of unknown type.
*/
static get DT_UNKNOWN()
{
}
}