-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
254 lines (196 loc) · 7.77 KB
/
index.d.ts
File metadata and controls
254 lines (196 loc) · 7.77 KB
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
/* auto-generated by NAPI-RS */
/* eslint-disable */
export declare class Dirent {
readonly name: string
readonly parentPath: string
isFile(): boolean
isDirectory(): boolean
isSymbolicLink(): boolean
isBlockDevice(): boolean
isCharacterDevice(): boolean
isFIFO(): boolean
isSocket(): boolean
get path(): string
}
export declare class Stats {
readonly dev: number
readonly mode: number
readonly nlink: number
readonly uid: number
readonly gid: number
readonly rdev: number
readonly blksize: number
readonly ino: number
readonly size: number
readonly blocks: number
readonly atimeMs: number
readonly mtimeMs: number
readonly ctimeMs: number
readonly birthtimeMs: number
isFile(): boolean
isDirectory(): boolean
isSymbolicLink(): boolean
isBlockDevice(): boolean
isCharacterDevice(): boolean
isFIFO(): boolean
isSocket(): boolean
/** Returns atime as a Date object (Node.js compatible) */
get atime(): Date
/** Returns mtime as a Date object (Node.js compatible) */
get mtime(): Date
/** Returns ctime as a Date object (Node.js compatible) */
get ctime(): Date
/** Returns birthtime as a Date object (Node.js compatible) */
get birthtime(): Date
}
export declare function access(path: string, mode?: number | undefined | null): Promise<unknown>
export declare function accessSync(path: string, mode?: number | undefined | null): void
export declare function appendFile(
path: string,
data: string | Buffer,
options?: WriteFileOptions | undefined | null,
): Promise<unknown>
export declare function appendFileSync(
path: string,
data: string | Buffer,
options?: WriteFileOptions | undefined | null,
): void
export declare function chmod(path: string, mode: number): Promise<unknown>
export declare function chmodSync(path: string, mode: number): void
export declare function chown(path: string, uid: number, gid: number): Promise<unknown>
export declare function chownSync(path: string, uid: number, gid: number): void
export declare function copyFile(src: string, dest: string, mode?: number | undefined | null): Promise<unknown>
export declare function copyFileSync(src: string, dest: string, mode?: number | undefined | null): void
export declare function cp(src: string, dest: string, options?: CpOptions | undefined | null): Promise<unknown>
export interface CpOptions {
recursive?: boolean
force?: boolean
errorOnExist?: boolean
preserveTimestamps?: boolean
dereference?: boolean
verbatimSymlinks?: boolean
/**
* Rush-FS extension: number of parallel threads for recursive copy.
* 0 or 1 means sequential; > 1 enables rayon parallel traversal.
*/
concurrency?: number
}
export declare function cpSync(src: string, dest: string, options?: CpOptions | undefined | null): void
export declare function exists(path: string): Promise<unknown>
export declare function existsSync(path: string): boolean
export declare function glob(pattern: string, options?: GlobOptions | undefined | null): Promise<unknown>
export interface GlobOptions {
cwd?: string
withFileTypes?: boolean
exclude?: Array<string>
concurrency?: number
gitIgnore?: boolean
}
export declare function globSync(
pattern: string,
options?: GlobOptions | undefined | null,
): Array<string> | Array<Dirent>
export declare function link(existingPath: string, newPath: string): Promise<unknown>
export declare function linkSync(existingPath: string, newPath: string): void
export declare function lstat(path: string): Promise<unknown>
export declare function lstatSync(path: string): Stats
export declare function mkdir(path: string, options?: MkdirOptions | undefined | null): Promise<unknown>
export interface MkdirOptions {
recursive?: boolean
mode?: number
}
export declare function mkdirSync(path: string, options?: MkdirOptions | undefined | null): string | null
export declare function mkdtemp(prefix: string): Promise<unknown>
export declare function mkdtempSync(prefix: string): string
export declare function readdir(path: string, options?: ReaddirOptions | undefined | null): Promise<unknown>
/** * Reads the contents of a directory.
* @param {string | Buffer | URL} path
* @param {string | {
* encoding?: string;
* withFileTypes?: boolean;
* recursive?: boolean;
* }} [options]
* @param {(
* err?: Error,
* files?: string[] | Buffer[] | Dirent[]
* ) => any} callback
* @returns {void}
*/
export interface ReaddirOptions {
/**
* File name encoding. 'utf8' (default) returns strings.
* 'buffer' returns Buffer objects for each name.
* Other values are treated as 'utf8'.
*/
encoding?: string
skipHidden?: boolean
concurrency?: number
recursive?: boolean
withFileTypes?: boolean
}
export declare function readdirSync(
path: string,
options?: ReaddirOptions | undefined | null,
): Array<string> | Array<Dirent>
export declare function readFile(path: string, options?: string | ReadFileOptions | undefined | null): Promise<unknown>
export interface ReadFileOptions {
encoding?: string
flag?: string
}
export declare function readFileSync(
path: string,
options?: string | ReadFileOptions | undefined | null,
): string | Buffer
export declare function readlink(path: string): Promise<unknown>
export declare function readlinkSync(path: string): string
export declare function realpath(path: string): Promise<unknown>
export declare function realpathSync(path: string): string
export declare function rename(oldPath: string, newPath: string): Promise<unknown>
export declare function renameSync(oldPath: string, newPath: string): void
export declare function rm(path: string, options?: RmOptions | undefined | null): Promise<unknown>
export declare function rmdir(path: string): Promise<unknown>
export declare function rmdirSync(path: string): void
/**
* Removes files and directories (modeled on the standard POSIX `rm` utility).
*
* - `force`: When true, silently ignore errors when path does not exist.
* - `recursive`: When true, remove directory and all its contents.
* - `maxRetries`: If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or `EPERM` error is
* encountered, Node.js retries the operation with a linear backoff of `retryDelay` ms longer on
* each try. This option represents the number of retries.
* - `retryDelay`: The amount of time in milliseconds to wait between retries (default 100ms).
* - `concurrency` (rush-fs extension): Number of parallel threads for recursive removal.
*/
export interface RmOptions {
force?: boolean
maxRetries?: number
recursive?: boolean
retryDelay?: number
concurrency?: number
}
export declare function rmSync(path: string, options?: RmOptions | undefined | null): void
export declare function stat(path: string): Promise<unknown>
export declare function statSync(path: string): Stats
export declare function symlink(target: string, path: string, symlinkType?: string | undefined | null): Promise<unknown>
export declare function symlinkSync(target: string, path: string, symlinkType?: string | undefined | null): void
export declare function truncate(path: string, len?: number | undefined | null): Promise<unknown>
export declare function truncateSync(path: string, len?: number | undefined | null): void
export declare function unlink(path: string): Promise<unknown>
export declare function unlinkSync(path: string): void
export declare function utimes(path: string, atime: number, mtime: number): Promise<unknown>
export declare function utimesSync(path: string, atime: number, mtime: number): void
export declare function writeFile(
path: string,
data: string | Buffer,
options?: WriteFileOptions | undefined | null,
): Promise<unknown>
export interface WriteFileOptions {
encoding?: string
mode?: number
flag?: string
}
export declare function writeFileSync(
path: string,
data: string | Buffer,
options?: WriteFileOptions | undefined | null,
): void