@types/node 16.9.0 → 16.9.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.d.ts +1 -1
- node/async_hooks.d.ts +1 -1
- node/buffer.d.ts +3 -3
- node/child_process.d.ts +12 -4
- node/cluster.d.ts +1 -1
- node/console.d.ts +1 -1
- node/crypto.d.ts +38 -18
- node/dgram.d.ts +2 -2
- node/diagnostics_channel.d.ts +1 -1
- node/dns/promises.d.ts +1 -1
- node/dns.d.ts +2 -2
- node/domain.d.ts +1 -1
- node/events.d.ts +2 -2
- node/fs/promises.d.ts +17 -10
- node/fs.d.ts +15 -7
- node/http.d.ts +1 -1
- node/http2.d.ts +2 -2
- node/https.d.ts +1 -1
- node/inspector.d.ts +2 -2
- node/net.d.ts +1 -1
- node/os.d.ts +5 -5
- node/package.json +2 -2
- node/path.d.ts +1 -1
- node/perf_hooks.d.ts +3 -3
- node/process.d.ts +3 -3
- node/punycode.d.ts +3 -3
- node/querystring.d.ts +9 -9
- node/readline.d.ts +1 -1
- node/repl.d.ts +1 -1
- node/stream.d.ts +12 -1
- node/string_decoder.d.ts +1 -1
- node/timers.d.ts +1 -1
- node/tls.d.ts +6 -6
- node/trace_events.d.ts +2 -2
- node/tty.d.ts +1 -1
- node/url.d.ts +2 -2
- node/util.d.ts +11 -12
- node/v8.d.ts +2 -2
- node/vm.d.ts +3 -4
- node/wasi.d.ts +9 -4
- node/worker_threads.d.ts +4 -4
- node/zlib.d.ts +1 -1
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.9.0/lib/net.js)
|
|
14
14
|
*/
|
|
15
15
|
declare module 'net' {
|
|
16
16
|
import * as stream from 'node:stream';
|
node/os.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* ```js
|
|
6
6
|
* const os = require('os');
|
|
7
7
|
* ```
|
|
8
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
8
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/os.js)
|
|
9
9
|
*/
|
|
10
10
|
declare module 'os' {
|
|
11
11
|
interface CpuInfo {
|
|
@@ -143,8 +143,8 @@ declare module 'os' {
|
|
|
143
143
|
/**
|
|
144
144
|
* Returns the operating system as a string.
|
|
145
145
|
*
|
|
146
|
-
* On POSIX systems, the operating system release is determined by calling[`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `GetVersionExW()` is used.
|
|
147
|
-
*
|
|
146
|
+
* On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `GetVersionExW()` is used. See
|
|
147
|
+
* [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information.
|
|
148
148
|
* @since v0.3.3
|
|
149
149
|
*/
|
|
150
150
|
function release(): string;
|
|
@@ -396,8 +396,8 @@ declare module 'os' {
|
|
|
396
396
|
/**
|
|
397
397
|
* Returns a string identifying the kernel version.
|
|
398
398
|
*
|
|
399
|
-
* On POSIX systems, the operating system release is determined by calling[`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not
|
|
400
|
-
* available, `GetVersionExW()` will be used. See[https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information.
|
|
399
|
+
* On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not
|
|
400
|
+
* available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information.
|
|
401
401
|
* @since v13.11.0, v12.17.0
|
|
402
402
|
*/
|
|
403
403
|
function version(): string;
|
node/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "16.9.
|
|
3
|
+
"version": "16.9.4",
|
|
4
4
|
"description": "TypeScript definitions for Node.js",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -230,6 +230,6 @@
|
|
|
230
230
|
},
|
|
231
231
|
"scripts": {},
|
|
232
232
|
"dependencies": {},
|
|
233
|
-
"typesPublisherContentHash": "
|
|
233
|
+
"typesPublisherContentHash": "3a9ba9eedbc5a775925dde51f42ad45be2e4e6d760b8d1d2e767e82f91cc4d92",
|
|
234
234
|
"typeScriptVersion": "3.7"
|
|
235
235
|
}
|
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.9.0/lib/path.js)
|
|
17
17
|
*/
|
|
18
18
|
declare module 'path' {
|
|
19
19
|
namespace path {
|
node/perf_hooks.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This module provides an implementation of a subset of the W3C[Web Performance APIs](https://w3c.github.io/perf-timing-primer/) as well as additional APIs for
|
|
2
|
+
* This module provides an implementation of a subset of the W3C [Web Performance APIs](https://w3c.github.io/perf-timing-primer/) as well as additional APIs for
|
|
3
3
|
* Node.js-specific performance measurements.
|
|
4
4
|
*
|
|
5
5
|
* Node.js supports the following [Web Performance APIs](https://w3c.github.io/perf-timing-primer/):
|
|
@@ -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.9.0/lib/perf_hooks.js)
|
|
30
30
|
*/
|
|
31
31
|
declare module 'perf_hooks' {
|
|
32
32
|
import { AsyncResource } from 'node:async_hooks';
|
|
@@ -84,7 +84,7 @@ declare module 'perf_hooks' {
|
|
|
84
84
|
* Additional detail specific to the `entryType`.
|
|
85
85
|
* @since v16.0.0
|
|
86
86
|
*/
|
|
87
|
-
readonly
|
|
87
|
+
readonly detail?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type.
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
90
90
|
* _This property is an extension by Node.js. It is not available in Web browsers._
|
node/process.d.ts
CHANGED
|
@@ -639,7 +639,7 @@ declare module 'process' {
|
|
|
639
639
|
*/
|
|
640
640
|
getgid(): number;
|
|
641
641
|
/**
|
|
642
|
-
* The `process.setgid()` method sets the group identity of the process. (See[`setgid(2)`](http://man7.org/linux/man-pages/man2/setgid.2.html).) The `id` can be passed as either a
|
|
642
|
+
* The `process.setgid()` method sets the group identity of the process. (See [`setgid(2)`](http://man7.org/linux/man-pages/man2/setgid.2.html).) The `id` can be passed as either a
|
|
643
643
|
* numeric ID or a group name
|
|
644
644
|
* string. If a group name is specified, this method blocks while resolving the
|
|
645
645
|
* associated numeric ID.
|
|
@@ -683,7 +683,7 @@ declare module 'process' {
|
|
|
683
683
|
*/
|
|
684
684
|
getuid(): number;
|
|
685
685
|
/**
|
|
686
|
-
* The `process.setuid(id)` method sets the user identity of the process. (See[`setuid(2)`](http://man7.org/linux/man-pages/man2/setuid.2.html).) The `id` can be passed as either a
|
|
686
|
+
* The `process.setuid(id)` method sets the user identity of the process. (See [`setuid(2)`](http://man7.org/linux/man-pages/man2/setuid.2.html).) The `id` can be passed as either a
|
|
687
687
|
* numeric ID or a username string.
|
|
688
688
|
* If a username is specified, the method blocks while resolving the associated
|
|
689
689
|
* numeric ID.
|
|
@@ -1067,7 +1067,7 @@ declare module 'process' {
|
|
|
1067
1067
|
* ```
|
|
1068
1068
|
*
|
|
1069
1069
|
* The value `'android'` may also be returned if the Node.js is built on the
|
|
1070
|
-
* Android operating system. However, Android support in Node.js[is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os).
|
|
1070
|
+
* Android operating system. However, Android support in Node.js [is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os).
|
|
1071
1071
|
* @since v0.1.16
|
|
1072
1072
|
*/
|
|
1073
1073
|
readonly platform: Platform;
|
node/punycode.d.ts
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* made available to developers as a convenience. Fixes or other modifications to
|
|
25
25
|
* the module must be directed to the [Punycode.js](https://github.com/bestiejs/punycode.js) project.
|
|
26
26
|
* @deprecated Since v7.0.0 - Deprecated
|
|
27
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
27
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/punycode.js)
|
|
28
28
|
*/
|
|
29
29
|
declare module 'punycode' {
|
|
30
30
|
/**
|
|
@@ -39,7 +39,7 @@ declare module 'punycode' {
|
|
|
39
39
|
*/
|
|
40
40
|
function decode(string: string): string;
|
|
41
41
|
/**
|
|
42
|
-
* The `punycode.encode()` method converts a string of Unicode codepoints to a[Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only characters.
|
|
42
|
+
* The `punycode.encode()` method converts a string of Unicode codepoints to a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only characters.
|
|
43
43
|
*
|
|
44
44
|
* ```js
|
|
45
45
|
* punycode.encode('mañana'); // 'maana-pta'
|
|
@@ -50,7 +50,7 @@ declare module 'punycode' {
|
|
|
50
50
|
function encode(string: string): string;
|
|
51
51
|
/**
|
|
52
52
|
* The `punycode.toUnicode()` method converts a string representing a domain name
|
|
53
|
-
* containing [Punycode](https://tools.ietf.org/html/rfc3492) encoded characters into Unicode. Only the [Punycode](https://tools.ietf.org/html/rfc3492)encoded parts of the domain name are be
|
|
53
|
+
* containing [Punycode](https://tools.ietf.org/html/rfc3492) encoded characters into Unicode. Only the [Punycode](https://tools.ietf.org/html/rfc3492) encoded parts of the domain name are be
|
|
54
54
|
* converted.
|
|
55
55
|
*
|
|
56
56
|
* ```js
|
node/querystring.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* The `querystring` API is considered Legacy. While it is still maintained,
|
|
10
10
|
* new code should use the `URLSearchParams` API instead.
|
|
11
11
|
* @deprecated Legacy
|
|
12
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
12
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/querystring.js)
|
|
13
13
|
*/
|
|
14
14
|
declare module 'querystring' {
|
|
15
15
|
interface StringifyOptions {
|
|
@@ -25,14 +25,14 @@ declare module 'querystring' {
|
|
|
25
25
|
* The `querystring.stringify()` method produces a URL query string from a
|
|
26
26
|
* given `obj` by iterating through the object's "own properties".
|
|
27
27
|
*
|
|
28
|
-
* It serializes the following types of values passed in `obj`:[
|
|
29
|
-
* [
|
|
30
|
-
* [
|
|
31
|
-
* [
|
|
32
|
-
* [
|
|
33
|
-
* [
|
|
34
|
-
* [
|
|
35
|
-
* [
|
|
28
|
+
* It serializes the following types of values passed in `obj`:[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) |
|
|
29
|
+
* [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) |
|
|
30
|
+
* [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) |
|
|
31
|
+
* [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) |
|
|
32
|
+
* [string\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) |
|
|
33
|
+
* [number\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) |
|
|
34
|
+
* [bigint\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) |
|
|
35
|
+
* [boolean\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) The numeric values must be finite. Any other input values will be coerced to
|
|
36
36
|
* empty strings.
|
|
37
37
|
*
|
|
38
38
|
* ```js
|
node/readline.d.ts
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
*
|
|
27
27
|
* Once this code is invoked, the Node.js application will not terminate until the`readline.Interface` is closed because the interface waits for data to be
|
|
28
28
|
* received on the `input` stream.
|
|
29
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
29
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/readline.js)
|
|
30
30
|
*/
|
|
31
31
|
declare module 'readline' {
|
|
32
32
|
import { Abortable, EventEmitter } from 'node:events';
|
node/repl.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* ```js
|
|
7
7
|
* const repl = require('repl');
|
|
8
8
|
* ```
|
|
9
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/repl.js)
|
|
10
10
|
*/
|
|
11
11
|
declare module 'repl' {
|
|
12
12
|
import { Interface, Completer, AsyncCompleter } from 'node:readline';
|
node/stream.d.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* The `stream` module is useful for creating new types of stream instances. It is
|
|
16
16
|
* usually not necessary to use the `stream` module to consume streams.
|
|
17
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
17
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/stream.js)
|
|
18
18
|
*/
|
|
19
19
|
declare module 'stream' {
|
|
20
20
|
import { EventEmitter, Abortable } from 'node:events';
|
|
@@ -60,6 +60,7 @@ declare module 'stream' {
|
|
|
60
60
|
/**
|
|
61
61
|
* Returns whether the stream was destroyed or errored before emitting `'end'`.
|
|
62
62
|
* @since v16.8.0
|
|
63
|
+
* @experimental
|
|
63
64
|
*/
|
|
64
65
|
readonly readableAborted: boolean;
|
|
65
66
|
/**
|
|
@@ -71,6 +72,7 @@ declare module 'stream' {
|
|
|
71
72
|
/**
|
|
72
73
|
* Returns whether `'data'` has been emitted.
|
|
73
74
|
* @since v16.7.0
|
|
75
|
+
* @experimental
|
|
74
76
|
*/
|
|
75
77
|
readonly readableDidRead: boolean;
|
|
76
78
|
/**
|
|
@@ -805,6 +807,15 @@ declare module 'stream' {
|
|
|
805
807
|
readonly writableLength: number;
|
|
806
808
|
readonly writableObjectMode: boolean;
|
|
807
809
|
readonly writableCorked: number;
|
|
810
|
+
/**
|
|
811
|
+
* If `false` then the stream will automatically end the writable side when the
|
|
812
|
+
* readable side ends. Set initially by the `allowHalfOpen` constructor option,
|
|
813
|
+
* which defaults to `false`.
|
|
814
|
+
*
|
|
815
|
+
* This can be changed manually to change the half-open behavior of an existing`Duplex` stream instance, but must be changed before the `'end'` event is
|
|
816
|
+
* emitted.
|
|
817
|
+
* @since v0.9.4
|
|
818
|
+
*/
|
|
808
819
|
allowHalfOpen: boolean;
|
|
809
820
|
constructor(opts?: DuplexOptions);
|
|
810
821
|
/**
|
node/string_decoder.d.ts
CHANGED
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
* decoder.write(Buffer.from([0x82]));
|
|
37
37
|
* console.log(decoder.end(Buffer.from([0xAC])));
|
|
38
38
|
* ```
|
|
39
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
39
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/string_decoder.js)
|
|
40
40
|
*/
|
|
41
41
|
declare module 'string_decoder' {
|
|
42
42
|
class StringDecoder {
|
node/timers.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* The timer functions within Node.js implement a similar API as the timers API
|
|
7
7
|
* provided by Web Browsers but use a different internal implementation that is
|
|
8
8
|
* built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout).
|
|
9
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/timers.js)
|
|
10
10
|
*/
|
|
11
11
|
declare module 'timers' {
|
|
12
12
|
import { Abortable } from 'node:events';
|
node/tls.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* ```js
|
|
7
7
|
* const tls = require('tls');
|
|
8
8
|
* ```
|
|
9
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/tls.js)
|
|
10
10
|
*/
|
|
11
11
|
declare module 'tls' {
|
|
12
12
|
import { X509Certificate } from 'node:crypto';
|
|
@@ -189,7 +189,7 @@ declare module 'tls' {
|
|
|
189
189
|
* }
|
|
190
190
|
* ```
|
|
191
191
|
*
|
|
192
|
-
* See[SSL\_CIPHER\_get\_name](https://www.openssl.org/docs/man1.1.1/man3/SSL_CIPHER_get_name.html)for more information.
|
|
192
|
+
* See [SSL\_CIPHER\_get\_name](https://www.openssl.org/docs/man1.1.1/man3/SSL_CIPHER_get_name.html) for more information.
|
|
193
193
|
* @since v0.11.4
|
|
194
194
|
*/
|
|
195
195
|
getCipher(): CipherNameAndProtocol;
|
|
@@ -274,7 +274,7 @@ declare module 'tls' {
|
|
|
274
274
|
*/
|
|
275
275
|
getSession(): Buffer | undefined;
|
|
276
276
|
/**
|
|
277
|
-
* See[SSL\_get\_shared\_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html)for more information.
|
|
277
|
+
* See [SSL\_get\_shared\_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html) for more information.
|
|
278
278
|
* @since v12.11.0
|
|
279
279
|
* @return List of signature algorithms shared between the server and the client in the order of decreasing preference.
|
|
280
280
|
*/
|
|
@@ -810,8 +810,8 @@ declare module 'tls' {
|
|
|
810
810
|
/**
|
|
811
811
|
* Verifies the certificate `cert` is issued to `hostname`.
|
|
812
812
|
*
|
|
813
|
-
* Returns [
|
|
814
|
-
* failure. On success, returns [
|
|
813
|
+
* Returns [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object, populating it with `reason`, `host`, and `cert` on
|
|
814
|
+
* failure. On success, returns [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Undefined_type).
|
|
815
815
|
*
|
|
816
816
|
* This function can be overwritten by providing alternative function as part of
|
|
817
817
|
* the `options.checkServerIdentity` option passed to `tls.connect()`. The
|
|
@@ -962,7 +962,7 @@ declare module 'tls' {
|
|
|
962
962
|
*
|
|
963
963
|
* A key is _required_ for ciphers that use certificates. Either `key` or`pfx` can be used to provide it.
|
|
964
964
|
*
|
|
965
|
-
* If the `ca` option is not given, then Node.js will default to using[Mozilla's publicly trusted list of
|
|
965
|
+
* If the `ca` option is not given, then Node.js will default to using [Mozilla's publicly trusted list of
|
|
966
966
|
* CAs](https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt).
|
|
967
967
|
* @since v0.11.13
|
|
968
968
|
*/
|
node/trace_events.d.ts
CHANGED
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
* ```
|
|
57
57
|
*
|
|
58
58
|
* Running Node.js with tracing enabled will produce log files that can be opened
|
|
59
|
-
* in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool)tab of Chrome.
|
|
59
|
+
* in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) tab of Chrome.
|
|
60
60
|
*
|
|
61
61
|
* The logging file is by default called `node_trace.${rotation}.log`, where`${rotation}` is an incrementing log-rotation id. The filepath pattern can
|
|
62
62
|
* be specified with `--trace-event-file-pattern` that accepts a template
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
*
|
|
74
74
|
* The features from this module are not available in `Worker` threads.
|
|
75
75
|
* @experimental
|
|
76
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
76
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/trace_events.js)
|
|
77
77
|
*/
|
|
78
78
|
declare module 'trace_events' {
|
|
79
79
|
/**
|
node/tty.d.ts
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*
|
|
23
23
|
* In most cases, there should be little to no reason for an application to
|
|
24
24
|
* manually create instances of the `tty.ReadStream` and `tty.WriteStream`classes.
|
|
25
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
25
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/tty.js)
|
|
26
26
|
*/
|
|
27
27
|
declare module 'tty' {
|
|
28
28
|
import * as net from 'node:net';
|
node/url.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* ```js
|
|
6
6
|
* import url from 'url';
|
|
7
7
|
* ```
|
|
8
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
8
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/url.js)
|
|
9
9
|
*/
|
|
10
10
|
declare module 'url' {
|
|
11
11
|
import { Blob } from 'node:buffer';
|
|
@@ -684,7 +684,7 @@ declare module 'url' {
|
|
|
684
684
|
* @since v7.5.0, v6.13.0
|
|
685
685
|
*/
|
|
686
686
|
class URLSearchParams implements Iterable<[string, string]> {
|
|
687
|
-
constructor(init?: URLSearchParams | string |
|
|
687
|
+
constructor(init?: URLSearchParams | string | Record<string, string | ReadonlyArray<string>> | Iterable<[string, string]> | ReadonlyArray<[string, string]>);
|
|
688
688
|
/**
|
|
689
689
|
* Append a new name-value pair to the query string.
|
|
690
690
|
*/
|
node/util.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* ```js
|
|
7
7
|
* const util = require('util');
|
|
8
8
|
* ```
|
|
9
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/util.js)
|
|
10
10
|
*/
|
|
11
11
|
declare module 'util' {
|
|
12
12
|
import * as types from 'node:util/types';
|
|
@@ -145,7 +145,6 @@ declare module 'util' {
|
|
|
145
145
|
* Returns the `string` after replacing any surrogate code points
|
|
146
146
|
* (or equivalently, any unpaired surrogate code units) with the
|
|
147
147
|
* Unicode "replacement character" U+FFFD.
|
|
148
|
-
*
|
|
149
148
|
* @since v16.8.0
|
|
150
149
|
*/
|
|
151
150
|
export function toUSVString(string: string): string;
|
|
@@ -253,7 +252,7 @@ declare module 'util' {
|
|
|
253
252
|
* The `showHidden` option allows [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) and
|
|
254
253
|
* [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries to be
|
|
255
254
|
* inspected. If there are more entries than `maxArrayLength`, there is no
|
|
256
|
-
* guarantee which entries are displayed. That means retrieving the same[`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries twice may
|
|
255
|
+
* guarantee which entries are displayed. That means retrieving the same [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries twice may
|
|
257
256
|
* result in different output. Furthermore, entries
|
|
258
257
|
* with no remaining strong references may be garbage collected at any time.
|
|
259
258
|
*
|
|
@@ -965,7 +964,7 @@ declare module 'util' {
|
|
|
965
964
|
const custom: unique symbol;
|
|
966
965
|
}
|
|
967
966
|
/**
|
|
968
|
-
* An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/)`TextDecoder` API.
|
|
967
|
+
* An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextDecoder` API.
|
|
969
968
|
*
|
|
970
969
|
* ```js
|
|
971
970
|
* const decoder = new TextDecoder('shift_jis');
|
|
@@ -1027,7 +1026,7 @@ declare module 'util' {
|
|
|
1027
1026
|
}
|
|
1028
1027
|
export { types };
|
|
1029
1028
|
/**
|
|
1030
|
-
* An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/)`TextEncoder` API. All
|
|
1029
|
+
* An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextEncoder` API. All
|
|
1031
1030
|
* instances of `TextEncoder` only support UTF-8 encoding.
|
|
1032
1031
|
*
|
|
1033
1032
|
* ```js
|
|
@@ -1071,8 +1070,8 @@ declare module 'util/types' {
|
|
|
1071
1070
|
declare module 'util/types' {
|
|
1072
1071
|
import { KeyObject, webcrypto } from 'node:crypto';
|
|
1073
1072
|
/**
|
|
1074
|
-
* Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)
|
|
1075
|
-
*
|
|
1073
|
+
* Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) or
|
|
1074
|
+
* [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance.
|
|
1076
1075
|
*
|
|
1077
1076
|
* See also `util.types.isArrayBuffer()` and `util.types.isSharedArrayBuffer()`.
|
|
1078
1077
|
*
|
|
@@ -1107,9 +1106,9 @@ declare module 'util/types' {
|
|
|
1107
1106
|
*/
|
|
1108
1107
|
function isArrayBuffer(object: unknown): object is ArrayBuffer;
|
|
1109
1108
|
/**
|
|
1110
|
-
* Returns `true` if the value is an instance of one of the [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)views, such as typed
|
|
1111
|
-
* objects or [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView). Equivalent
|
|
1112
|
-
*
|
|
1109
|
+
* Returns `true` if the value is an instance of one of the [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) views, such as typed
|
|
1110
|
+
* array objects or [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView). Equivalent to
|
|
1111
|
+
* [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView).
|
|
1113
1112
|
*
|
|
1114
1113
|
* ```js
|
|
1115
1114
|
* util.types.isArrayBufferView(new Int8Array()); // true
|
|
@@ -1337,7 +1336,7 @@ declare module 'util/types' {
|
|
|
1337
1336
|
*/
|
|
1338
1337
|
function isMap<T>(object: T | {}): object is T extends ReadonlyMap<any, any> ? (unknown extends T ? never : ReadonlyMap<any, any>) : Map<unknown, unknown>;
|
|
1339
1338
|
/**
|
|
1340
|
-
* Returns `true` if the value is an iterator returned for a built-in[`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance.
|
|
1339
|
+
* Returns `true` if the value is an iterator returned for a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance.
|
|
1341
1340
|
*
|
|
1342
1341
|
* ```js
|
|
1343
1342
|
* const map = new Map();
|
|
@@ -1423,7 +1422,7 @@ declare module 'util/types' {
|
|
|
1423
1422
|
*/
|
|
1424
1423
|
function isSet<T>(object: T | {}): object is T extends ReadonlySet<any> ? (unknown extends T ? never : ReadonlySet<any>) : Set<unknown>;
|
|
1425
1424
|
/**
|
|
1426
|
-
* Returns `true` if the value is an iterator returned for a built-in[`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance.
|
|
1425
|
+
* Returns `true` if the value is an iterator returned for a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance.
|
|
1427
1426
|
*
|
|
1428
1427
|
* ```js
|
|
1429
1428
|
* const set = new Set();
|
node/v8.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `v8` module exposes APIs that are specific to the version of [V8](https://developers.google.com/v8/)built into the Node.js binary. It can be accessed using:
|
|
2
|
+
* The `v8` module exposes APIs that are specific to the version of [V8](https://developers.google.com/v8/) built into the Node.js binary. It can be accessed using:
|
|
3
3
|
*
|
|
4
4
|
* ```js
|
|
5
5
|
* const v8 = require('v8');
|
|
6
6
|
* ```
|
|
7
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
7
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/v8.js)
|
|
8
8
|
*/
|
|
9
9
|
declare module 'v8' {
|
|
10
10
|
import { Readable } from 'node:stream';
|
node/vm.d.ts
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
*
|
|
33
33
|
* console.log(x); // 1; y is not defined.
|
|
34
34
|
* ```
|
|
35
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
35
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/vm.js)
|
|
36
36
|
*/
|
|
37
37
|
declare module 'vm' {
|
|
38
38
|
interface Context extends NodeJS.Dict<any> {}
|
|
@@ -267,7 +267,6 @@ declare module 'vm' {
|
|
|
267
267
|
* @since v10.6.0
|
|
268
268
|
*/
|
|
269
269
|
createCachedData(): Buffer;
|
|
270
|
-
|
|
271
270
|
/** @deprecated in favor of `script.createCachedData()` */
|
|
272
271
|
cachedDataProduced?: boolean | undefined;
|
|
273
272
|
cachedDataRejected?: boolean | undefined;
|
|
@@ -277,7 +276,7 @@ declare module 'vm' {
|
|
|
277
276
|
* If given a `contextObject`, the `vm.createContext()` method will `prepare
|
|
278
277
|
* that object` so that it can be used in calls to {@link runInContext} or `script.runInContext()`. Inside such scripts,
|
|
279
278
|
* the `contextObject` will be the global object, retaining all of its existing
|
|
280
|
-
* properties but also having the built-in objects and functions any standard[global object](https://es5.github.io/#x15.1) has. Outside of scripts run by the vm module, global variables
|
|
279
|
+
* properties but also having the built-in objects and functions any standard [global object](https://es5.github.io/#x15.1) has. Outside of scripts run by the vm module, global variables
|
|
281
280
|
* will remain unchanged.
|
|
282
281
|
*
|
|
283
282
|
* ```js
|
|
@@ -398,7 +397,7 @@ declare module 'vm' {
|
|
|
398
397
|
* ```
|
|
399
398
|
*
|
|
400
399
|
* Because `vm.runInThisContext()` does not have access to the local scope,`localVar` is unchanged. In contrast,
|
|
401
|
-
* [`eval()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval)_does_ have access to the
|
|
400
|
+
* [`eval()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval) _does_ have access to the
|
|
402
401
|
* local scope, so the value `localVar` is changed. In this way`vm.runInThisContext()` is much like an [indirect `eval()` call](https://es5.github.io/#x10.4.2), e.g.`(0,eval)('code')`.
|
|
403
402
|
*
|
|
404
403
|
* ## Example: Running an HTTP server within a VM
|
node/wasi.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The WASI API provides an implementation of the [WebAssembly System Interface](https://wasi.dev/)specification. WASI gives sandboxed WebAssembly applications access to the
|
|
2
|
+
* The WASI API provides an implementation of the [WebAssembly System Interface](https://wasi.dev/) specification. WASI gives sandboxed WebAssembly applications access to the
|
|
3
3
|
* underlying operating system via a collection of POSIX-like functions.
|
|
4
4
|
*
|
|
5
5
|
* ```js
|
|
6
|
-
* import
|
|
6
|
+
* import { readFile } from 'fs/promises';
|
|
7
7
|
* import { WASI } from 'wasi';
|
|
8
8
|
* import { argv, env } from 'process';
|
|
9
9
|
*
|
|
@@ -14,9 +14,14 @@
|
|
|
14
14
|
* '/sandbox': '/some/real/path/that/wasm/can/access'
|
|
15
15
|
* }
|
|
16
16
|
* });
|
|
17
|
+
*
|
|
18
|
+
* // Some WASI binaries require:
|
|
19
|
+
* // const importObject = { wasi_unstable: wasi.wasiImport };
|
|
17
20
|
* const importObject = { wasi_snapshot_preview1: wasi.wasiImport };
|
|
18
21
|
*
|
|
19
|
-
* const wasm = await WebAssembly.compile(
|
|
22
|
+
* const wasm = await WebAssembly.compile(
|
|
23
|
+
* await readFile(new URL('./demo.wasm', import.meta.url))
|
|
24
|
+
* );
|
|
20
25
|
* const instance = await WebAssembly.instantiate(wasm, importObject);
|
|
21
26
|
*
|
|
22
27
|
* wasi.start(instance);
|
|
@@ -63,7 +68,7 @@
|
|
|
63
68
|
* The `--experimental-wasi-unstable-preview1` CLI argument is needed for this
|
|
64
69
|
* example to run.
|
|
65
70
|
* @experimental
|
|
66
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
71
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/wasi.js)
|
|
67
72
|
*/
|
|
68
73
|
declare module 'wasi' {
|
|
69
74
|
interface WASIOptions {
|
node/worker_threads.d.ts
CHANGED
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
*
|
|
50
50
|
* Worker threads inherit non-process-specific options by default. Refer to `Worker constructor options` to know how to customize worker thread options,
|
|
51
51
|
* specifically `argv` and `execArgv` options.
|
|
52
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
52
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/worker_threads.js)
|
|
53
53
|
*/
|
|
54
54
|
declare module 'worker_threads' {
|
|
55
55
|
import { Blob } from 'node:buffer';
|
|
@@ -94,7 +94,7 @@ declare module 'worker_threads' {
|
|
|
94
94
|
* asynchronous, two-way communications channel. It can be used to transfer
|
|
95
95
|
* structured data, memory regions and other `MessagePort`s between different `Worker` s.
|
|
96
96
|
*
|
|
97
|
-
* This implementation matches [browser `MessagePort`](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort)s.
|
|
97
|
+
* This implementation matches [browser `MessagePort`](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort) s.
|
|
98
98
|
* @since v10.5.0
|
|
99
99
|
*/
|
|
100
100
|
class MessagePort extends EventEmitter {
|
|
@@ -572,11 +572,11 @@ declare module 'worker_threads' {
|
|
|
572
572
|
* takes its place.
|
|
573
573
|
*
|
|
574
574
|
* The returned `MessagePort` is an object in the target context and
|
|
575
|
-
* inherits from its global `Object` class. Objects passed to the[`port.onmessage()`](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort/onmessage) listener are also created in the
|
|
575
|
+
* inherits from its global `Object` class. Objects passed to the [`port.onmessage()`](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort/onmessage) listener are also created in the
|
|
576
576
|
* target context
|
|
577
577
|
* and inherit from its global `Object` class.
|
|
578
578
|
*
|
|
579
|
-
* However, the created `MessagePort` no longer inherits from[`EventTarget`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget), and only
|
|
579
|
+
* However, the created `MessagePort` no longer inherits from [`EventTarget`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget), and only
|
|
580
580
|
* [`port.onmessage()`](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort/onmessage) can be used to receive
|
|
581
581
|
* events using it.
|
|
582
582
|
* @since v11.13.0
|
node/zlib.d.ts
CHANGED
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
* });
|
|
89
89
|
* ```
|
|
90
90
|
* @since v0.5.8
|
|
91
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
91
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/zlib.js)
|
|
92
92
|
*/
|
|
93
93
|
declare module 'zlib' {
|
|
94
94
|
import * as stream from 'node:stream';
|