@types/node 22.15.21 → 24.10.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 v24.10/README.md +15 -0
- node v24.10/assert/strict.d.ts +111 -0
- node/assert.d.ts → node v24.10/assert.d.ts +162 -101
- node/async_hooks.d.ts → node v24.10/async_hooks.d.ts +26 -6
- node/buffer.buffer.d.ts → node v24.10/buffer.buffer.d.ts +9 -0
- node/buffer.d.ts → node v24.10/buffer.d.ts +15 -7
- node/child_process.d.ts → node v24.10/child_process.d.ts +91 -164
- node/cluster.d.ts → node v24.10/cluster.d.ts +19 -20
- node/console.d.ts → node v24.10/console.d.ts +19 -18
- node/crypto.d.ts → node v24.10/crypto.d.ts +1264 -356
- node/dgram.d.ts → node v24.10/dgram.d.ts +10 -9
- node/diagnostics_channel.d.ts → node v24.10/diagnostics_channel.d.ts +18 -15
- node/dns/promises.d.ts → node v24.10/dns/promises.d.ts +36 -9
- node/dns.d.ts → node v24.10/dns.d.ts +95 -37
- node/domain.d.ts → node v24.10/domain.d.ts +1 -1
- node/events.d.ts → node v24.10/events.d.ts +81 -36
- node/fs/promises.d.ts → node v24.10/fs/promises.d.ts +104 -59
- node/fs.d.ts → node v24.10/fs.d.ts +414 -137
- node v24.10/globals.d.ts +170 -0
- node v24.10/globals.typedarray.d.ts +41 -0
- node/http.d.ts → node v24.10/http.d.ts +187 -37
- node/http2.d.ts → node v24.10/http2.d.ts +266 -67
- node/https.d.ts → node v24.10/https.d.ts +97 -63
- node/index.d.ts → node v24.10/index.d.ts +16 -7
- node v24.10/inspector.d.ts +277 -0
- node/inspector.d.ts → node v24.10/inspector.generated.d.ts +1059 -828
- node/module.d.ts → node v24.10/module.d.ts +153 -31
- node/net.d.ts → node v24.10/net.d.ts +35 -16
- node/os.d.ts → node v24.10/os.d.ts +22 -10
- node/package.json → node v24.10/package.json +14 -84
- node/path.d.ts → node v24.10/path.d.ts +2 -2
- node/perf_hooks.d.ts → node v24.10/perf_hooks.d.ts +30 -18
- node/process.d.ts → node v24.10/process.d.ts +45 -34
- node/punycode.d.ts → node v24.10/punycode.d.ts +1 -1
- node/querystring.d.ts → node v24.10/querystring.d.ts +1 -1
- node/readline/promises.d.ts → node v24.10/readline/promises.d.ts +1 -2
- node/readline.d.ts → node v24.10/readline.d.ts +13 -13
- node/repl.d.ts → node v24.10/repl.d.ts +25 -17
- node/sea.d.ts → node v24.10/sea.d.ts +10 -1
- node/sqlite.d.ts → node v24.10/sqlite.d.ts +438 -9
- node/stream/consumers.d.ts → node v24.10/stream/consumers.d.ts +2 -2
- node/stream/web.d.ts → node v24.10/stream/web.d.ts +13 -54
- node/stream.d.ts → node v24.10/stream.d.ts +68 -47
- node/string_decoder.d.ts → node v24.10/string_decoder.d.ts +3 -3
- node v24.10/test.d.ts +2339 -0
- node/timers/promises.d.ts → node v24.10/timers/promises.d.ts +1 -1
- node/timers.d.ts → node v24.10/timers.d.ts +1 -3
- node/tls.d.ts → node v24.10/tls.d.ts +124 -114
- node/trace_events.d.ts → node v24.10/trace_events.d.ts +6 -6
- node/ts5.6/buffer.buffer.d.ts → node v24.10/ts5.6/buffer.buffer.d.ts +10 -2
- node v24.10/ts5.6/compatibility/float16array.d.ts +71 -0
- node v24.10/ts5.6/globals.typedarray.d.ts +36 -0
- node/ts5.6/index.d.ts → node v24.10/ts5.6/index.d.ts +18 -7
- node v24.10/ts5.7/compatibility/float16array.d.ts +72 -0
- node v24.10/ts5.7/index.d.ts +103 -0
- node/tty.d.ts → node v24.10/tty.d.ts +1 -1
- node/url.d.ts → node v24.10/url.d.ts +119 -34
- node/util.d.ts → node v24.10/util.d.ts +46 -305
- node/v8.d.ts → node v24.10/v8.d.ts +100 -37
- node/vm.d.ts → node v24.10/vm.d.ts +299 -110
- node/wasi.d.ts → node v24.10/wasi.d.ts +23 -2
- node v24.10/web-globals/abortcontroller.d.ts +34 -0
- node v24.10/web-globals/crypto.d.ts +32 -0
- node v24.10/web-globals/domexception.d.ts +68 -0
- node v24.10/web-globals/events.d.ts +97 -0
- node v24.10/web-globals/fetch.d.ts +50 -0
- node v24.10/web-globals/navigator.d.ts +25 -0
- node v24.10/web-globals/storage.d.ts +24 -0
- node v24.10/web-globals/streams.d.ts +22 -0
- node/worker_threads.d.ts → node v24.10/worker_threads.d.ts +225 -75
- node/zlib.d.ts → node v24.10/zlib.d.ts +44 -33
- node/README.md +0 -15
- node/assert/strict.d.ts +0 -8
- node/compatibility/disposable.d.ts +0 -16
- node/compatibility/index.d.ts +0 -9
- node/compatibility/indexable.d.ts +0 -23
- node/dom-events.d.ts +0 -124
- node/globals.d.ts +0 -371
- node/globals.typedarray.d.ts +0 -21
- node/test.d.ts +0 -2280
- node/ts5.6/globals.typedarray.d.ts +0 -19
- {node → node v24.10}/LICENSE +0 -0
- {node → node v24.10}/compatibility/iterators.d.ts +0 -0
- {node → node v24.10}/constants.d.ts +0 -0
- {node → node v24.10}/stream/promises.d.ts +0 -0
|
@@ -23,9 +23,10 @@
|
|
|
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
|
+
import { NonSharedBuffer } from "node:buffer";
|
|
29
30
|
import { AddressInfo, BlockList } from "node:net";
|
|
30
31
|
import * as dns from "node:dns";
|
|
31
32
|
import { Abortable, EventEmitter } from "node:events";
|
|
@@ -85,8 +86,8 @@ declare module "dgram" {
|
|
|
85
86
|
* @param options Available options are:
|
|
86
87
|
* @param callback Attached as a listener for `'message'` events. Optional.
|
|
87
88
|
*/
|
|
88
|
-
function createSocket(type: SocketType, callback?: (msg:
|
|
89
|
-
function createSocket(options: SocketOptions, callback?: (msg:
|
|
89
|
+
function createSocket(type: SocketType, callback?: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): Socket;
|
|
90
|
+
function createSocket(options: SocketOptions, callback?: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): Socket;
|
|
90
91
|
/**
|
|
91
92
|
* Encapsulates the datagram functionality.
|
|
92
93
|
*
|
|
@@ -556,37 +557,37 @@ declare module "dgram" {
|
|
|
556
557
|
addListener(event: "connect", listener: () => void): this;
|
|
557
558
|
addListener(event: "error", listener: (err: Error) => void): this;
|
|
558
559
|
addListener(event: "listening", listener: () => void): this;
|
|
559
|
-
addListener(event: "message", listener: (msg:
|
|
560
|
+
addListener(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this;
|
|
560
561
|
emit(event: string | symbol, ...args: any[]): boolean;
|
|
561
562
|
emit(event: "close"): boolean;
|
|
562
563
|
emit(event: "connect"): boolean;
|
|
563
564
|
emit(event: "error", err: Error): boolean;
|
|
564
565
|
emit(event: "listening"): boolean;
|
|
565
|
-
emit(event: "message", msg:
|
|
566
|
+
emit(event: "message", msg: NonSharedBuffer, rinfo: RemoteInfo): boolean;
|
|
566
567
|
on(event: string, listener: (...args: any[]) => void): this;
|
|
567
568
|
on(event: "close", listener: () => void): this;
|
|
568
569
|
on(event: "connect", listener: () => void): this;
|
|
569
570
|
on(event: "error", listener: (err: Error) => void): this;
|
|
570
571
|
on(event: "listening", listener: () => void): this;
|
|
571
|
-
on(event: "message", listener: (msg:
|
|
572
|
+
on(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this;
|
|
572
573
|
once(event: string, listener: (...args: any[]) => void): this;
|
|
573
574
|
once(event: "close", listener: () => void): this;
|
|
574
575
|
once(event: "connect", listener: () => void): this;
|
|
575
576
|
once(event: "error", listener: (err: Error) => void): this;
|
|
576
577
|
once(event: "listening", listener: () => void): this;
|
|
577
|
-
once(event: "message", listener: (msg:
|
|
578
|
+
once(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this;
|
|
578
579
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
579
580
|
prependListener(event: "close", listener: () => void): this;
|
|
580
581
|
prependListener(event: "connect", listener: () => void): this;
|
|
581
582
|
prependListener(event: "error", listener: (err: Error) => void): this;
|
|
582
583
|
prependListener(event: "listening", listener: () => void): this;
|
|
583
|
-
prependListener(event: "message", listener: (msg:
|
|
584
|
+
prependListener(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this;
|
|
584
585
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
585
586
|
prependOnceListener(event: "close", listener: () => void): this;
|
|
586
587
|
prependOnceListener(event: "connect", listener: () => void): this;
|
|
587
588
|
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
|
588
589
|
prependOnceListener(event: "listening", listener: () => void): this;
|
|
589
|
-
prependOnceListener(event: "message", listener: (msg:
|
|
590
|
+
prependOnceListener(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this;
|
|
590
591
|
/**
|
|
591
592
|
* Calls `socket.close()` and returns a promise that fulfills when the socket has closed.
|
|
592
593
|
* @since v20.5.0
|
|
@@ -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";
|
|
@@ -189,7 +189,6 @@ declare module "diagnostics_channel" {
|
|
|
189
189
|
* });
|
|
190
190
|
* ```
|
|
191
191
|
* @since v15.1.0, v14.17.0
|
|
192
|
-
* @deprecated Since v18.7.0,v16.17.0 - Use {@link subscribe(name, onMessage)}
|
|
193
192
|
* @param onMessage The handler to receive channel messages
|
|
194
193
|
*/
|
|
195
194
|
subscribe(onMessage: ChannelListener): void;
|
|
@@ -210,7 +209,6 @@ declare module "diagnostics_channel" {
|
|
|
210
209
|
* channel.unsubscribe(onMessage);
|
|
211
210
|
* ```
|
|
212
211
|
* @since v15.1.0, v14.17.0
|
|
213
|
-
* @deprecated Since v18.7.0,v16.17.0 - Use {@link unsubscribe(name, onMessage)}
|
|
214
212
|
* @param onMessage The previous subscribed handler to remove
|
|
215
213
|
* @return `true` if the handler was found, `false` otherwise.
|
|
216
214
|
*/
|
|
@@ -297,7 +295,12 @@ declare module "diagnostics_channel" {
|
|
|
297
295
|
* @param thisArg The receiver to be used for the function call.
|
|
298
296
|
* @param args Optional arguments to pass to the function.
|
|
299
297
|
*/
|
|
300
|
-
runStores(
|
|
298
|
+
runStores<ThisArg = any, Args extends any[] = any[], Result = any>(
|
|
299
|
+
context: ContextType,
|
|
300
|
+
fn: (this: ThisArg, ...args: Args) => Result,
|
|
301
|
+
thisArg?: ThisArg,
|
|
302
|
+
...args: Args
|
|
303
|
+
): Result;
|
|
301
304
|
}
|
|
302
305
|
interface TracingChannelSubscribers<ContextType extends object> {
|
|
303
306
|
start: (message: ContextType) => void;
|
|
@@ -441,12 +444,12 @@ declare module "diagnostics_channel" {
|
|
|
441
444
|
* @param args Optional arguments to pass to the function
|
|
442
445
|
* @return The return value of the given function
|
|
443
446
|
*/
|
|
444
|
-
traceSync<ThisArg = any, Args extends any[] = any[]>(
|
|
445
|
-
fn: (this: ThisArg, ...args: Args) =>
|
|
447
|
+
traceSync<ThisArg = any, Args extends any[] = any[], Result = any>(
|
|
448
|
+
fn: (this: ThisArg, ...args: Args) => Result,
|
|
446
449
|
context?: ContextType,
|
|
447
450
|
thisArg?: ThisArg,
|
|
448
451
|
...args: Args
|
|
449
|
-
):
|
|
452
|
+
): Result;
|
|
450
453
|
/**
|
|
451
454
|
* Trace a promise-returning function call. This will always produce a `start event` and `end event` around the synchronous portion of the
|
|
452
455
|
* function execution, and will produce an `asyncStart event` and `asyncEnd event` when a promise continuation is reached. It may also
|
|
@@ -476,12 +479,12 @@ declare module "diagnostics_channel" {
|
|
|
476
479
|
* @param args Optional arguments to pass to the function
|
|
477
480
|
* @return Chained from promise returned by the given function
|
|
478
481
|
*/
|
|
479
|
-
tracePromise<ThisArg = any, Args extends any[] = any[]>(
|
|
480
|
-
fn: (this: ThisArg, ...args: Args) => Promise<
|
|
482
|
+
tracePromise<ThisArg = any, Args extends any[] = any[], Result = any>(
|
|
483
|
+
fn: (this: ThisArg, ...args: Args) => Promise<Result>,
|
|
481
484
|
context?: ContextType,
|
|
482
485
|
thisArg?: ThisArg,
|
|
483
486
|
...args: Args
|
|
484
|
-
):
|
|
487
|
+
): Promise<Result>;
|
|
485
488
|
/**
|
|
486
489
|
* Trace a callback-receiving function call. This will always produce a `start event` and `end event` around the synchronous portion of the
|
|
487
490
|
* function execution, and will produce a `asyncStart event` and `asyncEnd event` around the callback execution. It may also produce an `error event` if the given function throws an error or
|
|
@@ -540,13 +543,13 @@ declare module "diagnostics_channel" {
|
|
|
540
543
|
* @param args Optional arguments to pass to the function
|
|
541
544
|
* @return The return value of the given function
|
|
542
545
|
*/
|
|
543
|
-
traceCallback<
|
|
544
|
-
fn:
|
|
546
|
+
traceCallback<ThisArg = any, Args extends any[] = any[], Result = any>(
|
|
547
|
+
fn: (this: ThisArg, ...args: Args) => Result,
|
|
545
548
|
position?: number,
|
|
546
549
|
context?: ContextType,
|
|
547
|
-
thisArg?:
|
|
548
|
-
...args:
|
|
549
|
-
):
|
|
550
|
+
thisArg?: ThisArg,
|
|
551
|
+
...args: Args
|
|
552
|
+
): Result;
|
|
550
553
|
/**
|
|
551
554
|
* `true` if any of the individual channels has a subscriber, `false` if not.
|
|
552
555
|
*
|
|
@@ -20,6 +20,7 @@ declare module "dns/promises" {
|
|
|
20
20
|
ResolveWithTtlOptions,
|
|
21
21
|
SoaRecord,
|
|
22
22
|
SrvRecord,
|
|
23
|
+
TlsaRecord,
|
|
23
24
|
} from "node:dns";
|
|
24
25
|
/**
|
|
25
26
|
* Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6),
|
|
@@ -126,22 +127,26 @@ declare module "dns/promises" {
|
|
|
126
127
|
* @param [rrtype='A'] Resource record type.
|
|
127
128
|
*/
|
|
128
129
|
function resolve(hostname: string): Promise<string[]>;
|
|
129
|
-
function resolve(hostname: string, rrtype: "A"): Promise<string[]>;
|
|
130
|
-
function resolve(hostname: string, rrtype: "AAAA"): Promise<string[]>;
|
|
130
|
+
function resolve(hostname: string, rrtype: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise<string[]>;
|
|
131
131
|
function resolve(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
|
|
132
132
|
function resolve(hostname: string, rrtype: "CAA"): Promise<CaaRecord[]>;
|
|
133
|
-
function resolve(hostname: string, rrtype: "CNAME"): Promise<string[]>;
|
|
134
133
|
function resolve(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
|
|
135
134
|
function resolve(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
|
|
136
|
-
function resolve(hostname: string, rrtype: "NS"): Promise<string[]>;
|
|
137
|
-
function resolve(hostname: string, rrtype: "PTR"): Promise<string[]>;
|
|
138
135
|
function resolve(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
|
|
139
136
|
function resolve(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
|
|
137
|
+
function resolve(hostname: string, rrtype: "TLSA"): Promise<TlsaRecord[]>;
|
|
140
138
|
function resolve(hostname: string, rrtype: "TXT"): Promise<string[][]>;
|
|
141
|
-
function resolve(
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
139
|
+
function resolve(hostname: string, rrtype: string): Promise<
|
|
140
|
+
| string[]
|
|
141
|
+
| CaaRecord[]
|
|
142
|
+
| MxRecord[]
|
|
143
|
+
| NaptrRecord[]
|
|
144
|
+
| SoaRecord
|
|
145
|
+
| SrvRecord[]
|
|
146
|
+
| TlsaRecord[]
|
|
147
|
+
| string[][]
|
|
148
|
+
| AnyRecord[]
|
|
149
|
+
>;
|
|
145
150
|
/**
|
|
146
151
|
* Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the `hostname`. On success, the `Promise` is resolved with an array of IPv4
|
|
147
152
|
* addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
|
|
@@ -292,6 +297,27 @@ declare module "dns/promises" {
|
|
|
292
297
|
* @since v10.6.0
|
|
293
298
|
*/
|
|
294
299
|
function resolveSrv(hostname: string): Promise<SrvRecord[]>;
|
|
300
|
+
/**
|
|
301
|
+
* Uses the DNS protocol to resolve certificate associations (`TLSA` records) for
|
|
302
|
+
* the `hostname`. On success, the `Promise` is resolved with an array of objectsAdd commentMore actions
|
|
303
|
+
* with these properties:
|
|
304
|
+
*
|
|
305
|
+
* * `certUsage`
|
|
306
|
+
* * `selector`
|
|
307
|
+
* * `match`
|
|
308
|
+
* * `data`
|
|
309
|
+
*
|
|
310
|
+
* ```js
|
|
311
|
+
* {
|
|
312
|
+
* certUsage: 3,
|
|
313
|
+
* selector: 1,
|
|
314
|
+
* match: 1,
|
|
315
|
+
* data: [ArrayBuffer]
|
|
316
|
+
* }
|
|
317
|
+
* ```
|
|
318
|
+
* @since v23.9.0, v22.15.0
|
|
319
|
+
*/
|
|
320
|
+
function resolveTlsa(hostname: string): Promise<TlsaRecord[]>;
|
|
295
321
|
/**
|
|
296
322
|
* Uses the DNS protocol to resolve text queries (`TXT` records) for the `hostname`. On success, the `Promise` is resolved with a two-dimensional array
|
|
297
323
|
* of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of
|
|
@@ -450,6 +476,7 @@ declare module "dns/promises" {
|
|
|
450
476
|
resolvePtr: typeof resolvePtr;
|
|
451
477
|
resolveSoa: typeof resolveSoa;
|
|
452
478
|
resolveSrv: typeof resolveSrv;
|
|
479
|
+
resolveTlsa: typeof resolveTlsa;
|
|
453
480
|
resolveTxt: typeof resolveTxt;
|
|
454
481
|
reverse: typeof reverse;
|
|
455
482
|
/**
|
|
@@ -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
|
*/
|
|
@@ -250,6 +250,9 @@ declare module "dns" {
|
|
|
250
250
|
contactemail?: string | undefined;
|
|
251
251
|
contactphone?: string | undefined;
|
|
252
252
|
}
|
|
253
|
+
export interface AnyCaaRecord extends CaaRecord {
|
|
254
|
+
type: "CAA";
|
|
255
|
+
}
|
|
253
256
|
export interface MxRecord {
|
|
254
257
|
priority: number;
|
|
255
258
|
exchange: string;
|
|
@@ -289,6 +292,15 @@ declare module "dns" {
|
|
|
289
292
|
export interface AnySrvRecord extends SrvRecord {
|
|
290
293
|
type: "SRV";
|
|
291
294
|
}
|
|
295
|
+
export interface TlsaRecord {
|
|
296
|
+
certUsage: number;
|
|
297
|
+
selector: number;
|
|
298
|
+
match: number;
|
|
299
|
+
data: ArrayBuffer;
|
|
300
|
+
}
|
|
301
|
+
export interface AnyTlsaRecord extends TlsaRecord {
|
|
302
|
+
type: "TLSA";
|
|
303
|
+
}
|
|
292
304
|
export interface AnyTxtRecord {
|
|
293
305
|
type: "TXT";
|
|
294
306
|
entries: string[];
|
|
@@ -308,6 +320,7 @@ declare module "dns" {
|
|
|
308
320
|
export type AnyRecord =
|
|
309
321
|
| AnyARecord
|
|
310
322
|
| AnyAaaaRecord
|
|
323
|
+
| AnyCaaRecord
|
|
311
324
|
| AnyCnameRecord
|
|
312
325
|
| AnyMxRecord
|
|
313
326
|
| AnyNaptrRecord
|
|
@@ -315,6 +328,7 @@ declare module "dns" {
|
|
|
315
328
|
| AnyPtrRecord
|
|
316
329
|
| AnySoaRecord
|
|
317
330
|
| AnySrvRecord
|
|
331
|
+
| AnyTlsaRecord
|
|
318
332
|
| AnyTxtRecord;
|
|
319
333
|
/**
|
|
320
334
|
* Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array
|
|
@@ -323,7 +337,7 @@ declare module "dns" {
|
|
|
323
337
|
*
|
|
324
338
|
* <omitted>
|
|
325
339
|
*
|
|
326
|
-
* On error, `err` is an [`Error`](https://nodejs.org/docs/latest-
|
|
340
|
+
* On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v24.x/api/errors.html#class-error) object,
|
|
327
341
|
* where `err.code` is one of the `DNS error codes`.
|
|
328
342
|
* @since v0.1.27
|
|
329
343
|
* @param hostname Host name to resolve.
|
|
@@ -335,12 +349,7 @@ declare module "dns" {
|
|
|
335
349
|
): void;
|
|
336
350
|
export function resolve(
|
|
337
351
|
hostname: string,
|
|
338
|
-
rrtype: "A",
|
|
339
|
-
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
|
340
|
-
): void;
|
|
341
|
-
export function resolve(
|
|
342
|
-
hostname: string,
|
|
343
|
-
rrtype: "AAAA",
|
|
352
|
+
rrtype: "A" | "AAAA" | "CNAME" | "NS" | "PTR",
|
|
344
353
|
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
|
345
354
|
): void;
|
|
346
355
|
export function resolve(
|
|
@@ -350,8 +359,8 @@ declare module "dns" {
|
|
|
350
359
|
): void;
|
|
351
360
|
export function resolve(
|
|
352
361
|
hostname: string,
|
|
353
|
-
rrtype: "
|
|
354
|
-
callback: (err: NodeJS.ErrnoException | null,
|
|
362
|
+
rrtype: "CAA",
|
|
363
|
+
callback: (err: NodeJS.ErrnoException | null, address: CaaRecord[]) => void,
|
|
355
364
|
): void;
|
|
356
365
|
export function resolve(
|
|
357
366
|
hostname: string,
|
|
@@ -363,16 +372,6 @@ declare module "dns" {
|
|
|
363
372
|
rrtype: "NAPTR",
|
|
364
373
|
callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void,
|
|
365
374
|
): void;
|
|
366
|
-
export function resolve(
|
|
367
|
-
hostname: string,
|
|
368
|
-
rrtype: "NS",
|
|
369
|
-
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
|
370
|
-
): void;
|
|
371
|
-
export function resolve(
|
|
372
|
-
hostname: string,
|
|
373
|
-
rrtype: "PTR",
|
|
374
|
-
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
|
375
|
-
): void;
|
|
376
375
|
export function resolve(
|
|
377
376
|
hostname: string,
|
|
378
377
|
rrtype: "SOA",
|
|
@@ -383,6 +382,11 @@ declare module "dns" {
|
|
|
383
382
|
rrtype: "SRV",
|
|
384
383
|
callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void,
|
|
385
384
|
): void;
|
|
385
|
+
export function resolve(
|
|
386
|
+
hostname: string,
|
|
387
|
+
rrtype: "TLSA",
|
|
388
|
+
callback: (err: NodeJS.ErrnoException | null, addresses: TlsaRecord[]) => void,
|
|
389
|
+
): void;
|
|
386
390
|
export function resolve(
|
|
387
391
|
hostname: string,
|
|
388
392
|
rrtype: "TXT",
|
|
@@ -393,21 +397,42 @@ declare module "dns" {
|
|
|
393
397
|
rrtype: string,
|
|
394
398
|
callback: (
|
|
395
399
|
err: NodeJS.ErrnoException | null,
|
|
396
|
-
addresses:
|
|
400
|
+
addresses:
|
|
401
|
+
| string[]
|
|
402
|
+
| CaaRecord[]
|
|
403
|
+
| MxRecord[]
|
|
404
|
+
| NaptrRecord[]
|
|
405
|
+
| SoaRecord
|
|
406
|
+
| SrvRecord[]
|
|
407
|
+
| TlsaRecord[]
|
|
408
|
+
| string[][]
|
|
409
|
+
| AnyRecord[],
|
|
397
410
|
) => void,
|
|
398
411
|
): void;
|
|
399
412
|
export namespace resolve {
|
|
400
413
|
function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise<string[]>;
|
|
401
414
|
function __promisify__(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
|
|
415
|
+
function __promisify__(hostname: string, rrtype: "CAA"): Promise<CaaRecord[]>;
|
|
402
416
|
function __promisify__(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
|
|
403
417
|
function __promisify__(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
|
|
404
418
|
function __promisify__(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
|
|
405
419
|
function __promisify__(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
|
|
420
|
+
function __promisify__(hostname: string, rrtype: "TLSA"): Promise<TlsaRecord[]>;
|
|
406
421
|
function __promisify__(hostname: string, rrtype: "TXT"): Promise<string[][]>;
|
|
407
422
|
function __promisify__(
|
|
408
423
|
hostname: string,
|
|
409
424
|
rrtype: string,
|
|
410
|
-
): Promise<
|
|
425
|
+
): Promise<
|
|
426
|
+
| string[]
|
|
427
|
+
| CaaRecord[]
|
|
428
|
+
| MxRecord[]
|
|
429
|
+
| NaptrRecord[]
|
|
430
|
+
| SoaRecord
|
|
431
|
+
| SrvRecord[]
|
|
432
|
+
| TlsaRecord[]
|
|
433
|
+
| string[][]
|
|
434
|
+
| AnyRecord[]
|
|
435
|
+
>;
|
|
411
436
|
}
|
|
412
437
|
/**
|
|
413
438
|
* Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the `hostname`. The `addresses` argument passed to the `callback` function
|
|
@@ -609,6 +634,33 @@ declare module "dns" {
|
|
|
609
634
|
export namespace resolveSrv {
|
|
610
635
|
function __promisify__(hostname: string): Promise<SrvRecord[]>;
|
|
611
636
|
}
|
|
637
|
+
/**
|
|
638
|
+
* Uses the DNS protocol to resolve certificate associations (`TLSA` records) for
|
|
639
|
+
* the `hostname`. The `records` argument passed to the `callback` function is an
|
|
640
|
+
* array of objects with these properties:
|
|
641
|
+
*
|
|
642
|
+
* * `certUsage`
|
|
643
|
+
* * `selector`
|
|
644
|
+
* * `match`
|
|
645
|
+
* * `data`
|
|
646
|
+
*
|
|
647
|
+
* ```js
|
|
648
|
+
* {
|
|
649
|
+
* certUsage: 3,
|
|
650
|
+
* selector: 1,
|
|
651
|
+
* match: 1,
|
|
652
|
+
* data: [ArrayBuffer]
|
|
653
|
+
* }
|
|
654
|
+
* ```
|
|
655
|
+
* @since v23.9.0, v22.15.0
|
|
656
|
+
*/
|
|
657
|
+
export function resolveTlsa(
|
|
658
|
+
hostname: string,
|
|
659
|
+
callback: (err: NodeJS.ErrnoException | null, addresses: TlsaRecord[]) => void,
|
|
660
|
+
): void;
|
|
661
|
+
export namespace resolveTlsa {
|
|
662
|
+
function __promisify__(hostname: string): Promise<TlsaRecord[]>;
|
|
663
|
+
}
|
|
612
664
|
/**
|
|
613
665
|
* Uses the DNS protocol to resolve text queries (`TXT` records) for the `hostname`. The `records` argument passed to the `callback` function is a
|
|
614
666
|
* 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
|
|
@@ -664,8 +716,8 @@ declare module "dns" {
|
|
|
664
716
|
* Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an
|
|
665
717
|
* array of host names.
|
|
666
718
|
*
|
|
667
|
-
* On error, `err` is an [`Error`](https://nodejs.org/docs/latest-
|
|
668
|
-
* one of the [DNS error codes](https://nodejs.org/docs/latest-
|
|
719
|
+
* On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v24.x/api/errors.html#class-error) object, where `err.code` is
|
|
720
|
+
* one of the [DNS error codes](https://nodejs.org/docs/latest-v24.x/api/dns.html#error-codes).
|
|
669
721
|
* @since v0.1.16
|
|
670
722
|
*/
|
|
671
723
|
export function reverse(
|
|
@@ -673,7 +725,7 @@ declare module "dns" {
|
|
|
673
725
|
callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void,
|
|
674
726
|
): void;
|
|
675
727
|
/**
|
|
676
|
-
* Get the default value for `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-
|
|
728
|
+
* Get the default value for `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v24.x/api/dns.html#dnspromiseslookuphostname-options).
|
|
677
729
|
* The value could be:
|
|
678
730
|
*
|
|
679
731
|
* * `ipv4first`: for `order` defaulting to `ipv4first`.
|
|
@@ -728,7 +780,7 @@ declare module "dns" {
|
|
|
728
780
|
*/
|
|
729
781
|
export function getServers(): string[];
|
|
730
782
|
/**
|
|
731
|
-
* Set the default value of `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-
|
|
783
|
+
* Set the default value of `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v24.x/api/dns.html#dnspromiseslookuphostname-options).
|
|
732
784
|
* The value could be:
|
|
733
785
|
*
|
|
734
786
|
* * `ipv4first`: sets default `order` to `ipv4first`.
|
|
@@ -736,8 +788,8 @@ declare module "dns" {
|
|
|
736
788
|
* * `verbatim`: sets default `order` to `verbatim`.
|
|
737
789
|
*
|
|
738
790
|
* The default is `verbatim` and {@link setDefaultResultOrder} have higher
|
|
739
|
-
* priority than [`--dns-result-order`](https://nodejs.org/docs/latest-
|
|
740
|
-
* [worker threads](https://nodejs.org/docs/latest-
|
|
791
|
+
* priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v24.x/api/cli.html#--dns-result-orderorder). When using
|
|
792
|
+
* [worker threads](https://nodejs.org/docs/latest-v24.x/api/worker_threads.html), {@link setDefaultResultOrder} from the main
|
|
741
793
|
* thread won't affect the default dns orders in workers.
|
|
742
794
|
* @since v16.4.0, v14.18.0
|
|
743
795
|
* @param order must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`.
|
|
@@ -777,13 +829,18 @@ declare module "dns" {
|
|
|
777
829
|
* The number of tries the resolver will try contacting each name server before giving up.
|
|
778
830
|
* @default 4
|
|
779
831
|
*/
|
|
780
|
-
tries?: number;
|
|
832
|
+
tries?: number | undefined;
|
|
833
|
+
/**
|
|
834
|
+
* The max retry timeout, in milliseconds.
|
|
835
|
+
* @default 0
|
|
836
|
+
*/
|
|
837
|
+
maxTimeout?: number | undefined;
|
|
781
838
|
}
|
|
782
839
|
/**
|
|
783
840
|
* An independent resolver for DNS requests.
|
|
784
841
|
*
|
|
785
842
|
* Creating a new resolver uses the default server settings. Setting
|
|
786
|
-
* the servers used for a resolver using [`resolver.setServers()`](https://nodejs.org/docs/latest-
|
|
843
|
+
* the servers used for a resolver using [`resolver.setServers()`](https://nodejs.org/docs/latest-v24.x/api/dns.html#dnssetserversservers) does not affect
|
|
787
844
|
* other resolvers:
|
|
788
845
|
*
|
|
789
846
|
* ```js
|
|
@@ -838,6 +895,7 @@ declare module "dns" {
|
|
|
838
895
|
resolvePtr: typeof resolvePtr;
|
|
839
896
|
resolveSoa: typeof resolveSoa;
|
|
840
897
|
resolveSrv: typeof resolveSrv;
|
|
898
|
+
resolveTlsa: typeof resolveTlsa;
|
|
841
899
|
resolveTxt: typeof resolveTxt;
|
|
842
900
|
reverse: typeof reverse;
|
|
843
901
|
/**
|
|
@@ -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");
|