@types/node 22.15.21 → 22.19.3
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 v22.19/README.md +15 -0
- node v22.19/assert/strict.d.ts +111 -0
- node/assert.d.ts → node v22.19/assert.d.ts +119 -95
- node/buffer.buffer.d.ts → node v22.19/buffer.buffer.d.ts +9 -0
- node/buffer.d.ts → node v22.19/buffer.d.ts +14 -6
- node/child_process.d.ts → node v22.19/child_process.d.ts +89 -162
- node/cluster.d.ts → node v22.19/cluster.d.ts +4 -5
- node/compatibility/disposable.d.ts → node v22.19/compatibility/disposable.d.ts +0 -2
- node/compatibility/indexable.d.ts → node v22.19/compatibility/indexable.d.ts +0 -3
- node/compatibility/iterators.d.ts → node v22.19/compatibility/iterators.d.ts +0 -1
- node/crypto.d.ts → node v22.19/crypto.d.ts +203 -167
- node/dgram.d.ts → node v22.19/dgram.d.ts +9 -8
- node/diagnostics_channel.d.ts → node v22.19/diagnostics_channel.d.ts +17 -12
- node/dns/promises.d.ts → node v22.19/dns/promises.d.ts +36 -9
- node/dns.d.ts → node v22.19/dns.d.ts +79 -21
- node/events.d.ts → node v22.19/events.d.ts +80 -35
- node/fs/promises.d.ts → node v22.19/fs/promises.d.ts +81 -58
- node/fs.d.ts → node v22.19/fs.d.ts +154 -130
- node v22.19/globals.d.ts +172 -0
- node v22.19/globals.typedarray.d.ts +38 -0
- node/http.d.ts → node v22.19/http.d.ts +140 -35
- node/http2.d.ts → node v22.19/http2.d.ts +114 -27
- node/https.d.ts → node v22.19/https.d.ts +96 -62
- node/index.d.ts → node v22.19/index.d.ts +7 -2
- node v22.19/inspector.d.ts +253 -0
- node/inspector.d.ts → node v22.19/inspector.generated.d.ts +880 -830
- node/module.d.ts → node v22.19/module.d.ts +136 -17
- node/net.d.ts → node v22.19/net.d.ts +33 -11
- node/os.d.ts → node v22.19/os.d.ts +14 -3
- node/package.json → node v22.19/package.json +3 -83
- node/path.d.ts → node v22.19/path.d.ts +1 -1
- node/perf_hooks.d.ts → node v22.19/perf_hooks.d.ts +8 -10
- node/process.d.ts → node v22.19/process.d.ts +39 -27
- node/readline/promises.d.ts → node v22.19/readline/promises.d.ts +1 -2
- node/repl.d.ts → node v22.19/repl.d.ts +3 -5
- node/sqlite.d.ts → node v22.19/sqlite.d.ts +219 -6
- node/stream/consumers.d.ts → node v22.19/stream/consumers.d.ts +2 -2
- node/stream/web.d.ts → node v22.19/stream/web.d.ts +8 -0
- node/stream.d.ts → node v22.19/stream.d.ts +34 -32
- node/string_decoder.d.ts → node v22.19/string_decoder.d.ts +2 -2
- node v22.19/test.d.ts +2162 -0
- node/tls.d.ts → node v22.19/tls.d.ts +122 -66
- node/ts5.6/buffer.buffer.d.ts → node v22.19/ts5.6/buffer.buffer.d.ts +10 -2
- node v22.19/ts5.6/globals.typedarray.d.ts +34 -0
- node/ts5.6/index.d.ts → node v22.19/ts5.6/index.d.ts +7 -2
- node/url.d.ts → node v22.19/url.d.ts +21 -9
- node/util.d.ts → node v22.19/util.d.ts +33 -11
- node/v8.d.ts → node v22.19/v8.d.ts +66 -35
- node/vm.d.ts → node v22.19/vm.d.ts +65 -56
- node/wasi.d.ts → node v22.19/wasi.d.ts +1 -1
- node v22.19/web-globals/abortcontroller.d.ts +34 -0
- node v22.19/web-globals/domexception.d.ts +68 -0
- node v22.19/web-globals/events.d.ts +97 -0
- node v22.19/web-globals/fetch.d.ts +46 -0
- node v22.19/web-globals/navigator.d.ts +22 -0
- node v22.19/web-globals/storage.d.ts +24 -0
- node/worker_threads.d.ts → node v22.19/worker_threads.d.ts +112 -74
- node/zlib.d.ts → node v22.19/zlib.d.ts +39 -26
- node/README.md +0 -15
- node/assert/strict.d.ts +0 -8
- node/dom-events.d.ts +0 -124
- node/globals.d.ts +0 -371
- node/globals.typedarray.d.ts +0 -21
- node/test.d.ts +0 -2280
- node/ts5.6/globals.typedarray.d.ts +0 -19
- {node → node v22.19}/LICENSE +0 -0
- node/async_hooks.d.ts → node v22.19/async_hooks.d.ts +1 -1
- {node → node v22.19}/compatibility/index.d.ts +0 -0
- {node → node v22.19}/console.d.ts +0 -0
- {node → node v22.19}/constants.d.ts +0 -0
- {node → node v22.19}/domain.d.ts +0 -0
- {node → node v22.19}/punycode.d.ts +0 -0
- {node → node v22.19}/querystring.d.ts +0 -0
- {node → node v22.19}/readline.d.ts +0 -0
- {node → node v22.19}/sea.d.ts +0 -0
- {node → node v22.19}/stream/promises.d.ts +0 -0
- {node → node v22.19}/timers/promises.d.ts +0 -0
- {node → node v22.19}/timers.d.ts +0 -0
- {node → node v22.19}/trace_events.d.ts +0 -0
- {node → node v22.19}/tty.d.ts +0 -0
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* @since v10.0.0
|
|
10
10
|
*/
|
|
11
11
|
declare module "fs/promises" {
|
|
12
|
+
import { NonSharedBuffer } from "node:buffer";
|
|
12
13
|
import { Abortable } from "node:events";
|
|
13
14
|
import { Stream } from "node:stream";
|
|
14
15
|
import { ReadableStream } from "node:stream/web";
|
|
@@ -29,6 +30,9 @@ declare module "fs/promises" {
|
|
|
29
30
|
OpenDirOptions,
|
|
30
31
|
OpenMode,
|
|
31
32
|
PathLike,
|
|
33
|
+
ReadOptions,
|
|
34
|
+
ReadOptionsWithBuffer,
|
|
35
|
+
ReadPosition,
|
|
32
36
|
ReadStream,
|
|
33
37
|
ReadVResult,
|
|
34
38
|
RmDirOptions,
|
|
@@ -39,7 +43,7 @@ declare module "fs/promises" {
|
|
|
39
43
|
StatsFs,
|
|
40
44
|
TimeLike,
|
|
41
45
|
WatchEventType,
|
|
42
|
-
WatchOptions,
|
|
46
|
+
WatchOptions as _WatchOptions,
|
|
43
47
|
WriteStream,
|
|
44
48
|
WriteVResult,
|
|
45
49
|
} from "node:fs";
|
|
@@ -56,6 +60,7 @@ declare module "fs/promises" {
|
|
|
56
60
|
bytesRead: number;
|
|
57
61
|
buffer: T;
|
|
58
62
|
}
|
|
63
|
+
/** @deprecated This interface will be removed in a future version. Use `import { ReadOptionsWithBuffer } from "node:fs"` instead. */
|
|
59
64
|
interface FileReadOptions<T extends NodeJS.ArrayBufferView = Buffer> {
|
|
60
65
|
/**
|
|
61
66
|
* @default `Buffer.alloc(0xffff)`
|
|
@@ -69,7 +74,7 @@ declare module "fs/promises" {
|
|
|
69
74
|
* @default `buffer.byteLength`
|
|
70
75
|
*/
|
|
71
76
|
length?: number | null;
|
|
72
|
-
position?:
|
|
77
|
+
position?: ReadPosition | null;
|
|
73
78
|
}
|
|
74
79
|
interface CreateReadStreamOptions extends Abortable {
|
|
75
80
|
encoding?: BufferEncoding | null | undefined;
|
|
@@ -87,6 +92,9 @@ declare module "fs/promises" {
|
|
|
87
92
|
highWaterMark?: number | undefined;
|
|
88
93
|
flush?: boolean | undefined;
|
|
89
94
|
}
|
|
95
|
+
interface ReadableWebStreamOptions {
|
|
96
|
+
autoClose?: boolean | undefined;
|
|
97
|
+
}
|
|
90
98
|
// TODO: Add `EventEmitter` close
|
|
91
99
|
interface FileHandle {
|
|
92
100
|
/**
|
|
@@ -229,13 +237,15 @@ declare module "fs/promises" {
|
|
|
229
237
|
buffer: T,
|
|
230
238
|
offset?: number | null,
|
|
231
239
|
length?: number | null,
|
|
232
|
-
position?:
|
|
240
|
+
position?: ReadPosition | null,
|
|
233
241
|
): Promise<FileReadResult<T>>;
|
|
234
|
-
read<T extends NodeJS.ArrayBufferView
|
|
242
|
+
read<T extends NodeJS.ArrayBufferView>(
|
|
235
243
|
buffer: T,
|
|
236
|
-
options?:
|
|
244
|
+
options?: ReadOptions,
|
|
245
|
+
): Promise<FileReadResult<T>>;
|
|
246
|
+
read<T extends NodeJS.ArrayBufferView = NonSharedBuffer>(
|
|
247
|
+
options?: ReadOptionsWithBuffer<T>,
|
|
237
248
|
): Promise<FileReadResult<T>>;
|
|
238
|
-
read<T extends NodeJS.ArrayBufferView = Buffer>(options?: FileReadOptions<T>): Promise<FileReadResult<T>>;
|
|
239
249
|
/**
|
|
240
250
|
* Returns a byte-oriented `ReadableStream` that may be used to read the file's
|
|
241
251
|
* contents.
|
|
@@ -259,9 +269,8 @@ declare module "fs/promises" {
|
|
|
259
269
|
* While the `ReadableStream` will read the file to completion, it will not
|
|
260
270
|
* close the `FileHandle` automatically. User code must still call the`fileHandle.close()` method.
|
|
261
271
|
* @since v17.0.0
|
|
262
|
-
* @experimental
|
|
263
272
|
*/
|
|
264
|
-
readableWebStream(): ReadableStream;
|
|
273
|
+
readableWebStream(options?: ReadableWebStreamOptions): ReadableStream;
|
|
265
274
|
/**
|
|
266
275
|
* Asynchronously reads the entire contents of a file.
|
|
267
276
|
*
|
|
@@ -280,7 +289,7 @@ declare module "fs/promises" {
|
|
|
280
289
|
options?:
|
|
281
290
|
| ({ encoding?: null | undefined } & Abortable)
|
|
282
291
|
| null,
|
|
283
|
-
): Promise<
|
|
292
|
+
): Promise<NonSharedBuffer>;
|
|
284
293
|
/**
|
|
285
294
|
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
|
286
295
|
* The `FileHandle` must have been opened for reading.
|
|
@@ -299,7 +308,7 @@ declare module "fs/promises" {
|
|
|
299
308
|
| (ObjectEncodingOptions & Abortable)
|
|
300
309
|
| BufferEncoding
|
|
301
310
|
| null,
|
|
302
|
-
): Promise<string |
|
|
311
|
+
): Promise<string | NonSharedBuffer>;
|
|
303
312
|
/**
|
|
304
313
|
* Convenience method to create a `readline` interface and stream over the file.
|
|
305
314
|
* See `filehandle.createReadStream()` for the options.
|
|
@@ -408,7 +417,7 @@ declare module "fs/promises" {
|
|
|
408
417
|
* @param [position='null'] The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current
|
|
409
418
|
* position. See the POSIX pwrite(2) documentation for more detail.
|
|
410
419
|
*/
|
|
411
|
-
write<TBuffer extends
|
|
420
|
+
write<TBuffer extends NodeJS.ArrayBufferView>(
|
|
412
421
|
buffer: TBuffer,
|
|
413
422
|
offset?: number | null,
|
|
414
423
|
length?: number | null,
|
|
@@ -447,14 +456,20 @@ declare module "fs/promises" {
|
|
|
447
456
|
* @param [position='null'] The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current
|
|
448
457
|
* position.
|
|
449
458
|
*/
|
|
450
|
-
writev
|
|
459
|
+
writev<TBuffers extends readonly NodeJS.ArrayBufferView[]>(
|
|
460
|
+
buffers: TBuffers,
|
|
461
|
+
position?: number,
|
|
462
|
+
): Promise<WriteVResult<TBuffers>>;
|
|
451
463
|
/**
|
|
452
464
|
* Read from a file and write to an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s
|
|
453
465
|
* @since v13.13.0, v12.17.0
|
|
454
466
|
* @param [position='null'] The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position.
|
|
455
467
|
* @return Fulfills upon success an object containing two properties:
|
|
456
468
|
*/
|
|
457
|
-
readv
|
|
469
|
+
readv<TBuffers extends readonly NodeJS.ArrayBufferView[]>(
|
|
470
|
+
buffers: TBuffers,
|
|
471
|
+
position?: number,
|
|
472
|
+
): Promise<ReadVResult<TBuffers>>;
|
|
458
473
|
/**
|
|
459
474
|
* Closes the file handle after waiting for any pending operation on the handle to
|
|
460
475
|
* complete.
|
|
@@ -474,7 +489,8 @@ declare module "fs/promises" {
|
|
|
474
489
|
*/
|
|
475
490
|
close(): Promise<void>;
|
|
476
491
|
/**
|
|
477
|
-
*
|
|
492
|
+
* Calls `filehandle.close()` and returns a promise that fulfills when the
|
|
493
|
+
* filehandle is closed.
|
|
478
494
|
* @since v20.4.0
|
|
479
495
|
*/
|
|
480
496
|
[Symbol.asyncDispose](): Promise<void>;
|
|
@@ -690,7 +706,7 @@ declare module "fs/promises" {
|
|
|
690
706
|
recursive?: boolean | undefined;
|
|
691
707
|
}
|
|
692
708
|
| "buffer",
|
|
693
|
-
): Promise<
|
|
709
|
+
): Promise<NonSharedBuffer[]>;
|
|
694
710
|
/**
|
|
695
711
|
* Asynchronous readdir(3) - read a directory.
|
|
696
712
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -705,7 +721,7 @@ declare module "fs/promises" {
|
|
|
705
721
|
})
|
|
706
722
|
| BufferEncoding
|
|
707
723
|
| null,
|
|
708
|
-
): Promise<string[] |
|
|
724
|
+
): Promise<string[] | NonSharedBuffer[]>;
|
|
709
725
|
/**
|
|
710
726
|
* Asynchronous readdir(3) - read a directory.
|
|
711
727
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -730,7 +746,7 @@ declare module "fs/promises" {
|
|
|
730
746
|
withFileTypes: true;
|
|
731
747
|
recursive?: boolean | undefined;
|
|
732
748
|
},
|
|
733
|
-
): Promise<Dirent<
|
|
749
|
+
): Promise<Dirent<NonSharedBuffer>[]>;
|
|
734
750
|
/**
|
|
735
751
|
* 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
|
|
736
752
|
* fulfilled with the`linkString` upon success.
|
|
@@ -748,13 +764,16 @@ declare module "fs/promises" {
|
|
|
748
764
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
749
765
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
750
766
|
*/
|
|
751
|
-
function readlink(path: PathLike, options: BufferEncodingOption): Promise<
|
|
767
|
+
function readlink(path: PathLike, options: BufferEncodingOption): Promise<NonSharedBuffer>;
|
|
752
768
|
/**
|
|
753
769
|
* Asynchronous readlink(2) - read value of a symbolic link.
|
|
754
770
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
755
771
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
756
772
|
*/
|
|
757
|
-
function readlink(
|
|
773
|
+
function readlink(
|
|
774
|
+
path: PathLike,
|
|
775
|
+
options?: ObjectEncodingOptions | string | null,
|
|
776
|
+
): Promise<string | NonSharedBuffer>;
|
|
758
777
|
/**
|
|
759
778
|
* Creates a symbolic link.
|
|
760
779
|
*
|
|
@@ -905,7 +924,7 @@ declare module "fs/promises" {
|
|
|
905
924
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
906
925
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
907
926
|
*/
|
|
908
|
-
function realpath(path: PathLike, options: BufferEncodingOption): Promise<
|
|
927
|
+
function realpath(path: PathLike, options: BufferEncodingOption): Promise<NonSharedBuffer>;
|
|
909
928
|
/**
|
|
910
929
|
* Asynchronous realpath(3) - return the canonicalized absolute pathname.
|
|
911
930
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -914,7 +933,7 @@ declare module "fs/promises" {
|
|
|
914
933
|
function realpath(
|
|
915
934
|
path: PathLike,
|
|
916
935
|
options?: ObjectEncodingOptions | BufferEncoding | null,
|
|
917
|
-
): Promise<string |
|
|
936
|
+
): Promise<string | NonSharedBuffer>;
|
|
918
937
|
/**
|
|
919
938
|
* Creates a unique temporary directory. A unique directory name is generated by
|
|
920
939
|
* appending six random characters to the end of the provided `prefix`. Due to
|
|
@@ -950,13 +969,16 @@ declare module "fs/promises" {
|
|
|
950
969
|
* Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory.
|
|
951
970
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
952
971
|
*/
|
|
953
|
-
function mkdtemp(prefix: string, options: BufferEncodingOption): Promise<
|
|
972
|
+
function mkdtemp(prefix: string, options: BufferEncodingOption): Promise<NonSharedBuffer>;
|
|
954
973
|
/**
|
|
955
974
|
* Asynchronously creates a unique temporary directory.
|
|
956
975
|
* Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory.
|
|
957
976
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
958
977
|
*/
|
|
959
|
-
function mkdtemp(
|
|
978
|
+
function mkdtemp(
|
|
979
|
+
prefix: string,
|
|
980
|
+
options?: ObjectEncodingOptions | BufferEncoding | null,
|
|
981
|
+
): Promise<string | NonSharedBuffer>;
|
|
960
982
|
/**
|
|
961
983
|
* Asynchronously writes data to a file, replacing the file if it already exists. `data` can be a string, a buffer, an
|
|
962
984
|
* [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface), or an
|
|
@@ -1112,7 +1134,7 @@ declare module "fs/promises" {
|
|
|
1112
1134
|
flag?: OpenMode | undefined;
|
|
1113
1135
|
} & Abortable)
|
|
1114
1136
|
| null,
|
|
1115
|
-
): Promise<
|
|
1137
|
+
): Promise<NonSharedBuffer>;
|
|
1116
1138
|
/**
|
|
1117
1139
|
* Asynchronously reads the entire contents of a file.
|
|
1118
1140
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -1148,7 +1170,7 @@ declare module "fs/promises" {
|
|
|
1148
1170
|
)
|
|
1149
1171
|
| BufferEncoding
|
|
1150
1172
|
| null,
|
|
1151
|
-
): Promise<string |
|
|
1173
|
+
): Promise<string | NonSharedBuffer>;
|
|
1152
1174
|
/**
|
|
1153
1175
|
* 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.
|
|
1154
1176
|
*
|
|
@@ -1178,6 +1200,16 @@ declare module "fs/promises" {
|
|
|
1178
1200
|
* @return Fulfills with an {fs.Dir}.
|
|
1179
1201
|
*/
|
|
1180
1202
|
function opendir(path: PathLike, options?: OpenDirOptions): Promise<Dir>;
|
|
1203
|
+
interface WatchOptions extends _WatchOptions {
|
|
1204
|
+
maxQueue?: number | undefined;
|
|
1205
|
+
overflow?: "ignore" | "throw" | undefined;
|
|
1206
|
+
}
|
|
1207
|
+
interface WatchOptionsWithBufferEncoding extends WatchOptions {
|
|
1208
|
+
encoding: "buffer";
|
|
1209
|
+
}
|
|
1210
|
+
interface WatchOptionsWithStringEncoding extends WatchOptions {
|
|
1211
|
+
encoding?: BufferEncoding | undefined;
|
|
1212
|
+
}
|
|
1181
1213
|
/**
|
|
1182
1214
|
* Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory.
|
|
1183
1215
|
*
|
|
@@ -1210,33 +1242,16 @@ declare module "fs/promises" {
|
|
|
1210
1242
|
*/
|
|
1211
1243
|
function watch(
|
|
1212
1244
|
filename: PathLike,
|
|
1213
|
-
options
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
):
|
|
1219
|
-
/**
|
|
1220
|
-
* Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
|
|
1221
|
-
* @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
|
|
1222
|
-
* @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
|
|
1223
|
-
* If `encoding` is not supplied, the default of `'utf8'` is used.
|
|
1224
|
-
* If `persistent` is not supplied, the default of `true` is used.
|
|
1225
|
-
* If `recursive` is not supplied, the default of `false` is used.
|
|
1226
|
-
*/
|
|
1227
|
-
function watch(filename: PathLike, options?: WatchOptions | BufferEncoding): AsyncIterable<FileChangeInfo<string>>;
|
|
1228
|
-
/**
|
|
1229
|
-
* Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
|
|
1230
|
-
* @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
|
|
1231
|
-
* @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
|
|
1232
|
-
* If `encoding` is not supplied, the default of `'utf8'` is used.
|
|
1233
|
-
* If `persistent` is not supplied, the default of `true` is used.
|
|
1234
|
-
* If `recursive` is not supplied, the default of `false` is used.
|
|
1235
|
-
*/
|
|
1245
|
+
options?: WatchOptionsWithStringEncoding | BufferEncoding,
|
|
1246
|
+
): NodeJS.AsyncIterator<FileChangeInfo<string>>;
|
|
1247
|
+
function watch(
|
|
1248
|
+
filename: PathLike,
|
|
1249
|
+
options: WatchOptionsWithBufferEncoding | "buffer",
|
|
1250
|
+
): NodeJS.AsyncIterator<FileChangeInfo<NonSharedBuffer>>;
|
|
1236
1251
|
function watch(
|
|
1237
1252
|
filename: PathLike,
|
|
1238
|
-
options: WatchOptions |
|
|
1239
|
-
):
|
|
1253
|
+
options: WatchOptions | BufferEncoding | "buffer",
|
|
1254
|
+
): NodeJS.AsyncIterator<FileChangeInfo<string | NonSharedBuffer>>;
|
|
1240
1255
|
/**
|
|
1241
1256
|
* Asynchronously copies the entire directory structure from `src` to `dest`,
|
|
1242
1257
|
* including subdirectories and files.
|
|
@@ -1251,20 +1266,28 @@ declare module "fs/promises" {
|
|
|
1251
1266
|
*/
|
|
1252
1267
|
function cp(source: string | URL, destination: string | URL, opts?: CopyOptions): Promise<void>;
|
|
1253
1268
|
/**
|
|
1254
|
-
*
|
|
1269
|
+
* ```js
|
|
1270
|
+
* import { glob } from 'node:fs/promises';
|
|
1271
|
+
*
|
|
1272
|
+
* for await (const entry of glob('*.js'))
|
|
1273
|
+
* console.log(entry);
|
|
1274
|
+
* ```
|
|
1275
|
+
* @since v22.0.0
|
|
1276
|
+
* @returns An AsyncIterator that yields the paths of files
|
|
1277
|
+
* that match the pattern.
|
|
1255
1278
|
*/
|
|
1256
|
-
function glob(pattern: string | string[]): NodeJS.AsyncIterator<string>;
|
|
1279
|
+
function glob(pattern: string | readonly string[]): NodeJS.AsyncIterator<string>;
|
|
1257
1280
|
function glob(
|
|
1258
|
-
pattern: string | string[],
|
|
1259
|
-
|
|
1281
|
+
pattern: string | readonly string[],
|
|
1282
|
+
options: GlobOptionsWithFileTypes,
|
|
1260
1283
|
): NodeJS.AsyncIterator<Dirent>;
|
|
1261
1284
|
function glob(
|
|
1262
|
-
pattern: string | string[],
|
|
1263
|
-
|
|
1285
|
+
pattern: string | readonly string[],
|
|
1286
|
+
options: GlobOptionsWithoutFileTypes,
|
|
1264
1287
|
): NodeJS.AsyncIterator<string>;
|
|
1265
1288
|
function glob(
|
|
1266
|
-
pattern: string | string[],
|
|
1267
|
-
|
|
1289
|
+
pattern: string | readonly string[],
|
|
1290
|
+
options: GlobOptions,
|
|
1268
1291
|
): NodeJS.AsyncIterator<Dirent | string>;
|
|
1269
1292
|
}
|
|
1270
1293
|
declare module "node:fs/promises" {
|