1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | import * as fs from 'fs';
|
18 | import Stats = fs.Stats;
|
19 | import PathLike = fs.PathLike;
|
20 |
|
21 | export * from 'fs';
|
22 |
|
23 | export function copy(src: string, dest: string, options?: CopyOptions): Promise<void>;
|
24 | export function copy(src: string, dest: string, callback: (err: Error) => void): void;
|
25 | export function copy(src: string, dest: string, options: CopyOptions, callback: (err: Error) => void): void;
|
26 | export function copySync(src: string, dest: string, options?: CopyOptionsSync): void;
|
27 |
|
28 | export function copyFile(src: string, dest: string, flags?: number): Promise<void>;
|
29 | export function copyFile(src: string, dest: string, callback: (err: Error) => void): void;
|
30 | export function copyFile(src: string, dest: string, flags: number, callback: (err: Error) => void): void;
|
31 |
|
32 | export function move(src: string, dest: string, options?: MoveOptions): Promise<void>;
|
33 | export function move(src: string, dest: string, callback: (err: Error) => void): void;
|
34 | export function move(src: string, dest: string, options: MoveOptions, callback: (err: Error) => void): void;
|
35 | export function moveSync(src: string, dest: string, options?: MoveOptions): void;
|
36 |
|
37 | export function createFile(file: string): Promise<void>;
|
38 | export function createFile(file: string, callback: (err: Error) => void): void;
|
39 | export function createFileSync(file: string): void;
|
40 |
|
41 | export function createSymlink(src: string, dest: string, type: SymlinkType): Promise<void>;
|
42 | export function createSymlink(src: string, dest: string, type: SymlinkType, callback?: (err: Error) => void): void;
|
43 | export function createSymlinkSync(src: string, dest: string, type: SymlinkType): void;
|
44 |
|
45 | export function ensureDir(path: string, options?: EnsureOptions | number): Promise<void>;
|
46 | export function ensureDir(path: string, callback?: (err: Error) => void): void;
|
47 | export function ensureDir(path: string, options?: EnsureOptions | number, callback?: (err: Error) => void): void;
|
48 | export function ensureDirSync(path: string, options?: EnsureOptions | number): void;
|
49 |
|
50 | export function mkdirs(dir: string): Promise<void>;
|
51 | export function mkdirs(dir: string, callback: (err: Error) => void): void;
|
52 | export function mkdirp(dir: string): Promise<void>;
|
53 | export function mkdirp(dir: string, callback: (err: Error) => void): void;
|
54 | export function mkdirsSync(dir: string): void;
|
55 | export function mkdirpSync(dir: string): void;
|
56 |
|
57 | export function outputFile(
|
58 | file: string,
|
59 | data: any,
|
60 | options?: WriteFileOptions | BufferEncoding | string,
|
61 | ): Promise<void>;
|
62 | export function outputFile(file: string, data: any, callback: (err: Error) => void): void;
|
63 | export function outputFile(
|
64 | file: string,
|
65 | data: any,
|
66 | options: WriteFileOptions | string,
|
67 | callback: (err: Error) => void,
|
68 | ): void;
|
69 | export function outputFileSync(file: string, data: any, options?: WriteFileOptions | BufferEncoding | string): void;
|
70 |
|
71 | export function readJson(file: string, options?: ReadOptions | BufferEncoding | string): Promise<any>;
|
72 | export function readJson(file: string, callback: (err: Error, jsonObject: any) => void): void;
|
73 | export function readJson(
|
74 | file: string,
|
75 | options: ReadOptions | BufferEncoding | string,
|
76 | callback: (err: Error, jsonObject: any) => void,
|
77 | ): void;
|
78 | export function readJSON(file: string, options?: ReadOptions | BufferEncoding | string): Promise<any>;
|
79 | export function readJSON(file: string, callback: (err: Error, jsonObject: any) => void): void;
|
80 | export function readJSON(
|
81 | file: string,
|
82 | options: ReadOptions | BufferEncoding | string,
|
83 | callback: (err: Error, jsonObject: any) => void,
|
84 | ): void;
|
85 |
|
86 | export function readJsonSync(file: string, options?: ReadOptions | BufferEncoding | string): any;
|
87 | export function readJSONSync(file: string, options?: ReadOptions | BufferEncoding | string): any;
|
88 |
|
89 | export function remove(dir: string, callback: (err: Error) => void): void;
|
90 | export function remove(dir: string, callback?: (err: Error) => void): Promise<void>;
|
91 | export function removeSync(dir: string): void;
|
92 |
|
93 | export function outputJSON(file: string, data: any, options?: WriteOptions | BufferEncoding | string): Promise<void>;
|
94 | export function outputJSON(
|
95 | file: string,
|
96 | data: any,
|
97 | options: WriteOptions | BufferEncoding | string,
|
98 | callback: (err: Error) => void,
|
99 | ): void;
|
100 | export function outputJSON(file: string, data: any, callback: (err: Error) => void): void;
|
101 | export function outputJson(file: string, data: any, options?: WriteOptions | BufferEncoding | string): Promise<void>;
|
102 | export function outputJson(
|
103 | file: string,
|
104 | data: any,
|
105 | options: WriteOptions | BufferEncoding | string,
|
106 | callback: (err: Error) => void,
|
107 | ): void;
|
108 | export function outputJson(file: string, data: any, callback: (err: Error) => void): void;
|
109 | export function outputJsonSync(file: string, data: any, options?: WriteOptions | BufferEncoding | string): void;
|
110 | export function outputJSONSync(file: string, data: any, options?: WriteOptions | BufferEncoding | string): void;
|
111 |
|
112 | export function writeJSON(file: string, object: any, options?: WriteOptions | BufferEncoding | string): Promise<void>;
|
113 | export function writeJSON(file: string, object: any, callback: (err: Error) => void): void;
|
114 | export function writeJSON(
|
115 | file: string,
|
116 | object: any,
|
117 | options: WriteOptions | BufferEncoding | string,
|
118 | callback: (err: Error) => void,
|
119 | ): void;
|
120 | export function writeJson(file: string, object: any, options?: WriteOptions | BufferEncoding | string): Promise<void>;
|
121 | export function writeJson(file: string, object: any, callback: (err: Error) => void): void;
|
122 | export function writeJson(
|
123 | file: string,
|
124 | object: any,
|
125 | options: WriteOptions | BufferEncoding | string,
|
126 | callback: (err: Error) => void,
|
127 | ): void;
|
128 |
|
129 | export function writeJsonSync(file: string, object: any, options?: WriteOptions | BufferEncoding | string): void;
|
130 | export function writeJSONSync(file: string, object: any, options?: WriteOptions | BufferEncoding | string): void;
|
131 |
|
132 | export function ensureFile(path: string): Promise<void>;
|
133 | export function ensureFile(path: string, callback: (err: Error) => void): void;
|
134 | export function ensureFileSync(path: string): void;
|
135 |
|
136 | export function ensureLink(src: string, dest: string): Promise<void>;
|
137 | export function ensureLink(src: string, dest: string, callback: (err: Error) => void): void;
|
138 |
|
139 | export const createLink: typeof ensureLink;
|
140 | export function ensureLinkSync(src: string, dest: string): void;
|
141 |
|
142 | export const createLinkSync: typeof ensureLinkSync;
|
143 |
|
144 | export function ensureSymlink(src: string, dest: string, type?: SymlinkType): Promise<void>;
|
145 | export function ensureSymlink(src: string, dest: string, type: SymlinkType, callback: (err: Error) => void): void;
|
146 | export function ensureSymlink(src: string, dest: string, callback: (err: Error) => void): void;
|
147 | export function ensureSymlinkSync(src: string, dest: string, type?: SymlinkType): void;
|
148 |
|
149 | export function emptyDir(path: string): Promise<void>;
|
150 | export function emptyDir(path: string, callback: (err: Error) => void): void;
|
151 | export const emptydir: typeof emptyDir;
|
152 |
|
153 | export function emptyDirSync(path: string): void;
|
154 | export const emptydirSync: typeof emptyDirSync;
|
155 |
|
156 | export function pathExists(path: string): Promise<boolean>;
|
157 | export function pathExists(path: string, callback: (err: Error, exists: boolean) => void): void;
|
158 | export function pathExistsSync(path: string): boolean;
|
159 |
|
160 |
|
161 |
|
162 |
|
163 | export function access(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
|
164 | export function access(path: PathLike, mode: number, callback: (err: NodeJS.ErrnoException) => void): void;
|
165 | export function access(path: PathLike, mode?: number): Promise<void>;
|
166 |
|
167 | export function appendFile(
|
168 | file: PathLike | number,
|
169 | data: any,
|
170 | options: {
|
171 | encoding?: BufferEncoding | string | undefined;
|
172 | mode?: number | string | undefined;
|
173 | flag?: string | undefined;
|
174 | },
|
175 | callback: (err: NodeJS.ErrnoException) => void,
|
176 | ): void;
|
177 | export function appendFile(file: PathLike | number, data: any, callback: (err: NodeJS.ErrnoException) => void): void;
|
178 | export function appendFile(
|
179 | file: PathLike | number,
|
180 | data: any,
|
181 | options?:
|
182 | | {
|
183 | encoding?: BufferEncoding | string | undefined;
|
184 | mode?: number | string | undefined;
|
185 | flag?: string | undefined;
|
186 | }
|
187 | | BufferEncoding
|
188 | | string,
|
189 | ): Promise<void>;
|
190 |
|
191 | export function chmod(path: PathLike, mode: Mode, callback: (err: NodeJS.ErrnoException) => void): void;
|
192 | export function chmod(path: PathLike, mode: Mode): Promise<void>;
|
193 |
|
194 | export function chown(path: PathLike, uid: number, gid: number): Promise<void>;
|
195 | export function chown(path: PathLike, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void;
|
196 |
|
197 | export function close(fd: number, callback: (err: NodeJS.ErrnoException) => void): void;
|
198 | export function close(fd: number): Promise<void>;
|
199 |
|
200 | export function fchmod(fd: number, mode: Mode, callback: (err: NodeJS.ErrnoException) => void): void;
|
201 | export function fchmod(fd: number, mode: Mode): Promise<void>;
|
202 |
|
203 | export function fchown(fd: number, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void;
|
204 | export function fchown(fd: number, uid: number, gid: number): Promise<void>;
|
205 |
|
206 | export function fdatasync(fd: number, callback: () => void): void;
|
207 | export function fdatasync(fd: number): Promise<void>;
|
208 |
|
209 | export function fstat(fd: number, callback: (err: NodeJS.ErrnoException, stats: Stats) => any): void;
|
210 | export function fstat(fd: number): Promise<Stats>;
|
211 |
|
212 | export function fsync(fd: number, callback: (err: NodeJS.ErrnoException) => void): void;
|
213 | export function fsync(fd: number): Promise<void>;
|
214 |
|
215 | export function ftruncate(fd: number, callback: (err: NodeJS.ErrnoException) => void): void;
|
216 | export function ftruncate(fd: number, len: number, callback: (err: NodeJS.ErrnoException) => void): void;
|
217 | export function ftruncate(fd: number, len?: number): Promise<void>;
|
218 |
|
219 | export function futimes(fd: number, atime: number, mtime: number, callback: (err: NodeJS.ErrnoException) => void): void;
|
220 | export function futimes(fd: number, atime: Date, mtime: Date, callback: (err: NodeJS.ErrnoException) => void): void;
|
221 | export function futimes(fd: number, atime: number, mtime: number): Promise<void>;
|
222 | export function futimes(fd: number, atime: Date, mtime: Date): Promise<void>;
|
223 |
|
224 | export function lchown(path: PathLike, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void;
|
225 | export function lchown(path: PathLike, uid: number, gid: number): Promise<void>;
|
226 |
|
227 | export function link(existingPath: PathLike, newPath: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
|
228 | export function link(existingPath: PathLike, newPath: PathLike): Promise<void>;
|
229 |
|
230 | export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException, stats: Stats) => any): void;
|
231 | export function lstat(path: PathLike): Promise<Stats>;
|
232 |
|
233 |
|
234 |
|
235 |
|
236 |
|
237 |
|
238 | export function mkdir(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
|
239 |
|
240 |
|
241 |
|
242 |
|
243 |
|
244 | export function mkdir(
|
245 | path: PathLike,
|
246 | options: Mode | fs.MakeDirectoryOptions | null,
|
247 | callback: (err: NodeJS.ErrnoException) => void,
|
248 | ): void;
|
249 | export function mkdir(path: PathLike, options?: Mode | fs.MakeDirectoryOptions | null): Promise<void>;
|
250 | export function mkdirSync(path: PathLike, options?: Mode | fs.MakeDirectoryOptions | null): void;
|
251 |
|
252 | export function open(
|
253 | path: PathLike,
|
254 | flags: string | number,
|
255 | callback: (err: NodeJS.ErrnoException, fd: number) => void,
|
256 | ): void;
|
257 | export function open(
|
258 | path: PathLike,
|
259 | flags: string | number,
|
260 | mode: Mode,
|
261 | callback: (err: NodeJS.ErrnoException, fd: number) => void,
|
262 | ): void;
|
263 | export function open(path: PathLike, flags: string | number, mode?: Mode | null): Promise<number>;
|
264 |
|
265 | export function opendir(path: string, cb: (err: NodeJS.ErrnoException | null, dir: fs.Dir) => void): void;
|
266 | export function opendir(
|
267 | path: string,
|
268 | options: fs.OpenDirOptions,
|
269 | cb: (err: NodeJS.ErrnoException | null, dir: fs.Dir) => void,
|
270 | ): void;
|
271 | export function opendir(path: string, options?: fs.OpenDirOptions): Promise<fs.Dir>;
|
272 |
|
273 | export function read<TBuffer extends ArrayBufferView>(
|
274 | fd: number,
|
275 | buffer: TBuffer,
|
276 | offset: number,
|
277 | length: number,
|
278 | position: number | null,
|
279 | callback: (err: NodeJS.ErrnoException, bytesRead: number, buffer: TBuffer) => void,
|
280 | ): void;
|
281 | export function read<TBuffer extends ArrayBufferView>(
|
282 | fd: number,
|
283 | buffer: TBuffer,
|
284 | offset: number,
|
285 | length: number,
|
286 | position: number | null,
|
287 | ): Promise<{ bytesRead: number; buffer: TBuffer }>;
|
288 |
|
289 | export function readFile(file: PathLike | number, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void;
|
290 | export function readFile(
|
291 | file: PathLike | number,
|
292 | encoding: BufferEncoding | string,
|
293 | callback: (err: NodeJS.ErrnoException, data: string) => void,
|
294 | ): void;
|
295 | export function readFile(
|
296 | file: PathLike | number,
|
297 | options: { flag?: string | undefined } | { encoding: BufferEncoding | string; flag?: string | undefined },
|
298 | callback: (err: NodeJS.ErrnoException, data: Buffer) => void,
|
299 | ): void;
|
300 | export function readFile(
|
301 | file: PathLike | number,
|
302 | options: { flag?: string | undefined } | { encoding: BufferEncoding | string; flag?: string | undefined },
|
303 | ): Promise<string>;
|
304 |
|
305 | export function readFile(file: PathLike | number, encoding: BufferEncoding | string): Promise<string>;
|
306 | export function readFile(file: PathLike | number): Promise<Buffer>;
|
307 |
|
308 | export function readdir(path: PathLike, callback: (err: NodeJS.ErrnoException, files: string[]) => void): void;
|
309 | export function readdir(
|
310 | path: PathLike,
|
311 | options: 'buffer' | { encoding: 'buffer'; withFileTypes?: false | undefined },
|
312 | ): Promise<Buffer[]>;
|
313 | export function readdir(
|
314 | path: PathLike,
|
315 | options?:
|
316 | | { encoding: BufferEncoding | string | null; withFileTypes?: false | undefined }
|
317 | | BufferEncoding
|
318 | | string
|
319 | | null,
|
320 | ): Promise<string[]>;
|
321 | export function readdir(
|
322 | path: PathLike,
|
323 | options?: { encoding?: BufferEncoding | string | null | undefined; withFileTypes?: false | undefined },
|
324 | ): Promise<string[] | Buffer[]>;
|
325 | export function readdir(
|
326 | path: PathLike,
|
327 | options: { encoding?: BufferEncoding | string | null | undefined; withFileTypes: true },
|
328 | ): Promise<fs.Dirent[]>;
|
329 |
|
330 | export function readlink(path: PathLike, callback: (err: NodeJS.ErrnoException, linkString: string) => any): void;
|
331 | export function readlink(path: PathLike): Promise<string>;
|
332 |
|
333 | export function realpath(path: PathLike, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void;
|
334 | export function realpath(
|
335 | path: PathLike,
|
336 | cache: { [path: string]: string },
|
337 | callback: (err: NodeJS.ErrnoException, resolvedPath: string) => any,
|
338 | ): void;
|
339 | export function realpath(path: PathLike, cache?: { [path: string]: string }): Promise<string>;
|
340 |
|
341 |
|
342 | export namespace realpath {
|
343 | const native: {
|
344 | (path: PathLike, options: { encoding: 'buffer' } | 'buffer'): Promise<Buffer>;
|
345 | (
|
346 | path: PathLike,
|
347 | options: { encoding: BufferEncoding | string | null } | BufferEncoding | string | undefined | null,
|
348 | ): Promise<string>;
|
349 | (path: PathLike, options: { encoding: BufferEncoding | string | null } | string | undefined | null): Promise<
|
350 | string | Buffer
|
351 | >;
|
352 | (path: PathLike): Promise<string>;
|
353 | } & typeof fs.realpath.native;
|
354 | }
|
355 |
|
356 |
|
357 | export function rename(oldPath: PathLike, newPath: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
|
358 | export function rename(oldPath: PathLike, newPath: PathLike): Promise<void>;
|
359 |
|
360 |
|
361 |
|
362 |
|
363 |
|
364 |
|
365 |
|
366 | export function rm(
|
367 | path: PathLike,
|
368 | options?: {
|
369 | force?: boolean | undefined;
|
370 | maxRetries?: number | undefined;
|
371 | recursive?: boolean | undefined;
|
372 | retryDelay?: number | undefined;
|
373 | },
|
374 | ): Promise<void>;
|
375 |
|
376 |
|
377 |
|
378 |
|
379 |
|
380 |
|
381 | export function rmdir(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
|
382 | export function rmdir(path: PathLike, options?: fs.RmDirOptions): Promise<void>;
|
383 |
|
384 | export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException, stats: Stats) => any): void;
|
385 | export function stat(path: PathLike): Promise<Stats>;
|
386 |
|
387 | export function symlink(
|
388 | target: PathLike,
|
389 | path: PathLike,
|
390 | type: SymlinkType | undefined,
|
391 | callback: (err: NodeJS.ErrnoException) => void,
|
392 | ): void;
|
393 | export function symlink(target: PathLike, path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
|
394 | export function symlink(target: PathLike, path: PathLike, type?: SymlinkType): Promise<void>;
|
395 |
|
396 | export function truncate(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
|
397 | export function truncate(path: PathLike, len: number, callback: (err: NodeJS.ErrnoException) => void): void;
|
398 | export function truncate(path: PathLike, len?: number): Promise<void>;
|
399 |
|
400 |
|
401 |
|
402 |
|
403 |
|
404 |
|
405 | export function unlink(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
|
406 | export function unlink(path: PathLike): Promise<void>;
|
407 |
|
408 | export function utimes(
|
409 | path: PathLike,
|
410 | atime: number,
|
411 | mtime: number,
|
412 | callback: (err: NodeJS.ErrnoException) => void,
|
413 | ): void;
|
414 | export function utimes(path: PathLike, atime: Date, mtime: Date, callback: (err: NodeJS.ErrnoException) => void): void;
|
415 | export function utimes(path: PathLike, atime: number, mtime: number): Promise<void>;
|
416 | export function utimes(path: PathLike, atime: Date, mtime: Date): Promise<void>;
|
417 |
|
418 | export function write<TBuffer extends ArrayBufferView>(
|
419 | fd: number,
|
420 | buffer: TBuffer,
|
421 | offset: number,
|
422 | length: number,
|
423 | position: number | null,
|
424 | callback: (err: NodeJS.ErrnoException, written: number, buffer: TBuffer) => void,
|
425 | ): void;
|
426 | export function write<TBuffer extends ArrayBufferView>(
|
427 | fd: number,
|
428 | buffer: TBuffer,
|
429 | offset: number,
|
430 | length: number,
|
431 | callback: (err: NodeJS.ErrnoException, written: number, buffer: TBuffer) => void,
|
432 | ): void;
|
433 | export function write(
|
434 | fd: number,
|
435 | data: any,
|
436 | callback: (err: NodeJS.ErrnoException, written: number, str: string) => void,
|
437 | ): void;
|
438 | export function write(
|
439 | fd: number,
|
440 | data: any,
|
441 | offset: number,
|
442 | callback: (err: NodeJS.ErrnoException, written: number, str: string) => void,
|
443 | ): void;
|
444 | export function write(
|
445 | fd: number,
|
446 | data: any,
|
447 | offset: number,
|
448 | encoding: BufferEncoding | string,
|
449 | callback: (err: NodeJS.ErrnoException, written: number, str: string) => void,
|
450 | ): void;
|
451 | export function write<TBuffer extends ArrayBufferView>(
|
452 | fd: number,
|
453 | buffer: TBuffer,
|
454 | offset?: number,
|
455 | length?: number,
|
456 | position?: number | null,
|
457 | ): Promise<{ bytesWritten: number; buffer: TBuffer }>;
|
458 | export function write(
|
459 | fd: number,
|
460 | data: any,
|
461 | offset?: number,
|
462 | encoding?: BufferEncoding | string,
|
463 | ): Promise<{ bytesWritten: number; buffer: string }>;
|
464 |
|
465 | export function writeFile(file: PathLike | number, data: any, callback: (err: NodeJS.ErrnoException) => void): void;
|
466 | export function writeFile(
|
467 | file: PathLike | number,
|
468 | data: any,
|
469 | options?: WriteFileOptions | BufferEncoding | string,
|
470 | ): Promise<void>;
|
471 | export function writeFile(
|
472 | file: PathLike | number,
|
473 | data: any,
|
474 | options: WriteFileOptions | BufferEncoding | string,
|
475 | callback: (err: NodeJS.ErrnoException) => void,
|
476 | ): void;
|
477 |
|
478 | export function writev(
|
479 | fd: number,
|
480 | buffers: NodeJS.ArrayBufferView[],
|
481 | position: number,
|
482 | cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void,
|
483 | ): void;
|
484 | export function writev(
|
485 | fd: number,
|
486 | buffers: NodeJS.ArrayBufferView[],
|
487 | cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void,
|
488 | ): void;
|
489 | export function writev(fd: number, buffers: NodeJS.ArrayBufferView[], position?: number): Promise<WritevResult>;
|
490 |
|
491 |
|
492 |
|
493 |
|
494 |
|
495 |
|
496 | export function mkdtemp(prefix: string): Promise<string>;
|
497 | export function mkdtemp(prefix: string, callback: (err: NodeJS.ErrnoException, folder: string) => void): void;
|
498 |
|
499 | export interface PathEntry {
|
500 | path: string;
|
501 | stats: Stats;
|
502 | }
|
503 |
|
504 | export interface PathEntryStream {
|
505 | read(): PathEntry | null;
|
506 | }
|
507 |
|
508 | export type CopyFilterSync = (src: string, dest: string) => boolean;
|
509 | export type CopyFilterAsync = (src: string, dest: string) => Promise<boolean>;
|
510 |
|
511 | export type SymlinkType = 'dir' | 'file' | 'junction';
|
512 |
|
513 | export type Mode = string | number;
|
514 |
|
515 | export type ArrayBufferView = NodeJS.TypedArray | DataView;
|
516 |
|
517 | export interface CopyOptions {
|
518 | dereference?: boolean | undefined;
|
519 | overwrite?: boolean | undefined;
|
520 | preserveTimestamps?: boolean | undefined;
|
521 | errorOnExist?: boolean | undefined;
|
522 | filter?: CopyFilterSync | CopyFilterAsync | undefined;
|
523 | recursive?: boolean | undefined;
|
524 | }
|
525 |
|
526 | export interface CopyOptionsSync extends CopyOptions {
|
527 | filter?: CopyFilterSync | undefined;
|
528 | }
|
529 |
|
530 | export interface EnsureOptions {
|
531 | mode?: number | undefined;
|
532 | }
|
533 |
|
534 | export interface MoveOptions {
|
535 | overwrite?: boolean | undefined;
|
536 | limit?: number | undefined;
|
537 | }
|
538 |
|
539 | export interface ReadOptions {
|
540 | throws?: boolean | undefined;
|
541 | fs?: object | undefined;
|
542 | reviver?: any;
|
543 | encoding?: BufferEncoding | string | undefined;
|
544 | flag?: string | undefined;
|
545 | }
|
546 |
|
547 | export interface WriteFileOptions {
|
548 | encoding?: BufferEncoding | string | null | undefined;
|
549 | flag?: string | undefined;
|
550 | mode?: number | undefined;
|
551 | }
|
552 |
|
553 | export interface WriteOptions extends WriteFileOptions {
|
554 | fs?: object | undefined;
|
555 | replacer?: any;
|
556 | spaces?: number | string | undefined;
|
557 | EOL?: string | undefined;
|
558 | }
|
559 |
|
560 | export interface WritevResult {
|
561 | bytesWritten: number;
|
562 | buffers: ArrayBufferView[];
|
563 | }
|