@types/node 18.17.18 → 18.17.19
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 v18.17/README.md +1 -1
- node v18.17/assert/strict.d.ts +4 -4
- node v18.17/assert.d.ts +48 -24
- node v18.17/async_hooks.d.ts +10 -7
- node v18.17/buffer.d.ts +32 -34
- node v18.17/child_process.d.ts +262 -122
- node v18.17/cluster.d.ts +107 -89
- node v18.17/console.d.ts +7 -7
- node v18.17/constants.d.ts +12 -11
- node v18.17/crypto.d.ts +746 -268
- node v18.17/dgram.d.ts +81 -45
- node v18.17/diagnostics_channel.d.ts +3 -3
- node v18.17/dns/promises.d.ts +28 -25
- node v18.17/dns.d.ts +203 -62
- node v18.17/dom-events.d.ts +67 -71
- node v18.17/domain.d.ts +4 -4
- node v18.17/events.d.ts +15 -7
- node v18.17/fs/promises.d.ts +102 -73
- node v18.17/fs.d.ts +513 -311
- node v18.17/globals.d.ts +16 -18
- node v18.17/http.d.ts +185 -185
- node v18.17/http2.d.ts +628 -376
- node v18.17/https.d.ts +107 -105
- node v18.17/module.d.ts +11 -8
- node v18.17/net.d.ts +112 -93
- node v18.17/os.d.ts +7 -7
- node v18.17/package.json +2 -2
- node v18.17/path.d.ts +13 -13
- node v18.17/perf_hooks.d.ts +20 -19
- node v18.17/process.d.ts +155 -125
- node v18.17/punycode.d.ts +3 -3
- node v18.17/querystring.d.ts +14 -4
- node v18.17/readline/promises.d.ts +5 -5
- node v18.17/readline.d.ts +69 -56
- node v18.17/repl.d.ts +67 -61
- node v18.17/stream/consumers.d.ts +4 -4
- node v18.17/stream/promises.d.ts +56 -15
- node v18.17/stream/web.d.ts +26 -20
- node v18.17/stream.d.ts +356 -226
- node v18.17/string_decoder.d.ts +3 -3
- node v18.17/test.d.ts +76 -91
- node v18.17/timers/promises.d.ts +4 -4
- node v18.17/timers.d.ts +23 -8
- node v18.17/tls.d.ts +151 -71
- node v18.17/trace_events.d.ts +3 -3
- node v18.17/ts4.8/assert/strict.d.ts +4 -4
- node v18.17/ts4.8/assert.d.ts +48 -24
- node v18.17/ts4.8/async_hooks.d.ts +10 -7
- node v18.17/ts4.8/buffer.d.ts +32 -34
- node v18.17/ts4.8/child_process.d.ts +262 -122
- node v18.17/ts4.8/cluster.d.ts +107 -89
- node v18.17/ts4.8/console.d.ts +7 -7
- node v18.17/ts4.8/constants.d.ts +12 -11
- node v18.17/ts4.8/crypto.d.ts +746 -268
- node v18.17/ts4.8/dgram.d.ts +81 -45
- node v18.17/ts4.8/diagnostics_channel.d.ts +3 -3
- node v18.17/ts4.8/dns/promises.d.ts +28 -25
- node v18.17/ts4.8/dns.d.ts +203 -62
- node v18.17/ts4.8/dom-events.d.ts +67 -71
- node v18.17/ts4.8/domain.d.ts +4 -4
- node v18.17/ts4.8/events.d.ts +15 -7
- node v18.17/ts4.8/fs/promises.d.ts +102 -73
- node v18.17/ts4.8/fs.d.ts +514 -312
- node v18.17/ts4.8/globals.d.ts +44 -46
- node v18.17/ts4.8/http.d.ts +185 -185
- node v18.17/ts4.8/http2.d.ts +628 -376
- node v18.17/ts4.8/https.d.ts +107 -105
- node v18.17/ts4.8/module.d.ts +11 -8
- node v18.17/ts4.8/net.d.ts +112 -93
- node v18.17/ts4.8/os.d.ts +7 -7
- node v18.17/ts4.8/path.d.ts +13 -13
- node v18.17/ts4.8/perf_hooks.d.ts +20 -19
- node v18.17/ts4.8/process.d.ts +155 -125
- node v18.17/ts4.8/punycode.d.ts +3 -3
- node v18.17/ts4.8/querystring.d.ts +14 -4
- node v18.17/ts4.8/readline/promises.d.ts +5 -5
- node v18.17/ts4.8/readline.d.ts +69 -56
- node v18.17/ts4.8/repl.d.ts +67 -61
- node v18.17/ts4.8/stream/consumers.d.ts +4 -4
- node v18.17/ts4.8/stream/promises.d.ts +56 -15
- node v18.17/ts4.8/stream/web.d.ts +26 -20
- node v18.17/ts4.8/stream.d.ts +321 -217
- node v18.17/ts4.8/string_decoder.d.ts +3 -3
- node v18.17/ts4.8/test.d.ts +75 -90
- node v18.17/ts4.8/timers/promises.d.ts +4 -4
- node v18.17/ts4.8/timers.d.ts +23 -8
- node v18.17/ts4.8/tls.d.ts +151 -71
- node v18.17/ts4.8/trace_events.d.ts +3 -3
- node v18.17/ts4.8/tty.d.ts +10 -10
- node v18.17/ts4.8/url.d.ts +26 -14
- node v18.17/ts4.8/util.d.ts +178 -117
- node v18.17/ts4.8/v8.d.ts +4 -4
- node v18.17/ts4.8/vm.d.ts +60 -42
- node v18.17/ts4.8/wasi.d.ts +3 -3
- node v18.17/ts4.8/worker_threads.d.ts +82 -85
- node v18.17/ts4.8/zlib.d.ts +9 -9
- node v18.17/tty.d.ts +10 -10
- node v18.17/url.d.ts +26 -14
- node v18.17/util.d.ts +178 -117
- node v18.17/v8.d.ts +4 -4
- node v18.17/vm.d.ts +60 -42
- node v18.17/wasi.d.ts +3 -3
- node v18.17/worker_threads.d.ts +82 -85
- node v18.17/zlib.d.ts +9 -9
node v18.17/ts4.8/events.d.ts
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
* ```
|
|
35
35
|
* @see [source](https://github.com/nodejs/node/blob/v18.0.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.
|
|
@@ -87,7 +87,7 @@ declare module 'events' {
|
|
|
87
87
|
listener: (...args: any[]) => void,
|
|
88
88
|
opts?: {
|
|
89
89
|
once: boolean;
|
|
90
|
-
}
|
|
90
|
+
},
|
|
91
91
|
): any;
|
|
92
92
|
}
|
|
93
93
|
interface StaticEventEmitterOptions {
|
|
@@ -191,7 +191,11 @@ declare module 'events' {
|
|
|
191
191
|
* ```
|
|
192
192
|
* @since v11.13.0, v10.16.0
|
|
193
193
|
*/
|
|
194
|
-
static once(
|
|
194
|
+
static once(
|
|
195
|
+
emitter: _NodeEventTarget,
|
|
196
|
+
eventName: string | symbol,
|
|
197
|
+
options?: StaticEventEmitterOptions,
|
|
198
|
+
): Promise<any[]>;
|
|
195
199
|
static once(emitter: _DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise<any[]>;
|
|
196
200
|
/**
|
|
197
201
|
* ```js
|
|
@@ -251,7 +255,11 @@ declare module 'events' {
|
|
|
251
255
|
* @param eventName The name of the event being listened for
|
|
252
256
|
* @return that iterates `eventName` events emitted by the `emitter`
|
|
253
257
|
*/
|
|
254
|
-
static on(
|
|
258
|
+
static on(
|
|
259
|
+
emitter: NodeJS.EventEmitter,
|
|
260
|
+
eventName: string,
|
|
261
|
+
options?: StaticEventEmitterOptions,
|
|
262
|
+
): AsyncIterableIterator<any>;
|
|
255
263
|
/**
|
|
256
264
|
* A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.
|
|
257
265
|
*
|
|
@@ -362,7 +370,7 @@ declare module 'events' {
|
|
|
362
370
|
static captureRejections: boolean;
|
|
363
371
|
static defaultMaxListeners: number;
|
|
364
372
|
}
|
|
365
|
-
import internal = require(
|
|
373
|
+
import internal = require("node:events");
|
|
366
374
|
namespace EventEmitter {
|
|
367
375
|
// Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4
|
|
368
376
|
export { internal as EventEmitter };
|
|
@@ -705,7 +713,7 @@ declare module 'events' {
|
|
|
705
713
|
}
|
|
706
714
|
export = EventEmitter;
|
|
707
715
|
}
|
|
708
|
-
declare module
|
|
709
|
-
import events = require(
|
|
716
|
+
declare module "node:events" {
|
|
717
|
+
import events = require("events");
|
|
710
718
|
export = events;
|
|
711
719
|
}
|
|
@@ -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 '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 '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
|
|
|
45
45
|
interface FileChangeInfo<T extends string | Buffer> {
|
|
46
46
|
eventType: WatchEventType;
|
|
@@ -89,7 +89,7 @@ declare module 'fs/promises' {
|
|
|
89
89
|
* Whether to open a normal or a `'bytes'` stream.
|
|
90
90
|
* @since v18.17.0
|
|
91
91
|
*/
|
|
92
|
-
type?:
|
|
92
|
+
type?: "bytes" | undefined;
|
|
93
93
|
}
|
|
94
94
|
// TODO: Add `EventEmitter` close
|
|
95
95
|
interface FileHandle {
|
|
@@ -106,7 +106,10 @@ declare module 'fs/promises' {
|
|
|
106
106
|
* @since v10.0.0
|
|
107
107
|
* @return Fulfills with `undefined` upon success.
|
|
108
108
|
*/
|
|
109
|
-
appendFile(
|
|
109
|
+
appendFile(
|
|
110
|
+
data: string | Uint8Array,
|
|
111
|
+
options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null,
|
|
112
|
+
): Promise<void>;
|
|
110
113
|
/**
|
|
111
114
|
* Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html).
|
|
112
115
|
* @since v10.0.0
|
|
@@ -223,7 +226,12 @@ declare module 'fs/promises' {
|
|
|
223
226
|
* integer, the current file position will remain unchanged.
|
|
224
227
|
* @return Fulfills upon success with an object with two properties:
|
|
225
228
|
*/
|
|
226
|
-
read<T extends NodeJS.ArrayBufferView>(
|
|
229
|
+
read<T extends NodeJS.ArrayBufferView>(
|
|
230
|
+
buffer: T,
|
|
231
|
+
offset?: number | null,
|
|
232
|
+
length?: number | null,
|
|
233
|
+
position?: number | null,
|
|
234
|
+
): Promise<FileReadResult<T>>;
|
|
227
235
|
read<T extends NodeJS.ArrayBufferView = Buffer>(options?: FileReadOptions<T>): Promise<FileReadResult<T>>;
|
|
228
236
|
/**
|
|
229
237
|
* Returns a `ReadableStream` that may be used to read the files data.
|
|
@@ -266,7 +274,7 @@ declare module 'fs/promises' {
|
|
|
266
274
|
options?: {
|
|
267
275
|
encoding?: null | undefined;
|
|
268
276
|
flag?: OpenMode | undefined;
|
|
269
|
-
} | null
|
|
277
|
+
} | null,
|
|
270
278
|
): Promise<Buffer>;
|
|
271
279
|
/**
|
|
272
280
|
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
|
@@ -277,10 +285,10 @@ declare module 'fs/promises' {
|
|
|
277
285
|
readFile(
|
|
278
286
|
options:
|
|
279
287
|
| {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
| BufferEncoding
|
|
288
|
+
encoding: BufferEncoding;
|
|
289
|
+
flag?: OpenMode | undefined;
|
|
290
|
+
}
|
|
291
|
+
| BufferEncoding,
|
|
284
292
|
): Promise<string>;
|
|
285
293
|
/**
|
|
286
294
|
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
|
@@ -291,10 +299,10 @@ declare module 'fs/promises' {
|
|
|
291
299
|
readFile(
|
|
292
300
|
options?:
|
|
293
301
|
| (ObjectEncodingOptions & {
|
|
294
|
-
|
|
295
|
-
|
|
302
|
+
flag?: OpenMode | undefined;
|
|
303
|
+
})
|
|
296
304
|
| BufferEncoding
|
|
297
|
-
| null
|
|
305
|
+
| null,
|
|
298
306
|
): Promise<string | Buffer>;
|
|
299
307
|
/**
|
|
300
308
|
* Convenience method to create a `readline` interface and stream over the file. For example:
|
|
@@ -320,12 +328,12 @@ declare module '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 '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 '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 '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;
|
|
@@ -588,7 +599,7 @@ declare module 'fs/promises' {
|
|
|
588
599
|
path: PathLike,
|
|
589
600
|
options: MakeDirectoryOptions & {
|
|
590
601
|
recursive: true;
|
|
591
|
-
}
|
|
602
|
+
},
|
|
592
603
|
): Promise<string | undefined>;
|
|
593
604
|
/**
|
|
594
605
|
* Asynchronous mkdir(2) - create a directory.
|
|
@@ -601,9 +612,9 @@ declare module 'fs/promises' {
|
|
|
601
612
|
options?:
|
|
602
613
|
| Mode
|
|
603
614
|
| (MakeDirectoryOptions & {
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
| null
|
|
615
|
+
recursive?: false | undefined;
|
|
616
|
+
})
|
|
617
|
+
| null,
|
|
607
618
|
): Promise<void>;
|
|
608
619
|
/**
|
|
609
620
|
* Asynchronous mkdir(2) - create a directory.
|
|
@@ -640,11 +651,11 @@ declare module 'fs/promises' {
|
|
|
640
651
|
path: PathLike,
|
|
641
652
|
options?:
|
|
642
653
|
| (ObjectEncodingOptions & {
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
654
|
+
withFileTypes?: false | undefined;
|
|
655
|
+
recursive?: boolean | undefined;
|
|
656
|
+
})
|
|
646
657
|
| BufferEncoding
|
|
647
|
-
| null
|
|
658
|
+
| null,
|
|
648
659
|
): Promise<string[]>;
|
|
649
660
|
/**
|
|
650
661
|
* Asynchronous readdir(3) - read a directory.
|
|
@@ -655,11 +666,11 @@ declare module 'fs/promises' {
|
|
|
655
666
|
path: PathLike,
|
|
656
667
|
options:
|
|
657
668
|
| {
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
|
669
|
+
encoding: "buffer";
|
|
670
|
+
withFileTypes?: false | undefined;
|
|
671
|
+
recursive?: boolean | undefined;
|
|
672
|
+
}
|
|
673
|
+
| "buffer",
|
|
663
674
|
): Promise<Buffer[]>;
|
|
664
675
|
/**
|
|
665
676
|
* Asynchronous readdir(3) - read a directory.
|
|
@@ -670,11 +681,11 @@ declare module 'fs/promises' {
|
|
|
670
681
|
path: PathLike,
|
|
671
682
|
options?:
|
|
672
683
|
| (ObjectEncodingOptions & {
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
684
|
+
withFileTypes?: false | undefined;
|
|
685
|
+
recursive?: boolean | undefined;
|
|
686
|
+
})
|
|
676
687
|
| BufferEncoding
|
|
677
|
-
| null
|
|
688
|
+
| null,
|
|
678
689
|
): Promise<string[] | Buffer[]>;
|
|
679
690
|
/**
|
|
680
691
|
* Asynchronous readdir(3) - read a directory.
|
|
@@ -686,7 +697,7 @@ declare module 'fs/promises' {
|
|
|
686
697
|
options: ObjectEncodingOptions & {
|
|
687
698
|
withFileTypes: true;
|
|
688
699
|
recursive?: boolean | undefined;
|
|
689
|
-
}
|
|
700
|
+
},
|
|
690
701
|
): Promise<Dirent[]>;
|
|
691
702
|
/**
|
|
692
703
|
* 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
|
|
@@ -734,13 +745,13 @@ declare module 'fs/promises' {
|
|
|
734
745
|
path: PathLike,
|
|
735
746
|
opts?: StatOptions & {
|
|
736
747
|
bigint?: false | undefined;
|
|
737
|
-
}
|
|
748
|
+
},
|
|
738
749
|
): Promise<Stats>;
|
|
739
750
|
function lstat(
|
|
740
751
|
path: PathLike,
|
|
741
752
|
opts: StatOptions & {
|
|
742
753
|
bigint: true;
|
|
743
|
-
}
|
|
754
|
+
},
|
|
744
755
|
): Promise<BigIntStats>;
|
|
745
756
|
function lstat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
|
|
746
757
|
/**
|
|
@@ -751,13 +762,13 @@ declare module 'fs/promises' {
|
|
|
751
762
|
path: PathLike,
|
|
752
763
|
opts?: StatOptions & {
|
|
753
764
|
bigint?: false | undefined;
|
|
754
|
-
}
|
|
765
|
+
},
|
|
755
766
|
): Promise<Stats>;
|
|
756
767
|
function stat(
|
|
757
768
|
path: PathLike,
|
|
758
769
|
opts: StatOptions & {
|
|
759
770
|
bigint: true;
|
|
760
|
-
}
|
|
771
|
+
},
|
|
761
772
|
): Promise<BigIntStats>;
|
|
762
773
|
function stat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
|
|
763
774
|
/**
|
|
@@ -768,13 +779,13 @@ declare module 'fs/promises' {
|
|
|
768
779
|
path: PathLike,
|
|
769
780
|
opts?: StatFsOptions & {
|
|
770
781
|
bigint?: false | undefined;
|
|
771
|
-
}
|
|
782
|
+
},
|
|
772
783
|
): Promise<StatsFs>;
|
|
773
784
|
function statfs(
|
|
774
785
|
path: PathLike,
|
|
775
786
|
opts: StatFsOptions & {
|
|
776
787
|
bigint: true;
|
|
777
|
-
}
|
|
788
|
+
},
|
|
778
789
|
): Promise<BigIntStatsFs>;
|
|
779
790
|
function statfs(path: PathLike, opts?: StatFsOptions): Promise<StatsFs | BigIntStatsFs>;
|
|
780
791
|
|
|
@@ -866,7 +877,10 @@ declare module 'fs/promises' {
|
|
|
866
877
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
867
878
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
868
879
|
*/
|
|
869
|
-
function realpath(
|
|
880
|
+
function realpath(
|
|
881
|
+
path: PathLike,
|
|
882
|
+
options?: ObjectEncodingOptions | BufferEncoding | null,
|
|
883
|
+
): Promise<string | Buffer>;
|
|
870
884
|
/**
|
|
871
885
|
* Creates a unique temporary directory. A unique directory name is generated by
|
|
872
886
|
* appending six random characters to the end of the provided `prefix`. Due to
|
|
@@ -959,14 +973,19 @@ declare module 'fs/promises' {
|
|
|
959
973
|
*/
|
|
960
974
|
function writeFile(
|
|
961
975
|
file: PathLike | FileHandle,
|
|
962
|
-
data:
|
|
976
|
+
data:
|
|
977
|
+
| string
|
|
978
|
+
| NodeJS.ArrayBufferView
|
|
979
|
+
| Iterable<string | NodeJS.ArrayBufferView>
|
|
980
|
+
| AsyncIterable<string | NodeJS.ArrayBufferView>
|
|
981
|
+
| Stream,
|
|
963
982
|
options?:
|
|
964
983
|
| (ObjectEncodingOptions & {
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
984
|
+
mode?: Mode | undefined;
|
|
985
|
+
flag?: OpenMode | undefined;
|
|
986
|
+
} & Abortable)
|
|
968
987
|
| BufferEncoding
|
|
969
|
-
| null
|
|
988
|
+
| null,
|
|
970
989
|
): Promise<void>;
|
|
971
990
|
/**
|
|
972
991
|
* Asynchronously append data to a file, creating the file if it does not yet
|
|
@@ -982,7 +1001,11 @@ declare module 'fs/promises' {
|
|
|
982
1001
|
* @param path filename or {FileHandle}
|
|
983
1002
|
* @return Fulfills with `undefined` upon success.
|
|
984
1003
|
*/
|
|
985
|
-
function appendFile(
|
|
1004
|
+
function appendFile(
|
|
1005
|
+
path: PathLike | FileHandle,
|
|
1006
|
+
data: string | Uint8Array,
|
|
1007
|
+
options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null,
|
|
1008
|
+
): Promise<void>;
|
|
986
1009
|
/**
|
|
987
1010
|
* Asynchronously reads the entire contents of a file.
|
|
988
1011
|
*
|
|
@@ -1029,10 +1052,10 @@ declare module 'fs/promises' {
|
|
|
1029
1052
|
path: PathLike | FileHandle,
|
|
1030
1053
|
options?:
|
|
1031
1054
|
| ({
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
| null
|
|
1055
|
+
encoding?: null | undefined;
|
|
1056
|
+
flag?: OpenMode | undefined;
|
|
1057
|
+
} & Abortable)
|
|
1058
|
+
| null,
|
|
1036
1059
|
): Promise<Buffer>;
|
|
1037
1060
|
/**
|
|
1038
1061
|
* Asynchronously reads the entire contents of a file.
|
|
@@ -1045,10 +1068,10 @@ declare module 'fs/promises' {
|
|
|
1045
1068
|
path: PathLike | FileHandle,
|
|
1046
1069
|
options:
|
|
1047
1070
|
| ({
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
| BufferEncoding
|
|
1071
|
+
encoding: BufferEncoding;
|
|
1072
|
+
flag?: OpenMode | undefined;
|
|
1073
|
+
} & Abortable)
|
|
1074
|
+
| BufferEncoding,
|
|
1052
1075
|
): Promise<string>;
|
|
1053
1076
|
/**
|
|
1054
1077
|
* Asynchronously reads the entire contents of a file.
|
|
@@ -1060,12 +1083,15 @@ declare module 'fs/promises' {
|
|
|
1060
1083
|
function readFile(
|
|
1061
1084
|
path: PathLike | FileHandle,
|
|
1062
1085
|
options?:
|
|
1063
|
-
| (
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1086
|
+
| (
|
|
1087
|
+
& ObjectEncodingOptions
|
|
1088
|
+
& Abortable
|
|
1089
|
+
& {
|
|
1090
|
+
flag?: OpenMode | undefined;
|
|
1091
|
+
}
|
|
1092
|
+
)
|
|
1067
1093
|
| BufferEncoding
|
|
1068
|
-
| null
|
|
1094
|
+
| null,
|
|
1069
1095
|
): Promise<string | Buffer>;
|
|
1070
1096
|
/**
|
|
1071
1097
|
* 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.
|
|
@@ -1130,9 +1156,9 @@ declare module 'fs/promises' {
|
|
|
1130
1156
|
filename: PathLike,
|
|
1131
1157
|
options:
|
|
1132
1158
|
| (WatchOptions & {
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
|
1159
|
+
encoding: "buffer";
|
|
1160
|
+
})
|
|
1161
|
+
| "buffer",
|
|
1136
1162
|
): AsyncIterable<FileChangeInfo<Buffer>>;
|
|
1137
1163
|
/**
|
|
1138
1164
|
* Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
|
|
@@ -1151,7 +1177,10 @@ declare module 'fs/promises' {
|
|
|
1151
1177
|
* If `persistent` is not supplied, the default of `true` is used.
|
|
1152
1178
|
* If `recursive` is not supplied, the default of `false` is used.
|
|
1153
1179
|
*/
|
|
1154
|
-
function watch(
|
|
1180
|
+
function watch(
|
|
1181
|
+
filename: PathLike,
|
|
1182
|
+
options: WatchOptions | string,
|
|
1183
|
+
): AsyncIterable<FileChangeInfo<string>> | AsyncIterable<FileChangeInfo<Buffer>>;
|
|
1155
1184
|
/**
|
|
1156
1185
|
* Asynchronously copies the entire directory structure from `src` to `dest`,
|
|
1157
1186
|
* including subdirectories and files.
|
|
@@ -1166,6 +1195,6 @@ declare module 'fs/promises' {
|
|
|
1166
1195
|
*/
|
|
1167
1196
|
function cp(source: string | URL, destination: string | URL, opts?: CopyOptions): Promise<void>;
|
|
1168
1197
|
}
|
|
1169
|
-
declare module
|
|
1170
|
-
export * from
|
|
1198
|
+
declare module "node:fs/promises" {
|
|
1199
|
+
export * from "fs/promises";
|
|
1171
1200
|
}
|