@types/node 14.18.61 → 14.18.63
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.18/README.md +1 -1
- node v14.18/assert.d.ts +33 -31
- node v14.18/async_hooks.d.ts +27 -20
- node v14.18/buffer.d.ts +4 -4
- node v14.18/child_process.d.ts +191 -62
- node v14.18/cluster.d.ts +59 -28
- node v14.18/console.d.ts +6 -6
- node v14.18/constants.d.ts +12 -11
- node v14.18/crypto.d.ts +232 -228
- node v14.18/dgram.d.ts +50 -14
- node v14.18/dns.d.ts +183 -54
- node v14.18/domain.d.ts +4 -4
- node v14.18/events.d.ts +4 -4
- node v14.18/fs/promises.d.ts +87 -25
- node v14.18/fs.d.ts +404 -104
- node v14.18/globals.d.ts +33 -16
- node v14.18/http.d.ts +201 -201
- node v14.18/http2.d.ts +340 -93
- node v14.18/https.d.ts +107 -105
- node v14.18/inspector.d.ts +4 -4
- node v14.18/module.d.ts +4 -4
- node v14.18/net.d.ts +27 -12
- node v14.18/os.d.ts +4 -4
- node v14.18/package.json +2 -2
- node v14.18/path.d.ts +5 -5
- node v14.18/perf_hooks.d.ts +5 -5
- node v14.18/process.d.ts +61 -22
- node v14.18/punycode.d.ts +3 -3
- node v14.18/querystring.d.ts +15 -5
- node v14.18/readline.d.ts +16 -6
- node v14.18/repl.d.ts +13 -7
- node v14.18/stream.d.ts +160 -100
- node v14.18/string_decoder.d.ts +3 -3
- node v14.18/timers.d.ts +3 -3
- node v14.18/tls.d.ts +109 -27
- node v14.18/trace_events.d.ts +3 -3
- node v14.18/ts4.8/assert.d.ts +33 -31
- node v14.18/ts4.8/async_hooks.d.ts +27 -20
- node v14.18/ts4.8/buffer.d.ts +4 -4
- node v14.18/ts4.8/child_process.d.ts +191 -62
- node v14.18/ts4.8/cluster.d.ts +59 -28
- node v14.18/ts4.8/console.d.ts +6 -6
- node v14.18/ts4.8/constants.d.ts +12 -11
- node v14.18/ts4.8/crypto.d.ts +232 -228
- node v14.18/ts4.8/dgram.d.ts +50 -14
- node v14.18/ts4.8/dns.d.ts +183 -54
- node v14.18/ts4.8/domain.d.ts +4 -4
- node v14.18/ts4.8/events.d.ts +4 -4
- node v14.18/ts4.8/fs/promises.d.ts +87 -25
- node v14.18/ts4.8/fs.d.ts +404 -104
- node v14.18/ts4.8/globals.d.ts +33 -16
- node v14.18/ts4.8/http.d.ts +200 -200
- node v14.18/ts4.8/http2.d.ts +340 -93
- node v14.18/ts4.8/https.d.ts +107 -105
- node v14.18/ts4.8/inspector.d.ts +4 -4
- node v14.18/ts4.8/module.d.ts +4 -4
- node v14.18/ts4.8/net.d.ts +27 -12
- node v14.18/ts4.8/os.d.ts +4 -4
- node v14.18/ts4.8/path.d.ts +5 -5
- node v14.18/ts4.8/perf_hooks.d.ts +5 -5
- node v14.18/ts4.8/process.d.ts +61 -22
- node v14.18/ts4.8/punycode.d.ts +3 -3
- node v14.18/ts4.8/querystring.d.ts +15 -5
- node v14.18/ts4.8/readline.d.ts +16 -6
- node v14.18/ts4.8/repl.d.ts +13 -7
- node v14.18/ts4.8/stream.d.ts +160 -100
- node v14.18/ts4.8/string_decoder.d.ts +3 -3
- node v14.18/ts4.8/timers.d.ts +3 -3
- node v14.18/ts4.8/tls.d.ts +109 -27
- node v14.18/ts4.8/trace_events.d.ts +3 -3
- node v14.18/ts4.8/tty.d.ts +4 -4
- node v14.18/ts4.8/url.d.ts +21 -12
- node v14.18/ts4.8/util.d.ts +102 -40
- node v14.18/ts4.8/v8.d.ts +4 -5
- node v14.18/ts4.8/vm.d.ts +7 -7
- node v14.18/ts4.8/wasi.d.ts +3 -4
- node v14.18/ts4.8/worker_threads.d.ts +8 -8
- node v14.18/ts4.8/zlib.d.ts +13 -13
- node v14.18/tty.d.ts +4 -4
- node v14.18/url.d.ts +21 -12
- node v14.18/util.d.ts +102 -40
- node v14.18/v8.d.ts +4 -5
- node v14.18/vm.d.ts +7 -7
- node v14.18/wasi.d.ts +3 -4
- node v14.18/worker_threads.d.ts +8 -8
- node v14.18/zlib.d.ts +13 -13
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare module
|
|
1
|
+
declare module "fs/promises" {
|
|
2
2
|
import {
|
|
3
3
|
BaseEncodingOptions,
|
|
4
4
|
BigIntStats,
|
|
@@ -17,7 +17,7 @@ declare module 'node:fs/promises' {
|
|
|
17
17
|
StatOptions,
|
|
18
18
|
Stats,
|
|
19
19
|
WriteVResult,
|
|
20
|
-
} from
|
|
20
|
+
} from "fs";
|
|
21
21
|
|
|
22
22
|
interface FileHandle {
|
|
23
23
|
/**
|
|
@@ -35,7 +35,13 @@ declare module 'node:fs/promises' {
|
|
|
35
35
|
* If `mode` is a string, it is parsed as an octal integer.
|
|
36
36
|
* If `flag` is not supplied, the default of `'a'` is used.
|
|
37
37
|
*/
|
|
38
|
-
appendFile(
|
|
38
|
+
appendFile(
|
|
39
|
+
data: string | Uint8Array,
|
|
40
|
+
options?:
|
|
41
|
+
| BaseEncodingOptions & { mode?: Mode | undefined; flag?: OpenMode | undefined }
|
|
42
|
+
| BufferEncoding
|
|
43
|
+
| null,
|
|
44
|
+
): Promise<void>;
|
|
39
45
|
|
|
40
46
|
/**
|
|
41
47
|
* Asynchronous fchown(2) - Change ownership of a file.
|
|
@@ -66,7 +72,12 @@ declare module 'node:fs/promises' {
|
|
|
66
72
|
* @param length The number of bytes to read.
|
|
67
73
|
* @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position.
|
|
68
74
|
*/
|
|
69
|
-
read<TBuffer extends Uint8Array>(
|
|
75
|
+
read<TBuffer extends Uint8Array>(
|
|
76
|
+
buffer: TBuffer,
|
|
77
|
+
offset?: number | null,
|
|
78
|
+
length?: number | null,
|
|
79
|
+
position?: number | null,
|
|
80
|
+
): Promise<{ bytesRead: number; buffer: TBuffer }>;
|
|
70
81
|
|
|
71
82
|
/**
|
|
72
83
|
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
|
@@ -74,7 +85,7 @@ declare module 'node:fs/promises' {
|
|
|
74
85
|
* @param options An object that may contain an optional flag.
|
|
75
86
|
* If a flag is not provided, it defaults to `'r'`.
|
|
76
87
|
*/
|
|
77
|
-
readFile(options?: { encoding?: null | undefined
|
|
88
|
+
readFile(options?: { encoding?: null | undefined; flag?: OpenMode | undefined } | null): Promise<Buffer>;
|
|
78
89
|
|
|
79
90
|
/**
|
|
80
91
|
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
|
@@ -82,7 +93,7 @@ declare module 'node:fs/promises' {
|
|
|
82
93
|
* @param options An object that may contain an optional flag.
|
|
83
94
|
* If a flag is not provided, it defaults to `'r'`.
|
|
84
95
|
*/
|
|
85
|
-
readFile(options: { encoding: BufferEncoding
|
|
96
|
+
readFile(options: { encoding: BufferEncoding; flag?: OpenMode | undefined } | BufferEncoding): Promise<string>;
|
|
86
97
|
|
|
87
98
|
/**
|
|
88
99
|
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
|
@@ -90,7 +101,9 @@ declare module 'node:fs/promises' {
|
|
|
90
101
|
* @param options An object that may contain an optional flag.
|
|
91
102
|
* If a flag is not provided, it defaults to `'r'`.
|
|
92
103
|
*/
|
|
93
|
-
readFile(
|
|
104
|
+
readFile(
|
|
105
|
+
options?: BaseEncodingOptions & { flag?: OpenMode | undefined } | BufferEncoding | null,
|
|
106
|
+
): Promise<string | Buffer>;
|
|
94
107
|
|
|
95
108
|
/**
|
|
96
109
|
* Asynchronous fstat(2) - Get file status.
|
|
@@ -120,7 +133,12 @@ declare module 'node:fs/promises' {
|
|
|
120
133
|
* @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
|
|
121
134
|
* @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
|
|
122
135
|
*/
|
|
123
|
-
write<TBuffer extends Uint8Array>(
|
|
136
|
+
write<TBuffer extends Uint8Array>(
|
|
137
|
+
buffer: TBuffer,
|
|
138
|
+
offset?: number | null,
|
|
139
|
+
length?: number | null,
|
|
140
|
+
position?: number | null,
|
|
141
|
+
): Promise<{ bytesWritten: number; buffer: TBuffer }>;
|
|
124
142
|
|
|
125
143
|
/**
|
|
126
144
|
* Asynchronously writes `string` to the file.
|
|
@@ -131,7 +149,11 @@ declare module 'node:fs/promises' {
|
|
|
131
149
|
* @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
|
|
132
150
|
* @param encoding The expected string encoding.
|
|
133
151
|
*/
|
|
134
|
-
write(
|
|
152
|
+
write(
|
|
153
|
+
data: string | Uint8Array,
|
|
154
|
+
position?: number | null,
|
|
155
|
+
encoding?: BufferEncoding | null,
|
|
156
|
+
): Promise<{ bytesWritten: number; buffer: string }>;
|
|
135
157
|
|
|
136
158
|
/**
|
|
137
159
|
* Asynchronously writes data to a file, replacing the file if it already exists. The underlying file will _not_ be closed automatically.
|
|
@@ -144,7 +166,13 @@ declare module 'node:fs/promises' {
|
|
|
144
166
|
* If `mode` is a string, it is parsed as an octal integer.
|
|
145
167
|
* If `flag` is not supplied, the default of `'w'` is used.
|
|
146
168
|
*/
|
|
147
|
-
writeFile(
|
|
169
|
+
writeFile(
|
|
170
|
+
data: string | Uint8Array,
|
|
171
|
+
options?:
|
|
172
|
+
| BaseEncodingOptions & { mode?: Mode | undefined; flag?: OpenMode | undefined }
|
|
173
|
+
| BufferEncoding
|
|
174
|
+
| null,
|
|
175
|
+
): Promise<void>;
|
|
148
176
|
|
|
149
177
|
/**
|
|
150
178
|
* See `fs.writev` promisified version.
|
|
@@ -208,7 +236,7 @@ declare module 'node:fs/promises' {
|
|
|
208
236
|
offset?: number | null,
|
|
209
237
|
length?: number | null,
|
|
210
238
|
position?: number | null,
|
|
211
|
-
): Promise<{ bytesRead: number
|
|
239
|
+
): Promise<{ bytesRead: number; buffer: TBuffer }>;
|
|
212
240
|
|
|
213
241
|
/**
|
|
214
242
|
* Asynchronously writes `buffer` to the file referenced by the supplied `FileHandle`.
|
|
@@ -224,7 +252,9 @@ declare module 'node:fs/promises' {
|
|
|
224
252
|
handle: FileHandle,
|
|
225
253
|
buffer: TBuffer,
|
|
226
254
|
offset?: number | null,
|
|
227
|
-
length?: number | null,
|
|
255
|
+
length?: number | null,
|
|
256
|
+
position?: number | null,
|
|
257
|
+
): Promise<{ bytesWritten: number; buffer: TBuffer }>;
|
|
228
258
|
|
|
229
259
|
/**
|
|
230
260
|
* Asynchronously writes `string` to the file referenced by the supplied `FileHandle`.
|
|
@@ -235,7 +265,12 @@ declare module 'node:fs/promises' {
|
|
|
235
265
|
* @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
|
|
236
266
|
* @param encoding The expected string encoding.
|
|
237
267
|
*/
|
|
238
|
-
function write(
|
|
268
|
+
function write(
|
|
269
|
+
handle: FileHandle,
|
|
270
|
+
string: string,
|
|
271
|
+
position?: number | null,
|
|
272
|
+
encoding?: BufferEncoding | null,
|
|
273
|
+
): Promise<{ bytesWritten: number; buffer: string }>;
|
|
239
274
|
|
|
240
275
|
/**
|
|
241
276
|
* Asynchronous rename(2) - Change the name or location of a file or directory.
|
|
@@ -289,7 +324,7 @@ declare module 'node:fs/promises' {
|
|
|
289
324
|
* @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
|
|
290
325
|
* should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
|
|
291
326
|
*/
|
|
292
|
-
function mkdir(path: PathLike, options: MakeDirectoryOptions & { recursive: true
|
|
327
|
+
function mkdir(path: PathLike, options: MakeDirectoryOptions & { recursive: true }): Promise<string | undefined>;
|
|
293
328
|
|
|
294
329
|
/**
|
|
295
330
|
* Asynchronous mkdir(2) - create a directory.
|
|
@@ -297,7 +332,10 @@ declare module 'node:fs/promises' {
|
|
|
297
332
|
* @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
|
|
298
333
|
* should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
|
|
299
334
|
*/
|
|
300
|
-
function mkdir(
|
|
335
|
+
function mkdir(
|
|
336
|
+
path: PathLike,
|
|
337
|
+
options?: Mode | (MakeDirectoryOptions & { recursive?: false | undefined }) | null,
|
|
338
|
+
): Promise<void>;
|
|
301
339
|
|
|
302
340
|
/**
|
|
303
341
|
* Asynchronous mkdir(2) - create a directory.
|
|
@@ -312,21 +350,30 @@ declare module 'node:fs/promises' {
|
|
|
312
350
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
313
351
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
314
352
|
*/
|
|
315
|
-
function readdir(
|
|
353
|
+
function readdir(
|
|
354
|
+
path: PathLike,
|
|
355
|
+
options?: BaseEncodingOptions & { withFileTypes?: false | undefined } | BufferEncoding | null,
|
|
356
|
+
): Promise<string[]>;
|
|
316
357
|
|
|
317
358
|
/**
|
|
318
359
|
* Asynchronous readdir(3) - read a directory.
|
|
319
360
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
320
361
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
321
362
|
*/
|
|
322
|
-
function readdir(
|
|
363
|
+
function readdir(
|
|
364
|
+
path: PathLike,
|
|
365
|
+
options: { encoding: "buffer"; withFileTypes?: false | undefined } | "buffer",
|
|
366
|
+
): Promise<Buffer[]>;
|
|
323
367
|
|
|
324
368
|
/**
|
|
325
369
|
* Asynchronous readdir(3) - read a directory.
|
|
326
370
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
327
371
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
328
372
|
*/
|
|
329
|
-
function readdir(
|
|
373
|
+
function readdir(
|
|
374
|
+
path: PathLike,
|
|
375
|
+
options?: BaseEncodingOptions & { withFileTypes?: false | undefined } | BufferEncoding | null,
|
|
376
|
+
): Promise<string[] | Buffer[]>;
|
|
330
377
|
|
|
331
378
|
/**
|
|
332
379
|
* Asynchronous readdir(3) - read a directory.
|
|
@@ -517,7 +564,10 @@ declare module 'node:fs/promises' {
|
|
|
517
564
|
function writeFile(
|
|
518
565
|
path: PathLike | FileHandle,
|
|
519
566
|
data: string | Uint8Array,
|
|
520
|
-
options?:
|
|
567
|
+
options?:
|
|
568
|
+
| BaseEncodingOptions & { mode?: Mode | undefined; flag?: OpenMode | undefined }
|
|
569
|
+
| BufferEncoding
|
|
570
|
+
| null,
|
|
521
571
|
): Promise<void>;
|
|
522
572
|
|
|
523
573
|
/**
|
|
@@ -535,7 +585,10 @@ declare module 'node:fs/promises' {
|
|
|
535
585
|
function appendFile(
|
|
536
586
|
path: PathLike | FileHandle,
|
|
537
587
|
data: string | Uint8Array,
|
|
538
|
-
options?:
|
|
588
|
+
options?:
|
|
589
|
+
| BaseEncodingOptions & { mode?: Mode | undefined; flag?: OpenMode | undefined }
|
|
590
|
+
| BufferEncoding
|
|
591
|
+
| null,
|
|
539
592
|
): Promise<void>;
|
|
540
593
|
|
|
541
594
|
/**
|
|
@@ -545,7 +598,10 @@ declare module 'node:fs/promises' {
|
|
|
545
598
|
* @param options An object that may contain an optional flag.
|
|
546
599
|
* If a flag is not provided, it defaults to `'r'`.
|
|
547
600
|
*/
|
|
548
|
-
function readFile(
|
|
601
|
+
function readFile(
|
|
602
|
+
path: PathLike | FileHandle,
|
|
603
|
+
options?: { encoding?: null | undefined; flag?: OpenMode | undefined } | null,
|
|
604
|
+
): Promise<Buffer>;
|
|
549
605
|
|
|
550
606
|
/**
|
|
551
607
|
* Asynchronously reads the entire contents of a file.
|
|
@@ -554,7 +610,10 @@ declare module 'node:fs/promises' {
|
|
|
554
610
|
* @param options An object that may contain an optional flag.
|
|
555
611
|
* If a flag is not provided, it defaults to `'r'`.
|
|
556
612
|
*/
|
|
557
|
-
function readFile(
|
|
613
|
+
function readFile(
|
|
614
|
+
path: PathLike | FileHandle,
|
|
615
|
+
options: { encoding: BufferEncoding; flag?: OpenMode | undefined } | BufferEncoding,
|
|
616
|
+
): Promise<string>;
|
|
558
617
|
|
|
559
618
|
/**
|
|
560
619
|
* Asynchronously reads the entire contents of a file.
|
|
@@ -563,10 +622,13 @@ declare module 'node:fs/promises' {
|
|
|
563
622
|
* @param options An object that may contain an optional flag.
|
|
564
623
|
* If a flag is not provided, it defaults to `'r'`.
|
|
565
624
|
*/
|
|
566
|
-
function readFile(
|
|
625
|
+
function readFile(
|
|
626
|
+
path: PathLike | FileHandle,
|
|
627
|
+
options?: BaseEncodingOptions & { flag?: OpenMode | undefined } | BufferEncoding | null,
|
|
628
|
+
): Promise<string | Buffer>;
|
|
567
629
|
|
|
568
630
|
function opendir(path: PathLike, options?: OpenDirOptions): Promise<Dir>;
|
|
569
631
|
}
|
|
570
|
-
declare module
|
|
571
|
-
export * from
|
|
632
|
+
declare module "node:fs/promises" {
|
|
633
|
+
export * from "fs/promises";
|
|
572
634
|
}
|