@types/node 22.16.0 → 24.0.1
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 v22.16/README.md → node/README.md +2 -2
- node v22.16/assert.d.ts → node/assert.d.ts +5 -5
- node v22.16/async_hooks.d.ts → node/async_hooks.d.ts +25 -5
- node v22.16/buffer.d.ts → node/buffer.d.ts +1 -4
- node v22.16/child_process.d.ts → node/child_process.d.ts +2 -2
- node v22.16/cluster.d.ts → node/cluster.d.ts +15 -15
- node v22.16/compatibility/iterators.d.ts → node/compatibility/iterators.d.ts +1 -0
- node v22.16/console.d.ts → node/console.d.ts +17 -17
- node v22.16/crypto.d.ts → node/crypto.d.ts +35 -28
- node v22.16/dgram.d.ts → node/dgram.d.ts +1 -1
- node v22.16/diagnostics_channel.d.ts → node/diagnostics_channel.d.ts +1 -1
- node v22.16/dns/promises.d.ts → node/dns/promises.d.ts +1 -27
- node v22.16/dns.d.ts → node/dns.d.ts +18 -72
- node v22.16/domain.d.ts → node/domain.d.ts +1 -1
- node v22.16/events.d.ts → node/events.d.ts +1 -1
- node v22.16/fs/promises.d.ts → node/fs/promises.d.ts +18 -12
- node v22.16/fs.d.ts → node/fs.d.ts +29 -20
- node v22.16/globals.d.ts → node/globals.d.ts +7 -4
- node v22.16/globals.typedarray.d.ts → node/globals.typedarray.d.ts +1 -0
- node v22.16/http.d.ts → node/http.d.ts +3 -80
- node v22.16/http2.d.ts → node/http2.d.ts +6 -3
- node v22.16/https.d.ts → node/https.d.ts +1 -1
- node v22.16/index.d.ts → node/index.d.ts +7 -5
- node v22.16/inspector.d.ts → node/inspector.d.ts +3 -7
- node v22.16/module.d.ts → node/module.d.ts +18 -63
- node v22.16/net.d.ts → node/net.d.ts +2 -5
- node v22.16/os.d.ts → node/os.d.ts +8 -7
- node v22.16/package.json → node/package.json +13 -3
- node v22.16/path.d.ts → node/path.d.ts +1 -1
- node v22.16/perf_hooks.d.ts → node/perf_hooks.d.ts +8 -8
- node v22.16/process.d.ts → node/process.d.ts +21 -9
- node v22.16/punycode.d.ts → node/punycode.d.ts +1 -1
- node v22.16/querystring.d.ts → node/querystring.d.ts +1 -1
- node v22.16/readline/promises.d.ts → node/readline/promises.d.ts +0 -1
- node v22.16/readline.d.ts → node/readline.d.ts +13 -13
- node v22.16/repl.d.ts → node/repl.d.ts +12 -12
- node v22.16/sea.d.ts → node/sea.d.ts +1 -1
- node v22.16/sqlite.d.ts → node/sqlite.d.ts +15 -7
- node v22.16/stream/web.d.ts → node/stream/web.d.ts +0 -4
- node v22.16/stream.d.ts → node/stream.d.ts +8 -19
- node v22.16/string_decoder.d.ts → node/string_decoder.d.ts +1 -1
- node/test.d.ts +2318 -0
- node v22.16/timers/promises.d.ts → node/timers/promises.d.ts +1 -1
- node v22.16/timers.d.ts → node/timers.d.ts +1 -1
- node v22.16/tls.d.ts → node/tls.d.ts +2 -48
- node v22.16/trace_events.d.ts → node/trace_events.d.ts +6 -6
- node v22.16/compatibility/disposable.d.ts → node/ts5.1/compatibility/disposable.d.ts +0 -2
- node/ts5.1/index.d.ts +98 -0
- node/ts5.6/compatibility/float16array.d.ts +71 -0
- node v22.16/ts5.6/globals.typedarray.d.ts → node/ts5.6/globals.typedarray.d.ts +1 -0
- node v22.16/ts5.6/index.d.ts → node/ts5.6/index.d.ts +9 -5
- node/ts5.7/compatibility/float16array.d.ts +72 -0
- node/ts5.7/index.d.ts +96 -0
- node v22.16/tty.d.ts → node/tty.d.ts +1 -1
- node v22.16/url.d.ts → node/url.d.ts +61 -19
- node v22.16/util.d.ts → node/util.d.ts +7 -298
- node v22.16/v8.d.ts → node/v8.d.ts +29 -65
- node v22.16/vm.d.ts → node/vm.d.ts +17 -10
- node v22.16/wasi.d.ts → node/wasi.d.ts +1 -1
- node v22.16/worker_threads.d.ts → node/worker_threads.d.ts +8 -2
- node v22.16/zlib.d.ts → node/zlib.d.ts +5 -7
- node v22.16/compatibility/index.d.ts +0 -9
- node v22.16/compatibility/indexable.d.ts +0 -20
- node v22.16/test.d.ts +0 -2175
- {node v22.16 → node}/LICENSE +0 -0
- {node v22.16 → node}/assert/strict.d.ts +0 -0
- {node v22.16 → node}/buffer.buffer.d.ts +0 -0
- {node v22.16 → node}/constants.d.ts +0 -0
- {node v22.16 → node}/dom-events.d.ts +0 -0
- {node v22.16 → node}/stream/consumers.d.ts +0 -0
- {node v22.16 → node}/stream/promises.d.ts +0 -0
- {node v22.16 → node}/ts5.6/buffer.buffer.d.ts +0 -0
@@ -14,7 +14,7 @@
|
|
14
14
|
* // Prints:
|
15
15
|
* // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e
|
16
16
|
* ```
|
17
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
17
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/crypto.js)
|
18
18
|
*/
|
19
19
|
declare module "crypto" {
|
20
20
|
import * as stream from "node:stream";
|
@@ -96,7 +96,7 @@ declare module "crypto" {
|
|
96
96
|
verifySpkac(spkac: NodeJS.ArrayBufferView): boolean;
|
97
97
|
}
|
98
98
|
namespace constants {
|
99
|
-
// https://nodejs.org/dist/latest-
|
99
|
+
// https://nodejs.org/dist/latest-v24.x/docs/api/crypto.html#crypto-constants
|
100
100
|
const OPENSSL_VERSION_NUMBER: number;
|
101
101
|
/** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */
|
102
102
|
const SSL_OP_ALL: number;
|
@@ -760,9 +760,9 @@ declare module "crypto" {
|
|
760
760
|
key: CipherKey,
|
761
761
|
iv: BinaryLike | null,
|
762
762
|
options?: stream.TransformOptions,
|
763
|
-
):
|
763
|
+
): Cipheriv;
|
764
764
|
/**
|
765
|
-
* Instances of the `
|
765
|
+
* Instances of the `Cipheriv` class are used to encrypt data. The class can be
|
766
766
|
* used in one of two ways:
|
767
767
|
*
|
768
768
|
* * As a `stream` that is both readable and writable, where plain unencrypted
|
@@ -771,10 +771,10 @@ declare module "crypto" {
|
|
771
771
|
* the encrypted data.
|
772
772
|
*
|
773
773
|
* The {@link createCipheriv} method is
|
774
|
-
* used to create `
|
774
|
+
* used to create `Cipheriv` instances. `Cipheriv` objects are not to be created
|
775
775
|
* directly using the `new` keyword.
|
776
776
|
*
|
777
|
-
* Example: Using `
|
777
|
+
* Example: Using `Cipheriv` objects as streams:
|
778
778
|
*
|
779
779
|
* ```js
|
780
780
|
* const {
|
@@ -809,7 +809,7 @@ declare module "crypto" {
|
|
809
809
|
* });
|
810
810
|
* ```
|
811
811
|
*
|
812
|
-
* Example: Using `
|
812
|
+
* Example: Using `Cipheriv` and piped streams:
|
813
813
|
*
|
814
814
|
* ```js
|
815
815
|
* import {
|
@@ -880,7 +880,7 @@ declare module "crypto" {
|
|
880
880
|
* ```
|
881
881
|
* @since v0.1.94
|
882
882
|
*/
|
883
|
-
class
|
883
|
+
class Cipheriv extends stream.Transform {
|
884
884
|
private constructor();
|
885
885
|
/**
|
886
886
|
* Updates the cipher with `data`. If the `inputEncoding` argument is given,
|
@@ -901,7 +901,7 @@ declare module "crypto" {
|
|
901
901
|
update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string;
|
902
902
|
update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string;
|
903
903
|
/**
|
904
|
-
* Once the `cipher.final()` method has been called, the `
|
904
|
+
* Once the `cipher.final()` method has been called, the `Cipheriv` object can no
|
905
905
|
* longer be used to encrypt data. Attempts to call `cipher.final()` more than
|
906
906
|
* once will result in an error being thrown.
|
907
907
|
* @since v0.1.94
|
@@ -911,7 +911,7 @@ declare module "crypto" {
|
|
911
911
|
final(): Buffer;
|
912
912
|
final(outputEncoding: BufferEncoding): string;
|
913
913
|
/**
|
914
|
-
* When using block encryption algorithms, the `
|
914
|
+
* When using block encryption algorithms, the `Cipheriv` class will automatically
|
915
915
|
* add padding to the input data to the appropriate block size. To disable the
|
916
916
|
* default padding call `cipher.setAutoPadding(false)`.
|
917
917
|
*
|
@@ -927,7 +927,7 @@ declare module "crypto" {
|
|
927
927
|
*/
|
928
928
|
setAutoPadding(autoPadding?: boolean): this;
|
929
929
|
}
|
930
|
-
interface CipherCCM extends
|
930
|
+
interface CipherCCM extends Cipheriv {
|
931
931
|
setAAD(
|
932
932
|
buffer: NodeJS.ArrayBufferView,
|
933
933
|
options: {
|
@@ -936,7 +936,7 @@ declare module "crypto" {
|
|
936
936
|
): this;
|
937
937
|
getAuthTag(): Buffer;
|
938
938
|
}
|
939
|
-
interface CipherGCM extends
|
939
|
+
interface CipherGCM extends Cipheriv {
|
940
940
|
setAAD(
|
941
941
|
buffer: NodeJS.ArrayBufferView,
|
942
942
|
options?: {
|
@@ -945,7 +945,7 @@ declare module "crypto" {
|
|
945
945
|
): this;
|
946
946
|
getAuthTag(): Buffer;
|
947
947
|
}
|
948
|
-
interface CipherOCB extends
|
948
|
+
interface CipherOCB extends Cipheriv {
|
949
949
|
setAAD(
|
950
950
|
buffer: NodeJS.ArrayBufferView,
|
951
951
|
options?: {
|
@@ -954,7 +954,7 @@ declare module "crypto" {
|
|
954
954
|
): this;
|
955
955
|
getAuthTag(): Buffer;
|
956
956
|
}
|
957
|
-
interface CipherChaCha20Poly1305 extends
|
957
|
+
interface CipherChaCha20Poly1305 extends Cipheriv {
|
958
958
|
setAAD(
|
959
959
|
buffer: NodeJS.ArrayBufferView,
|
960
960
|
options: {
|
@@ -964,7 +964,7 @@ declare module "crypto" {
|
|
964
964
|
getAuthTag(): Buffer;
|
965
965
|
}
|
966
966
|
/**
|
967
|
-
* Creates and returns a `
|
967
|
+
* Creates and returns a `Decipheriv` object that uses the given `algorithm`, `key` and initialization vector (`iv`).
|
968
968
|
*
|
969
969
|
* The `options` argument controls stream behavior and is optional except when a
|
970
970
|
* 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
|
@@ -1021,9 +1021,9 @@ declare module "crypto" {
|
|
1021
1021
|
key: CipherKey,
|
1022
1022
|
iv: BinaryLike | null,
|
1023
1023
|
options?: stream.TransformOptions,
|
1024
|
-
):
|
1024
|
+
): Decipheriv;
|
1025
1025
|
/**
|
1026
|
-
* Instances of the `
|
1026
|
+
* Instances of the `Decipheriv` class are used to decrypt data. The class can be
|
1027
1027
|
* used in one of two ways:
|
1028
1028
|
*
|
1029
1029
|
* * As a `stream` that is both readable and writable, where plain encrypted
|
@@ -1032,10 +1032,10 @@ declare module "crypto" {
|
|
1032
1032
|
* produce the unencrypted data.
|
1033
1033
|
*
|
1034
1034
|
* The {@link createDecipheriv} method is
|
1035
|
-
* used to create `
|
1035
|
+
* used to create `Decipheriv` instances. `Decipheriv` objects are not to be created
|
1036
1036
|
* directly using the `new` keyword.
|
1037
1037
|
*
|
1038
|
-
* Example: Using `
|
1038
|
+
* Example: Using `Decipheriv` objects as streams:
|
1039
1039
|
*
|
1040
1040
|
* ```js
|
1041
1041
|
* import { Buffer } from 'node:buffer';
|
@@ -1074,7 +1074,7 @@ declare module "crypto" {
|
|
1074
1074
|
* decipher.end();
|
1075
1075
|
* ```
|
1076
1076
|
*
|
1077
|
-
* Example: Using `
|
1077
|
+
* Example: Using `Decipheriv` and piped streams:
|
1078
1078
|
*
|
1079
1079
|
* ```js
|
1080
1080
|
* import {
|
@@ -1130,7 +1130,7 @@ declare module "crypto" {
|
|
1130
1130
|
* ```
|
1131
1131
|
* @since v0.1.94
|
1132
1132
|
*/
|
1133
|
-
class
|
1133
|
+
class Decipheriv extends stream.Transform {
|
1134
1134
|
private constructor();
|
1135
1135
|
/**
|
1136
1136
|
* Updates the decipher with `data`. If the `inputEncoding` argument is given,
|
@@ -1151,7 +1151,7 @@ declare module "crypto" {
|
|
1151
1151
|
update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string;
|
1152
1152
|
update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string;
|
1153
1153
|
/**
|
1154
|
-
* Once the `decipher.final()` method has been called, the `
|
1154
|
+
* Once the `decipher.final()` method has been called, the `Decipheriv` object can
|
1155
1155
|
* no longer be used to decrypt data. Attempts to call `decipher.final()` more
|
1156
1156
|
* than once will result in an error being thrown.
|
1157
1157
|
* @since v0.1.94
|
@@ -1174,7 +1174,7 @@ declare module "crypto" {
|
|
1174
1174
|
*/
|
1175
1175
|
setAutoPadding(auto_padding?: boolean): this;
|
1176
1176
|
}
|
1177
|
-
interface DecipherCCM extends
|
1177
|
+
interface DecipherCCM extends Decipheriv {
|
1178
1178
|
setAuthTag(buffer: NodeJS.ArrayBufferView): this;
|
1179
1179
|
setAAD(
|
1180
1180
|
buffer: NodeJS.ArrayBufferView,
|
@@ -1183,7 +1183,7 @@ declare module "crypto" {
|
|
1183
1183
|
},
|
1184
1184
|
): this;
|
1185
1185
|
}
|
1186
|
-
interface DecipherGCM extends
|
1186
|
+
interface DecipherGCM extends Decipheriv {
|
1187
1187
|
setAuthTag(buffer: NodeJS.ArrayBufferView): this;
|
1188
1188
|
setAAD(
|
1189
1189
|
buffer: NodeJS.ArrayBufferView,
|
@@ -1192,7 +1192,7 @@ declare module "crypto" {
|
|
1192
1192
|
},
|
1193
1193
|
): this;
|
1194
1194
|
}
|
1195
|
-
interface DecipherOCB extends
|
1195
|
+
interface DecipherOCB extends Decipheriv {
|
1196
1196
|
setAuthTag(buffer: NodeJS.ArrayBufferView): this;
|
1197
1197
|
setAAD(
|
1198
1198
|
buffer: NodeJS.ArrayBufferView,
|
@@ -1201,7 +1201,7 @@ declare module "crypto" {
|
|
1201
1201
|
},
|
1202
1202
|
): this;
|
1203
1203
|
}
|
1204
|
-
interface DecipherChaCha20Poly1305 extends
|
1204
|
+
interface DecipherChaCha20Poly1305 extends Decipheriv {
|
1205
1205
|
setAuthTag(buffer: NodeJS.ArrayBufferView): this;
|
1206
1206
|
setAAD(
|
1207
1207
|
buffer: NodeJS.ArrayBufferView,
|
@@ -3352,10 +3352,17 @@ declare module "crypto" {
|
|
3352
3352
|
): void;
|
3353
3353
|
/**
|
3354
3354
|
* Computes the Diffie-Hellman secret based on a `privateKey` and a `publicKey`.
|
3355
|
-
* Both keys must have the same `asymmetricKeyType`, which must be one of `'dh'`
|
3355
|
+
* Both keys must have the same `asymmetricKeyType`, which must be one of `'dh'`
|
3356
|
+
* (for Diffie-Hellman), `'ec'`, `'x448'`, or `'x25519'` (for ECDH).
|
3357
|
+
*
|
3358
|
+
* If the `callback` function is provided this function uses libuv's threadpool.
|
3356
3359
|
* @since v13.9.0, v12.17.0
|
3357
3360
|
*/
|
3358
3361
|
function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): Buffer;
|
3362
|
+
function diffieHellman(
|
3363
|
+
options: { privateKey: KeyObject; publicKey: KeyObject },
|
3364
|
+
callback: (err: Error | null, secret: Buffer) => void,
|
3365
|
+
): void;
|
3359
3366
|
/**
|
3360
3367
|
* A utility for creating one-shot hash digests of data. It can be faster than the object-based `crypto.createHash()` when hashing a smaller amount of data
|
3361
3368
|
* (<= 5MB) that's readily available. If the data can be big or if it is streamed, it's still recommended to use `crypto.createHash()` instead. The `algorithm`
|
@@ -3382,7 +3389,7 @@ declare module "crypto" {
|
|
3382
3389
|
* @since v21.7.0, v20.12.0
|
3383
3390
|
* @param data When `data` is a string, it will be encoded as UTF-8 before being hashed. If a different input encoding is desired for a string input, user
|
3384
3391
|
* could encode the string into a `TypedArray` using either `TextEncoder` or `Buffer.from()` and passing the encoded `TypedArray` into this API instead.
|
3385
|
-
* @param [outputEncoding='hex'] [Encoding](https://nodejs.org/docs/latest-
|
3392
|
+
* @param [outputEncoding='hex'] [Encoding](https://nodejs.org/docs/latest-v24.x/api/buffer.html#buffers-and-character-encodings) used to encode the returned digest.
|
3386
3393
|
*/
|
3387
3394
|
function hash(algorithm: string, data: BinaryLike, outputEncoding?: BinaryToTextEncoding): string;
|
3388
3395
|
function hash(algorithm: string, data: BinaryLike, outputEncoding: "buffer"): Buffer;
|
@@ -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/
|
26
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/dgram.js)
|
27
27
|
*/
|
28
28
|
declare module "dgram" {
|
29
29
|
import { AddressInfo, BlockList } from "node:net";
|
@@ -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/
|
23
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/diagnostics_channel.js)
|
24
24
|
*/
|
25
25
|
declare module "diagnostics_channel" {
|
26
26
|
import { AsyncLocalStorage } from "node:async_hooks";
|
@@ -20,7 +20,6 @@ declare module "dns/promises" {
|
|
20
20
|
ResolveWithTtlOptions,
|
21
21
|
SoaRecord,
|
22
22
|
SrvRecord,
|
23
|
-
TlsaRecord,
|
24
23
|
} from "node:dns";
|
25
24
|
/**
|
26
25
|
* Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6),
|
@@ -138,14 +137,11 @@ declare module "dns/promises" {
|
|
138
137
|
function resolve(hostname: string, rrtype: "PTR"): Promise<string[]>;
|
139
138
|
function resolve(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
|
140
139
|
function resolve(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
|
141
|
-
function resolve(hostname: string, rrtype: "TLSA"): Promise<TlsaRecord[]>;
|
142
140
|
function resolve(hostname: string, rrtype: "TXT"): Promise<string[][]>;
|
143
141
|
function resolve(
|
144
142
|
hostname: string,
|
145
143
|
rrtype: string,
|
146
|
-
): Promise<
|
147
|
-
string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | TlsaRecord[] | string[][] | AnyRecord[]
|
148
|
-
>;
|
144
|
+
): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
|
149
145
|
/**
|
150
146
|
* Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the `hostname`. On success, the `Promise` is resolved with an array of IPv4
|
151
147
|
* addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
|
@@ -296,27 +292,6 @@ declare module "dns/promises" {
|
|
296
292
|
* @since v10.6.0
|
297
293
|
*/
|
298
294
|
function resolveSrv(hostname: string): Promise<SrvRecord[]>;
|
299
|
-
/**
|
300
|
-
* Uses the DNS protocol to resolve certificate associations (`TLSA` records) for
|
301
|
-
* the `hostname`. On success, the `Promise` is resolved with an array of objectsAdd commentMore actions
|
302
|
-
* with these properties:
|
303
|
-
*
|
304
|
-
* * `certUsage`
|
305
|
-
* * `selector`
|
306
|
-
* * `match`
|
307
|
-
* * `data`
|
308
|
-
*
|
309
|
-
* ```js
|
310
|
-
* {
|
311
|
-
* certUsage: 3,
|
312
|
-
* selector: 1,
|
313
|
-
* match: 1,
|
314
|
-
* data: [ArrayBuffer]
|
315
|
-
* }
|
316
|
-
* ```
|
317
|
-
* @since v22.15.0
|
318
|
-
*/
|
319
|
-
function resolveTlsa(hostname: string): Promise<TlsaRecord[]>;
|
320
295
|
/**
|
321
296
|
* Uses the DNS protocol to resolve text queries (`TXT` records) for the `hostname`. On success, the `Promise` is resolved with a two-dimensional array
|
322
297
|
* of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of
|
@@ -475,7 +450,6 @@ declare module "dns/promises" {
|
|
475
450
|
resolvePtr: typeof resolvePtr;
|
476
451
|
resolveSoa: typeof resolveSoa;
|
477
452
|
resolveSrv: typeof resolveSrv;
|
478
|
-
resolveTlsa: typeof resolveTlsa;
|
479
453
|
resolveTxt: typeof resolveTxt;
|
480
454
|
reverse: typeof reverse;
|
481
455
|
/**
|
@@ -41,8 +41,8 @@
|
|
41
41
|
* });
|
42
42
|
* ```
|
43
43
|
*
|
44
|
-
* See the [Implementation considerations section](https://nodejs.org/docs/latest-
|
45
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
44
|
+
* See the [Implementation considerations section](https://nodejs.org/docs/latest-v24.x/api/dns.html#implementation-considerations) for more information.
|
45
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/dns.js)
|
46
46
|
*/
|
47
47
|
declare module "dns" {
|
48
48
|
import * as dnsPromises from "node:dns/promises";
|
@@ -71,7 +71,7 @@ declare module "dns" {
|
|
71
71
|
*/
|
72
72
|
family?: number | "IPv4" | "IPv6" | undefined;
|
73
73
|
/**
|
74
|
-
* One or more [supported `getaddrinfo`](https://nodejs.org/docs/latest-
|
74
|
+
* One or more [supported `getaddrinfo`](https://nodejs.org/docs/latest-v24.x/api/dns.html#supported-getaddrinfo-flags) flags. Multiple flags may be
|
75
75
|
* passed by bitwise `OR`ing their values.
|
76
76
|
*/
|
77
77
|
hints?: number | undefined;
|
@@ -84,7 +84,7 @@ declare module "dns" {
|
|
84
84
|
* When `verbatim`, the resolved addresses are return unsorted. When `ipv4first`, the resolved addresses are sorted
|
85
85
|
* by placing IPv4 addresses before IPv6 addresses. When `ipv6first`, the resolved addresses are sorted by placing IPv6
|
86
86
|
* addresses before IPv4 addresses. Default value is configurable using
|
87
|
-
* {@link setDefaultResultOrder} or [`--dns-result-order`](https://nodejs.org/docs/latest-
|
87
|
+
* {@link setDefaultResultOrder} or [`--dns-result-order`](https://nodejs.org/docs/latest-v24.x/api/cli.html#--dns-result-orderorder).
|
88
88
|
* @default `verbatim` (addresses are not reordered)
|
89
89
|
* @since v22.1.0
|
90
90
|
*/
|
@@ -133,7 +133,7 @@ declare module "dns" {
|
|
133
133
|
* The implementation uses an operating system facility that can associate names
|
134
134
|
* with addresses and vice versa. This implementation can have subtle but
|
135
135
|
* important consequences on the behavior of any Node.js program. Please take some
|
136
|
-
* time to consult the [Implementation considerations section](https://nodejs.org/docs/latest-
|
136
|
+
* time to consult the [Implementation considerations section](https://nodejs.org/docs/latest-v24.x/api/dns.html#implementation-considerations)
|
137
137
|
* before using `dns.lookup()`.
|
138
138
|
*
|
139
139
|
* Example usage:
|
@@ -155,7 +155,7 @@ declare module "dns" {
|
|
155
155
|
* // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}]
|
156
156
|
* ```
|
157
157
|
*
|
158
|
-
* If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-
|
158
|
+
* If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-v24.x/api/util.html#utilpromisifyoriginal) ed
|
159
159
|
* version, and `all` is not set to `true`, it returns a `Promise` for an `Object` with `address` and `family` properties.
|
160
160
|
* @since v0.1.90
|
161
161
|
*/
|
@@ -195,7 +195,7 @@ declare module "dns" {
|
|
195
195
|
* If `address` is not a valid IP address, a `TypeError` will be thrown.
|
196
196
|
* The `port` will be coerced to a number. If it is not a legal port, a `TypeError` will be thrown.
|
197
197
|
*
|
198
|
-
* On an error, `err` is an [`Error`](https://nodejs.org/docs/latest-
|
198
|
+
* On an error, `err` is an [`Error`](https://nodejs.org/docs/latest-v24.x/api/errors.html#class-error) object,
|
199
199
|
* where `err.code` is the error code.
|
200
200
|
*
|
201
201
|
* ```js
|
@@ -206,7 +206,7 @@ declare module "dns" {
|
|
206
206
|
* });
|
207
207
|
* ```
|
208
208
|
*
|
209
|
-
* If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-
|
209
|
+
* If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-v24.x/api/util.html#utilpromisifyoriginal) ed
|
210
210
|
* version, it returns a `Promise` for an `Object` with `hostname` and `service` properties.
|
211
211
|
* @since v0.11.14
|
212
212
|
*/
|
@@ -289,15 +289,6 @@ declare module "dns" {
|
|
289
289
|
export interface AnySrvRecord extends SrvRecord {
|
290
290
|
type: "SRV";
|
291
291
|
}
|
292
|
-
export interface TlsaRecord {
|
293
|
-
certUsage: number;
|
294
|
-
selector: number;
|
295
|
-
match: number;
|
296
|
-
data: ArrayBuffer;
|
297
|
-
}
|
298
|
-
export interface AnyTlsaRecord extends TlsaRecord {
|
299
|
-
type: "TLSA";
|
300
|
-
}
|
301
292
|
export interface AnyTxtRecord {
|
302
293
|
type: "TXT";
|
303
294
|
entries: string[];
|
@@ -324,7 +315,6 @@ declare module "dns" {
|
|
324
315
|
| AnyPtrRecord
|
325
316
|
| AnySoaRecord
|
326
317
|
| AnySrvRecord
|
327
|
-
| AnyTlsaRecord
|
328
318
|
| AnyTxtRecord;
|
329
319
|
/**
|
330
320
|
* Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array
|
@@ -333,7 +323,7 @@ declare module "dns" {
|
|
333
323
|
*
|
334
324
|
* <omitted>
|
335
325
|
*
|
336
|
-
* On error, `err` is an [`Error`](https://nodejs.org/docs/latest-
|
326
|
+
* On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v24.x/api/errors.html#class-error) object,
|
337
327
|
* where `err.code` is one of the `DNS error codes`.
|
338
328
|
* @since v0.1.27
|
339
329
|
* @param hostname Host name to resolve.
|
@@ -393,11 +383,6 @@ declare module "dns" {
|
|
393
383
|
rrtype: "SRV",
|
394
384
|
callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void,
|
395
385
|
): void;
|
396
|
-
export function resolve(
|
397
|
-
hostname: string,
|
398
|
-
rrtype: "TLSA",
|
399
|
-
callback: (err: NodeJS.ErrnoException | null, addresses: TlsaRecord[]) => void,
|
400
|
-
): void;
|
401
386
|
export function resolve(
|
402
387
|
hostname: string,
|
403
388
|
rrtype: "TXT",
|
@@ -408,15 +393,7 @@ declare module "dns" {
|
|
408
393
|
rrtype: string,
|
409
394
|
callback: (
|
410
395
|
err: NodeJS.ErrnoException | null,
|
411
|
-
addresses:
|
412
|
-
| string[]
|
413
|
-
| MxRecord[]
|
414
|
-
| NaptrRecord[]
|
415
|
-
| SoaRecord
|
416
|
-
| SrvRecord[]
|
417
|
-
| TlsaRecord[]
|
418
|
-
| string[][]
|
419
|
-
| AnyRecord[],
|
396
|
+
addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[],
|
420
397
|
) => void,
|
421
398
|
): void;
|
422
399
|
export namespace resolve {
|
@@ -426,14 +403,11 @@ declare module "dns" {
|
|
426
403
|
function __promisify__(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
|
427
404
|
function __promisify__(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
|
428
405
|
function __promisify__(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
|
429
|
-
function __promisify__(hostname: string, rrtype: "TLSA"): Promise<TlsaRecord[]>;
|
430
406
|
function __promisify__(hostname: string, rrtype: "TXT"): Promise<string[][]>;
|
431
407
|
function __promisify__(
|
432
408
|
hostname: string,
|
433
409
|
rrtype: string,
|
434
|
-
): Promise<
|
435
|
-
string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | TlsaRecord[] | string[][] | AnyRecord[]
|
436
|
-
>;
|
410
|
+
): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
|
437
411
|
}
|
438
412
|
/**
|
439
413
|
* Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the `hostname`. The `addresses` argument passed to the `callback` function
|
@@ -635,33 +609,6 @@ declare module "dns" {
|
|
635
609
|
export namespace resolveSrv {
|
636
610
|
function __promisify__(hostname: string): Promise<SrvRecord[]>;
|
637
611
|
}
|
638
|
-
/**
|
639
|
-
* Uses the DNS protocol to resolve certificate associations (`TLSA` records) for
|
640
|
-
* the `hostname`. The `records` argument passed to the `callback` function is an
|
641
|
-
* array of objects with these properties:
|
642
|
-
*
|
643
|
-
* * `certUsage`
|
644
|
-
* * `selector`
|
645
|
-
* * `match`
|
646
|
-
* * `data`
|
647
|
-
*
|
648
|
-
* ```js
|
649
|
-
* {
|
650
|
-
* certUsage: 3,
|
651
|
-
* selector: 1,
|
652
|
-
* match: 1,
|
653
|
-
* data: [ArrayBuffer]
|
654
|
-
* }
|
655
|
-
* ```
|
656
|
-
* @since v22.15.0
|
657
|
-
*/
|
658
|
-
export function resolveTlsa(
|
659
|
-
hostname: string,
|
660
|
-
callback: (err: NodeJS.ErrnoException | null, addresses: TlsaRecord[]) => void,
|
661
|
-
): void;
|
662
|
-
export namespace resolveTlsa {
|
663
|
-
function __promisify__(hostname: string): Promise<TlsaRecord[]>;
|
664
|
-
}
|
665
612
|
/**
|
666
613
|
* Uses the DNS protocol to resolve text queries (`TXT` records) for the `hostname`. The `records` argument passed to the `callback` function is a
|
667
614
|
* two-dimensional array of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of
|
@@ -717,8 +664,8 @@ declare module "dns" {
|
|
717
664
|
* Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an
|
718
665
|
* array of host names.
|
719
666
|
*
|
720
|
-
* On error, `err` is an [`Error`](https://nodejs.org/docs/latest-
|
721
|
-
* one of the [DNS error codes](https://nodejs.org/docs/latest-
|
667
|
+
* On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v24.x/api/errors.html#class-error) object, where `err.code` is
|
668
|
+
* one of the [DNS error codes](https://nodejs.org/docs/latest-v24.x/api/dns.html#error-codes).
|
722
669
|
* @since v0.1.16
|
723
670
|
*/
|
724
671
|
export function reverse(
|
@@ -726,7 +673,7 @@ declare module "dns" {
|
|
726
673
|
callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void,
|
727
674
|
): void;
|
728
675
|
/**
|
729
|
-
* Get the default value for `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-
|
676
|
+
* Get the default value for `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v24.x/api/dns.html#dnspromiseslookuphostname-options).
|
730
677
|
* The value could be:
|
731
678
|
*
|
732
679
|
* * `ipv4first`: for `order` defaulting to `ipv4first`.
|
@@ -781,7 +728,7 @@ declare module "dns" {
|
|
781
728
|
*/
|
782
729
|
export function getServers(): string[];
|
783
730
|
/**
|
784
|
-
* Set the default value of `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-
|
731
|
+
* Set the default value of `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v24.x/api/dns.html#dnspromiseslookuphostname-options).
|
785
732
|
* The value could be:
|
786
733
|
*
|
787
734
|
* * `ipv4first`: sets default `order` to `ipv4first`.
|
@@ -789,8 +736,8 @@ declare module "dns" {
|
|
789
736
|
* * `verbatim`: sets default `order` to `verbatim`.
|
790
737
|
*
|
791
738
|
* The default is `verbatim` and {@link setDefaultResultOrder} have higher
|
792
|
-
* priority than [`--dns-result-order`](https://nodejs.org/docs/latest-
|
793
|
-
* [worker threads](https://nodejs.org/docs/latest-
|
739
|
+
* priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v24.x/api/cli.html#--dns-result-orderorder). When using
|
740
|
+
* [worker threads](https://nodejs.org/docs/latest-v24.x/api/worker_threads.html), {@link setDefaultResultOrder} from the main
|
794
741
|
* thread won't affect the default dns orders in workers.
|
795
742
|
* @since v16.4.0, v14.18.0
|
796
743
|
* @param order must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`.
|
@@ -836,7 +783,7 @@ declare module "dns" {
|
|
836
783
|
* An independent resolver for DNS requests.
|
837
784
|
*
|
838
785
|
* Creating a new resolver uses the default server settings. Setting
|
839
|
-
* the servers used for a resolver using [`resolver.setServers()`](https://nodejs.org/docs/latest-
|
786
|
+
* the servers used for a resolver using [`resolver.setServers()`](https://nodejs.org/docs/latest-v24.x/api/dns.html#dnssetserversservers) does not affect
|
840
787
|
* other resolvers:
|
841
788
|
*
|
842
789
|
* ```js
|
@@ -891,7 +838,6 @@ declare module "dns" {
|
|
891
838
|
resolvePtr: typeof resolvePtr;
|
892
839
|
resolveSoa: typeof resolveSoa;
|
893
840
|
resolveSrv: typeof resolveSrv;
|
894
|
-
resolveTlsa: typeof resolveTlsa;
|
895
841
|
resolveTxt: typeof resolveTxt;
|
896
842
|
reverse: typeof reverse;
|
897
843
|
/**
|
@@ -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/
|
15
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/domain.js)
|
16
16
|
*/
|
17
17
|
declare module "domain" {
|
18
18
|
import EventEmitter = require("node:events");
|
@@ -32,7 +32,7 @@
|
|
32
32
|
* });
|
33
33
|
* myEmitter.emit('event');
|
34
34
|
* ```
|
35
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
35
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/events.js)
|
36
36
|
*/
|
37
37
|
declare module "events" {
|
38
38
|
import { AsyncResource, AsyncResourceOptions } from "node:async_hooks";
|
@@ -29,7 +29,6 @@ declare module "fs/promises" {
|
|
29
29
|
OpenDirOptions,
|
30
30
|
OpenMode,
|
31
31
|
PathLike,
|
32
|
-
ReadPosition,
|
33
32
|
ReadStream,
|
34
33
|
ReadVResult,
|
35
34
|
RmDirOptions,
|
@@ -70,7 +69,7 @@ declare module "fs/promises" {
|
|
70
69
|
* @default `buffer.byteLength`
|
71
70
|
*/
|
72
71
|
length?: number | null;
|
73
|
-
position?:
|
72
|
+
position?: number | null;
|
74
73
|
}
|
75
74
|
interface CreateReadStreamOptions extends Abortable {
|
76
75
|
encoding?: BufferEncoding | null | undefined;
|
@@ -230,7 +229,7 @@ declare module "fs/promises" {
|
|
230
229
|
buffer: T,
|
231
230
|
offset?: number | null,
|
232
231
|
length?: number | null,
|
233
|
-
position?:
|
232
|
+
position?: number | null,
|
234
233
|
): Promise<FileReadResult<T>>;
|
235
234
|
read<T extends NodeJS.ArrayBufferView = Buffer>(
|
236
235
|
buffer: T,
|
@@ -260,7 +259,6 @@ declare module "fs/promises" {
|
|
260
259
|
* While the `ReadableStream` will read the file to completion, it will not
|
261
260
|
* close the `FileHandle` automatically. User code must still call the`fileHandle.close()` method.
|
262
261
|
* @since v17.0.0
|
263
|
-
* @experimental
|
264
262
|
*/
|
265
263
|
readableWebStream(): ReadableStream;
|
266
264
|
/**
|
@@ -1252,20 +1250,28 @@ declare module "fs/promises" {
|
|
1252
1250
|
*/
|
1253
1251
|
function cp(source: string | URL, destination: string | URL, opts?: CopyOptions): Promise<void>;
|
1254
1252
|
/**
|
1255
|
-
*
|
1253
|
+
* ```js
|
1254
|
+
* import { glob } from 'node:fs/promises';
|
1255
|
+
*
|
1256
|
+
* for await (const entry of glob('*.js'))
|
1257
|
+
* console.log(entry);
|
1258
|
+
* ```
|
1259
|
+
* @since v22.0.0
|
1260
|
+
* @returns An AsyncIterator that yields the paths of files
|
1261
|
+
* that match the pattern.
|
1256
1262
|
*/
|
1257
|
-
function glob(pattern: string | string[]): NodeJS.AsyncIterator<string>;
|
1263
|
+
function glob(pattern: string | readonly string[]): NodeJS.AsyncIterator<string>;
|
1258
1264
|
function glob(
|
1259
|
-
pattern: string | string[],
|
1260
|
-
|
1265
|
+
pattern: string | readonly string[],
|
1266
|
+
options: GlobOptionsWithFileTypes,
|
1261
1267
|
): NodeJS.AsyncIterator<Dirent>;
|
1262
1268
|
function glob(
|
1263
|
-
pattern: string | string[],
|
1264
|
-
|
1269
|
+
pattern: string | readonly string[],
|
1270
|
+
options: GlobOptionsWithoutFileTypes,
|
1265
1271
|
): NodeJS.AsyncIterator<string>;
|
1266
1272
|
function glob(
|
1267
|
-
pattern: string | string[],
|
1268
|
-
|
1273
|
+
pattern: string | readonly string[],
|
1274
|
+
options: GlobOptions,
|
1269
1275
|
): NodeJS.AsyncIterator<Dirent | string>;
|
1270
1276
|
}
|
1271
1277
|
declare module "node:fs/promises" {
|