@types/node 20.12.14 → 20.14.0
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 +23 -23
- node/child_process.d.ts +34 -32
- node/cluster.d.ts +1 -1
- node/console.d.ts +1 -1
- node/crypto.d.ts +60 -59
- node/dgram.d.ts +2 -2
- node/diagnostics_channel.d.ts +10 -1
- node/dns/promises.d.ts +7 -6
- node/dns.d.ts +23 -12
- node/domain.d.ts +1 -1
- node/events.d.ts +22 -2
- node/fs.d.ts +2 -2
- node/http.d.ts +62 -43
- node/http2.d.ts +1 -1
- node/https.d.ts +3 -3
- node/inspector.d.ts +1 -1
- node/net.d.ts +8 -5
- node/os.d.ts +2 -2
- node/package.json +2 -2
- node/path.d.ts +1 -1
- node/perf_hooks.d.ts +306 -46
- node/process.d.ts +12 -5
- node/punycode.d.ts +1 -1
- node/querystring.d.ts +1 -1
- node/readline.d.ts +1 -1
- node/repl.d.ts +4 -4
- node/stream.d.ts +15 -15
- node/string_decoder.d.ts +1 -1
- node/test.d.ts +322 -74
- node/timers.d.ts +1 -1
- node/tls.d.ts +1 -1
- node/trace_events.d.ts +1 -1
- node/tty.d.ts +1 -1
- node/url.d.ts +11 -3
- node/util.d.ts +20 -4
- node/v8.d.ts +45 -1
- node/vm.d.ts +9 -6
- node/wasi.d.ts +1 -1
- node/worker_threads.d.ts +1 -1
- node/zlib.d.ts +1 -1
node/crypto.d.ts
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
* // Prints:
|
15
15
|
* // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e
|
16
16
|
* ```
|
17
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
17
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/crypto.js)
|
18
18
|
*/
|
19
19
|
declare module "crypto" {
|
20
20
|
import * as stream from "node:stream";
|
@@ -470,6 +470,7 @@ declare module "crypto" {
|
|
470
470
|
* // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e
|
471
471
|
* ```
|
472
472
|
* @since v0.1.94
|
473
|
+
* @deprecated Since v20.13.0 Calling `Hmac` class directly with `Hmac()` or `new Hmac()` is deprecated due to being internals, not intended for public use. Please use the {@link createHmac} method to create Hmac instances.
|
473
474
|
*/
|
474
475
|
class Hmac extends stream.Transform {
|
475
476
|
private constructor();
|
@@ -906,8 +907,8 @@ declare module "crypto" {
|
|
906
907
|
private constructor();
|
907
908
|
/**
|
908
909
|
* Updates the cipher with `data`. If the `inputEncoding` argument is given,
|
909
|
-
* the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`, `TypedArray`, or`DataView`. If `data` is a `Buffer`,
|
910
|
-
* `TypedArray`, or `DataView`, then`inputEncoding` is ignored.
|
910
|
+
* the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`, `TypedArray`, or `DataView`. If `data` is a `Buffer`,
|
911
|
+
* `TypedArray`, or `DataView`, then `inputEncoding` is ignored.
|
911
912
|
*
|
912
913
|
* The `outputEncoding` specifies the output format of the enciphered
|
913
914
|
* data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned.
|
@@ -980,7 +981,7 @@ declare module "crypto" {
|
|
980
981
|
* Creates and returns a `Decipher` object that uses the given `algorithm` and`password` (key).
|
981
982
|
*
|
982
983
|
* The `options` argument controls stream behavior and is optional except when a
|
983
|
-
* cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the
|
984
|
+
* cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the `authTagLength` option is required and specifies the length of the
|
984
985
|
* authentication tag in bytes, see `CCM mode`.
|
985
986
|
* For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes.
|
986
987
|
*
|
@@ -1008,11 +1009,11 @@ declare module "crypto" {
|
|
1008
1009
|
/** @deprecated since v10.0.0 use `createDecipheriv()` */
|
1009
1010
|
function createDecipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Decipher;
|
1010
1011
|
/**
|
1011
|
-
* Creates and returns a `Decipher` object that uses the given `algorithm`, `key`and initialization vector (`iv`).
|
1012
|
+
* Creates and returns a `Decipher` object that uses the given `algorithm`, `key` and initialization vector (`iv`).
|
1012
1013
|
*
|
1013
1014
|
* The `options` argument controls stream behavior and is optional except when a
|
1014
|
-
* cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the
|
1015
|
-
* authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to restrict accepted authentication tags
|
1015
|
+
* cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the `authTagLength` option is required and specifies the length of the
|
1016
|
+
* authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength` option is not required but can be used to restrict accepted authentication tags
|
1016
1017
|
* to those with the specified length.
|
1017
1018
|
* For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes.
|
1018
1019
|
*
|
@@ -1172,11 +1173,11 @@ declare module "crypto" {
|
|
1172
1173
|
private constructor();
|
1173
1174
|
/**
|
1174
1175
|
* Updates the decipher with `data`. If the `inputEncoding` argument is given,
|
1175
|
-
* the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`. If `data` is a `Buffer` then `inputEncoding` is
|
1176
|
+
* the `data` argument is a string using the specified encoding. If the `inputEncoding` argument is not given, `data` must be a `Buffer`. If `data` is a `Buffer` then `inputEncoding` is
|
1176
1177
|
* ignored.
|
1177
1178
|
*
|
1178
1179
|
* The `outputEncoding` specifies the output format of the enciphered
|
1179
|
-
* data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned.
|
1180
|
+
* data. If the `outputEncoding` is specified, a string using the specified encoding is returned. If no `outputEncoding` is provided, a `Buffer` is returned.
|
1180
1181
|
*
|
1181
1182
|
* The `decipher.update()` method can be called multiple times with new data until `decipher.final()` is called. Calling `decipher.update()` after `decipher.final()` will result in an error
|
1182
1183
|
* being thrown.
|
@@ -1199,7 +1200,7 @@ declare module "crypto" {
|
|
1199
1200
|
final(): Buffer;
|
1200
1201
|
final(outputEncoding: BufferEncoding): string;
|
1201
1202
|
/**
|
1202
|
-
* When data has been encrypted without standard block padding, calling`decipher.setAutoPadding(false)` will disable automatic padding to prevent `decipher.final()` from checking for and
|
1203
|
+
* When data has been encrypted without standard block padding, calling `decipher.setAutoPadding(false)` will disable automatic padding to prevent `decipher.final()` from checking for and
|
1203
1204
|
* removing padding.
|
1204
1205
|
*
|
1205
1206
|
* Turning auto padding off will only work if the input data's length is a
|
@@ -1253,7 +1254,7 @@ declare module "crypto" {
|
|
1253
1254
|
encoding?: string | undefined;
|
1254
1255
|
}
|
1255
1256
|
/**
|
1256
|
-
* Asynchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`.
|
1257
|
+
* Asynchronously generates a new random secret key of the given `length`. The `type` will determine which validations will be performed on the `length`.
|
1257
1258
|
*
|
1258
1259
|
* ```js
|
1259
1260
|
* const {
|
@@ -1279,7 +1280,7 @@ declare module "crypto" {
|
|
1279
1280
|
callback: (err: Error | null, key: KeyObject) => void,
|
1280
1281
|
): void;
|
1281
1282
|
/**
|
1282
|
-
* Synchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`.
|
1283
|
+
* Synchronously generates a new random secret key of the given `length`. The `type` will determine which validations will be performed on the `length`.
|
1283
1284
|
*
|
1284
1285
|
* ```js
|
1285
1286
|
* const {
|
@@ -1307,7 +1308,7 @@ declare module "crypto" {
|
|
1307
1308
|
}
|
1308
1309
|
/**
|
1309
1310
|
* Creates and returns a new key object containing a private key. If `key` is a
|
1310
|
-
* string or `Buffer`, `format` is assumed to be `'pem'`; otherwise, `key`must be an object with the properties described above.
|
1311
|
+
* string or `Buffer`, `format` is assumed to be `'pem'`; otherwise, `key` must be an object with the properties described above.
|
1311
1312
|
*
|
1312
1313
|
* If the private key is encrypted, a `passphrase` must be specified. The length
|
1313
1314
|
* of the passphrase is limited to 1024 bytes.
|
@@ -1316,7 +1317,7 @@ declare module "crypto" {
|
|
1316
1317
|
function createPrivateKey(key: PrivateKeyInput | string | Buffer | JsonWebKeyInput): KeyObject;
|
1317
1318
|
/**
|
1318
1319
|
* Creates and returns a new key object containing a public key. If `key` is a
|
1319
|
-
* string or `Buffer`, `format` is assumed to be `'pem'`; if `key` is a `KeyObject`with type `'private'`, the public key is derived from the given private key;
|
1320
|
+
* string or `Buffer`, `format` is assumed to be `'pem'`; if `key` is a `KeyObject` with type `'private'`, the public key is derived from the given private key;
|
1320
1321
|
* otherwise, `key` must be an object with the properties described above.
|
1321
1322
|
*
|
1322
1323
|
* If the format is `'pem'`, the `'key'` may also be an X.509 certificate.
|
@@ -1324,7 +1325,7 @@ declare module "crypto" {
|
|
1324
1325
|
* Because public keys can be derived from private keys, a private key may be
|
1325
1326
|
* passed instead of a public key. In that case, this function behaves as if {@link createPrivateKey} had been called, except that the type of the
|
1326
1327
|
* returned `KeyObject` will be `'public'` and that the private key cannot be
|
1327
|
-
* extracted from the returned `KeyObject`. Similarly, if a `KeyObject` with type`'private'` is given, a new `KeyObject` with type `'public'` will be returned
|
1328
|
+
* extracted from the returned `KeyObject`. Similarly, if a `KeyObject` with type `'private'` is given, a new `KeyObject` with type `'public'` will be returned
|
1328
1329
|
* and it will be impossible to extract the private key from the returned object.
|
1329
1330
|
* @since v11.6.0
|
1330
1331
|
*/
|
@@ -1449,7 +1450,7 @@ declare module "crypto" {
|
|
1449
1450
|
/**
|
1450
1451
|
* Calculates the signature on all the data passed through using either `sign.update()` or `sign.write()`.
|
1451
1452
|
*
|
1452
|
-
* If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an
|
1453
|
+
* If `privateKey` is not a `KeyObject`, this function behaves as if `privateKey` had been passed to {@link createPrivateKey}. If it is an
|
1453
1454
|
* object, the following additional properties can be passed:
|
1454
1455
|
*
|
1455
1456
|
* If `outputEncoding` is provided a string is returned; otherwise a `Buffer` is returned.
|
@@ -1467,7 +1468,7 @@ declare module "crypto" {
|
|
1467
1468
|
/**
|
1468
1469
|
* Creates and returns a `Verify` object that uses the given algorithm.
|
1469
1470
|
* Use {@link getHashes} to obtain an array of names of the available
|
1470
|
-
* signing algorithms. Optional `options` argument controls the`stream.Writable` behavior.
|
1471
|
+
* signing algorithms. Optional `options` argument controls the `stream.Writable` behavior.
|
1471
1472
|
*
|
1472
1473
|
* In some cases, a `Verify` instance can be created using the name of a signature
|
1473
1474
|
* algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use
|
@@ -1487,7 +1488,7 @@ declare module "crypto" {
|
|
1487
1488
|
* * Using the `verify.update()` and `verify.verify()` methods to verify
|
1488
1489
|
* the signature.
|
1489
1490
|
*
|
1490
|
-
* The {@link createVerify} method is used to create `Verify` instances
|
1491
|
+
* The {@link createVerify} method is used to create `Verify` instances. `Verify` objects are not to be created directly using the `new` keyword.
|
1491
1492
|
*
|
1492
1493
|
* See `Sign` for examples.
|
1493
1494
|
* @since v0.1.92
|
@@ -1498,7 +1499,7 @@ declare module "crypto" {
|
|
1498
1499
|
* Updates the `Verify` content with the given `data`, the encoding of which
|
1499
1500
|
* is given in `inputEncoding`.
|
1500
1501
|
* If `inputEncoding` is not provided, and the `data` is a string, an
|
1501
|
-
* encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored.
|
1502
|
+
* encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or `DataView`, then `inputEncoding` is ignored.
|
1502
1503
|
*
|
1503
1504
|
* This can be called many times with new data as it is streamed.
|
1504
1505
|
* @since v0.1.92
|
@@ -1509,13 +1510,13 @@ declare module "crypto" {
|
|
1509
1510
|
/**
|
1510
1511
|
* Verifies the provided data using the given `object` and `signature`.
|
1511
1512
|
*
|
1512
|
-
* If `object` is not a `KeyObject`, this function behaves as if`object` had been passed to {@link createPublicKey}. If it is an
|
1513
|
+
* If `object` is not a `KeyObject`, this function behaves as if `object` had been passed to {@link createPublicKey}. If it is an
|
1513
1514
|
* object, the following additional properties can be passed:
|
1514
1515
|
*
|
1515
1516
|
* The `signature` argument is the previously calculated signature for the data, in
|
1516
1517
|
* the `signatureEncoding`.
|
1517
1518
|
* If a `signatureEncoding` is specified, the `signature` is expected to be a
|
1518
|
-
* string; otherwise `signature` is expected to be a `Buffer
|
1519
|
+
* string; otherwise `signature` is expected to be a `Buffer`, `TypedArray`, or `DataView`.
|
1519
1520
|
*
|
1520
1521
|
* The `verify` object can not be used again after `verify.verify()` has been
|
1521
1522
|
* called. Multiple calls to `verify.verify()` will result in an error being
|
@@ -1539,7 +1540,7 @@ declare module "crypto" {
|
|
1539
1540
|
* Creates a `DiffieHellman` key exchange object using the supplied `prime` and an
|
1540
1541
|
* optional specific `generator`.
|
1541
1542
|
*
|
1542
|
-
* The `generator` argument can be a number, string, or `Buffer`. If`generator` is not specified, the value `2` is used.
|
1543
|
+
* The `generator` argument can be a number, string, or `Buffer`. If `generator` is not specified, the value `2` is used.
|
1543
1544
|
*
|
1544
1545
|
* If `primeEncoding` is specified, `prime` is expected to be a string; otherwise
|
1545
1546
|
* a `Buffer`, `TypedArray`, or `DataView` is expected.
|
@@ -1625,7 +1626,7 @@ declare module "crypto" {
|
|
1625
1626
|
* key is interpreted using the specified `inputEncoding`, and secret is
|
1626
1627
|
* encoded using specified `outputEncoding`.
|
1627
1628
|
* If the `inputEncoding` is not
|
1628
|
-
* provided, `otherPublicKey` is expected to be a `Buffer
|
1629
|
+
* provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or `DataView`.
|
1629
1630
|
*
|
1630
1631
|
* If `outputEncoding` is given a string is returned; otherwise, a `Buffer` is returned.
|
1631
1632
|
* @since v0.5.0
|
@@ -1681,7 +1682,7 @@ declare module "crypto" {
|
|
1681
1682
|
getPrivateKey(): Buffer;
|
1682
1683
|
getPrivateKey(encoding: BinaryToTextEncoding): string;
|
1683
1684
|
/**
|
1684
|
-
* Sets the Diffie-Hellman public key. If the `encoding` argument is provided
|
1685
|
+
* Sets the Diffie-Hellman public key. If the `encoding` argument is provided, `publicKey` is expected
|
1685
1686
|
* to be a string. If no `encoding` is provided, `publicKey` is expected
|
1686
1687
|
* to be a `Buffer`, `TypedArray`, or `DataView`.
|
1687
1688
|
* @since v0.5.0
|
@@ -1784,10 +1785,10 @@ declare module "crypto" {
|
|
1784
1785
|
/**
|
1785
1786
|
* Provides an asynchronous Password-Based Key Derivation Function 2 (PBKDF2)
|
1786
1787
|
* implementation. A selected HMAC digest algorithm specified by `digest` is
|
1787
|
-
* applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`.
|
1788
|
+
* applied to derive a key of the requested byte length (`keylen`) from the `password`, `salt` and `iterations`.
|
1788
1789
|
*
|
1789
|
-
* The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an error occurs while deriving the key, `err` will be set;
|
1790
|
-
* otherwise `err` will be `null`. By default, the successfully generated`derivedKey` will be passed to the callback as a `Buffer`. An error will be
|
1790
|
+
* The supplied `callback` function is called with two arguments: `err` and `derivedKey`. If an error occurs while deriving the key, `err` will be set;
|
1791
|
+
* otherwise `err` will be `null`. By default, the successfully generated `derivedKey` will be passed to the callback as a `Buffer`. An error will be
|
1791
1792
|
* thrown if any of the input arguments specify invalid values or types.
|
1792
1793
|
*
|
1793
1794
|
* The `iterations` argument must be a number set as high as possible. The
|
@@ -1827,7 +1828,7 @@ declare module "crypto" {
|
|
1827
1828
|
/**
|
1828
1829
|
* Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2)
|
1829
1830
|
* implementation. A selected HMAC digest algorithm specified by `digest` is
|
1830
|
-
* applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`.
|
1831
|
+
* applied to derive a key of the requested byte length (`keylen`) from the `password`, `salt` and `iterations`.
|
1831
1832
|
*
|
1832
1833
|
* If an error occurs an `Error` will be thrown, otherwise the derived key will be
|
1833
1834
|
* returned as a `Buffer`.
|
@@ -1866,7 +1867,7 @@ declare module "crypto" {
|
|
1866
1867
|
*
|
1867
1868
|
* If a `callback` function is provided, the bytes are generated asynchronously
|
1868
1869
|
* and the `callback` function is invoked with two arguments: `err` and `buf`.
|
1869
|
-
* If an error occurs, `err` will be an `Error` object; otherwise it is `null`. The`buf` argument is a `Buffer` containing the generated bytes.
|
1870
|
+
* If an error occurs, `err` will be an `Error` object; otherwise it is `null`. The `buf` argument is a `Buffer` containing the generated bytes.
|
1870
1871
|
*
|
1871
1872
|
* ```js
|
1872
1873
|
* // Asynchronous
|
@@ -2037,7 +2038,7 @@ declare module "crypto" {
|
|
2037
2038
|
* });
|
2038
2039
|
* ```
|
2039
2040
|
*
|
2040
|
-
* Any `ArrayBuffer`, `TypedArray`, or `DataView` instance may be passed as`buffer`.
|
2041
|
+
* Any `ArrayBuffer`, `TypedArray`, or `DataView` instance may be passed as `buffer`.
|
2041
2042
|
*
|
2042
2043
|
* While this includes instances of `Float32Array` and `Float64Array`, this
|
2043
2044
|
* function should not be used to generate random floating-point numbers. The
|
@@ -2117,7 +2118,7 @@ declare module "crypto" {
|
|
2117
2118
|
*
|
2118
2119
|
* When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`.
|
2119
2120
|
*
|
2120
|
-
* The `callback` function is called with two arguments: `err` and `derivedKey
|
2121
|
+
* The `callback` function is called with two arguments: `err` and `derivedKey`. `err` is an exception object when key derivation fails, otherwise `err` is `null`. `derivedKey` is passed to the
|
2121
2122
|
* callback as a `Buffer`.
|
2122
2123
|
*
|
2123
2124
|
* An exception is thrown when any of the input arguments specify invalid values
|
@@ -2203,8 +2204,8 @@ declare module "crypto" {
|
|
2203
2204
|
* Encrypts the content of `buffer` with `key` and returns a new `Buffer` with encrypted content. The returned data can be decrypted using
|
2204
2205
|
* the corresponding private key, for example using {@link privateDecrypt}.
|
2205
2206
|
*
|
2206
|
-
* If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an
|
2207
|
-
* object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`.
|
2207
|
+
* If `key` is not a `KeyObject`, this function behaves as if `key` had been passed to {@link createPublicKey}. If it is an
|
2208
|
+
* object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_OAEP_PADDING`.
|
2208
2209
|
*
|
2209
2210
|
* Because RSA public keys can be derived from private keys, a private key may
|
2210
2211
|
* be passed instead of a public key.
|
@@ -2215,8 +2216,8 @@ declare module "crypto" {
|
|
2215
2216
|
* Decrypts `buffer` with `key`.`buffer` was previously encrypted using
|
2216
2217
|
* the corresponding private key, for example using {@link privateEncrypt}.
|
2217
2218
|
*
|
2218
|
-
* If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an
|
2219
|
-
* object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`.
|
2219
|
+
* If `key` is not a `KeyObject`, this function behaves as if `key` had been passed to {@link createPublicKey}. If it is an
|
2220
|
+
* object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_PADDING`.
|
2220
2221
|
*
|
2221
2222
|
* Because RSA public keys can be derived from private keys, a private key may
|
2222
2223
|
* be passed instead of a public key.
|
@@ -2227,8 +2228,8 @@ declare module "crypto" {
|
|
2227
2228
|
* Decrypts `buffer` with `privateKey`. `buffer` was previously encrypted using
|
2228
2229
|
* the corresponding public key, for example using {@link publicEncrypt}.
|
2229
2230
|
*
|
2230
|
-
* If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an
|
2231
|
-
* object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`.
|
2231
|
+
* If `privateKey` is not a `KeyObject`, this function behaves as if `privateKey` had been passed to {@link createPrivateKey}. If it is an
|
2232
|
+
* object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_OAEP_PADDING`.
|
2232
2233
|
* @since v0.11.14
|
2233
2234
|
*/
|
2234
2235
|
function privateDecrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
|
@@ -2236,8 +2237,8 @@ declare module "crypto" {
|
|
2236
2237
|
* Encrypts `buffer` with `privateKey`. The returned data can be decrypted using
|
2237
2238
|
* the corresponding public key, for example using {@link publicDecrypt}.
|
2238
2239
|
*
|
2239
|
-
* If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an
|
2240
|
-
* object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`.
|
2240
|
+
* If `privateKey` is not a `KeyObject`, this function behaves as if `privateKey` had been passed to {@link createPrivateKey}. If it is an
|
2241
|
+
* object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_PADDING`.
|
2241
2242
|
* @since v1.1.0
|
2242
2243
|
*/
|
2243
2244
|
function privateEncrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
|
@@ -2332,9 +2333,9 @@ declare module "crypto" {
|
|
2332
2333
|
* On recent OpenSSL releases, `openssl ecparam -list_curves` will also display
|
2333
2334
|
* the name and description of each available elliptic curve.
|
2334
2335
|
*
|
2335
|
-
* If `format` is not specified the point will be returned in `'uncompressed'`format.
|
2336
|
+
* If `format` is not specified the point will be returned in `'uncompressed'` format.
|
2336
2337
|
*
|
2337
|
-
* If the `inputEncoding` is not provided, `key` is expected to be a `Buffer
|
2338
|
+
* If the `inputEncoding` is not provided, `key` is expected to be a `Buffer`, `TypedArray`, or `DataView`.
|
2338
2339
|
*
|
2339
2340
|
* Example (uncompressing a key):
|
2340
2341
|
*
|
@@ -2375,7 +2376,7 @@ declare module "crypto" {
|
|
2375
2376
|
* the public key in the specified `format` and `encoding`. This key should be
|
2376
2377
|
* transferred to the other party.
|
2377
2378
|
*
|
2378
|
-
* The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified, the point will be returned in`'uncompressed'` format.
|
2379
|
+
* The `format` argument specifies point encoding and can be `'compressed'` or `'uncompressed'`. If `format` is not specified, the point will be returned in`'uncompressed'` format.
|
2379
2380
|
*
|
2380
2381
|
* If `encoding` is provided a string is returned; otherwise a `Buffer` is returned.
|
2381
2382
|
* @since v0.11.14
|
@@ -2390,11 +2391,11 @@ declare module "crypto" {
|
|
2390
2391
|
* key is interpreted using specified `inputEncoding`, and the returned secret
|
2391
2392
|
* is encoded using the specified `outputEncoding`.
|
2392
2393
|
* If the `inputEncoding` is not
|
2393
|
-
* provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or`DataView`.
|
2394
|
+
* provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or `DataView`.
|
2394
2395
|
*
|
2395
2396
|
* If `outputEncoding` is given a string will be returned; otherwise a `Buffer` is returned.
|
2396
2397
|
*
|
2397
|
-
* `ecdh.computeSecret` will throw an`ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY` error when `otherPublicKey`lies outside of the elliptic curve. Since `otherPublicKey` is
|
2398
|
+
* `ecdh.computeSecret` will throw an`ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY` error when `otherPublicKey` lies outside of the elliptic curve. Since `otherPublicKey` is
|
2398
2399
|
* usually supplied from a remote user over an insecure network,
|
2399
2400
|
* be sure to handle this exception accordingly.
|
2400
2401
|
* @since v0.11.14
|
@@ -2419,7 +2420,7 @@ declare module "crypto" {
|
|
2419
2420
|
getPrivateKey(): Buffer;
|
2420
2421
|
getPrivateKey(encoding: BinaryToTextEncoding): string;
|
2421
2422
|
/**
|
2422
|
-
* The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified the point will be returned in`'uncompressed'` format.
|
2423
|
+
* The `format` argument specifies point encoding and can be `'compressed'` or `'uncompressed'`. If `format` is not specified the point will be returned in`'uncompressed'` format.
|
2423
2424
|
*
|
2424
2425
|
* If `encoding` is specified, a string is returned; otherwise a `Buffer` is
|
2425
2426
|
* returned.
|
@@ -2433,7 +2434,7 @@ declare module "crypto" {
|
|
2433
2434
|
/**
|
2434
2435
|
* Sets the EC Diffie-Hellman private key.
|
2435
2436
|
* If `encoding` is provided, `privateKey` is expected
|
2436
|
-
* to be a string; otherwise `privateKey` is expected to be a `Buffer
|
2437
|
+
* to be a string; otherwise `privateKey` is expected to be a `Buffer`, `TypedArray`, or `DataView`.
|
2437
2438
|
*
|
2438
2439
|
* If `privateKey` is not valid for the curve specified when the `ECDH` object was
|
2439
2440
|
* created, an error is thrown. Upon setting the private key, the associated
|
@@ -2453,7 +2454,7 @@ declare module "crypto" {
|
|
2453
2454
|
*/
|
2454
2455
|
function createECDH(curveName: string): ECDH;
|
2455
2456
|
/**
|
2456
|
-
* This function compares the underlying bytes that represent the given`ArrayBuffer`, `TypedArray`, or `DataView` instances using a constant-time
|
2457
|
+
* This function compares the underlying bytes that represent the given `ArrayBuffer`, `TypedArray`, or `DataView` instances using a constant-time
|
2457
2458
|
* algorithm.
|
2458
2459
|
*
|
2459
2460
|
* This function does not leak timing information that
|
@@ -2468,8 +2469,8 @@ declare module "crypto" {
|
|
2468
2469
|
* entry, such as `Uint16Array`, the result will be computed using the platform
|
2469
2470
|
* byte order.
|
2470
2471
|
*
|
2471
|
-
* **When both of the inputs are `Float32Array`s or`Float64Array`s, this function might return unexpected results due to IEEE 754**
|
2472
|
-
* **encoding of floating-point numbers. In particular, neither `x === y` nor`Object.is(x, y)` implies that the byte representations of two floating-point**
|
2472
|
+
* **When both of the inputs are `Float32Array`s or `Float64Array`s, this function might return unexpected results due to IEEE 754**
|
2473
|
+
* **encoding of floating-point numbers. In particular, neither `x === y` nor `Object.is(x, y)` implies that the byte representations of two floating-point**
|
2473
2474
|
* **numbers `x` and `y` are equal.**
|
2474
2475
|
*
|
2475
2476
|
* Use of `crypto.timingSafeEqual` does not guarantee that the _surrounding_ code
|
@@ -2846,7 +2847,7 @@ declare module "crypto" {
|
|
2846
2847
|
* behaves as if `keyObject.export()` had been called on its result. Otherwise,
|
2847
2848
|
* the respective part of the key is returned as a `KeyObject`.
|
2848
2849
|
*
|
2849
|
-
* It is recommended to encode public keys as `'spki'` and private keys as`'pkcs8'` with encryption for long-term storage:
|
2850
|
+
* It is recommended to encode public keys as `'spki'` and private keys as `'pkcs8'` with encryption for long-term storage:
|
2850
2851
|
*
|
2851
2852
|
* ```js
|
2852
2853
|
* const {
|
@@ -3374,7 +3375,7 @@ declare module "crypto" {
|
|
3374
3375
|
): void;
|
3375
3376
|
/**
|
3376
3377
|
* Computes the Diffie-Hellman secret based on a `privateKey` and a `publicKey`.
|
3377
|
-
* Both keys must have the same `asymmetricKeyType`, which must be one of `'dh'`(for Diffie-Hellman), `'ec'` (for ECDH), `'x448'`, or `'x25519'` (for ECDH-ES).
|
3378
|
+
* Both keys must have the same `asymmetricKeyType`, which must be one of `'dh'` (for Diffie-Hellman), `'ec'` (for ECDH), `'x448'`, or `'x25519'` (for ECDH-ES).
|
3378
3379
|
* @since v13.9.0, v12.17.0
|
3379
3380
|
*/
|
3380
3381
|
function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): Buffer;
|
@@ -3465,9 +3466,9 @@ declare module "crypto" {
|
|
3465
3466
|
*/
|
3466
3467
|
function getCipherInfo(nameOrNid: string | number, options?: CipherInfoOptions): CipherInfo | undefined;
|
3467
3468
|
/**
|
3468
|
-
* HKDF is a simple key derivation function defined in RFC 5869\. The given `ikm
|
3469
|
+
* HKDF is a simple key derivation function defined in RFC 5869\. The given `ikm`, `salt` and `info` are used with the `digest` to derive a key of `keylen` bytes.
|
3469
3470
|
*
|
3470
|
-
* The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an errors occurs while deriving the key, `err` will be set;
|
3471
|
+
* The supplied `callback` function is called with two arguments: `err` and `derivedKey`. If an errors occurs while deriving the key, `err` will be set;
|
3471
3472
|
* otherwise `err` will be `null`. The successfully generated `derivedKey` will
|
3472
3473
|
* 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
|
3473
3474
|
* of the input arguments specify invalid values or types.
|
@@ -3501,7 +3502,7 @@ declare module "crypto" {
|
|
3501
3502
|
): void;
|
3502
3503
|
/**
|
3503
3504
|
* Provides a synchronous HKDF key derivation function as defined in RFC 5869\. The
|
3504
|
-
* given `ikm`, `salt` and `info` are used with the `digest` to derive a key of`keylen` bytes.
|
3505
|
+
* given `ikm`, `salt` and `info` are used with the `digest` to derive a key of `keylen` bytes.
|
3505
3506
|
*
|
3506
3507
|
* The successfully generated `derivedKey` will be returned as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer).
|
3507
3508
|
*
|
@@ -3830,7 +3831,7 @@ declare module "crypto" {
|
|
3830
3831
|
/**
|
3831
3832
|
* Generates a pseudorandom prime of `size` bits.
|
3832
3833
|
*
|
3833
|
-
* If `options.safe` is `true`, the prime will be a safe prime -- that is
|
3834
|
+
* If `options.safe` is `true`, the prime will be a safe prime -- that is, `(prime - 1) / 2` will also be a prime.
|
3834
3835
|
*
|
3835
3836
|
* The `options.add` and `options.rem` parameters can be used to enforce additional
|
3836
3837
|
* requirements, e.g., for Diffie-Hellman:
|
@@ -3846,7 +3847,7 @@ declare module "crypto" {
|
|
3846
3847
|
* * `options.rem` is ignored if `options.add` is not given.
|
3847
3848
|
*
|
3848
3849
|
* Both `options.add` and `options.rem` must be encoded as big-endian sequences
|
3849
|
-
* if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`.
|
3850
|
+
* if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or `DataView`.
|
3850
3851
|
*
|
3851
3852
|
* By default, the prime is encoded as a big-endian sequence of octets
|
3852
3853
|
* in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a
|
@@ -3873,7 +3874,7 @@ declare module "crypto" {
|
|
3873
3874
|
/**
|
3874
3875
|
* Generates a pseudorandom prime of `size` bits.
|
3875
3876
|
*
|
3876
|
-
* If `options.safe` is `true`, the prime will be a safe prime -- that is
|
3877
|
+
* If `options.safe` is `true`, the prime will be a safe prime -- that is, `(prime - 1) / 2` will also be a prime.
|
3877
3878
|
*
|
3878
3879
|
* The `options.add` and `options.rem` parameters can be used to enforce additional
|
3879
3880
|
* requirements, e.g., for Diffie-Hellman:
|
@@ -3889,7 +3890,7 @@ declare module "crypto" {
|
|
3889
3890
|
* * `options.rem` is ignored if `options.add` is not given.
|
3890
3891
|
*
|
3891
3892
|
* Both `options.add` and `options.rem` must be encoded as big-endian sequences
|
3892
|
-
* if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`.
|
3893
|
+
* if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or `DataView`.
|
3893
3894
|
*
|
3894
3895
|
* By default, the prime is encoded as a big-endian sequence of octets
|
3895
3896
|
* in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a
|
@@ -3935,7 +3936,7 @@ declare module "crypto" {
|
|
3935
3936
|
*
|
3936
3937
|
* `engine` could be either an id or a path to the engine's shared library.
|
3937
3938
|
*
|
3938
|
-
* The optional `flags` argument uses `ENGINE_METHOD_ALL` by default. The `flags`is a bit field taking one of or a mix of the following flags (defined in`crypto.constants`):
|
3939
|
+
* The optional `flags` argument uses `ENGINE_METHOD_ALL` by default. The `flags` is a bit field taking one of or a mix of the following flags (defined in `crypto.constants`):
|
3939
3940
|
*
|
3940
3941
|
* * `crypto.constants.ENGINE_METHOD_RSA`
|
3941
3942
|
* * `crypto.constants.ENGINE_METHOD_DSA`
|
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/v20.
|
26
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/dgram.js)
|
27
27
|
*/
|
28
28
|
declare module "dgram" {
|
29
29
|
import { AddressInfo } from "node:net";
|
@@ -276,7 +276,7 @@ declare module "dgram" {
|
|
276
276
|
*
|
277
277
|
* The `address` argument is a string. If the value of `address` is a host name,
|
278
278
|
* DNS will be used to resolve the address of the host. If `address` is not
|
279
|
-
* provided or otherwise nullish, `'127.0.0.1'` (for `udp4` sockets) or `'::1'`(for `udp6` sockets) will be used by default.
|
279
|
+
* provided or otherwise nullish, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for `udp6` sockets) will be used by default.
|
280
280
|
*
|
281
281
|
* If the socket has not been previously bound with a call to `bind`, the socket
|
282
282
|
* is assigned a random port number and is bound to the "all interfaces" address
|
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
|
* @since v15.1.0, v14.17.0
|
23
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
23
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/diagnostics_channel.js)
|
24
24
|
*/
|
25
25
|
declare module "diagnostics_channel" {
|
26
26
|
import { AsyncLocalStorage } from "node:async_hooks";
|
@@ -419,6 +419,9 @@ declare module "diagnostics_channel" {
|
|
419
419
|
* This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all
|
420
420
|
* events should have any bound stores set to match this trace context.
|
421
421
|
*
|
422
|
+
* To ensure only correct trace graphs are formed, events will only be published if subscribers are present prior to starting the trace. Subscriptions
|
423
|
+
* which are added after the trace begins will not receive future events from that trace, only future traces will be seen.
|
424
|
+
*
|
422
425
|
* ```js
|
423
426
|
* import diagnostics_channel from 'node:diagnostics_channel';
|
424
427
|
*
|
@@ -451,6 +454,9 @@ declare module "diagnostics_channel" {
|
|
451
454
|
* returned promise rejects. This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all
|
452
455
|
* events should have any bound stores set to match this trace context.
|
453
456
|
*
|
457
|
+
* To ensure only correct trace graphs are formed, events will only be published if subscribers are present prior to starting the trace. Subscriptions
|
458
|
+
* which are added after the trace begins will not receive future events from that trace, only future traces will be seen.
|
459
|
+
*
|
454
460
|
* ```js
|
455
461
|
* import diagnostics_channel from 'node:diagnostics_channel';
|
456
462
|
*
|
@@ -502,6 +508,9 @@ declare module "diagnostics_channel" {
|
|
502
508
|
* The callback will also be run with `channel.runStores(context, ...)` which
|
503
509
|
* enables context loss recovery in some cases.
|
504
510
|
*
|
511
|
+
* To ensure only correct trace graphs are formed, events will only be published if subscribers are present prior to starting the trace. Subscriptions
|
512
|
+
* which are added after the trace begins will not receive future events from that trace, only future traces will be seen.
|
513
|
+
*
|
505
514
|
* ```js
|
506
515
|
* import diagnostics_channel from 'node:diagnostics_channel';
|
507
516
|
* import { AsyncLocalStorage } from 'node:async_hooks';
|
node/dns/promises.d.ts
CHANGED
@@ -338,7 +338,7 @@ declare module "dns/promises" {
|
|
338
338
|
* progress.
|
339
339
|
*
|
340
340
|
* This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html).
|
341
|
-
* 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
|
341
|
+
* 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
|
342
342
|
* subsequent servers provided. Fallback DNS servers will only be used if the
|
343
343
|
* earlier ones time out or result in some other error.
|
344
344
|
* @since v10.6.0
|
@@ -346,19 +346,20 @@ declare module "dns/promises" {
|
|
346
346
|
*/
|
347
347
|
function setServers(servers: readonly string[]): void;
|
348
348
|
/**
|
349
|
-
* Set the default value of `
|
349
|
+
* Set the default value of `order` in `dns.lookup()` and `{@link lookup}`. The value could be:
|
350
350
|
*
|
351
|
-
* * `ipv4first`: sets default `
|
352
|
-
* * `
|
351
|
+
* * `ipv4first`: sets default `order` to `ipv4first`.
|
352
|
+
* * `ipv6first`: sets default `order` to `ipv6first`.
|
353
|
+
* * `verbatim`: sets default `order` to `verbatim`.
|
353
354
|
*
|
354
355
|
* The default is `verbatim` and [dnsPromises.setDefaultResultOrder()](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetdefaultresultorderorder)
|
355
356
|
* have higher priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder).
|
356
357
|
* When using [worker threads](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html), [`dnsPromises.setDefaultResultOrder()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetdefaultresultorderorder)
|
357
358
|
* from the main thread won't affect the default dns orders in workers.
|
358
359
|
* @since v16.4.0, v14.18.0
|
359
|
-
* @param order must be `'ipv4first'` or `'verbatim'`.
|
360
|
+
* @param order must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`.
|
360
361
|
*/
|
361
|
-
function setDefaultResultOrder(order: "ipv4first" | "verbatim"): void;
|
362
|
+
function setDefaultResultOrder(order: "ipv4first" | "ipv6first" | "verbatim"): void;
|
362
363
|
const NODATA: "NODATA";
|
363
364
|
const FORMERR: "FORMERR";
|
364
365
|
const SERVFAIL: "SERVFAIL";
|
node/dns.d.ts
CHANGED
@@ -42,7 +42,7 @@
|
|
42
42
|
* ```
|
43
43
|
*
|
44
44
|
* See the [Implementation considerations section](https://nodejs.org/docs/latest-v20.x/api/dns.html#implementation-considerations) for more information.
|
45
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
45
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/dns.js)
|
46
46
|
*/
|
47
47
|
declare module "dns" {
|
48
48
|
import * as dnsPromises from "node:dns/promises";
|
@@ -64,7 +64,7 @@ declare module "dns" {
|
|
64
64
|
export const ALL: number;
|
65
65
|
export interface LookupOptions {
|
66
66
|
/**
|
67
|
-
* The record family. Must be `4`, `6`, or `0`. For backward compatibility reasons
|
67
|
+
* The record family. Must be `4`, `6`, or `0`. For backward compatibility reasons, `'IPv4'` and `'IPv6'` are interpreted
|
68
68
|
* as `4` and `6` respectively. The value 0 indicates that either an IPv4 or IPv6 address is returned. If the value `0` is used
|
69
69
|
* with `{ all: true } (see below)`, both IPv4 and IPv6 addresses are returned.
|
70
70
|
* @default 0
|
@@ -80,9 +80,18 @@ declare module "dns" {
|
|
80
80
|
* @default false
|
81
81
|
*/
|
82
82
|
all?: boolean | undefined;
|
83
|
+
/**
|
84
|
+
* When `verbatim`, the resolved addresses are return unsorted. When `ipv4first`, the resolved addresses are sorted
|
85
|
+
* by placing IPv4 addresses before IPv6 addresses. When `ipv6first`, the resolved addresses are sorted by placing IPv6
|
86
|
+
* addresses before IPv4 addresses. Default value is configurable using
|
87
|
+
* {@link setDefaultResultOrder} or [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder).
|
88
|
+
* @default `verbatim` (addresses are not reordered)
|
89
|
+
*/
|
90
|
+
order?: "ipv4first" | "ipv6first" | "verbatim" | undefined;
|
83
91
|
/**
|
84
92
|
* When `true`, the callback receives IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `false`, IPv4
|
85
|
-
* addresses are placed before IPv6 addresses.
|
93
|
+
* addresses are placed before IPv6 addresses. This option will be deprecated in favor of `order`. When both are specified,
|
94
|
+
* `order` has higher precedence. New code should only use `order`. Default value is configurable using {@link setDefaultResultOrder}
|
86
95
|
* or [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder).
|
87
96
|
* @default true (addresses are not reordered)
|
88
97
|
*/
|
@@ -663,14 +672,15 @@ declare module "dns" {
|
|
663
672
|
callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void,
|
664
673
|
): void;
|
665
674
|
/**
|
666
|
-
* Get the default value for `
|
675
|
+
* Get the default value for `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options).
|
667
676
|
* The value could be:
|
668
677
|
*
|
669
|
-
* * `ipv4first`: for `
|
670
|
-
* * `
|
678
|
+
* * `ipv4first`: for `order` defaulting to `ipv4first`.
|
679
|
+
* * `ipv6first`: for `order` defaulting to `ipv6first`.
|
680
|
+
* * `verbatim`: for `order` defaulting to `verbatim`.
|
671
681
|
* @since v18.17.0
|
672
682
|
*/
|
673
|
-
export function getDefaultResultOrder(): "ipv4first" | "verbatim";
|
683
|
+
export function getDefaultResultOrder(): "ipv4first" | "ipv6first" | "verbatim";
|
674
684
|
/**
|
675
685
|
* Sets the IP address and port of servers to be used when performing DNS
|
676
686
|
* resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted
|
@@ -717,20 +727,21 @@ declare module "dns" {
|
|
717
727
|
*/
|
718
728
|
export function getServers(): string[];
|
719
729
|
/**
|
720
|
-
* Set the default value of `
|
730
|
+
* Set the default value of `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options).
|
721
731
|
* The value could be:
|
722
732
|
*
|
723
|
-
* * `ipv4first`: sets default `
|
724
|
-
* * `
|
733
|
+
* * `ipv4first`: sets default `order` to `ipv4first`.
|
734
|
+
* * `ipv6first`: sets default `order` to `ipv6first`.
|
735
|
+
* * `verbatim`: sets default `order` to `verbatim`.
|
725
736
|
*
|
726
737
|
* The default is `verbatim` and {@link setDefaultResultOrder} have higher
|
727
738
|
* priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder). When using
|
728
739
|
* [worker threads](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html), {@link setDefaultResultOrder} from the main
|
729
740
|
* thread won't affect the default dns orders in workers.
|
730
741
|
* @since v16.4.0, v14.18.0
|
731
|
-
* @param order must be `'ipv4first'` or `'verbatim'`.
|
742
|
+
* @param order must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`.
|
732
743
|
*/
|
733
|
-
export function setDefaultResultOrder(order: "ipv4first" | "verbatim"): void;
|
744
|
+
export function setDefaultResultOrder(order: "ipv4first" | "ipv6first" | "verbatim"): void;
|
734
745
|
// Error codes
|
735
746
|
export const NODATA: "NODATA";
|
736
747
|
export const FORMERR: "FORMERR";
|
node/domain.d.ts
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
* will be notified, rather than losing the context of the error in the `process.on('uncaughtException')` handler, or causing the program to
|
13
13
|
* exit immediately with an error code.
|
14
14
|
* @deprecated Since v1.4.2 - Deprecated
|
15
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
15
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/domain.js)
|
16
16
|
*/
|
17
17
|
declare module "domain" {
|
18
18
|
import EventEmitter = require("node:events");
|