@types/node 16.9.3 → 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 +34 -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 +2 -2
- 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 +1 -1
- 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/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (https://nodejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated: Sun, 19 Sep 2021
|
|
11
|
+
* Last updated: Sun, 19 Sep 2021 18:01:23 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
* Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`
|
|
14
14
|
|
node/assert.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The `assert` module provides a set of assertion functions for verifying
|
|
3
3
|
* invariants.
|
|
4
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
4
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/assert.js)
|
|
5
5
|
*/
|
|
6
6
|
declare module 'assert' {
|
|
7
7
|
/**
|
node/async_hooks.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* import async_hooks from 'async_hooks';
|
|
7
7
|
* ```
|
|
8
8
|
* @experimental
|
|
9
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/async_hooks.js)
|
|
10
10
|
*/
|
|
11
11
|
declare module 'async_hooks' {
|
|
12
12
|
/**
|
node/buffer.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* The `Buffer` class is a subclass of JavaScript's [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) class and
|
|
6
6
|
* extends it with methods that cover additional use cases. Node.js APIs accept
|
|
7
|
-
* plain [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)s wherever `Buffer`s are supported as well.
|
|
7
|
+
* plain [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) s wherever `Buffer`s are supported as well.
|
|
8
8
|
*
|
|
9
9
|
* While the `Buffer` class is available within the global scope, it is still
|
|
10
10
|
* recommended to explicitly reference it via an import or require statement.
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
* // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74].
|
|
42
42
|
* const buf7 = Buffer.from('tést', 'latin1');
|
|
43
43
|
* ```
|
|
44
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
44
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/buffer.js)
|
|
45
45
|
*/
|
|
46
46
|
declare module 'buffer' {
|
|
47
47
|
import { BinaryLike } from 'node:crypto';
|
|
@@ -137,7 +137,7 @@ declare module 'buffer' {
|
|
|
137
137
|
*/
|
|
138
138
|
constructor(sources: Array<BinaryLike | Blob>, options?: BlobOptions);
|
|
139
139
|
/**
|
|
140
|
-
* Returns a promise that fulfills with an [
|
|
140
|
+
* Returns a promise that fulfills with an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) containing a copy of
|
|
141
141
|
* the `Blob` data.
|
|
142
142
|
* @since v15.7.0
|
|
143
143
|
*/
|
node/child_process.d.ts
CHANGED
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
* For certain use cases, such as automating shell scripts, the `synchronous counterparts` may be more convenient. In many cases, however,
|
|
61
61
|
* the synchronous methods can have significant impact on performance due to
|
|
62
62
|
* stalling the event loop while spawned processes complete.
|
|
63
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
63
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/child_process.js)
|
|
64
64
|
*/
|
|
65
65
|
declare module 'child_process' {
|
|
66
66
|
import { ObjectEncodingOptions } from 'node:fs';
|
|
@@ -70,6 +70,14 @@ declare module 'child_process' {
|
|
|
70
70
|
import { URL } from 'node:url';
|
|
71
71
|
type Serializable = string | object | number | boolean | bigint;
|
|
72
72
|
type SendHandle = net.Socket | net.Server;
|
|
73
|
+
/**
|
|
74
|
+
* Instances of the `ChildProcess` represent spawned child processes.
|
|
75
|
+
*
|
|
76
|
+
* Instances of `ChildProcess` are not intended to be created directly. Rather,
|
|
77
|
+
* use the {@link spawn}, {@link exec},{@link execFile}, or {@link fork} methods to create
|
|
78
|
+
* instances of `ChildProcess`.
|
|
79
|
+
* @since v2.2.0
|
|
80
|
+
*/
|
|
73
81
|
class ChildProcess extends EventEmitter {
|
|
74
82
|
/**
|
|
75
83
|
* A `Writable Stream` that represents the child process's `stdin`.
|
|
@@ -236,8 +244,8 @@ declare module 'child_process' {
|
|
|
236
244
|
readonly spawnfile: string;
|
|
237
245
|
/**
|
|
238
246
|
* The `subprocess.kill()` method sends a signal to the child process. If no
|
|
239
|
-
* argument is given, the process will be sent the `'SIGTERM'` signal. See[`signal(7)`](http://man7.org/linux/man-pages/man7/signal.7.html) for a list of available signals. This function
|
|
240
|
-
* returns `true` if[`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) succeeds, and `false` otherwise.
|
|
247
|
+
* argument is given, the process will be sent the `'SIGTERM'` signal. See [`signal(7)`](http://man7.org/linux/man-pages/man7/signal.7.html) for a list of available signals. This function
|
|
248
|
+
* returns `true` if [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) succeeds, and `false` otherwise.
|
|
241
249
|
*
|
|
242
250
|
* ```js
|
|
243
251
|
* const { spawn } = require('child_process');
|
|
@@ -799,7 +807,7 @@ declare module 'child_process' {
|
|
|
799
807
|
/**
|
|
800
808
|
* Spawns a shell then executes the `command` within that shell, buffering any
|
|
801
809
|
* generated output. The `command` string passed to the exec function is processed
|
|
802
|
-
* directly by the shell and special characters (vary based on[shell](https://en.wikipedia.org/wiki/List_of_command-line_interpreters))
|
|
810
|
+
* directly by the shell and special characters (vary based on [shell](https://en.wikipedia.org/wiki/List_of_command-line_interpreters))
|
|
803
811
|
* need to be dealt with accordingly:
|
|
804
812
|
*
|
|
805
813
|
* ```js
|
node/cluster.d.ts
CHANGED
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
* ```
|
|
50
50
|
*
|
|
51
51
|
* On Windows, it is not yet possible to set up a named pipe server in a worker.
|
|
52
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
52
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/cluster.js)
|
|
53
53
|
*/
|
|
54
54
|
declare module 'cluster' {
|
|
55
55
|
import * as child from 'node:child_process';
|
node/console.d.ts
CHANGED
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
* myConsole.warn(`Danger ${name}! Danger!`);
|
|
54
54
|
* // Prints: Danger Will Robinson! Danger!, to err
|
|
55
55
|
* ```
|
|
56
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
56
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/console.js)
|
|
57
57
|
*/
|
|
58
58
|
declare module 'console' {
|
|
59
59
|
import console = require('node:console');
|
node/crypto.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* // Prints:
|
|
14
14
|
* // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e
|
|
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/crypto.js)
|
|
17
17
|
*/
|
|
18
18
|
declare module 'crypto' {
|
|
19
19
|
import * as stream from 'node:stream';
|
|
@@ -548,6 +548,22 @@ declare module 'crypto' {
|
|
|
548
548
|
class KeyObject {
|
|
549
549
|
private constructor();
|
|
550
550
|
/**
|
|
551
|
+
* Example: Converting a `CryptoKey` instance to a `KeyObject`:
|
|
552
|
+
*
|
|
553
|
+
* ```js
|
|
554
|
+
* const { webcrypto, KeyObject } = await import('crypto');
|
|
555
|
+
* const { subtle } = webcrypto;
|
|
556
|
+
*
|
|
557
|
+
* const key = await subtle.generateKey({
|
|
558
|
+
* name: 'HMAC',
|
|
559
|
+
* hash: 'SHA-256',
|
|
560
|
+
* length: 256
|
|
561
|
+
* }, true, ['sign', 'verify']);
|
|
562
|
+
*
|
|
563
|
+
* const keyObject = KeyObject.from(key);
|
|
564
|
+
* console.log(keyObject.symmetricKeySize);
|
|
565
|
+
* // Prints: 32 (symmetric key size in bytes)
|
|
566
|
+
* ```
|
|
551
567
|
* @since v15.0.0
|
|
552
568
|
*/
|
|
553
569
|
static from(key: webcrypto.CryptoKey): KeyObject;
|
|
@@ -660,7 +676,7 @@ declare module 'crypto' {
|
|
|
660
676
|
* non-cryptographically secure hash algorithm allow passwords to be tested very
|
|
661
677
|
* rapidly.
|
|
662
678
|
*
|
|
663
|
-
* In line with OpenSSL's recommendation to use a more modern algorithm instead of[`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) it is recommended that
|
|
679
|
+
* In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) it is recommended that
|
|
664
680
|
* developers derive a key and IV on
|
|
665
681
|
* their own using {@link scrypt} and to use {@link createCipheriv} to create the `Cipher` object. Users should not use ciphers with counter mode
|
|
666
682
|
* (e.g. CTR, GCM, or CCM) in `crypto.createCipher()`. A warning is emitted when
|
|
@@ -688,7 +704,7 @@ declare module 'crypto' {
|
|
|
688
704
|
* recent OpenSSL releases, `openssl list -cipher-algorithms`(`openssl list-cipher-algorithms` for older versions of OpenSSL) will
|
|
689
705
|
* display the available cipher algorithms.
|
|
690
706
|
*
|
|
691
|
-
* The `key` is the raw key used by the `algorithm` and `iv` is an[initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded
|
|
707
|
+
* The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded
|
|
692
708
|
* strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be
|
|
693
709
|
* a `KeyObject` of type `secret`. If the cipher does not need
|
|
694
710
|
* an initialization vector, `iv` may be `null`.
|
|
@@ -905,7 +921,7 @@ declare module 'crypto' {
|
|
|
905
921
|
* non-cryptographically secure hash algorithm allow passwords to be tested very
|
|
906
922
|
* rapidly.
|
|
907
923
|
*
|
|
908
|
-
* In line with OpenSSL's recommendation to use a more modern algorithm instead of[`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) it is recommended that
|
|
924
|
+
* In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) it is recommended that
|
|
909
925
|
* developers derive a key and IV on
|
|
910
926
|
* their own using {@link scrypt} and to use {@link createDecipheriv} to create the `Decipher` object.
|
|
911
927
|
* @since v0.1.94
|
|
@@ -929,7 +945,7 @@ declare module 'crypto' {
|
|
|
929
945
|
* recent OpenSSL releases, `openssl list -cipher-algorithms`(`openssl list-cipher-algorithms` for older versions of OpenSSL) will
|
|
930
946
|
* display the available cipher algorithms.
|
|
931
947
|
*
|
|
932
|
-
* The `key` is the raw key used by the `algorithm` and `iv` is an[initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded
|
|
948
|
+
* The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded
|
|
933
949
|
* strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be
|
|
934
950
|
* a `KeyObject` of type `secret`. If the cipher does not need
|
|
935
951
|
* an initialization vector, `iv` may be `null`.
|
|
@@ -1524,7 +1540,7 @@ declare module 'crypto' {
|
|
|
1524
1540
|
}
|
|
1525
1541
|
/**
|
|
1526
1542
|
* Creates a predefined `DiffieHellmanGroup` key exchange object. The
|
|
1527
|
-
* supported groups are: `'modp1'`, `'modp2'`, `'modp5'` (defined in[RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt), but see `Caveats`) and `'modp14'`, `'modp15'`,`'modp16'`, `'modp17'`,
|
|
1543
|
+
* supported groups are: `'modp1'`, `'modp2'`, `'modp5'` (defined in [RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt), but see `Caveats`) and `'modp14'`, `'modp15'`,`'modp16'`, `'modp17'`,
|
|
1528
1544
|
* `'modp18'` (defined in [RFC 3526](https://www.rfc-editor.org/rfc/rfc3526.txt)). The
|
|
1529
1545
|
* returned object mimics the interface of objects created by {@link createDiffieHellman}, but will not allow changing
|
|
1530
1546
|
* the keys (with `diffieHellman.setPublicKey()`, for example). The
|
|
@@ -2209,7 +2225,7 @@ declare module 'crypto' {
|
|
|
2209
2225
|
* This function is based on a constant-time algorithm.
|
|
2210
2226
|
* Returns true if `a` is equal to `b`, without leaking timing information that
|
|
2211
2227
|
* would allow an attacker to guess one of the values. This is suitable for
|
|
2212
|
-
* comparing HMAC digests or secret values like authentication cookies or[capability urls](https://www.w3.org/TR/capability-urls/).
|
|
2228
|
+
* comparing HMAC digests or secret values like authentication cookies or [capability urls](https://www.w3.org/TR/capability-urls/).
|
|
2213
2229
|
*
|
|
2214
2230
|
* `a` and `b` must both be `Buffer`s, `TypedArray`s, or `DataView`s, and they
|
|
2215
2231
|
* must have the same byte length.
|
|
@@ -2382,8 +2398,8 @@ declare module 'crypto' {
|
|
|
2382
2398
|
privateKey: T2;
|
|
2383
2399
|
}
|
|
2384
2400
|
/**
|
|
2385
|
-
* Generates a new asymmetric key pair of the given `type`. RSA, DSA, EC,
|
|
2386
|
-
* Ed448, X25519, X448, and DH are currently supported.
|
|
2401
|
+
* Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC,
|
|
2402
|
+
* Ed25519, Ed448, X25519, X448, and DH are currently supported.
|
|
2387
2403
|
*
|
|
2388
2404
|
* If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function
|
|
2389
2405
|
* behaves as if `keyObject.export()` had been called on its result. Otherwise,
|
|
@@ -2463,8 +2479,8 @@ declare module 'crypto' {
|
|
|
2463
2479
|
function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
|
|
2464
2480
|
function generateKeyPairSync(type: 'x448', options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2465
2481
|
/**
|
|
2466
|
-
* Generates a new asymmetric key pair of the given `type`. RSA, DSA, EC,
|
|
2467
|
-
* Ed448, X25519, X448, and DH are currently supported.
|
|
2482
|
+
* Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC,
|
|
2483
|
+
* Ed25519, Ed448, X25519, X448, and DH are currently supported.
|
|
2468
2484
|
*
|
|
2469
2485
|
* If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function
|
|
2470
2486
|
* behaves as if `keyObject.export()` had been called on its result. Otherwise,
|
|
@@ -2499,7 +2515,7 @@ declare module 'crypto' {
|
|
|
2499
2515
|
* If this method is invoked as its `util.promisify()` ed version, it returns
|
|
2500
2516
|
* a `Promise` for an `Object` with `publicKey` and `privateKey` properties.
|
|
2501
2517
|
* @since v10.12.0
|
|
2502
|
-
* @param type Must be `'rsa'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`.
|
|
2518
|
+
* @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`.
|
|
2503
2519
|
*/
|
|
2504
2520
|
function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
|
|
2505
2521
|
function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
|
|
@@ -2880,7 +2896,7 @@ declare module 'crypto' {
|
|
|
2880
2896
|
*
|
|
2881
2897
|
* The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an errors occurs while deriving the key, `err` will be set;
|
|
2882
2898
|
* otherwise `err` will be `null`. The successfully generated `derivedKey` will
|
|
2883
|
-
* be passed to the callback as an [
|
|
2899
|
+
* be passed to the callback as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). An error will be thrown if any
|
|
2884
2900
|
* of the input arguments specify invalid values or types.
|
|
2885
2901
|
*
|
|
2886
2902
|
* ```js
|
|
@@ -2907,7 +2923,7 @@ declare module 'crypto' {
|
|
|
2907
2923
|
* Provides a synchronous HKDF key derivation function as defined in RFC 5869\. The
|
|
2908
2924
|
* given `ikm`, `salt` and `info` are used with the `digest` to derive a key of`keylen` bytes.
|
|
2909
2925
|
*
|
|
2910
|
-
* The successfully generated `derivedKey` will be returned as an [
|
|
2926
|
+
* The successfully generated `derivedKey` will be returned as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer).
|
|
2911
2927
|
*
|
|
2912
2928
|
* An error will be thrown if any of the input arguments specify invalid values or
|
|
2913
2929
|
* types, or if the derived key cannot be generated.
|
|
@@ -3169,8 +3185,8 @@ declare module 'crypto' {
|
|
|
3169
3185
|
* if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`.
|
|
3170
3186
|
*
|
|
3171
3187
|
* By default, the prime is encoded as a big-endian sequence of octets
|
|
3172
|
-
* in an [
|
|
3173
|
-
* [
|
|
3188
|
+
* in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a
|
|
3189
|
+
* [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided.
|
|
3174
3190
|
* @since v15.8.0
|
|
3175
3191
|
* @param size The size (in bits) of the prime to generate.
|
|
3176
3192
|
*/
|
|
@@ -3200,8 +3216,8 @@ declare module 'crypto' {
|
|
|
3200
3216
|
* if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`.
|
|
3201
3217
|
*
|
|
3202
3218
|
* By default, the prime is encoded as a big-endian sequence of octets
|
|
3203
|
-
* in an [
|
|
3204
|
-
* [
|
|
3219
|
+
* in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a
|
|
3220
|
+
* [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided.
|
|
3205
3221
|
* @since v15.8.0
|
|
3206
3222
|
* @param size The size (in bits) of the prime to generate.
|
|
3207
3223
|
*/
|
node/dgram.d.ts
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* server.bind(41234);
|
|
24
24
|
* // Prints: server listening 0.0.0.0:41234
|
|
25
25
|
* ```
|
|
26
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
26
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/dgram.js)
|
|
27
27
|
*/
|
|
28
28
|
declare module 'dgram' {
|
|
29
29
|
import { AddressInfo } from 'node:net';
|
|
@@ -350,7 +350,7 @@ declare module 'dgram' {
|
|
|
350
350
|
*/
|
|
351
351
|
setBroadcast(flag: boolean): void;
|
|
352
352
|
/**
|
|
353
|
-
* _All references to scope in this section are referring to[IPv6 Zone Indices](https://en.wikipedia.org/wiki/IPv6_address#Scoped_literal_IPv6_addresses), which are defined by [RFC
|
|
353
|
+
* _All references to scope in this section are referring to [IPv6 Zone Indices](https://en.wikipedia.org/wiki/IPv6_address#Scoped_literal_IPv6_addresses), which are defined by [RFC
|
|
354
354
|
* 4007](https://tools.ietf.org/html/rfc4007). In string form, an IP_
|
|
355
355
|
* _with a scope index is written as `'IP%scope'` where scope is an interface name_
|
|
356
356
|
* _or interface number._
|
node/diagnostics_channel.d.ts
CHANGED
|
@@ -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.9.0/lib/diagnostics_channel.js)
|
|
24
24
|
*/
|
|
25
25
|
declare module 'diagnostics_channel' {
|
|
26
26
|
/**
|
node/dns/promises.d.ts
CHANGED
|
@@ -323,7 +323,7 @@ declare module 'dns/promises' {
|
|
|
323
323
|
* The `dnsPromises.setServers()` method must not be called while a DNS query is in
|
|
324
324
|
* progress.
|
|
325
325
|
*
|
|
326
|
-
* This method works much like[resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html).
|
|
326
|
+
* This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html).
|
|
327
327
|
* That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with
|
|
328
328
|
* subsequent servers provided. Fallback DNS servers will only be used if the
|
|
329
329
|
* earlier ones time out or result in some other error.
|
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.9.0/lib/dns.js)
|
|
46
46
|
*/
|
|
47
47
|
declare module 'dns' {
|
|
48
48
|
import * as dnsPromises from 'node:dns/promises';
|
|
@@ -502,7 +502,7 @@ declare module 'dns' {
|
|
|
502
502
|
*
|
|
503
503
|
* The {@link setServers} method affects only {@link resolve},`dns.resolve*()` and {@link reverse} (and specifically _not_ {@link lookup}).
|
|
504
504
|
*
|
|
505
|
-
* This method works much like[resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html).
|
|
505
|
+
* This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html).
|
|
506
506
|
* That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with
|
|
507
507
|
* subsequent servers provided. Fallback DNS servers will only be used if the
|
|
508
508
|
* earlier ones time out or result in some other error.
|
node/domain.d.ts
CHANGED
|
@@ -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.9.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.9.0/lib/events.js)
|
|
36
36
|
*/
|
|
37
37
|
declare module 'events' {
|
|
38
38
|
interface EventEmitterOptions {
|
|
@@ -78,7 +78,7 @@ declare module 'events' {
|
|
|
78
78
|
* The `Promise` will resolve with an array of all the arguments emitted to the
|
|
79
79
|
* given event.
|
|
80
80
|
*
|
|
81
|
-
* This method is intentionally generic and works with the web platform[EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event
|
|
81
|
+
* This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event
|
|
82
82
|
* semantics and does not listen to the `'error'` event.
|
|
83
83
|
*
|
|
84
84
|
* ```js
|
node/fs/promises.d.ts
CHANGED
|
@@ -92,7 +92,7 @@ declare module 'fs/promises' {
|
|
|
92
92
|
chmod(mode: Mode): Promise<void>;
|
|
93
93
|
/**
|
|
94
94
|
* Forces all currently queued I/O operations associated with the file to the
|
|
95
|
-
* operating system's synchronized I/O completion state. Refer to the POSIX[`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details.
|
|
95
|
+
* operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details.
|
|
96
96
|
*
|
|
97
97
|
* Unlike `filehandle.sync` this method does not flush modified metadata.
|
|
98
98
|
* @since v10.0.0
|
|
@@ -220,7 +220,10 @@ declare module 'fs/promises' {
|
|
|
220
220
|
*/
|
|
221
221
|
utimes(atime: string | number | Date, mtime: string | number | Date): Promise<void>;
|
|
222
222
|
/**
|
|
223
|
-
* Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer,
|
|
223
|
+
* Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an
|
|
224
|
+
* [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface) or
|
|
225
|
+
* [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object, or an
|
|
226
|
+
* object with an own `toString` function
|
|
224
227
|
* property. The promise is resolved with no arguments upon success.
|
|
225
228
|
*
|
|
226
229
|
* If `options` is a string, then it specifies the `encoding`.
|
|
@@ -274,7 +277,7 @@ declare module 'fs/promises' {
|
|
|
274
277
|
buffer: string;
|
|
275
278
|
}>;
|
|
276
279
|
/**
|
|
277
|
-
* Write an array of [
|
|
280
|
+
* Write an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s to the file.
|
|
278
281
|
*
|
|
279
282
|
* The promise is resolved with an object containing a two properties:
|
|
280
283
|
*
|
|
@@ -290,7 +293,7 @@ declare module 'fs/promises' {
|
|
|
290
293
|
*/
|
|
291
294
|
writev(buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): Promise<WriteVResult>;
|
|
292
295
|
/**
|
|
293
|
-
* Read from a file and write to an array of [
|
|
296
|
+
* Read from a file and write to an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s
|
|
294
297
|
* @since v13.13.0, v12.17.0
|
|
295
298
|
* @param position 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.
|
|
296
299
|
* @return Fulfills upon success an object containing two properties:
|
|
@@ -324,7 +327,7 @@ declare module 'fs/promises' {
|
|
|
324
327
|
*
|
|
325
328
|
* If the accessibility check is successful, the promise is resolved with no
|
|
326
329
|
* value. If any of the accessibility checks fail, the promise is rejected
|
|
327
|
-
* with an [
|
|
330
|
+
* with an [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object. The following example checks if the file`/etc/passwd` can be read and
|
|
328
331
|
* written by the current process.
|
|
329
332
|
*
|
|
330
333
|
* ```js
|
|
@@ -391,7 +394,7 @@ declare module 'fs/promises' {
|
|
|
391
394
|
*
|
|
392
395
|
* Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented
|
|
393
396
|
* by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains
|
|
394
|
-
* a colon, Node.js will open a file system stream, as described by[this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams).
|
|
397
|
+
* a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams).
|
|
395
398
|
* @since v10.0.0
|
|
396
399
|
* @param [flags='r'] See `support of file system `flags``.
|
|
397
400
|
* @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created.
|
|
@@ -539,7 +542,7 @@ declare module 'fs/promises' {
|
|
|
539
542
|
}
|
|
540
543
|
): Promise<Dirent[]>;
|
|
541
544
|
/**
|
|
542
|
-
* 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
|
|
545
|
+
* 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
|
|
543
546
|
* resolved with the`linkString` upon success.
|
|
544
547
|
*
|
|
545
548
|
* The optional `options` argument can be a string specifying an encoding, or an
|
|
@@ -611,7 +614,7 @@ declare module 'fs/promises' {
|
|
|
611
614
|
): Promise<BigIntStats>;
|
|
612
615
|
function stat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
|
|
613
616
|
/**
|
|
614
|
-
* Creates a new link from the `existingPath` to the `newPath`. See the POSIX[`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail.
|
|
617
|
+
* Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail.
|
|
615
618
|
* @since v10.0.0
|
|
616
619
|
* @return Fulfills with `undefined` upon success.
|
|
617
620
|
*/
|
|
@@ -619,7 +622,7 @@ declare module 'fs/promises' {
|
|
|
619
622
|
/**
|
|
620
623
|
* If `path` refers to a symbolic link, then the link is removed without affecting
|
|
621
624
|
* the file or directory to which that link refers. If the `path` refers to a file
|
|
622
|
-
* path that is not a symbolic link, the file is deleted. See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html)documentation for more detail.
|
|
625
|
+
* path that is not a symbolic link, the file is deleted. See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more detail.
|
|
623
626
|
* @since v10.0.0
|
|
624
627
|
* @return Fulfills with `undefined` upon success.
|
|
625
628
|
*/
|
|
@@ -746,6 +749,8 @@ declare module 'fs/promises' {
|
|
|
746
749
|
*
|
|
747
750
|
* If `options` is a string, then it specifies the encoding.
|
|
748
751
|
*
|
|
752
|
+
* The `mode` option only affects the newly created file. See `fs.open()` for more details.
|
|
753
|
+
*
|
|
749
754
|
* Any specified `FileHandle` has to support writing.
|
|
750
755
|
*
|
|
751
756
|
* It is unsafe to use `fsPromises.writeFile()` multiple times on the same file
|
|
@@ -802,6 +807,8 @@ declare module 'fs/promises' {
|
|
|
802
807
|
*
|
|
803
808
|
* If `options` is a string, then it specifies the `encoding`.
|
|
804
809
|
*
|
|
810
|
+
* The `mode` option only affects the newly created file. See `fs.open()` for more details.
|
|
811
|
+
*
|
|
805
812
|
* The `path` may be specified as a `FileHandle` that has been opened
|
|
806
813
|
* for appending (using `fsPromises.open()`).
|
|
807
814
|
* @since v10.0.0
|
|
@@ -894,7 +901,7 @@ declare module 'fs/promises' {
|
|
|
894
901
|
| null
|
|
895
902
|
): Promise<string | Buffer>;
|
|
896
903
|
/**
|
|
897
|
-
* 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.
|
|
904
|
+
* 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.
|
|
898
905
|
*
|
|
899
906
|
* Creates an `fs.Dir`, which contains all further functions for reading from
|
|
900
907
|
* and cleaning up the directory.
|
node/fs.d.ts
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*
|
|
17
17
|
* All file system operations have synchronous, callback, and promise-based
|
|
18
18
|
* forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM).
|
|
19
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
19
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/fs.js)
|
|
20
20
|
*/
|
|
21
21
|
declare module 'fs' {
|
|
22
22
|
import * as stream from 'node:stream';
|
|
@@ -1045,8 +1045,8 @@ declare module 'fs' {
|
|
|
1045
1045
|
*/
|
|
1046
1046
|
export const lstatSync: StatSyncFn;
|
|
1047
1047
|
/**
|
|
1048
|
-
* Creates a new link from the `existingPath` to the `newPath`. See the POSIX[`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. No arguments other than
|
|
1049
|
-
* possible
|
|
1048
|
+
* Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. No arguments other than
|
|
1049
|
+
* a possible
|
|
1050
1050
|
* exception are given to the completion callback.
|
|
1051
1051
|
* @since v0.1.31
|
|
1052
1052
|
*/
|
|
@@ -1060,7 +1060,7 @@ declare module 'fs' {
|
|
|
1060
1060
|
function __promisify__(existingPath: PathLike, newPath: PathLike): Promise<void>;
|
|
1061
1061
|
}
|
|
1062
1062
|
/**
|
|
1063
|
-
* Creates a new link from the `existingPath` to the `newPath`. See the POSIX[`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. Returns `undefined`.
|
|
1063
|
+
* Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. Returns `undefined`.
|
|
1064
1064
|
* @since v0.1.31
|
|
1065
1065
|
*/
|
|
1066
1066
|
export function linkSync(existingPath: PathLike, newPath: PathLike): void;
|
|
@@ -1949,7 +1949,7 @@ declare module 'fs' {
|
|
|
1949
1949
|
*
|
|
1950
1950
|
* Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented
|
|
1951
1951
|
* by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains
|
|
1952
|
-
* a colon, Node.js will open a file system stream, as described by[this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams).
|
|
1952
|
+
* a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams).
|
|
1953
1953
|
*
|
|
1954
1954
|
* Functions based on `fs.open()` exhibit this behavior as well:`fs.writeFile()`, `fs.readFile()`, etc.
|
|
1955
1955
|
* @since v0.0.2
|
|
@@ -2510,6 +2510,8 @@ declare module 'fs' {
|
|
|
2510
2510
|
*
|
|
2511
2511
|
* The `encoding` option is ignored if `data` is a buffer.
|
|
2512
2512
|
*
|
|
2513
|
+
* The `mode` option only affects the newly created file. See {@link open} for more details.
|
|
2514
|
+
*
|
|
2513
2515
|
* If `data` is a plain object, it must have an own (not inherited) `toString`function property.
|
|
2514
2516
|
*
|
|
2515
2517
|
* ```js
|
|
@@ -2590,6 +2592,8 @@ declare module 'fs' {
|
|
|
2590
2592
|
*
|
|
2591
2593
|
* If `data` is a plain object, it must have an own (not inherited) `toString`function property.
|
|
2592
2594
|
*
|
|
2595
|
+
* The `mode` option only affects the newly created file. See {@link open} for more details.
|
|
2596
|
+
*
|
|
2593
2597
|
* For detailed information, see the documentation of the asynchronous version of
|
|
2594
2598
|
* this API: {@link writeFile}.
|
|
2595
2599
|
* @since v0.1.29
|
|
@@ -2600,6 +2604,8 @@ declare module 'fs' {
|
|
|
2600
2604
|
* Asynchronously append data to a file, creating the file if it does not yet
|
|
2601
2605
|
* exist. `data` can be a string or a `Buffer`.
|
|
2602
2606
|
*
|
|
2607
|
+
* The `mode` option only affects the newly created file. See {@link open} for more details.
|
|
2608
|
+
*
|
|
2603
2609
|
* ```js
|
|
2604
2610
|
* import { appendFile } from 'fs';
|
|
2605
2611
|
*
|
|
@@ -2674,6 +2680,8 @@ declare module 'fs' {
|
|
|
2674
2680
|
* Synchronously append data to a file, creating the file if it does not yet
|
|
2675
2681
|
* exist. `data` can be a string or a `Buffer`.
|
|
2676
2682
|
*
|
|
2683
|
+
* The `mode` option only affects the newly created file. See {@link open} for more details.
|
|
2684
|
+
*
|
|
2677
2685
|
* ```js
|
|
2678
2686
|
* import { appendFileSync } from 'fs';
|
|
2679
2687
|
*
|
|
@@ -3433,7 +3441,7 @@ declare module 'fs' {
|
|
|
3433
3441
|
export function createWriteStream(path: PathLike, options?: BufferEncoding | StreamOptions): WriteStream;
|
|
3434
3442
|
/**
|
|
3435
3443
|
* Forces all currently queued I/O operations associated with the file to the
|
|
3436
|
-
* operating system's synchronized I/O completion state. Refer to the POSIX[`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. No arguments other
|
|
3444
|
+
* operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. No arguments other
|
|
3437
3445
|
* than a possible
|
|
3438
3446
|
* exception are given to the completion callback.
|
|
3439
3447
|
* @since v0.1.96
|
|
@@ -3448,7 +3456,7 @@ declare module 'fs' {
|
|
|
3448
3456
|
}
|
|
3449
3457
|
/**
|
|
3450
3458
|
* Forces all currently queued I/O operations associated with the file to the
|
|
3451
|
-
* operating system's synchronized I/O completion state. Refer to the POSIX[`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. Returns `undefined`.
|
|
3459
|
+
* operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. Returns `undefined`.
|
|
3452
3460
|
* @since v0.1.96
|
|
3453
3461
|
*/
|
|
3454
3462
|
export function fdatasyncSync(fd: number): void;
|
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.9.0/lib/http.js)
|
|
41
41
|
*/
|
|
42
42
|
declare module 'http' {
|
|
43
43
|
import * as stream from 'node:stream';
|
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.9.0/lib/http2.js)
|
|
10
10
|
*/
|
|
11
11
|
declare module 'http2' {
|
|
12
12
|
import EventEmitter = require('node:events');
|
|
@@ -2014,7 +2014,7 @@ declare module 'http2' {
|
|
|
2014
2014
|
/**
|
|
2015
2015
|
* Returns a `net.Server` instance that creates and manages `Http2Session`instances.
|
|
2016
2016
|
*
|
|
2017
|
-
* Since there are no browsers known that support[unencrypted HTTP/2](https://http2.github.io/faq/#does-http2-require-encryption), the use of {@link createSecureServer} is necessary when
|
|
2017
|
+
* Since there are no browsers known that support [unencrypted HTTP/2](https://http2.github.io/faq/#does-http2-require-encryption), the use of {@link createSecureServer} is necessary when
|
|
2018
2018
|
* communicating
|
|
2019
2019
|
* with browser clients.
|
|
2020
2020
|
*
|
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.9.0/lib/https.js)
|
|
5
5
|
*/
|
|
6
6
|
declare module 'https' {
|
|
7
7
|
import { Duplex } from 'node:stream';
|
node/inspector.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* ```js
|
|
16
16
|
* const inspector = require('inspector');
|
|
17
17
|
* ```
|
|
18
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
18
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/inspector.js)
|
|
19
19
|
*/
|
|
20
20
|
declare module 'inspector' {
|
|
21
21
|
import EventEmitter = require('node:events');
|
|
@@ -1797,7 +1797,7 @@ declare module 'inspector' {
|
|
|
1797
1797
|
* // Output: { type: 'number', value: 4, description: '4' }
|
|
1798
1798
|
* ```
|
|
1799
1799
|
*
|
|
1800
|
-
* The latest version of the V8 inspector protocol is published on the[Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/v8/).
|
|
1800
|
+
* The latest version of the V8 inspector protocol is published on the [Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/v8/).
|
|
1801
1801
|
*
|
|
1802
1802
|
* Node.js inspector supports all the Chrome DevTools Protocol domains declared
|
|
1803
1803
|
* by V8\. Chrome DevTools Protocol domain provides an interface for interacting
|
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';
|
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
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';
|