@types/node 14.17.4 → 14.17.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- node v14.17/README.md +1 -1
- node v14.17/assert.d.ts +3 -3
- node v14.17/async_hooks.d.ts +2 -2
- node v14.17/child_process.d.ts +51 -51
- node v14.17/cluster.d.ts +10 -10
- node v14.17/console.d.ts +4 -4
- node v14.17/crypto.d.ts +32 -32
- node v14.17/dgram.d.ts +9 -9
- node v14.17/dns.d.ts +6 -6
- node v14.17/events.d.ts +1 -1
- node v14.17/fs/promises.d.ts +25 -17
- node v14.17/fs.d.ts +82 -70
- node v14.17/globals.d.ts +19 -19
- node v14.17/http.d.ts +97 -97
- node v14.17/http2.d.ts +64 -64
- node v14.17/https.d.ts +4 -4
- node v14.17/inspector.d.ts +149 -149
- node v14.17/net.d.ts +32 -26
- node v14.17/package.json +2 -2
- node v14.17/path.d.ts +5 -5
- node v14.17/perf_hooks.d.ts +4 -4
- node v14.17/process.d.ts +9 -9
- node v14.17/querystring.d.ts +3 -3
- node v14.17/readline.d.ts +14 -14
- node v14.17/repl.d.ts +14 -14
- node v14.17/stream.d.ts +20 -20
- node v14.17/tls.d.ts +50 -50
- node v14.17/url.d.ts +15 -15
- node v14.17/util.d.ts +2 -2
- node v14.17/vm.d.ts +24 -24
- node v14.17/wasi.d.ts +7 -7
- node v14.17/worker_threads.d.ts +15 -15
- node v14.17/zlib.d.ts +16 -16
node v14.17/fs/promises.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ declare module 'fs/promises' {
|
|
|
34
34
|
* If `mode` is a string, it is parsed as an octal integer.
|
|
35
35
|
* If `flag` is not supplied, the default of `'a'` is used.
|
|
36
36
|
*/
|
|
37
|
-
appendFile(data: string | Uint8Array, options?: BaseEncodingOptions & { mode?: Mode, flag?: OpenMode } | BufferEncoding | null): Promise<void>;
|
|
37
|
+
appendFile(data: string | Uint8Array, options?: BaseEncodingOptions & { mode?: Mode | undefined, flag?: OpenMode | undefined } | BufferEncoding | null): Promise<void>;
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* Asynchronous fchown(2) - Change ownership of a file.
|
|
@@ -73,7 +73,7 @@ declare module 'fs/promises' {
|
|
|
73
73
|
* @param options An object that may contain an optional flag.
|
|
74
74
|
* If a flag is not provided, it defaults to `'r'`.
|
|
75
75
|
*/
|
|
76
|
-
readFile(options?: { encoding?: null, flag?: OpenMode } | null): Promise<Buffer>;
|
|
76
|
+
readFile(options?: { encoding?: null | undefined, flag?: OpenMode | undefined } | null): Promise<Buffer>;
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
79
|
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
|
@@ -81,7 +81,7 @@ declare module 'fs/promises' {
|
|
|
81
81
|
* @param options An object that may contain an optional flag.
|
|
82
82
|
* If a flag is not provided, it defaults to `'r'`.
|
|
83
83
|
*/
|
|
84
|
-
readFile(options: { encoding: BufferEncoding, flag?: OpenMode } | BufferEncoding): Promise<string>;
|
|
84
|
+
readFile(options: { encoding: BufferEncoding, flag?: OpenMode | undefined } | BufferEncoding): Promise<string>;
|
|
85
85
|
|
|
86
86
|
/**
|
|
87
87
|
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
|
@@ -89,12 +89,12 @@ declare module 'fs/promises' {
|
|
|
89
89
|
* @param options An object that may contain an optional flag.
|
|
90
90
|
* If a flag is not provided, it defaults to `'r'`.
|
|
91
91
|
*/
|
|
92
|
-
readFile(options?: BaseEncodingOptions & { flag?: OpenMode } | BufferEncoding | null): Promise<string | Buffer>;
|
|
92
|
+
readFile(options?: BaseEncodingOptions & { flag?: OpenMode | undefined } | BufferEncoding | null): Promise<string | Buffer>;
|
|
93
93
|
|
|
94
94
|
/**
|
|
95
95
|
* Asynchronous fstat(2) - Get file status.
|
|
96
96
|
*/
|
|
97
|
-
stat(opts?: StatOptions & { bigint?: false }): Promise<Stats>;
|
|
97
|
+
stat(opts?: StatOptions & { bigint?: false | undefined }): Promise<Stats>;
|
|
98
98
|
stat(opts: StatOptions & { bigint: true }): Promise<BigIntStats>;
|
|
99
99
|
stat(opts?: StatOptions): Promise<Stats | BigIntStats>;
|
|
100
100
|
|
|
@@ -143,7 +143,7 @@ declare module 'fs/promises' {
|
|
|
143
143
|
* If `mode` is a string, it is parsed as an octal integer.
|
|
144
144
|
* If `flag` is not supplied, the default of `'w'` is used.
|
|
145
145
|
*/
|
|
146
|
-
writeFile(data: string | Uint8Array, options?: BaseEncodingOptions & { mode?: Mode, flag?: OpenMode } | BufferEncoding | null): Promise<void>;
|
|
146
|
+
writeFile(data: string | Uint8Array, options?: BaseEncodingOptions & { mode?: Mode | undefined, flag?: OpenMode | undefined } | BufferEncoding | null): Promise<void>;
|
|
147
147
|
|
|
148
148
|
/**
|
|
149
149
|
* See `fs.writev` promisified version.
|
|
@@ -293,7 +293,7 @@ declare module 'fs/promises' {
|
|
|
293
293
|
* @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
|
|
294
294
|
* should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
|
|
295
295
|
*/
|
|
296
|
-
function mkdir(path: PathLike, options?: Mode | (MakeDirectoryOptions & { recursive?: false; }) | null): Promise<void>;
|
|
296
|
+
function mkdir(path: PathLike, options?: Mode | (MakeDirectoryOptions & { recursive?: false | undefined; }) | null): Promise<void>;
|
|
297
297
|
|
|
298
298
|
/**
|
|
299
299
|
* Asynchronous mkdir(2) - create a directory.
|
|
@@ -308,21 +308,21 @@ declare module 'fs/promises' {
|
|
|
308
308
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
309
309
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
310
310
|
*/
|
|
311
|
-
function readdir(path: PathLike, options?: BaseEncodingOptions & { withFileTypes?: false } | BufferEncoding | null): Promise<string[]>;
|
|
311
|
+
function readdir(path: PathLike, options?: BaseEncodingOptions & { withFileTypes?: false | undefined } | BufferEncoding | null): Promise<string[]>;
|
|
312
312
|
|
|
313
313
|
/**
|
|
314
314
|
* Asynchronous readdir(3) - read a directory.
|
|
315
315
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
316
316
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
317
317
|
*/
|
|
318
|
-
function readdir(path: PathLike, options: { encoding: "buffer"; withFileTypes?: false } | "buffer"): Promise<Buffer[]>;
|
|
318
|
+
function readdir(path: PathLike, options: { encoding: "buffer"; withFileTypes?: false | undefined } | "buffer"): Promise<Buffer[]>;
|
|
319
319
|
|
|
320
320
|
/**
|
|
321
321
|
* Asynchronous readdir(3) - read a directory.
|
|
322
322
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
323
323
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
324
324
|
*/
|
|
325
|
-
function readdir(path: PathLike, options?: BaseEncodingOptions & { withFileTypes?: false } | BufferEncoding | null): Promise<string[] | Buffer[]>;
|
|
325
|
+
function readdir(path: PathLike, options?: BaseEncodingOptions & { withFileTypes?: false | undefined } | BufferEncoding | null): Promise<string[] | Buffer[]>;
|
|
326
326
|
|
|
327
327
|
/**
|
|
328
328
|
* Asynchronous readdir(3) - read a directory.
|
|
@@ -365,7 +365,7 @@ declare module 'fs/promises' {
|
|
|
365
365
|
* Asynchronous lstat(2) - Get file status. Does not dereference symbolic links.
|
|
366
366
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
367
367
|
*/
|
|
368
|
-
function lstat(path: PathLike, opts?: StatOptions & { bigint?: false }): Promise<Stats>;
|
|
368
|
+
function lstat(path: PathLike, opts?: StatOptions & { bigint?: false | undefined }): Promise<Stats>;
|
|
369
369
|
function lstat(path: PathLike, opts: StatOptions & { bigint: true }): Promise<BigIntStats>;
|
|
370
370
|
function lstat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
|
|
371
371
|
|
|
@@ -373,7 +373,7 @@ declare module 'fs/promises' {
|
|
|
373
373
|
* Asynchronous stat(2) - Get file status.
|
|
374
374
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
375
375
|
*/
|
|
376
|
-
function stat(path: PathLike, opts?: StatOptions & { bigint?: false }): Promise<Stats>;
|
|
376
|
+
function stat(path: PathLike, opts?: StatOptions & { bigint?: false | undefined }): Promise<Stats>;
|
|
377
377
|
function stat(path: PathLike, opts: StatOptions & { bigint: true }): Promise<BigIntStats>;
|
|
378
378
|
function stat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
|
|
379
379
|
|
|
@@ -510,7 +510,11 @@ declare module 'fs/promises' {
|
|
|
510
510
|
* If `mode` is a string, it is parsed as an octal integer.
|
|
511
511
|
* If `flag` is not supplied, the default of `'w'` is used.
|
|
512
512
|
*/
|
|
513
|
-
function writeFile(
|
|
513
|
+
function writeFile(
|
|
514
|
+
path: PathLike | FileHandle,
|
|
515
|
+
data: string | Uint8Array,
|
|
516
|
+
options?: BaseEncodingOptions & { mode?: Mode | undefined, flag?: OpenMode | undefined } | BufferEncoding | null
|
|
517
|
+
): Promise<void>;
|
|
514
518
|
|
|
515
519
|
/**
|
|
516
520
|
* Asynchronously append data to a file, creating the file if it does not exist.
|
|
@@ -524,7 +528,11 @@ declare module 'fs/promises' {
|
|
|
524
528
|
* If `mode` is a string, it is parsed as an octal integer.
|
|
525
529
|
* If `flag` is not supplied, the default of `'a'` is used.
|
|
526
530
|
*/
|
|
527
|
-
function appendFile(
|
|
531
|
+
function appendFile(
|
|
532
|
+
path: PathLike | FileHandle,
|
|
533
|
+
data: string | Uint8Array,
|
|
534
|
+
options?: BaseEncodingOptions & { mode?: Mode | undefined, flag?: OpenMode | undefined } | BufferEncoding | null
|
|
535
|
+
): Promise<void>;
|
|
528
536
|
|
|
529
537
|
/**
|
|
530
538
|
* Asynchronously reads the entire contents of a file.
|
|
@@ -533,7 +541,7 @@ declare module 'fs/promises' {
|
|
|
533
541
|
* @param options An object that may contain an optional flag.
|
|
534
542
|
* If a flag is not provided, it defaults to `'r'`.
|
|
535
543
|
*/
|
|
536
|
-
function readFile(path: PathLike | FileHandle, options?: { encoding?: null, flag?: OpenMode } | null): Promise<Buffer>;
|
|
544
|
+
function readFile(path: PathLike | FileHandle, options?: { encoding?: null | undefined, flag?: OpenMode | undefined } | null): Promise<Buffer>;
|
|
537
545
|
|
|
538
546
|
/**
|
|
539
547
|
* Asynchronously reads the entire contents of a file.
|
|
@@ -542,7 +550,7 @@ declare module 'fs/promises' {
|
|
|
542
550
|
* @param options An object that may contain an optional flag.
|
|
543
551
|
* If a flag is not provided, it defaults to `'r'`.
|
|
544
552
|
*/
|
|
545
|
-
function readFile(path: PathLike | FileHandle, options: { encoding: BufferEncoding, flag?: OpenMode } | BufferEncoding): Promise<string>;
|
|
553
|
+
function readFile(path: PathLike | FileHandle, options: { encoding: BufferEncoding, flag?: OpenMode | undefined } | BufferEncoding): Promise<string>;
|
|
546
554
|
|
|
547
555
|
/**
|
|
548
556
|
* Asynchronously reads the entire contents of a file.
|
|
@@ -551,7 +559,7 @@ declare module 'fs/promises' {
|
|
|
551
559
|
* @param options An object that may contain an optional flag.
|
|
552
560
|
* If a flag is not provided, it defaults to `'r'`.
|
|
553
561
|
*/
|
|
554
|
-
function readFile(path: PathLike | FileHandle, options?: BaseEncodingOptions & { flag?: OpenMode } | BufferEncoding | null): Promise<string | Buffer>;
|
|
562
|
+
function readFile(path: PathLike | FileHandle, options?: BaseEncodingOptions & { flag?: OpenMode | undefined } | BufferEncoding | null): Promise<string | Buffer>;
|
|
555
563
|
|
|
556
564
|
function opendir(path: string, options?: OpenDirOptions): Promise<Dir>;
|
|
557
565
|
}
|
node v14.17/fs.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ declare module 'fs' {
|
|
|
15
15
|
export type BufferEncodingOption = 'buffer' | { encoding: 'buffer' };
|
|
16
16
|
|
|
17
17
|
export interface BaseEncodingOptions {
|
|
18
|
-
encoding?: BufferEncoding | null;
|
|
18
|
+
encoding?: BufferEncoding | null | undefined;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export type OpenMode = number | string;
|
|
@@ -537,7 +537,7 @@ declare module 'fs' {
|
|
|
537
537
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
538
538
|
*/
|
|
539
539
|
export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
|
|
540
|
-
export function stat(path: PathLike, options: StatOptions & { bigint?: false } | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
|
|
540
|
+
export function stat(path: PathLike, options: StatOptions & { bigint?: false | undefined } | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
|
|
541
541
|
export function stat(path: PathLike, options: StatOptions & { bigint: true }, callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void): void;
|
|
542
542
|
export function stat(path: PathLike, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void;
|
|
543
543
|
|
|
@@ -547,7 +547,7 @@ declare module 'fs' {
|
|
|
547
547
|
* Asynchronous stat(2) - Get file status.
|
|
548
548
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
549
549
|
*/
|
|
550
|
-
function __promisify__(path: PathLike, options?: StatOptions & { bigint?: false }): Promise<Stats>;
|
|
550
|
+
function __promisify__(path: PathLike, options?: StatOptions & { bigint?: false | undefined }): Promise<Stats>;
|
|
551
551
|
function __promisify__(path: PathLike, options: StatOptions & { bigint: true }): Promise<BigIntStats>;
|
|
552
552
|
function __promisify__(path: PathLike, options?: StatOptions): Promise<Stats | BigIntStats>;
|
|
553
553
|
}
|
|
@@ -556,7 +556,7 @@ declare module 'fs' {
|
|
|
556
556
|
* Synchronous stat(2) - Get file status.
|
|
557
557
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
558
558
|
*/
|
|
559
|
-
export function statSync(path: PathLike, options?: StatOptions & { bigint?: false }): Stats;
|
|
559
|
+
export function statSync(path: PathLike, options?: StatOptions & { bigint?: false | undefined }): Stats;
|
|
560
560
|
export function statSync(path: PathLike, options: StatOptions & { bigint: true }): BigIntStats;
|
|
561
561
|
export function statSync(path: PathLike, options?: StatOptions): Stats | BigIntStats;
|
|
562
562
|
|
|
@@ -565,7 +565,7 @@ declare module 'fs' {
|
|
|
565
565
|
* @param fd A file descriptor.
|
|
566
566
|
*/
|
|
567
567
|
export function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
|
|
568
|
-
export function fstat(fd: number, options: StatOptions & { bigint?: false } | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
|
|
568
|
+
export function fstat(fd: number, options: StatOptions & { bigint?: false | undefined } | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
|
|
569
569
|
export function fstat(fd: number, options: StatOptions & { bigint: true }, callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void): void;
|
|
570
570
|
export function fstat(fd: number, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void;
|
|
571
571
|
|
|
@@ -575,7 +575,7 @@ declare module 'fs' {
|
|
|
575
575
|
* Asynchronous fstat(2) - Get file status.
|
|
576
576
|
* @param fd A file descriptor.
|
|
577
577
|
*/
|
|
578
|
-
function __promisify__(fd: number, options?: StatOptions & { bigint?: false }): Promise<Stats>;
|
|
578
|
+
function __promisify__(fd: number, options?: StatOptions & { bigint?: false | undefined }): Promise<Stats>;
|
|
579
579
|
function __promisify__(fd: number, options: StatOptions & { bigint: true }): Promise<BigIntStats>;
|
|
580
580
|
function __promisify__(fd: number, options?: StatOptions): Promise<Stats | BigIntStats>;
|
|
581
581
|
}
|
|
@@ -584,7 +584,7 @@ declare module 'fs' {
|
|
|
584
584
|
* Synchronous fstat(2) - Get file status.
|
|
585
585
|
* @param fd A file descriptor.
|
|
586
586
|
*/
|
|
587
|
-
export function fstatSync(fd: number, options?: StatOptions & { bigint?: false }): Stats;
|
|
587
|
+
export function fstatSync(fd: number, options?: StatOptions & { bigint?: false | undefined }): Stats;
|
|
588
588
|
export function fstatSync(fd: number, options: StatOptions & { bigint: true }): BigIntStats;
|
|
589
589
|
export function fstatSync(fd: number, options?: StatOptions): Stats | BigIntStats;
|
|
590
590
|
|
|
@@ -593,7 +593,7 @@ declare module 'fs' {
|
|
|
593
593
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
594
594
|
*/
|
|
595
595
|
export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
|
|
596
|
-
export function lstat(path: PathLike, options: StatOptions & { bigint?: false } | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
|
|
596
|
+
export function lstat(path: PathLike, options: StatOptions & { bigint?: false | undefined } | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
|
|
597
597
|
export function lstat(path: PathLike, options: StatOptions & { bigint: true }, callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void): void;
|
|
598
598
|
export function lstat(path: PathLike, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void;
|
|
599
599
|
|
|
@@ -603,7 +603,7 @@ declare module 'fs' {
|
|
|
603
603
|
* Asynchronous lstat(2) - Get file status. Does not dereference symbolic links.
|
|
604
604
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
605
605
|
*/
|
|
606
|
-
function __promisify__(path: PathLike, options?: StatOptions & { bigint?: false }): Promise<Stats>;
|
|
606
|
+
function __promisify__(path: PathLike, options?: StatOptions & { bigint?: false | undefined }): Promise<Stats>;
|
|
607
607
|
function __promisify__(path: PathLike, options: StatOptions & { bigint: true }): Promise<BigIntStats>;
|
|
608
608
|
function __promisify__(path: PathLike, options?: StatOptions): Promise<Stats | BigIntStats>;
|
|
609
609
|
}
|
|
@@ -612,7 +612,7 @@ declare module 'fs' {
|
|
|
612
612
|
* Synchronous lstat(2) - Get file status. Does not dereference symbolic links.
|
|
613
613
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
614
614
|
*/
|
|
615
|
-
export function lstatSync(path: PathLike, options?: StatOptions & { bigint?: false }): Stats;
|
|
615
|
+
export function lstatSync(path: PathLike, options?: StatOptions & { bigint?: false | undefined }): Stats;
|
|
616
616
|
export function lstatSync(path: PathLike, options: StatOptions & { bigint: true }): BigIntStats;
|
|
617
617
|
export function lstatSync(path: PathLike, options?: StatOptions): Stats | BigIntStats;
|
|
618
618
|
|
|
@@ -876,7 +876,7 @@ declare module 'fs' {
|
|
|
876
876
|
* `true`.
|
|
877
877
|
* @default 0
|
|
878
878
|
*/
|
|
879
|
-
maxRetries?: number;
|
|
879
|
+
maxRetries?: number | undefined;
|
|
880
880
|
/**
|
|
881
881
|
* @deprecated since v14.14.0 In future versions of Node.js,
|
|
882
882
|
* `fs.rmdir(path, { recursive: true })` will throw on nonexistent
|
|
@@ -888,13 +888,13 @@ declare module 'fs' {
|
|
|
888
888
|
* operations are retried on failure.
|
|
889
889
|
* @default false
|
|
890
890
|
*/
|
|
891
|
-
recursive?: boolean;
|
|
891
|
+
recursive?: boolean | undefined;
|
|
892
892
|
/**
|
|
893
893
|
* The amount of time in milliseconds to wait between retries.
|
|
894
894
|
* This option is ignored if the `recursive` option is not `true`.
|
|
895
895
|
* @default 100
|
|
896
896
|
*/
|
|
897
|
-
retryDelay?: number;
|
|
897
|
+
retryDelay?: number | undefined;
|
|
898
898
|
}
|
|
899
899
|
|
|
900
900
|
/**
|
|
@@ -924,7 +924,7 @@ declare module 'fs' {
|
|
|
924
924
|
* When `true`, exceptions will be ignored if `path` does not exist.
|
|
925
925
|
* @default false
|
|
926
926
|
*/
|
|
927
|
-
force?: boolean;
|
|
927
|
+
force?: boolean | undefined;
|
|
928
928
|
/**
|
|
929
929
|
* If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or
|
|
930
930
|
* `EPERM` error is encountered, Node.js will retry the operation with a linear
|
|
@@ -933,20 +933,20 @@ declare module 'fs' {
|
|
|
933
933
|
* `true`.
|
|
934
934
|
* @default 0
|
|
935
935
|
*/
|
|
936
|
-
maxRetries?: number;
|
|
936
|
+
maxRetries?: number | undefined;
|
|
937
937
|
/**
|
|
938
938
|
* If `true`, perform a recursive directory removal. In
|
|
939
939
|
* recursive mode, errors are not reported if `path` does not exist, and
|
|
940
940
|
* operations are retried on failure.
|
|
941
941
|
* @default false
|
|
942
942
|
*/
|
|
943
|
-
recursive?: boolean;
|
|
943
|
+
recursive?: boolean | undefined;
|
|
944
944
|
/**
|
|
945
945
|
* The amount of time in milliseconds to wait between retries.
|
|
946
946
|
* This option is ignored if the `recursive` option is not `true`.
|
|
947
947
|
* @default 100
|
|
948
948
|
*/
|
|
949
|
-
retryDelay?: number;
|
|
949
|
+
retryDelay?: number | undefined;
|
|
950
950
|
}
|
|
951
951
|
|
|
952
952
|
/**
|
|
@@ -974,12 +974,12 @@ declare module 'fs' {
|
|
|
974
974
|
* If a folder was created, the path to the first created folder will be returned.
|
|
975
975
|
* @default false
|
|
976
976
|
*/
|
|
977
|
-
recursive?: boolean;
|
|
977
|
+
recursive?: boolean | undefined;
|
|
978
978
|
/**
|
|
979
979
|
* A file mode. If a string is passed, it is parsed as an octal integer. If not specified
|
|
980
980
|
* @default 0o777
|
|
981
981
|
*/
|
|
982
|
-
mode?: Mode;
|
|
982
|
+
mode?: Mode | undefined;
|
|
983
983
|
}
|
|
984
984
|
|
|
985
985
|
/**
|
|
@@ -996,7 +996,7 @@ declare module 'fs' {
|
|
|
996
996
|
* @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
|
|
997
997
|
* should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
|
|
998
998
|
*/
|
|
999
|
-
export function mkdir(path: PathLike, options: Mode | (MakeDirectoryOptions & { recursive?: false; }) | null | undefined, callback: NoParamCallback): void;
|
|
999
|
+
export function mkdir(path: PathLike, options: Mode | (MakeDirectoryOptions & { recursive?: false | undefined; }) | null | undefined, callback: NoParamCallback): void;
|
|
1000
1000
|
|
|
1001
1001
|
/**
|
|
1002
1002
|
* Asynchronous mkdir(2) - create a directory.
|
|
@@ -1028,7 +1028,7 @@ declare module 'fs' {
|
|
|
1028
1028
|
* @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
|
|
1029
1029
|
* should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
|
|
1030
1030
|
*/
|
|
1031
|
-
function __promisify__(path: PathLike, options?: Mode | (MakeDirectoryOptions & { recursive?: false; }) | null): Promise<void>;
|
|
1031
|
+
function __promisify__(path: PathLike, options?: Mode | (MakeDirectoryOptions & { recursive?: false | undefined; }) | null): Promise<void>;
|
|
1032
1032
|
|
|
1033
1033
|
/**
|
|
1034
1034
|
* Asynchronous mkdir(2) - create a directory.
|
|
@@ -1053,7 +1053,7 @@ declare module 'fs' {
|
|
|
1053
1053
|
* @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
|
|
1054
1054
|
* should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
|
|
1055
1055
|
*/
|
|
1056
|
-
export function mkdirSync(path: PathLike, options?: Mode | (MakeDirectoryOptions & { recursive?: false; }) | null): void;
|
|
1056
|
+
export function mkdirSync(path: PathLike, options?: Mode | (MakeDirectoryOptions & { recursive?: false | undefined; }) | null): void;
|
|
1057
1057
|
|
|
1058
1058
|
/**
|
|
1059
1059
|
* Synchronous mkdir(2) - create a directory.
|
|
@@ -1142,7 +1142,7 @@ declare module 'fs' {
|
|
|
1142
1142
|
*/
|
|
1143
1143
|
export function readdir(
|
|
1144
1144
|
path: PathLike,
|
|
1145
|
-
options: { encoding: BufferEncoding | null; withFileTypes?: false } | BufferEncoding | undefined | null,
|
|
1145
|
+
options: { encoding: BufferEncoding | null; withFileTypes?: false | undefined } | BufferEncoding | undefined | null,
|
|
1146
1146
|
callback: (err: NodeJS.ErrnoException | null, files: string[]) => void,
|
|
1147
1147
|
): void;
|
|
1148
1148
|
|
|
@@ -1151,7 +1151,11 @@ declare module 'fs' {
|
|
|
1151
1151
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
1152
1152
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
1153
1153
|
*/
|
|
1154
|
-
export function readdir(
|
|
1154
|
+
export function readdir(
|
|
1155
|
+
path: PathLike,
|
|
1156
|
+
options: { encoding: "buffer"; withFileTypes?: false | undefined } | "buffer",
|
|
1157
|
+
callback: (err: NodeJS.ErrnoException | null, files: Buffer[]) => void
|
|
1158
|
+
): void;
|
|
1155
1159
|
|
|
1156
1160
|
/**
|
|
1157
1161
|
* Asynchronous readdir(3) - read a directory.
|
|
@@ -1160,7 +1164,7 @@ declare module 'fs' {
|
|
|
1160
1164
|
*/
|
|
1161
1165
|
export function readdir(
|
|
1162
1166
|
path: PathLike,
|
|
1163
|
-
options: BaseEncodingOptions & { withFileTypes?: false } | BufferEncoding | undefined | null,
|
|
1167
|
+
options: BaseEncodingOptions & { withFileTypes?: false | undefined } | BufferEncoding | undefined | null,
|
|
1164
1168
|
callback: (err: NodeJS.ErrnoException | null, files: string[] | Buffer[]) => void,
|
|
1165
1169
|
): void;
|
|
1166
1170
|
|
|
@@ -1184,21 +1188,21 @@ declare module 'fs' {
|
|
|
1184
1188
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
1185
1189
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
1186
1190
|
*/
|
|
1187
|
-
function __promisify__(path: PathLike, options?: { encoding: BufferEncoding | null; withFileTypes?: false } | BufferEncoding | null): Promise<string[]>;
|
|
1191
|
+
function __promisify__(path: PathLike, options?: { encoding: BufferEncoding | null; withFileTypes?: false | undefined } | BufferEncoding | null): Promise<string[]>;
|
|
1188
1192
|
|
|
1189
1193
|
/**
|
|
1190
1194
|
* Asynchronous readdir(3) - read a directory.
|
|
1191
1195
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
1192
1196
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
1193
1197
|
*/
|
|
1194
|
-
function __promisify__(path: PathLike, options: "buffer" | { encoding: "buffer"; withFileTypes?: false }): Promise<Buffer[]>;
|
|
1198
|
+
function __promisify__(path: PathLike, options: "buffer" | { encoding: "buffer"; withFileTypes?: false | undefined }): Promise<Buffer[]>;
|
|
1195
1199
|
|
|
1196
1200
|
/**
|
|
1197
1201
|
* Asynchronous readdir(3) - read a directory.
|
|
1198
1202
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
1199
1203
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
1200
1204
|
*/
|
|
1201
|
-
function __promisify__(path: PathLike, options?: BaseEncodingOptions & { withFileTypes?: false } | BufferEncoding | null): Promise<string[] | Buffer[]>;
|
|
1205
|
+
function __promisify__(path: PathLike, options?: BaseEncodingOptions & { withFileTypes?: false | undefined } | BufferEncoding | null): Promise<string[] | Buffer[]>;
|
|
1202
1206
|
|
|
1203
1207
|
/**
|
|
1204
1208
|
* Asynchronous readdir(3) - read a directory.
|
|
@@ -1213,21 +1217,21 @@ declare module 'fs' {
|
|
|
1213
1217
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
1214
1218
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
1215
1219
|
*/
|
|
1216
|
-
export function readdirSync(path: PathLike, options?: { encoding: BufferEncoding | null; withFileTypes?: false } | BufferEncoding | null): string[];
|
|
1220
|
+
export function readdirSync(path: PathLike, options?: { encoding: BufferEncoding | null; withFileTypes?: false | undefined } | BufferEncoding | null): string[];
|
|
1217
1221
|
|
|
1218
1222
|
/**
|
|
1219
1223
|
* Synchronous readdir(3) - read a directory.
|
|
1220
1224
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
1221
1225
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
1222
1226
|
*/
|
|
1223
|
-
export function readdirSync(path: PathLike, options: { encoding: "buffer"; withFileTypes?: false } | "buffer"): Buffer[];
|
|
1227
|
+
export function readdirSync(path: PathLike, options: { encoding: "buffer"; withFileTypes?: false | undefined } | "buffer"): Buffer[];
|
|
1224
1228
|
|
|
1225
1229
|
/**
|
|
1226
1230
|
* Synchronous readdir(3) - read a directory.
|
|
1227
1231
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
1228
1232
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
1229
1233
|
*/
|
|
1230
|
-
export function readdirSync(path: PathLike, options?: BaseEncodingOptions & { withFileTypes?: false } | BufferEncoding | null): string[] | Buffer[];
|
|
1234
|
+
export function readdirSync(path: PathLike, options?: BaseEncodingOptions & { withFileTypes?: false | undefined } | BufferEncoding | null): string[] | Buffer[];
|
|
1231
1235
|
|
|
1232
1236
|
/**
|
|
1233
1237
|
* Synchronous readdir(3) - read a directory.
|
|
@@ -1524,15 +1528,15 @@ declare module 'fs' {
|
|
|
1524
1528
|
/**
|
|
1525
1529
|
* @default 0
|
|
1526
1530
|
*/
|
|
1527
|
-
offset?: number;
|
|
1531
|
+
offset?: number | undefined;
|
|
1528
1532
|
/**
|
|
1529
1533
|
* @default `length of buffer`
|
|
1530
1534
|
*/
|
|
1531
|
-
length?: number;
|
|
1535
|
+
length?: number | undefined;
|
|
1532
1536
|
/**
|
|
1533
1537
|
* @default null
|
|
1534
1538
|
*/
|
|
1535
|
-
position?: number | null;
|
|
1539
|
+
position?: number | null | undefined;
|
|
1536
1540
|
}
|
|
1537
1541
|
|
|
1538
1542
|
/**
|
|
@@ -1558,7 +1562,11 @@ declare module 'fs' {
|
|
|
1558
1562
|
* @param options An object that may contain an optional flag.
|
|
1559
1563
|
* If a flag is not provided, it defaults to `'r'`.
|
|
1560
1564
|
*/
|
|
1561
|
-
export function readFile(
|
|
1565
|
+
export function readFile(
|
|
1566
|
+
path: PathLike | number,
|
|
1567
|
+
options: { encoding?: null | undefined; flag?: string | undefined; } | undefined | null,
|
|
1568
|
+
callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void
|
|
1569
|
+
): void;
|
|
1562
1570
|
|
|
1563
1571
|
/**
|
|
1564
1572
|
* Asynchronously reads the entire contents of a file.
|
|
@@ -1568,7 +1576,11 @@ declare module 'fs' {
|
|
|
1568
1576
|
* @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
|
|
1569
1577
|
* If a flag is not provided, it defaults to `'r'`.
|
|
1570
1578
|
*/
|
|
1571
|
-
export function readFile(
|
|
1579
|
+
export function readFile(
|
|
1580
|
+
path: PathLike | number,
|
|
1581
|
+
options: { encoding: BufferEncoding; flag?: string | undefined; } | BufferEncoding,
|
|
1582
|
+
callback: (err: NodeJS.ErrnoException | null, data: string) => void
|
|
1583
|
+
): void;
|
|
1572
1584
|
|
|
1573
1585
|
/**
|
|
1574
1586
|
* Asynchronously reads the entire contents of a file.
|
|
@@ -1580,7 +1592,7 @@ declare module 'fs' {
|
|
|
1580
1592
|
*/
|
|
1581
1593
|
export function readFile(
|
|
1582
1594
|
path: PathLike | number,
|
|
1583
|
-
options: BaseEncodingOptions & { flag?: string; } |
|
|
1595
|
+
options: BaseEncodingOptions & { flag?: string | undefined; } | BufferEncoding | undefined | null,
|
|
1584
1596
|
callback: (err: NodeJS.ErrnoException | null, data: string | Buffer) => void,
|
|
1585
1597
|
): void;
|
|
1586
1598
|
|
|
@@ -1600,7 +1612,7 @@ declare module 'fs' {
|
|
|
1600
1612
|
* @param options An object that may contain an optional flag.
|
|
1601
1613
|
* If a flag is not provided, it defaults to `'r'`.
|
|
1602
1614
|
*/
|
|
1603
|
-
function __promisify__(path: PathLike | number, options?: { encoding?: null; flag?: string; } | null): Promise<Buffer>;
|
|
1615
|
+
function __promisify__(path: PathLike | number, options?: { encoding?: null | undefined; flag?: string | undefined; } | null): Promise<Buffer>;
|
|
1604
1616
|
|
|
1605
1617
|
/**
|
|
1606
1618
|
* Asynchronously reads the entire contents of a file.
|
|
@@ -1610,7 +1622,7 @@ declare module 'fs' {
|
|
|
1610
1622
|
* @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
|
|
1611
1623
|
* If a flag is not provided, it defaults to `'r'`.
|
|
1612
1624
|
*/
|
|
1613
|
-
function __promisify__(path: PathLike | number, options: { encoding: BufferEncoding; flag?: string; } |
|
|
1625
|
+
function __promisify__(path: PathLike | number, options: { encoding: BufferEncoding; flag?: string | undefined; } | BufferEncoding): Promise<string>;
|
|
1614
1626
|
|
|
1615
1627
|
/**
|
|
1616
1628
|
* Asynchronously reads the entire contents of a file.
|
|
@@ -1620,7 +1632,7 @@ declare module 'fs' {
|
|
|
1620
1632
|
* @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
|
|
1621
1633
|
* If a flag is not provided, it defaults to `'r'`.
|
|
1622
1634
|
*/
|
|
1623
|
-
function __promisify__(path: PathLike | number, options?: BaseEncodingOptions & { flag?: string; } |
|
|
1635
|
+
function __promisify__(path: PathLike | number, options?: BaseEncodingOptions & { flag?: string | undefined; } | BufferEncoding | null): Promise<string | Buffer>;
|
|
1624
1636
|
}
|
|
1625
1637
|
|
|
1626
1638
|
/**
|
|
@@ -1630,7 +1642,7 @@ declare module 'fs' {
|
|
|
1630
1642
|
* If a file descriptor is provided, the underlying file will _not_ be closed automatically.
|
|
1631
1643
|
* @param options An object that may contain an optional flag. If a flag is not provided, it defaults to `'r'`.
|
|
1632
1644
|
*/
|
|
1633
|
-
export function readFileSync(path: PathLike | number, options?: { encoding?: null; flag?: string; } | null): Buffer;
|
|
1645
|
+
export function readFileSync(path: PathLike | number, options?: { encoding?: null | undefined; flag?: string | undefined; } | null): Buffer;
|
|
1634
1646
|
|
|
1635
1647
|
/**
|
|
1636
1648
|
* Synchronously reads the entire contents of a file.
|
|
@@ -1640,7 +1652,7 @@ declare module 'fs' {
|
|
|
1640
1652
|
* @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
|
|
1641
1653
|
* If a flag is not provided, it defaults to `'r'`.
|
|
1642
1654
|
*/
|
|
1643
|
-
export function readFileSync(path: PathLike | number, options: { encoding: BufferEncoding; flag?: string; } | BufferEncoding): string;
|
|
1655
|
+
export function readFileSync(path: PathLike | number, options: { encoding: BufferEncoding; flag?: string | undefined; } | BufferEncoding): string;
|
|
1644
1656
|
|
|
1645
1657
|
/**
|
|
1646
1658
|
* Synchronously reads the entire contents of a file.
|
|
@@ -1650,9 +1662,9 @@ declare module 'fs' {
|
|
|
1650
1662
|
* @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
|
|
1651
1663
|
* If a flag is not provided, it defaults to `'r'`.
|
|
1652
1664
|
*/
|
|
1653
|
-
export function readFileSync(path: PathLike | number, options?: BaseEncodingOptions & { flag?: string; } | BufferEncoding | null): string | Buffer;
|
|
1665
|
+
export function readFileSync(path: PathLike | number, options?: BaseEncodingOptions & { flag?: string | undefined; } | BufferEncoding | null): string | Buffer;
|
|
1654
1666
|
|
|
1655
|
-
export type WriteFileOptions = BaseEncodingOptions & { mode?: Mode; flag?: string; } |
|
|
1667
|
+
export type WriteFileOptions = BaseEncodingOptions & { mode?: Mode | undefined; flag?: string | undefined; } | BufferEncoding | null;
|
|
1656
1668
|
|
|
1657
1669
|
/**
|
|
1658
1670
|
* Asynchronously writes data to a file, replacing the file if it already exists.
|
|
@@ -1765,7 +1777,7 @@ declare module 'fs' {
|
|
|
1765
1777
|
/**
|
|
1766
1778
|
* Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed.
|
|
1767
1779
|
*/
|
|
1768
|
-
export function watchFile(filename: PathLike, options: { persistent?: boolean; interval?: number; } | undefined, listener: (curr: Stats, prev: Stats) => void): void;
|
|
1780
|
+
export function watchFile(filename: PathLike, options: { persistent?: boolean | undefined; interval?: number | undefined; } | undefined, listener: (curr: Stats, prev: Stats) => void): void;
|
|
1769
1781
|
|
|
1770
1782
|
/**
|
|
1771
1783
|
* Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed.
|
|
@@ -1792,7 +1804,7 @@ declare module 'fs' {
|
|
|
1792
1804
|
*/
|
|
1793
1805
|
export function watch(
|
|
1794
1806
|
filename: PathLike,
|
|
1795
|
-
options: { encoding?: BufferEncoding | null, persistent?: boolean, recursive?: boolean } | BufferEncoding | undefined | null,
|
|
1807
|
+
options: { encoding?: BufferEncoding | null | undefined, persistent?: boolean | undefined, recursive?: boolean | undefined } | BufferEncoding | undefined | null,
|
|
1796
1808
|
listener?: (event: "rename" | "change", filename: string) => void,
|
|
1797
1809
|
): FSWatcher;
|
|
1798
1810
|
|
|
@@ -1807,7 +1819,7 @@ declare module 'fs' {
|
|
|
1807
1819
|
*/
|
|
1808
1820
|
export function watch(
|
|
1809
1821
|
filename: PathLike,
|
|
1810
|
-
options: { encoding: "buffer", persistent?: boolean, recursive?: boolean; } | "buffer",
|
|
1822
|
+
options: { encoding: "buffer", persistent?: boolean | undefined, recursive?: boolean | undefined; } | "buffer",
|
|
1811
1823
|
listener?: (event: "rename" | "change", filename: Buffer) => void
|
|
1812
1824
|
): FSWatcher;
|
|
1813
1825
|
|
|
@@ -1822,7 +1834,7 @@ declare module 'fs' {
|
|
|
1822
1834
|
*/
|
|
1823
1835
|
export function watch(
|
|
1824
1836
|
filename: PathLike,
|
|
1825
|
-
options: { encoding?: BufferEncoding | null, persistent?: boolean, recursive?: boolean } | string | null,
|
|
1837
|
+
options: { encoding?: BufferEncoding | null | undefined, persistent?: boolean | undefined, recursive?: boolean | undefined } | string | null,
|
|
1826
1838
|
listener?: (event: "rename" | "change", filename: string | Buffer) => void,
|
|
1827
1839
|
): FSWatcher;
|
|
1828
1840
|
|
|
@@ -2056,19 +2068,19 @@ declare module 'fs' {
|
|
|
2056
2068
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2057
2069
|
* URL support is _experimental_.
|
|
2058
2070
|
*/
|
|
2059
|
-
export function createReadStream(path: PathLike, options?:
|
|
2060
|
-
flags?: string;
|
|
2061
|
-
encoding?: BufferEncoding;
|
|
2062
|
-
fd?: number;
|
|
2063
|
-
mode?: number;
|
|
2064
|
-
autoClose?: boolean;
|
|
2071
|
+
export function createReadStream(path: PathLike, options?: BufferEncoding | {
|
|
2072
|
+
flags?: string | undefined;
|
|
2073
|
+
encoding?: BufferEncoding | undefined;
|
|
2074
|
+
fd?: number | undefined;
|
|
2075
|
+
mode?: number | undefined;
|
|
2076
|
+
autoClose?: boolean | undefined;
|
|
2065
2077
|
/**
|
|
2066
2078
|
* @default false
|
|
2067
2079
|
*/
|
|
2068
|
-
emitClose?: boolean;
|
|
2069
|
-
start?: number;
|
|
2070
|
-
end?: number;
|
|
2071
|
-
highWaterMark?: number;
|
|
2080
|
+
emitClose?: boolean | undefined;
|
|
2081
|
+
start?: number | undefined;
|
|
2082
|
+
end?: number | undefined;
|
|
2083
|
+
highWaterMark?: number | undefined;
|
|
2072
2084
|
}): ReadStream;
|
|
2073
2085
|
|
|
2074
2086
|
/**
|
|
@@ -2076,15 +2088,15 @@ declare module 'fs' {
|
|
|
2076
2088
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2077
2089
|
* URL support is _experimental_.
|
|
2078
2090
|
*/
|
|
2079
|
-
export function createWriteStream(path: PathLike, options?:
|
|
2080
|
-
flags?: string;
|
|
2081
|
-
encoding?: BufferEncoding;
|
|
2082
|
-
fd?: number;
|
|
2083
|
-
mode?: number;
|
|
2084
|
-
autoClose?: boolean;
|
|
2085
|
-
emitClose?: boolean;
|
|
2086
|
-
start?: number;
|
|
2087
|
-
highWaterMark?: number;
|
|
2091
|
+
export function createWriteStream(path: PathLike, options?: BufferEncoding | {
|
|
2092
|
+
flags?: string | undefined;
|
|
2093
|
+
encoding?: BufferEncoding | undefined;
|
|
2094
|
+
fd?: number | undefined;
|
|
2095
|
+
mode?: number | undefined;
|
|
2096
|
+
autoClose?: boolean | undefined;
|
|
2097
|
+
emitClose?: boolean | undefined;
|
|
2098
|
+
start?: number | undefined;
|
|
2099
|
+
highWaterMark?: number | undefined;
|
|
2088
2100
|
}): WriteStream;
|
|
2089
2101
|
|
|
2090
2102
|
/**
|
|
@@ -2219,14 +2231,14 @@ declare module 'fs' {
|
|
|
2219
2231
|
export function readvSync(fd: number, buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): number;
|
|
2220
2232
|
|
|
2221
2233
|
export interface OpenDirOptions {
|
|
2222
|
-
encoding?: BufferEncoding;
|
|
2234
|
+
encoding?: BufferEncoding | undefined;
|
|
2223
2235
|
/**
|
|
2224
2236
|
* Number of directory entries that are buffered
|
|
2225
2237
|
* internally when reading from the directory. Higher values lead to better
|
|
2226
2238
|
* performance but higher memory usage.
|
|
2227
2239
|
* @default 32
|
|
2228
2240
|
*/
|
|
2229
|
-
bufferSize?: number;
|
|
2241
|
+
bufferSize?: number | undefined;
|
|
2230
2242
|
}
|
|
2231
2243
|
|
|
2232
2244
|
export function opendirSync(path: string, options?: OpenDirOptions): Dir;
|
|
@@ -2253,6 +2265,6 @@ declare module 'fs' {
|
|
|
2253
2265
|
}
|
|
2254
2266
|
|
|
2255
2267
|
export interface StatOptions {
|
|
2256
|
-
bigint?: boolean;
|
|
2268
|
+
bigint?: boolean | undefined;
|
|
2257
2269
|
}
|
|
2258
2270
|
}
|