@types/node 20.6.2 → 20.6.4
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/README.md +1 -1
- node/assert/strict.d.ts +4 -4
- node/assert.d.ts +48 -24
- node/async_hooks.d.ts +13 -6
- node/buffer.d.ts +32 -34
- node/child_process.d.ts +262 -122
- node/cluster.d.ts +107 -89
- node/console.d.ts +7 -7
- node/constants.d.ts +12 -11
- node/crypto.d.ts +746 -268
- node/dgram.d.ts +81 -45
- node/diagnostics_channel.d.ts +3 -3
- node/dns/promises.d.ts +28 -25
- node/dns.d.ts +203 -62
- node/dom-events.d.ts +67 -71
- node/domain.d.ts +4 -4
- node/events.d.ts +15 -7
- node/fs/promises.d.ts +102 -73
- node/fs.d.ts +513 -311
- node/globals.d.ts +18 -20
- node/http.d.ts +238 -186
- node/http2.d.ts +628 -376
- node/https.d.ts +221 -112
- node/inspector.d.ts +3 -3
- node/module.d.ts +16 -9
- node/net.d.ts +112 -93
- node/os.d.ts +7 -7
- node/package.json +2 -2
- node/path.d.ts +13 -13
- node/perf_hooks.d.ts +19 -18
- node/process.d.ts +155 -125
- node/punycode.d.ts +3 -3
- node/querystring.d.ts +14 -4
- node/readline/promises.d.ts +12 -7
- node/readline.d.ts +69 -56
- node/repl.d.ts +67 -61
- node/stream/consumers.d.ts +5 -5
- node/stream/promises.d.ts +56 -15
- node/stream/web.d.ts +26 -20
- node/stream.d.ts +361 -228
- node/string_decoder.d.ts +3 -3
- node/test.d.ts +78 -93
- node/timers/promises.d.ts +4 -4
- node/timers.d.ts +23 -8
- node/tls.d.ts +151 -71
- node/trace_events.d.ts +3 -3
- node/ts4.8/assert/strict.d.ts +4 -4
- node/ts4.8/assert.d.ts +48 -24
- node/ts4.8/async_hooks.d.ts +13 -6
- node/ts4.8/buffer.d.ts +32 -34
- node/ts4.8/child_process.d.ts +262 -122
- node/ts4.8/cluster.d.ts +107 -89
- node/ts4.8/console.d.ts +7 -7
- node/ts4.8/constants.d.ts +12 -11
- node/ts4.8/crypto.d.ts +746 -268
- node/ts4.8/dgram.d.ts +81 -45
- node/ts4.8/diagnostics_channel.d.ts +3 -3
- node/ts4.8/dns/promises.d.ts +28 -25
- node/ts4.8/dns.d.ts +203 -62
- node/ts4.8/dom-events.d.ts +67 -71
- node/ts4.8/domain.d.ts +4 -4
- node/ts4.8/events.d.ts +15 -7
- node/ts4.8/fs/promises.d.ts +102 -73
- node/ts4.8/fs.d.ts +513 -311
- node/ts4.8/globals.d.ts +18 -20
- node/ts4.8/http.d.ts +238 -186
- node/ts4.8/http2.d.ts +628 -376
- node/ts4.8/https.d.ts +221 -112
- node/ts4.8/inspector.d.ts +3 -3
- node/ts4.8/module.d.ts +16 -9
- node/ts4.8/net.d.ts +112 -93
- node/ts4.8/os.d.ts +7 -7
- node/ts4.8/path.d.ts +13 -13
- node/ts4.8/perf_hooks.d.ts +19 -18
- node/ts4.8/process.d.ts +155 -125
- node/ts4.8/punycode.d.ts +3 -3
- node/ts4.8/querystring.d.ts +14 -4
- node/ts4.8/readline/promises.d.ts +12 -7
- node/ts4.8/readline.d.ts +69 -56
- node/ts4.8/repl.d.ts +67 -61
- node/ts4.8/stream/consumers.d.ts +5 -5
- node/ts4.8/stream/promises.d.ts +56 -15
- node/ts4.8/stream/web.d.ts +26 -20
- node/ts4.8/stream.d.ts +326 -219
- node/ts4.8/string_decoder.d.ts +3 -3
- node/ts4.8/test.d.ts +78 -93
- node/ts4.8/timers/promises.d.ts +4 -4
- node/ts4.8/timers.d.ts +23 -8
- node/ts4.8/tls.d.ts +151 -71
- node/ts4.8/trace_events.d.ts +3 -3
- node/ts4.8/tty.d.ts +10 -10
- node/ts4.8/url.d.ts +26 -14
- node/ts4.8/util.d.ts +178 -116
- node/ts4.8/v8.d.ts +4 -4
- node/ts4.8/vm.d.ts +52 -46
- node/ts4.8/wasi.d.ts +3 -3
- node/ts4.8/worker_threads.d.ts +81 -84
- node/ts4.8/zlib.d.ts +9 -9
- node/tty.d.ts +10 -10
- node/url.d.ts +26 -14
- node/util.d.ts +178 -116
- node/v8.d.ts +4 -4
- node/vm.d.ts +52 -46
- node/wasi.d.ts +3 -3
- node/worker_threads.d.ts +81 -84
- node/zlib.d.ts +9 -9
node/events.d.ts
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
* ```
|
|
35
35
|
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/events.js)
|
|
36
36
|
*/
|
|
37
|
-
declare module
|
|
37
|
+
declare module "events" {
|
|
38
38
|
// NOTE: This class is in the docs but is **not actually exported** by Node.
|
|
39
39
|
// If https://github.com/nodejs/node/issues/39903 gets resolved and Node
|
|
40
40
|
// actually starts exporting the class, uncomment below.
|
|
@@ -85,7 +85,7 @@ declare module 'node:events' {
|
|
|
85
85
|
listener: (...args: any[]) => void,
|
|
86
86
|
opts?: {
|
|
87
87
|
once: boolean;
|
|
88
|
-
}
|
|
88
|
+
},
|
|
89
89
|
): any;
|
|
90
90
|
}
|
|
91
91
|
interface StaticEventEmitterOptions {
|
|
@@ -186,7 +186,11 @@ declare module 'node:events' {
|
|
|
186
186
|
* ```
|
|
187
187
|
* @since v11.13.0, v10.16.0
|
|
188
188
|
*/
|
|
189
|
-
static once(
|
|
189
|
+
static once(
|
|
190
|
+
emitter: _NodeEventTarget,
|
|
191
|
+
eventName: string | symbol,
|
|
192
|
+
options?: StaticEventEmitterOptions,
|
|
193
|
+
): Promise<any[]>;
|
|
190
194
|
static once(emitter: _DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise<any[]>;
|
|
191
195
|
/**
|
|
192
196
|
* ```js
|
|
@@ -247,7 +251,11 @@ declare module 'node:events' {
|
|
|
247
251
|
* @param eventName The name of the event being listened for
|
|
248
252
|
* @return that iterates `eventName` events emitted by the `emitter`
|
|
249
253
|
*/
|
|
250
|
-
static on(
|
|
254
|
+
static on(
|
|
255
|
+
emitter: NodeJS.EventEmitter,
|
|
256
|
+
eventName: string,
|
|
257
|
+
options?: StaticEventEmitterOptions,
|
|
258
|
+
): AsyncIterableIterator<any>;
|
|
251
259
|
/**
|
|
252
260
|
* A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.
|
|
253
261
|
*
|
|
@@ -433,7 +441,7 @@ declare module 'node:events' {
|
|
|
433
441
|
*/
|
|
434
442
|
static defaultMaxListeners: number;
|
|
435
443
|
}
|
|
436
|
-
import internal = require(
|
|
444
|
+
import internal = require("node:events");
|
|
437
445
|
namespace EventEmitter {
|
|
438
446
|
// Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4
|
|
439
447
|
export { internal as EventEmitter };
|
|
@@ -782,7 +790,7 @@ declare module 'node:events' {
|
|
|
782
790
|
}
|
|
783
791
|
export = EventEmitter;
|
|
784
792
|
}
|
|
785
|
-
declare module
|
|
786
|
-
import events = require(
|
|
793
|
+
declare module "node:events" {
|
|
794
|
+
import events = require("events");
|
|
787
795
|
export = events;
|
|
788
796
|
}
|
node/fs/promises.d.ts
CHANGED
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
* concurrent modifications on the same file or data corruption may occur.
|
|
9
9
|
* @since v10.0.0
|
|
10
10
|
*/
|
|
11
|
-
declare module
|
|
12
|
-
import { Abortable } from
|
|
13
|
-
import { Stream } from
|
|
14
|
-
import { ReadableStream } from
|
|
11
|
+
declare module "fs/promises" {
|
|
12
|
+
import { Abortable } from "node:events";
|
|
13
|
+
import { Stream } from "node:stream";
|
|
14
|
+
import { ReadableStream } from "node:stream/web";
|
|
15
15
|
import {
|
|
16
16
|
BigIntStats,
|
|
17
17
|
BigIntStatsFs,
|
|
@@ -30,8 +30,8 @@ declare module 'node:fs/promises' {
|
|
|
30
30
|
ReadVResult,
|
|
31
31
|
RmDirOptions,
|
|
32
32
|
RmOptions,
|
|
33
|
-
StatOptions,
|
|
34
33
|
StatFsOptions,
|
|
34
|
+
StatOptions,
|
|
35
35
|
Stats,
|
|
36
36
|
StatsFs,
|
|
37
37
|
TimeLike,
|
|
@@ -39,8 +39,8 @@ declare module 'node:fs/promises' {
|
|
|
39
39
|
WatchOptions,
|
|
40
40
|
WriteStream,
|
|
41
41
|
WriteVResult,
|
|
42
|
-
} from
|
|
43
|
-
import { Interface as ReadlineInterface } from
|
|
42
|
+
} from "node:fs";
|
|
43
|
+
import { Interface as ReadlineInterface } from "node:readline";
|
|
44
44
|
interface FileChangeInfo<T extends string | Buffer> {
|
|
45
45
|
eventType: WatchEventType;
|
|
46
46
|
filename: T | null;
|
|
@@ -88,7 +88,7 @@ declare module 'node:fs/promises' {
|
|
|
88
88
|
* Whether to open a normal or a `'bytes'` stream.
|
|
89
89
|
* @since v20.0.0
|
|
90
90
|
*/
|
|
91
|
-
type?:
|
|
91
|
+
type?: "bytes" | undefined;
|
|
92
92
|
}
|
|
93
93
|
// TODO: Add `EventEmitter` close
|
|
94
94
|
interface FileHandle {
|
|
@@ -105,7 +105,10 @@ declare module 'node:fs/promises' {
|
|
|
105
105
|
* @since v10.0.0
|
|
106
106
|
* @return Fulfills with `undefined` upon success.
|
|
107
107
|
*/
|
|
108
|
-
appendFile(
|
|
108
|
+
appendFile(
|
|
109
|
+
data: string | Uint8Array,
|
|
110
|
+
options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null,
|
|
111
|
+
): Promise<void>;
|
|
109
112
|
/**
|
|
110
113
|
* Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html).
|
|
111
114
|
* @since v10.0.0
|
|
@@ -222,7 +225,12 @@ declare module 'node:fs/promises' {
|
|
|
222
225
|
* integer, the current file position will remain unchanged.
|
|
223
226
|
* @return Fulfills upon success with an object with two properties:
|
|
224
227
|
*/
|
|
225
|
-
read<T extends NodeJS.ArrayBufferView>(
|
|
228
|
+
read<T extends NodeJS.ArrayBufferView>(
|
|
229
|
+
buffer: T,
|
|
230
|
+
offset?: number | null,
|
|
231
|
+
length?: number | null,
|
|
232
|
+
position?: number | null,
|
|
233
|
+
): Promise<FileReadResult<T>>;
|
|
226
234
|
read<T extends NodeJS.ArrayBufferView = Buffer>(options?: FileReadOptions<T>): Promise<FileReadResult<T>>;
|
|
227
235
|
/**
|
|
228
236
|
* Returns a `ReadableStream` that may be used to read the files data.
|
|
@@ -267,7 +275,7 @@ declare module 'node:fs/promises' {
|
|
|
267
275
|
options?: {
|
|
268
276
|
encoding?: null | undefined;
|
|
269
277
|
flag?: OpenMode | undefined;
|
|
270
|
-
} | null
|
|
278
|
+
} | null,
|
|
271
279
|
): Promise<Buffer>;
|
|
272
280
|
/**
|
|
273
281
|
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
|
@@ -278,10 +286,10 @@ declare module 'node:fs/promises' {
|
|
|
278
286
|
readFile(
|
|
279
287
|
options:
|
|
280
288
|
| {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
| BufferEncoding
|
|
289
|
+
encoding: BufferEncoding;
|
|
290
|
+
flag?: OpenMode | undefined;
|
|
291
|
+
}
|
|
292
|
+
| BufferEncoding,
|
|
285
293
|
): Promise<string>;
|
|
286
294
|
/**
|
|
287
295
|
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
|
@@ -292,10 +300,10 @@ declare module 'node:fs/promises' {
|
|
|
292
300
|
readFile(
|
|
293
301
|
options?:
|
|
294
302
|
| (ObjectEncodingOptions & {
|
|
295
|
-
|
|
296
|
-
|
|
303
|
+
flag?: OpenMode | undefined;
|
|
304
|
+
})
|
|
297
305
|
| BufferEncoding
|
|
298
|
-
| null
|
|
306
|
+
| null,
|
|
299
307
|
): Promise<string | Buffer>;
|
|
300
308
|
/**
|
|
301
309
|
* Convenience method to create a `readline` interface and stream over the file.
|
|
@@ -320,12 +328,12 @@ declare module 'node:fs/promises' {
|
|
|
320
328
|
stat(
|
|
321
329
|
opts?: StatOptions & {
|
|
322
330
|
bigint?: false | undefined;
|
|
323
|
-
}
|
|
331
|
+
},
|
|
324
332
|
): Promise<Stats>;
|
|
325
333
|
stat(
|
|
326
334
|
opts: StatOptions & {
|
|
327
335
|
bigint: true;
|
|
328
|
-
}
|
|
336
|
+
},
|
|
329
337
|
): Promise<BigIntStats>;
|
|
330
338
|
stat(opts?: StatOptions): Promise<Stats | BigIntStats>;
|
|
331
339
|
/**
|
|
@@ -380,7 +388,10 @@ declare module 'node:fs/promises' {
|
|
|
380
388
|
* beginning of the file.
|
|
381
389
|
* @since v10.0.0
|
|
382
390
|
*/
|
|
383
|
-
writeFile(
|
|
391
|
+
writeFile(
|
|
392
|
+
data: string | Uint8Array,
|
|
393
|
+
options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null,
|
|
394
|
+
): Promise<void>;
|
|
384
395
|
/**
|
|
385
396
|
* Write `buffer` to the file.
|
|
386
397
|
*
|
|
@@ -403,7 +414,7 @@ declare module 'node:fs/promises' {
|
|
|
403
414
|
buffer: TBuffer,
|
|
404
415
|
offset?: number | null,
|
|
405
416
|
length?: number | null,
|
|
406
|
-
position?: number | null
|
|
417
|
+
position?: number | null,
|
|
407
418
|
): Promise<{
|
|
408
419
|
bytesWritten: number;
|
|
409
420
|
buffer: TBuffer;
|
|
@@ -411,7 +422,7 @@ declare module 'node:fs/promises' {
|
|
|
411
422
|
write(
|
|
412
423
|
data: string,
|
|
413
424
|
position?: number | null,
|
|
414
|
-
encoding?: BufferEncoding | null
|
|
425
|
+
encoding?: BufferEncoding | null,
|
|
415
426
|
): Promise<{
|
|
416
427
|
bytesWritten: number;
|
|
417
428
|
buffer: string;
|
|
@@ -602,7 +613,7 @@ declare module 'node:fs/promises' {
|
|
|
602
613
|
path: PathLike,
|
|
603
614
|
options: MakeDirectoryOptions & {
|
|
604
615
|
recursive: true;
|
|
605
|
-
}
|
|
616
|
+
},
|
|
606
617
|
): Promise<string | undefined>;
|
|
607
618
|
/**
|
|
608
619
|
* Asynchronous mkdir(2) - create a directory.
|
|
@@ -615,9 +626,9 @@ declare module 'node:fs/promises' {
|
|
|
615
626
|
options?:
|
|
616
627
|
| Mode
|
|
617
628
|
| (MakeDirectoryOptions & {
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
| null
|
|
629
|
+
recursive?: false | undefined;
|
|
630
|
+
})
|
|
631
|
+
| null,
|
|
621
632
|
): Promise<void>;
|
|
622
633
|
/**
|
|
623
634
|
* Asynchronous mkdir(2) - create a directory.
|
|
@@ -654,11 +665,11 @@ declare module 'node:fs/promises' {
|
|
|
654
665
|
path: PathLike,
|
|
655
666
|
options?:
|
|
656
667
|
| (ObjectEncodingOptions & {
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
668
|
+
withFileTypes?: false | undefined;
|
|
669
|
+
recursive?: boolean | undefined;
|
|
670
|
+
})
|
|
660
671
|
| BufferEncoding
|
|
661
|
-
| null
|
|
672
|
+
| null,
|
|
662
673
|
): Promise<string[]>;
|
|
663
674
|
/**
|
|
664
675
|
* Asynchronous readdir(3) - read a directory.
|
|
@@ -669,11 +680,11 @@ declare module 'node:fs/promises' {
|
|
|
669
680
|
path: PathLike,
|
|
670
681
|
options:
|
|
671
682
|
| {
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
|
683
|
+
encoding: "buffer";
|
|
684
|
+
withFileTypes?: false | undefined;
|
|
685
|
+
recursive?: boolean | undefined;
|
|
686
|
+
}
|
|
687
|
+
| "buffer",
|
|
677
688
|
): Promise<Buffer[]>;
|
|
678
689
|
/**
|
|
679
690
|
* Asynchronous readdir(3) - read a directory.
|
|
@@ -684,11 +695,11 @@ declare module 'node:fs/promises' {
|
|
|
684
695
|
path: PathLike,
|
|
685
696
|
options?:
|
|
686
697
|
| (ObjectEncodingOptions & {
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
698
|
+
withFileTypes?: false | undefined;
|
|
699
|
+
recursive?: boolean | undefined;
|
|
700
|
+
})
|
|
690
701
|
| BufferEncoding
|
|
691
|
-
| null
|
|
702
|
+
| null,
|
|
692
703
|
): Promise<string[] | Buffer[]>;
|
|
693
704
|
/**
|
|
694
705
|
* Asynchronous readdir(3) - read a directory.
|
|
@@ -700,7 +711,7 @@ declare module 'node:fs/promises' {
|
|
|
700
711
|
options: ObjectEncodingOptions & {
|
|
701
712
|
withFileTypes: true;
|
|
702
713
|
recursive?: boolean | undefined;
|
|
703
|
-
}
|
|
714
|
+
},
|
|
704
715
|
): Promise<Dirent[]>;
|
|
705
716
|
/**
|
|
706
717
|
* Reads the contents of the symbolic link referred to by `path`. See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more detail. The promise is
|
|
@@ -751,13 +762,13 @@ declare module 'node:fs/promises' {
|
|
|
751
762
|
path: PathLike,
|
|
752
763
|
opts?: StatOptions & {
|
|
753
764
|
bigint?: false | undefined;
|
|
754
|
-
}
|
|
765
|
+
},
|
|
755
766
|
): Promise<Stats>;
|
|
756
767
|
function lstat(
|
|
757
768
|
path: PathLike,
|
|
758
769
|
opts: StatOptions & {
|
|
759
770
|
bigint: true;
|
|
760
|
-
}
|
|
771
|
+
},
|
|
761
772
|
): Promise<BigIntStats>;
|
|
762
773
|
function lstat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
|
|
763
774
|
/**
|
|
@@ -768,13 +779,13 @@ declare module 'node:fs/promises' {
|
|
|
768
779
|
path: PathLike,
|
|
769
780
|
opts?: StatOptions & {
|
|
770
781
|
bigint?: false | undefined;
|
|
771
|
-
}
|
|
782
|
+
},
|
|
772
783
|
): Promise<Stats>;
|
|
773
784
|
function stat(
|
|
774
785
|
path: PathLike,
|
|
775
786
|
opts: StatOptions & {
|
|
776
787
|
bigint: true;
|
|
777
|
-
}
|
|
788
|
+
},
|
|
778
789
|
): Promise<BigIntStats>;
|
|
779
790
|
function stat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
|
|
780
791
|
/**
|
|
@@ -785,13 +796,13 @@ declare module 'node:fs/promises' {
|
|
|
785
796
|
path: PathLike,
|
|
786
797
|
opts?: StatFsOptions & {
|
|
787
798
|
bigint?: false | undefined;
|
|
788
|
-
}
|
|
799
|
+
},
|
|
789
800
|
): Promise<StatsFs>;
|
|
790
801
|
function statfs(
|
|
791
802
|
path: PathLike,
|
|
792
803
|
opts: StatFsOptions & {
|
|
793
804
|
bigint: true;
|
|
794
|
-
}
|
|
805
|
+
},
|
|
795
806
|
): Promise<BigIntStatsFs>;
|
|
796
807
|
function statfs(path: PathLike, opts?: StatFsOptions): Promise<StatsFs | BigIntStatsFs>;
|
|
797
808
|
/**
|
|
@@ -882,7 +893,10 @@ declare module 'node:fs/promises' {
|
|
|
882
893
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
883
894
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
884
895
|
*/
|
|
885
|
-
function realpath(
|
|
896
|
+
function realpath(
|
|
897
|
+
path: PathLike,
|
|
898
|
+
options?: ObjectEncodingOptions | BufferEncoding | null,
|
|
899
|
+
): Promise<string | Buffer>;
|
|
886
900
|
/**
|
|
887
901
|
* Creates a unique temporary directory. A unique directory name is generated by
|
|
888
902
|
* appending six random characters to the end of the provided `prefix`. Due to
|
|
@@ -977,14 +991,19 @@ declare module 'node:fs/promises' {
|
|
|
977
991
|
*/
|
|
978
992
|
function writeFile(
|
|
979
993
|
file: PathLike | FileHandle,
|
|
980
|
-
data:
|
|
994
|
+
data:
|
|
995
|
+
| string
|
|
996
|
+
| NodeJS.ArrayBufferView
|
|
997
|
+
| Iterable<string | NodeJS.ArrayBufferView>
|
|
998
|
+
| AsyncIterable<string | NodeJS.ArrayBufferView>
|
|
999
|
+
| Stream,
|
|
981
1000
|
options?:
|
|
982
1001
|
| (ObjectEncodingOptions & {
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
1002
|
+
mode?: Mode | undefined;
|
|
1003
|
+
flag?: OpenMode | undefined;
|
|
1004
|
+
} & Abortable)
|
|
986
1005
|
| BufferEncoding
|
|
987
|
-
| null
|
|
1006
|
+
| null,
|
|
988
1007
|
): Promise<void>;
|
|
989
1008
|
/**
|
|
990
1009
|
* Asynchronously append data to a file, creating the file if it does not yet
|
|
@@ -1000,7 +1019,11 @@ declare module 'node:fs/promises' {
|
|
|
1000
1019
|
* @param path filename or {FileHandle}
|
|
1001
1020
|
* @return Fulfills with `undefined` upon success.
|
|
1002
1021
|
*/
|
|
1003
|
-
function appendFile(
|
|
1022
|
+
function appendFile(
|
|
1023
|
+
path: PathLike | FileHandle,
|
|
1024
|
+
data: string | Uint8Array,
|
|
1025
|
+
options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null,
|
|
1026
|
+
): Promise<void>;
|
|
1004
1027
|
/**
|
|
1005
1028
|
* Asynchronously reads the entire contents of a file.
|
|
1006
1029
|
*
|
|
@@ -1061,10 +1084,10 @@ declare module 'node:fs/promises' {
|
|
|
1061
1084
|
path: PathLike | FileHandle,
|
|
1062
1085
|
options?:
|
|
1063
1086
|
| ({
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
| null
|
|
1087
|
+
encoding?: null | undefined;
|
|
1088
|
+
flag?: OpenMode | undefined;
|
|
1089
|
+
} & Abortable)
|
|
1090
|
+
| null,
|
|
1068
1091
|
): Promise<Buffer>;
|
|
1069
1092
|
/**
|
|
1070
1093
|
* Asynchronously reads the entire contents of a file.
|
|
@@ -1077,10 +1100,10 @@ declare module 'node:fs/promises' {
|
|
|
1077
1100
|
path: PathLike | FileHandle,
|
|
1078
1101
|
options:
|
|
1079
1102
|
| ({
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
| BufferEncoding
|
|
1103
|
+
encoding: BufferEncoding;
|
|
1104
|
+
flag?: OpenMode | undefined;
|
|
1105
|
+
} & Abortable)
|
|
1106
|
+
| BufferEncoding,
|
|
1084
1107
|
): Promise<string>;
|
|
1085
1108
|
/**
|
|
1086
1109
|
* Asynchronously reads the entire contents of a file.
|
|
@@ -1092,12 +1115,15 @@ declare module 'node:fs/promises' {
|
|
|
1092
1115
|
function readFile(
|
|
1093
1116
|
path: PathLike | FileHandle,
|
|
1094
1117
|
options?:
|
|
1095
|
-
| (
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1118
|
+
| (
|
|
1119
|
+
& ObjectEncodingOptions
|
|
1120
|
+
& Abortable
|
|
1121
|
+
& {
|
|
1122
|
+
flag?: OpenMode | undefined;
|
|
1123
|
+
}
|
|
1124
|
+
)
|
|
1099
1125
|
| BufferEncoding
|
|
1100
|
-
| null
|
|
1126
|
+
| null,
|
|
1101
1127
|
): Promise<string | Buffer>;
|
|
1102
1128
|
/**
|
|
1103
1129
|
* Asynchronously open a directory for iterative scanning. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for more detail.
|
|
@@ -1162,9 +1188,9 @@ declare module 'node:fs/promises' {
|
|
|
1162
1188
|
filename: PathLike,
|
|
1163
1189
|
options:
|
|
1164
1190
|
| (WatchOptions & {
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
|
1191
|
+
encoding: "buffer";
|
|
1192
|
+
})
|
|
1193
|
+
| "buffer",
|
|
1168
1194
|
): AsyncIterable<FileChangeInfo<Buffer>>;
|
|
1169
1195
|
/**
|
|
1170
1196
|
* Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
|
|
@@ -1183,7 +1209,10 @@ declare module 'node:fs/promises' {
|
|
|
1183
1209
|
* If `persistent` is not supplied, the default of `true` is used.
|
|
1184
1210
|
* If `recursive` is not supplied, the default of `false` is used.
|
|
1185
1211
|
*/
|
|
1186
|
-
function watch(
|
|
1212
|
+
function watch(
|
|
1213
|
+
filename: PathLike,
|
|
1214
|
+
options: WatchOptions | string,
|
|
1215
|
+
): AsyncIterable<FileChangeInfo<string>> | AsyncIterable<FileChangeInfo<Buffer>>;
|
|
1187
1216
|
/**
|
|
1188
1217
|
* Asynchronously copies the entire directory structure from `src` to `dest`,
|
|
1189
1218
|
* including subdirectories and files.
|
|
@@ -1198,6 +1227,6 @@ declare module 'node:fs/promises' {
|
|
|
1198
1227
|
*/
|
|
1199
1228
|
function cp(source: string | URL, destination: string | URL, opts?: CopyOptions): Promise<void>;
|
|
1200
1229
|
}
|
|
1201
|
-
declare module
|
|
1202
|
-
export * from
|
|
1230
|
+
declare module "node:fs/promises" {
|
|
1231
|
+
export * from "fs/promises";
|
|
1203
1232
|
}
|