@types/node 16.4.13 → 16.6.2
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.d.ts +1 -531
- node/async_hooks.d.ts +16 -16
- node/base.d.ts +1 -1
- node/buffer.d.ts +143 -5
- node/child_process.d.ts +1 -1
- node/cluster.d.ts +13 -7
- node/console.d.ts +1 -1
- node/crypto.d.ts +63 -874
- node/dgram.d.ts +17 -8
- node/diagnostics_channel.d.ts +24 -7
- node/dns.d.ts +1 -1
- node/domain.d.ts +2 -2
- node/events.d.ts +1 -1
- node/fs/promises.d.ts +12 -5
- node/fs.d.ts +12 -16
- node/globals.d.ts +24 -13
- node/http.d.ts +63 -9
- node/http2.d.ts +1 -1
- node/https.d.ts +1 -1
- node/index.d.ts +1 -1
- node/inspector.d.ts +4 -5
- node/net.d.ts +1 -1
- node/os.d.ts +1 -1
- node/package.json +2 -2
- node/path.d.ts +1 -1
- node/perf_hooks.d.ts +1 -1
- node/process.d.ts +110 -35
- node/punycode.d.ts +2 -3
- node/querystring.d.ts +1 -1
- node/readline.d.ts +1 -1
- node/repl.d.ts +1 -1
- node/stream/web.d.ts +7 -0
- node/stream.d.ts +1 -1
- node/string_decoder.d.ts +1 -1
- node/timers/promises.d.ts +0 -45
- node/timers.d.ts +1 -1
- node/tls.d.ts +2 -2
- node/trace_events.d.ts +1 -1
- node/ts3.6/base.d.ts +2 -1
- node/tty.d.ts +4 -4
- node/url.d.ts +1 -75
- node/util.d.ts +1 -1
- node/v8.d.ts +1 -1
- node/vm.d.ts +2 -2
- node/wasi.d.ts +4 -24
- node/worker_threads.d.ts +1 -1
- node/zlib.d.ts +1 -1
node/dgram.d.ts
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* The `dgram` module provides an implementation of UDP datagram sockets.
|
|
3
3
|
*
|
|
4
4
|
* ```js
|
|
5
|
-
*
|
|
5
|
+
* import dgram from 'dgram';
|
|
6
|
+
*
|
|
6
7
|
* const server = dgram.createSocket('udp4');
|
|
7
8
|
*
|
|
8
9
|
* server.on('error', (err) => {
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
* server.bind(41234);
|
|
23
24
|
* // Prints: server listening 0.0.0.0:41234
|
|
24
25
|
* ```
|
|
25
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
26
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.6.0/lib/dgram.js)
|
|
26
27
|
*/
|
|
27
28
|
declare module 'dgram' {
|
|
28
29
|
import { AddressInfo } from 'node:net';
|
|
@@ -97,8 +98,9 @@ declare module 'dgram' {
|
|
|
97
98
|
* When sharing a UDP socket across multiple `cluster` workers, the`socket.addMembership()` function must be called only once or an`EADDRINUSE` error will occur:
|
|
98
99
|
*
|
|
99
100
|
* ```js
|
|
100
|
-
*
|
|
101
|
-
*
|
|
101
|
+
* import cluster from 'cluster';
|
|
102
|
+
* import dgram from 'dgram';
|
|
103
|
+
*
|
|
102
104
|
* if (cluster.isPrimary) {
|
|
103
105
|
* cluster.fork(); // Works ok.
|
|
104
106
|
* cluster.fork(); // Fails with EADDRINUSE.
|
|
@@ -140,7 +142,8 @@ declare module 'dgram' {
|
|
|
140
142
|
* Example of a UDP server listening on port 41234:
|
|
141
143
|
*
|
|
142
144
|
* ```js
|
|
143
|
-
*
|
|
145
|
+
* import dgram from 'dgram';
|
|
146
|
+
*
|
|
144
147
|
* const server = dgram.createSocket('udp4');
|
|
145
148
|
*
|
|
146
149
|
* server.on('error', (err) => {
|
|
@@ -281,7 +284,9 @@ declare module 'dgram' {
|
|
|
281
284
|
* Example of sending a UDP packet to a port on `localhost`;
|
|
282
285
|
*
|
|
283
286
|
* ```js
|
|
284
|
-
*
|
|
287
|
+
* import dgram from 'dgram';
|
|
288
|
+
* import { Buffer } from 'buffer';
|
|
289
|
+
*
|
|
285
290
|
* const message = Buffer.from('Some bytes');
|
|
286
291
|
* const client = dgram.createSocket('udp4');
|
|
287
292
|
* client.send(message, 41234, 'localhost', (err) => {
|
|
@@ -292,7 +297,9 @@ declare module 'dgram' {
|
|
|
292
297
|
* Example of sending a UDP packet composed of multiple buffers to a port on`127.0.0.1`;
|
|
293
298
|
*
|
|
294
299
|
* ```js
|
|
295
|
-
*
|
|
300
|
+
* import dgram from 'dgram';
|
|
301
|
+
* import { Buffer } from 'buffer';
|
|
302
|
+
*
|
|
296
303
|
* const buf1 = Buffer.from('Some ');
|
|
297
304
|
* const buf2 = Buffer.from('bytes');
|
|
298
305
|
* const client = dgram.createSocket('udp4');
|
|
@@ -309,7 +316,9 @@ declare module 'dgram' {
|
|
|
309
316
|
* Example of sending a UDP packet using a socket connected to a port on`localhost`:
|
|
310
317
|
*
|
|
311
318
|
* ```js
|
|
312
|
-
*
|
|
319
|
+
* import dgram from 'dgram';
|
|
320
|
+
* import { Buffer } from 'buffer';
|
|
321
|
+
*
|
|
313
322
|
* const message = Buffer.from('Some bytes');
|
|
314
323
|
* const client = dgram.createSocket('udp4');
|
|
315
324
|
* client.connect(41234, 'localhost', (err) => {
|
node/diagnostics_channel.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* It can be accessed using:
|
|
6
6
|
*
|
|
7
7
|
* ```js
|
|
8
|
-
*
|
|
8
|
+
* import diagnostics_channel from 'diagnostics_channel';
|
|
9
9
|
* ```
|
|
10
10
|
*
|
|
11
11
|
* It is intended that a module writer wanting to report diagnostics messages
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* should generally include the module name to avoid collisions with data from
|
|
21
21
|
* other modules.
|
|
22
22
|
* @experimental
|
|
23
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
23
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.6.0/lib/diagnostics_channel.js)
|
|
24
24
|
*/
|
|
25
25
|
declare module 'diagnostics_channel' {
|
|
26
26
|
/**
|
|
@@ -31,7 +31,7 @@ declare module 'diagnostics_channel' {
|
|
|
31
31
|
* performance-sensitive code.
|
|
32
32
|
*
|
|
33
33
|
* ```js
|
|
34
|
-
*
|
|
34
|
+
* import diagnostics_channel from 'diagnostics_channel';
|
|
35
35
|
*
|
|
36
36
|
* if (diagnostics_channel.hasSubscribers('my-channel')) {
|
|
37
37
|
* // There are subscribers, prepare and publish message
|
|
@@ -47,7 +47,7 @@ declare module 'diagnostics_channel' {
|
|
|
47
47
|
* publish time as much as possible.
|
|
48
48
|
*
|
|
49
49
|
* ```js
|
|
50
|
-
*
|
|
50
|
+
* import diagnostics_channel from 'diagnostics_channel';
|
|
51
51
|
*
|
|
52
52
|
* const channel = diagnostics_channel.channel('my-channel');
|
|
53
53
|
* ```
|
|
@@ -66,7 +66,24 @@ declare module 'diagnostics_channel' {
|
|
|
66
66
|
*/
|
|
67
67
|
class Channel {
|
|
68
68
|
readonly name: string;
|
|
69
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Check if there are active subscribers to this channel. This is helpful if
|
|
71
|
+
* the message you want to send might be expensive to prepare.
|
|
72
|
+
*
|
|
73
|
+
* This API is optional but helpful when trying to publish messages from very
|
|
74
|
+
* performance-sensitive code.
|
|
75
|
+
*
|
|
76
|
+
* ```js
|
|
77
|
+
* import diagnostics_channel from 'diagnostics_channel';
|
|
78
|
+
*
|
|
79
|
+
* const channel = diagnostics_channel.channel('my-channel');
|
|
80
|
+
*
|
|
81
|
+
* if (channel.hasSubscribers) {
|
|
82
|
+
* // There are subscribers, prepare and publish message
|
|
83
|
+
* }
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
readonly hasSubscribers: boolean;
|
|
70
87
|
private constructor(name: string);
|
|
71
88
|
/**
|
|
72
89
|
* Register a message handler to subscribe to this channel. This message handler
|
|
@@ -74,7 +91,7 @@ declare module 'diagnostics_channel' {
|
|
|
74
91
|
* errors thrown in the message handler will trigger an `'uncaughtException'`.
|
|
75
92
|
*
|
|
76
93
|
* ```js
|
|
77
|
-
*
|
|
94
|
+
* import diagnostics_channel from 'diagnostics_channel';
|
|
78
95
|
*
|
|
79
96
|
* const channel = diagnostics_channel.channel('my-channel');
|
|
80
97
|
*
|
|
@@ -89,7 +106,7 @@ declare module 'diagnostics_channel' {
|
|
|
89
106
|
* Remove a message handler previously registered to this channel with `channel.subscribe(onMessage)`.
|
|
90
107
|
*
|
|
91
108
|
* ```js
|
|
92
|
-
*
|
|
109
|
+
* import diagnostics_channel from 'diagnostics_channel';
|
|
93
110
|
*
|
|
94
111
|
* const channel = diagnostics_channel.channel('my-channel');
|
|
95
112
|
*
|
node/dns.d.ts
CHANGED
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
* ```
|
|
43
43
|
*
|
|
44
44
|
* See the `Implementation considerations section` for more information.
|
|
45
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
45
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.6.0/lib/dns.js)
|
|
46
46
|
*/
|
|
47
47
|
declare module 'dns' {
|
|
48
48
|
import * as dnsPromises from 'node:dns/promises';
|
node/domain.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* **This module is pending deprecation
|
|
2
|
+
* **This module is pending deprecation.** Once a replacement API has been
|
|
3
3
|
* finalized, this module will be fully deprecated. Most developers should**not** have cause to use this module. Users who absolutely must have
|
|
4
4
|
* the functionality that domains provide may rely on it for the time being
|
|
5
5
|
* but should expect to have to migrate to a different solution
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* will be notified, rather than losing the context of the error in the`process.on('uncaughtException')` handler, or causing the program to
|
|
12
12
|
* exit immediately with an error code.
|
|
13
13
|
* @deprecated Since v1.4.2 - Deprecated
|
|
14
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
14
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.6.0/lib/domain.js)
|
|
15
15
|
*/
|
|
16
16
|
declare module 'domain' {
|
|
17
17
|
import EventEmitter = require('node:events');
|
node/events.d.ts
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
* });
|
|
33
33
|
* myEmitter.emit('event');
|
|
34
34
|
* ```
|
|
35
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
35
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.6.0/lib/events.js)
|
|
36
36
|
*/
|
|
37
37
|
declare module 'events' {
|
|
38
38
|
interface EventEmitterOptions {
|
node/fs/promises.d.ts
CHANGED
|
@@ -29,7 +29,12 @@ declare module 'fs/promises' {
|
|
|
29
29
|
OpenMode,
|
|
30
30
|
Mode,
|
|
31
31
|
WatchOptions,
|
|
32
|
+
WatchEventType,
|
|
32
33
|
} from 'node:fs';
|
|
34
|
+
interface FileChangeInfo<T extends (string | Buffer)> {
|
|
35
|
+
eventType: WatchEventType;
|
|
36
|
+
filename: T;
|
|
37
|
+
}
|
|
33
38
|
interface FlagAndOpenMode {
|
|
34
39
|
mode?: Mode | undefined;
|
|
35
40
|
flag?: OpenMode | undefined;
|
|
@@ -233,6 +238,8 @@ declare module 'fs/promises' {
|
|
|
233
238
|
/**
|
|
234
239
|
* Write `buffer` to the file.
|
|
235
240
|
*
|
|
241
|
+
* If `buffer` is a plain object, it must have an own (not inherited) `toString`function property.
|
|
242
|
+
*
|
|
236
243
|
* The promise is resolved with an object containing two properties:
|
|
237
244
|
*
|
|
238
245
|
* It is unsafe to use `filehandle.write()` multiple times on the same file
|
|
@@ -732,8 +739,7 @@ declare module 'fs/promises' {
|
|
|
732
739
|
*/
|
|
733
740
|
function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string | Buffer>;
|
|
734
741
|
/**
|
|
735
|
-
* Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a `<Buffer>`, or an object with an own `toString` function
|
|
736
|
-
* property.
|
|
742
|
+
* Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a `<Buffer>`, or, an object with an own (not inherited)`toString` function property.
|
|
737
743
|
*
|
|
738
744
|
* The `encoding` option is ignored if `data` is a buffer.
|
|
739
745
|
*
|
|
@@ -754,6 +760,7 @@ declare module 'fs/promises' {
|
|
|
754
760
|
*
|
|
755
761
|
* ```js
|
|
756
762
|
* import { writeFile } from 'fs/promises';
|
|
763
|
+
* import { Buffer } from 'buffer';
|
|
757
764
|
*
|
|
758
765
|
* try {
|
|
759
766
|
* const controller = new AbortController();
|
|
@@ -951,7 +958,7 @@ declare module 'fs/promises' {
|
|
|
951
958
|
encoding: 'buffer';
|
|
952
959
|
})
|
|
953
960
|
| 'buffer'
|
|
954
|
-
): AsyncIterable<Buffer
|
|
961
|
+
): AsyncIterable<FileChangeInfo<Buffer>>;
|
|
955
962
|
/**
|
|
956
963
|
* Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
|
|
957
964
|
* @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -960,7 +967,7 @@ declare module 'fs/promises' {
|
|
|
960
967
|
* If `persistent` is not supplied, the default of `true` is used.
|
|
961
968
|
* If `recursive` is not supplied, the default of `false` is used.
|
|
962
969
|
*/
|
|
963
|
-
function watch(filename: PathLike, options?: WatchOptions | BufferEncoding): AsyncIterable<string
|
|
970
|
+
function watch(filename: PathLike, options?: WatchOptions | BufferEncoding): AsyncIterable<FileChangeInfo<string>>;
|
|
964
971
|
/**
|
|
965
972
|
* Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
|
|
966
973
|
* @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -969,7 +976,7 @@ declare module 'fs/promises' {
|
|
|
969
976
|
* If `persistent` is not supplied, the default of `true` is used.
|
|
970
977
|
* If `recursive` is not supplied, the default of `false` is used.
|
|
971
978
|
*/
|
|
972
|
-
function watch(filename: PathLike, options: WatchOptions | string): AsyncIterable<string
|
|
979
|
+
function watch(filename: PathLike, options: WatchOptions | string): AsyncIterable<FileChangeInfo<string>> | AsyncIterable<FileChangeInfo<Buffer>>;
|
|
973
980
|
}
|
|
974
981
|
declare module 'node:fs/promises' {
|
|
975
982
|
export * from 'fs/promises';
|
node/fs.d.ts
CHANGED
|
@@ -5,30 +5,18 @@
|
|
|
5
5
|
* To use the promise-based APIs:
|
|
6
6
|
*
|
|
7
7
|
* ```js
|
|
8
|
-
* // Using ESM Module syntax:
|
|
9
8
|
* import * as fs from 'fs/promises';
|
|
10
9
|
* ```
|
|
11
10
|
*
|
|
12
|
-
* ```js
|
|
13
|
-
* // Using CommonJS syntax:
|
|
14
|
-
* const fs = require('fs/promises');
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
11
|
* To use the callback and sync APIs:
|
|
18
12
|
*
|
|
19
13
|
* ```js
|
|
20
|
-
* // Using ESM Module syntax:
|
|
21
14
|
* import * as fs from 'fs';
|
|
22
15
|
* ```
|
|
23
16
|
*
|
|
24
|
-
* ```js
|
|
25
|
-
* // Using CommonJS syntax:
|
|
26
|
-
* const fs = require('fs');
|
|
27
|
-
* ```
|
|
28
|
-
*
|
|
29
17
|
* All file system operations have synchronous, callback, and promise-based
|
|
30
18
|
* forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM).
|
|
31
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
19
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.6.0/lib/fs.js)
|
|
32
20
|
*/
|
|
33
21
|
declare module 'fs' {
|
|
34
22
|
import * as stream from 'node:stream';
|
|
@@ -2177,6 +2165,8 @@ declare module 'fs' {
|
|
|
2177
2165
|
}>;
|
|
2178
2166
|
}
|
|
2179
2167
|
/**
|
|
2168
|
+
* If `buffer` is a plain object, it must have an own (not inherited) `toString`function property.
|
|
2169
|
+
*
|
|
2180
2170
|
* For detailed information, see the documentation of the asynchronous version of
|
|
2181
2171
|
* this API: {@link write}.
|
|
2182
2172
|
* @since v0.1.21
|
|
@@ -2510,10 +2500,12 @@ declare module 'fs' {
|
|
|
2510
2500
|
* a file descriptor.
|
|
2511
2501
|
*
|
|
2512
2502
|
* The `encoding` option is ignored if `data` is a buffer.
|
|
2513
|
-
*
|
|
2503
|
+
*
|
|
2504
|
+
* If `data` is a plain object, it must have an own (not inherited) `toString`function property.
|
|
2514
2505
|
*
|
|
2515
2506
|
* ```js
|
|
2516
2507
|
* import { writeFile } from 'fs';
|
|
2508
|
+
* import { Buffer } from 'buffer';
|
|
2517
2509
|
*
|
|
2518
2510
|
* const data = new Uint8Array(Buffer.from('Hello Node.js'));
|
|
2519
2511
|
* writeFile('message.txt', data, (err) => {
|
|
@@ -2544,6 +2536,7 @@ declare module 'fs' {
|
|
|
2544
2536
|
*
|
|
2545
2537
|
* ```js
|
|
2546
2538
|
* import { writeFile } from 'fs';
|
|
2539
|
+
* import { Buffer } from 'buffer';
|
|
2547
2540
|
*
|
|
2548
2541
|
* const controller = new AbortController();
|
|
2549
2542
|
* const { signal } = controller;
|
|
@@ -2586,6 +2579,8 @@ declare module 'fs' {
|
|
|
2586
2579
|
/**
|
|
2587
2580
|
* Returns `undefined`.
|
|
2588
2581
|
*
|
|
2582
|
+
* If `data` is a plain object, it must have an own (not inherited) `toString`function property.
|
|
2583
|
+
*
|
|
2589
2584
|
* For detailed information, see the documentation of the asynchronous version of
|
|
2590
2585
|
* this API: {@link writeFile}.
|
|
2591
2586
|
* @since v0.1.29
|
|
@@ -2791,7 +2786,8 @@ declare module 'fs' {
|
|
|
2791
2786
|
persistent?: boolean | undefined;
|
|
2792
2787
|
recursive?: boolean | undefined;
|
|
2793
2788
|
}
|
|
2794
|
-
export type
|
|
2789
|
+
export type WatchEventType = 'rename' | 'change';
|
|
2790
|
+
export type WatchListener<T> = (event: WatchEventType, filename: T) => void;
|
|
2795
2791
|
/**
|
|
2796
2792
|
* Watch for changes on `filename`, where `filename` is either a file or a
|
|
2797
2793
|
* directory.
|
|
@@ -3145,7 +3141,7 @@ declare module 'fs' {
|
|
|
3145
3141
|
* });
|
|
3146
3142
|
*
|
|
3147
3143
|
* // Check if the file exists in the current directory, and if it is writable.
|
|
3148
|
-
* access(file, constants.F_OK |
|
|
3144
|
+
* access(file, constants.F_OK | constants.W_OK, (err) => {
|
|
3149
3145
|
* if (err) {
|
|
3150
3146
|
* console.error(
|
|
3151
3147
|
* `${file} ${err.code === 'ENOENT' ? 'does not exist' : 'is read-only'}`);
|
node/globals.d.ts
CHANGED
|
@@ -13,19 +13,6 @@ interface ErrorConstructor {
|
|
|
13
13
|
stackTraceLimit: number;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
// Node.js ESNEXT support
|
|
17
|
-
interface String {
|
|
18
|
-
/** Removes whitespace from the left end of a string. */
|
|
19
|
-
trimLeft(): string;
|
|
20
|
-
/** Removes whitespace from the right end of a string. */
|
|
21
|
-
trimRight(): string;
|
|
22
|
-
|
|
23
|
-
/** Returns a copy with leading whitespace removed. */
|
|
24
|
-
trimStart(): string;
|
|
25
|
-
/** Returns a copy with trailing whitespace removed. */
|
|
26
|
-
trimEnd(): string;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
16
|
/*-----------------------------------------------*
|
|
30
17
|
* *
|
|
31
18
|
* GLOBAL *
|
|
@@ -89,6 +76,30 @@ declare var AbortSignal: {
|
|
|
89
76
|
};
|
|
90
77
|
//#endregion borrowed
|
|
91
78
|
|
|
79
|
+
//#region ArrayLike.at()
|
|
80
|
+
interface RelativeIndexable<T> {
|
|
81
|
+
/**
|
|
82
|
+
* Takes an integer value and returns the item at that index,
|
|
83
|
+
* allowing for positive and negative integers.
|
|
84
|
+
* Negative integers count back from the last item in the array.
|
|
85
|
+
*/
|
|
86
|
+
at(index: number): T | undefined;
|
|
87
|
+
}
|
|
88
|
+
interface String extends RelativeIndexable<string> {}
|
|
89
|
+
interface Array<T> extends RelativeIndexable<T> {}
|
|
90
|
+
interface Int8Array extends RelativeIndexable<number> {}
|
|
91
|
+
interface Uint8Array extends RelativeIndexable<number> {}
|
|
92
|
+
interface Uint8ClampedArray extends RelativeIndexable<number> {}
|
|
93
|
+
interface Int16Array extends RelativeIndexable<number> {}
|
|
94
|
+
interface Uint16Array extends RelativeIndexable<number> {}
|
|
95
|
+
interface Int32Array extends RelativeIndexable<number> {}
|
|
96
|
+
interface Uint32Array extends RelativeIndexable<number> {}
|
|
97
|
+
interface Float32Array extends RelativeIndexable<number> {}
|
|
98
|
+
interface Float64Array extends RelativeIndexable<number> {}
|
|
99
|
+
interface BigInt64Array extends RelativeIndexable<bigint> {}
|
|
100
|
+
interface BigUint64Array extends RelativeIndexable<bigint> {}
|
|
101
|
+
//#endregion ArrayLike.at() end
|
|
102
|
+
|
|
92
103
|
/*----------------------------------------------*
|
|
93
104
|
* *
|
|
94
105
|
* GLOBAL INTERFACES *
|
node/http.d.ts
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
* 'Host', 'mysite.com',
|
|
38
38
|
* 'accepT', '*' ]
|
|
39
39
|
* ```
|
|
40
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
40
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.6.0/lib/http.js)
|
|
41
41
|
*/
|
|
42
42
|
declare module 'http' {
|
|
43
43
|
import * as stream from 'node:stream';
|
|
@@ -162,26 +162,80 @@ declare module 'http' {
|
|
|
162
162
|
class Server extends NetServer {
|
|
163
163
|
constructor(requestListener?: RequestListener);
|
|
164
164
|
constructor(options: ServerOptions, requestListener?: RequestListener);
|
|
165
|
+
/**
|
|
166
|
+
* Sets the timeout value for sockets, and emits a `'timeout'` event on
|
|
167
|
+
* the Server object, passing the socket as an argument, if a timeout
|
|
168
|
+
* occurs.
|
|
169
|
+
*
|
|
170
|
+
* If there is a `'timeout'` event listener on the Server object, then it
|
|
171
|
+
* will be called with the timed-out socket as an argument.
|
|
172
|
+
*
|
|
173
|
+
* By default, the Server does not timeout sockets. However, if a callback
|
|
174
|
+
* is assigned to the Server's `'timeout'` event, timeouts must be handled
|
|
175
|
+
* explicitly.
|
|
176
|
+
* @since v0.9.12
|
|
177
|
+
* @param [msecs=0 (no timeout)]
|
|
178
|
+
*/
|
|
165
179
|
setTimeout(msecs?: number, callback?: () => void): this;
|
|
166
180
|
setTimeout(callback: () => void): this;
|
|
167
181
|
/**
|
|
168
182
|
* Limits maximum incoming headers count. If set to 0, no limit will be applied.
|
|
169
|
-
* @
|
|
170
|
-
* {@link https://nodejs.org/api/http.html#http_server_maxheaderscount}
|
|
183
|
+
* @since v0.7.0
|
|
171
184
|
*/
|
|
172
185
|
maxHeadersCount: number | null;
|
|
186
|
+
/**
|
|
187
|
+
* The number of milliseconds of inactivity before a socket is presumed
|
|
188
|
+
* to have timed out.
|
|
189
|
+
*
|
|
190
|
+
* A value of `0` will disable the timeout behavior on incoming connections.
|
|
191
|
+
*
|
|
192
|
+
* The socket timeout logic is set up on connection, so changing this
|
|
193
|
+
* value only affects new connections to the server, not any existing connections.
|
|
194
|
+
* @since v0.9.12
|
|
195
|
+
*/
|
|
173
196
|
timeout: number;
|
|
174
197
|
/**
|
|
175
|
-
* Limit the amount of time the parser will wait to receive the complete HTTP
|
|
176
|
-
*
|
|
177
|
-
*
|
|
198
|
+
* Limit the amount of time the parser will wait to receive the complete HTTP
|
|
199
|
+
* headers.
|
|
200
|
+
*
|
|
201
|
+
* In case of inactivity, the rules defined in `server.timeout` apply. However,
|
|
202
|
+
* that inactivity based timeout would still allow the connection to be kept open
|
|
203
|
+
* if the headers are being sent very slowly (by default, up to a byte per 2
|
|
204
|
+
* minutes). In order to prevent this, whenever header data arrives an additional
|
|
205
|
+
* check is made that more than `server.headersTimeout` milliseconds has not
|
|
206
|
+
* passed since the connection was established. If the check fails, a `'timeout'`event is emitted on the server object, and (by default) the socket is destroyed.
|
|
207
|
+
* See `server.timeout` for more information on how timeout behavior can be
|
|
208
|
+
* customized.
|
|
209
|
+
* @since v11.3.0, v10.14.0
|
|
178
210
|
*/
|
|
179
211
|
headersTimeout: number;
|
|
212
|
+
/**
|
|
213
|
+
* The number of milliseconds of inactivity a server needs to wait for additional
|
|
214
|
+
* incoming data, after it has finished writing the last response, before a socket
|
|
215
|
+
* will be destroyed. If the server receives new data before the keep-alive
|
|
216
|
+
* timeout has fired, it will reset the regular inactivity timeout, i.e.,`server.timeout`.
|
|
217
|
+
*
|
|
218
|
+
* A value of `0` will disable the keep-alive timeout behavior on incoming
|
|
219
|
+
* connections.
|
|
220
|
+
* A value of `0` makes the http server behave similarly to Node.js versions prior
|
|
221
|
+
* to 8.0.0, which did not have a keep-alive timeout.
|
|
222
|
+
*
|
|
223
|
+
* The socket timeout logic is set up on connection, so changing this value only
|
|
224
|
+
* affects new connections to the server, not any existing connections.
|
|
225
|
+
* @since v8.0.0
|
|
226
|
+
*/
|
|
180
227
|
keepAliveTimeout: number;
|
|
181
228
|
/**
|
|
182
|
-
* Sets the timeout value in milliseconds for receiving the entire request from
|
|
183
|
-
*
|
|
184
|
-
*
|
|
229
|
+
* Sets the timeout value in milliseconds for receiving the entire request from
|
|
230
|
+
* the client.
|
|
231
|
+
*
|
|
232
|
+
* If the timeout expires, the server responds with status 408 without
|
|
233
|
+
* forwarding the request to the request listener and then closes the connection.
|
|
234
|
+
*
|
|
235
|
+
* It must be set to a non-zero value (e.g. 120 seconds) to protect against
|
|
236
|
+
* potential Denial-of-Service attacks in case the server is deployed without a
|
|
237
|
+
* reverse proxy in front.
|
|
238
|
+
* @since v14.11.0
|
|
185
239
|
*/
|
|
186
240
|
requestTimeout: number;
|
|
187
241
|
addListener(event: string, listener: (...args: any[]) => void): this;
|
node/http2.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* const http2 = require('http2');
|
|
7
7
|
* ```
|
|
8
8
|
* @since v8.4.0
|
|
9
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.6.0/lib/http2.js)
|
|
10
10
|
*/
|
|
11
11
|
declare module 'http2' {
|
|
12
12
|
import EventEmitter = require('node:events');
|
node/https.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a
|
|
3
3
|
* separate module.
|
|
4
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
4
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.6.0/lib/https.js)
|
|
5
5
|
*/
|
|
6
6
|
declare module 'https' {
|
|
7
7
|
import { Duplex } from 'node:stream';
|
node/index.d.ts
CHANGED
node/inspector.d.ts
CHANGED
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
* ```js
|
|
16
16
|
* const inspector = require('inspector');
|
|
17
17
|
* ```
|
|
18
|
-
* @
|
|
19
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/inspector.js)
|
|
18
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.6.0/lib/inspector.js)
|
|
20
19
|
*/
|
|
21
20
|
declare module 'inspector' {
|
|
22
21
|
import EventEmitter = require('node:events');
|
|
@@ -2697,9 +2696,9 @@ declare module 'inspector' {
|
|
|
2697
2696
|
* and flow control has been passed to the debugger client.
|
|
2698
2697
|
*
|
|
2699
2698
|
* See the `security warning` regarding the `host`parameter usage.
|
|
2700
|
-
* @param port Port to listen on for inspector connections. Optional.
|
|
2701
|
-
* @param host Host to listen on for inspector connections. Optional.
|
|
2702
|
-
* @param wait Block until a client has connected. Optional.
|
|
2699
|
+
* @param [port='what was specified on the CLI'] Port to listen on for inspector connections. Optional.
|
|
2700
|
+
* @param [host='what was specified on the CLI'] Host to listen on for inspector connections. Optional.
|
|
2701
|
+
* @param [wait=false] Block until a client has connected. Optional.
|
|
2703
2702
|
*/
|
|
2704
2703
|
function open(port?: number, host?: string, wait?: boolean): void;
|
|
2705
2704
|
/**
|
node/net.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* ```js
|
|
11
11
|
* const net = require('net');
|
|
12
12
|
* ```
|
|
13
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
13
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.6.0/lib/net.js)
|
|
14
14
|
*/
|
|
15
15
|
declare module 'net' {
|
|
16
16
|
import * as stream from 'node:stream';
|
node/os.d.ts
CHANGED
node/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.6.2",
|
|
4
4
|
"description": "TypeScript definitions for Node.js",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -237,6 +237,6 @@
|
|
|
237
237
|
},
|
|
238
238
|
"scripts": {},
|
|
239
239
|
"dependencies": {},
|
|
240
|
-
"typesPublisherContentHash": "
|
|
240
|
+
"typesPublisherContentHash": "9098a84e13359567fcbeac38e6b9c82834a684435352a1307abccf6f39a6b5a3",
|
|
241
241
|
"typeScriptVersion": "3.6"
|
|
242
242
|
}
|
node/path.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ declare module 'path/win32' {
|
|
|
13
13
|
* ```js
|
|
14
14
|
* const path = require('path');
|
|
15
15
|
* ```
|
|
16
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
16
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.6.0/lib/path.js)
|
|
17
17
|
*/
|
|
18
18
|
declare module 'path' {
|
|
19
19
|
namespace path {
|
node/perf_hooks.d.ts
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* performance.measure('A to B', 'A', 'B');
|
|
27
27
|
* });
|
|
28
28
|
* ```
|
|
29
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
29
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.6.0/lib/perf_hooks.js)
|
|
30
30
|
*/
|
|
31
31
|
declare module 'perf_hooks' {
|
|
32
32
|
import { AsyncResource } from 'node:async_hooks';
|