@types/node 22.15.21 → 22.19.3
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.19/README.md +15 -0
- node v22.19/assert/strict.d.ts +111 -0
- node/assert.d.ts → node v22.19/assert.d.ts +119 -95
- node/buffer.buffer.d.ts → node v22.19/buffer.buffer.d.ts +9 -0
- node/buffer.d.ts → node v22.19/buffer.d.ts +14 -6
- node/child_process.d.ts → node v22.19/child_process.d.ts +89 -162
- node/cluster.d.ts → node v22.19/cluster.d.ts +4 -5
- node/compatibility/disposable.d.ts → node v22.19/compatibility/disposable.d.ts +0 -2
- node/compatibility/indexable.d.ts → node v22.19/compatibility/indexable.d.ts +0 -3
- node/compatibility/iterators.d.ts → node v22.19/compatibility/iterators.d.ts +0 -1
- node/crypto.d.ts → node v22.19/crypto.d.ts +203 -167
- node/dgram.d.ts → node v22.19/dgram.d.ts +9 -8
- node/diagnostics_channel.d.ts → node v22.19/diagnostics_channel.d.ts +17 -12
- node/dns/promises.d.ts → node v22.19/dns/promises.d.ts +36 -9
- node/dns.d.ts → node v22.19/dns.d.ts +79 -21
- node/events.d.ts → node v22.19/events.d.ts +80 -35
- node/fs/promises.d.ts → node v22.19/fs/promises.d.ts +81 -58
- node/fs.d.ts → node v22.19/fs.d.ts +154 -130
- node v22.19/globals.d.ts +172 -0
- node v22.19/globals.typedarray.d.ts +38 -0
- node/http.d.ts → node v22.19/http.d.ts +140 -35
- node/http2.d.ts → node v22.19/http2.d.ts +114 -27
- node/https.d.ts → node v22.19/https.d.ts +96 -62
- node/index.d.ts → node v22.19/index.d.ts +7 -2
- node v22.19/inspector.d.ts +253 -0
- node/inspector.d.ts → node v22.19/inspector.generated.d.ts +880 -830
- node/module.d.ts → node v22.19/module.d.ts +136 -17
- node/net.d.ts → node v22.19/net.d.ts +33 -11
- node/os.d.ts → node v22.19/os.d.ts +14 -3
- node/package.json → node v22.19/package.json +3 -83
- node/path.d.ts → node v22.19/path.d.ts +1 -1
- node/perf_hooks.d.ts → node v22.19/perf_hooks.d.ts +8 -10
- node/process.d.ts → node v22.19/process.d.ts +39 -27
- node/readline/promises.d.ts → node v22.19/readline/promises.d.ts +1 -2
- node/repl.d.ts → node v22.19/repl.d.ts +3 -5
- node/sqlite.d.ts → node v22.19/sqlite.d.ts +219 -6
- node/stream/consumers.d.ts → node v22.19/stream/consumers.d.ts +2 -2
- node/stream/web.d.ts → node v22.19/stream/web.d.ts +8 -0
- node/stream.d.ts → node v22.19/stream.d.ts +34 -32
- node/string_decoder.d.ts → node v22.19/string_decoder.d.ts +2 -2
- node v22.19/test.d.ts +2162 -0
- node/tls.d.ts → node v22.19/tls.d.ts +122 -66
- node/ts5.6/buffer.buffer.d.ts → node v22.19/ts5.6/buffer.buffer.d.ts +10 -2
- node v22.19/ts5.6/globals.typedarray.d.ts +34 -0
- node/ts5.6/index.d.ts → node v22.19/ts5.6/index.d.ts +7 -2
- node/url.d.ts → node v22.19/url.d.ts +21 -9
- node/util.d.ts → node v22.19/util.d.ts +33 -11
- node/v8.d.ts → node v22.19/v8.d.ts +66 -35
- node/vm.d.ts → node v22.19/vm.d.ts +65 -56
- node/wasi.d.ts → node v22.19/wasi.d.ts +1 -1
- node v22.19/web-globals/abortcontroller.d.ts +34 -0
- node v22.19/web-globals/domexception.d.ts +68 -0
- node v22.19/web-globals/events.d.ts +97 -0
- node v22.19/web-globals/fetch.d.ts +46 -0
- node v22.19/web-globals/navigator.d.ts +22 -0
- node v22.19/web-globals/storage.d.ts +24 -0
- node/worker_threads.d.ts → node v22.19/worker_threads.d.ts +112 -74
- node/zlib.d.ts → node v22.19/zlib.d.ts +39 -26
- node/README.md +0 -15
- node/assert/strict.d.ts +0 -8
- 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 v22.19}/LICENSE +0 -0
- node/async_hooks.d.ts → node v22.19/async_hooks.d.ts +1 -1
- {node → node v22.19}/compatibility/index.d.ts +0 -0
- {node → node v22.19}/console.d.ts +0 -0
- {node → node v22.19}/constants.d.ts +0 -0
- {node → node v22.19}/domain.d.ts +0 -0
- {node → node v22.19}/punycode.d.ts +0 -0
- {node → node v22.19}/querystring.d.ts +0 -0
- {node → node v22.19}/readline.d.ts +0 -0
- {node → node v22.19}/sea.d.ts +0 -0
- {node → node v22.19}/stream/promises.d.ts +0 -0
- {node → node v22.19}/timers/promises.d.ts +0 -0
- {node → node v22.19}/timers.d.ts +0 -0
- {node → node v22.19}/trace_events.d.ts +0 -0
- {node → node v22.19}/tty.d.ts +0 -0
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
* @see [source](https://github.com/nodejs/node/blob/v22.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
|
|
@@ -297,7 +297,12 @@ declare module "diagnostics_channel" {
|
|
|
297
297
|
* @param thisArg The receiver to be used for the function call.
|
|
298
298
|
* @param args Optional arguments to pass to the function.
|
|
299
299
|
*/
|
|
300
|
-
runStores(
|
|
300
|
+
runStores<ThisArg = any, Args extends any[] = any[], Result = any>(
|
|
301
|
+
context: ContextType,
|
|
302
|
+
fn: (this: ThisArg, ...args: Args) => Result,
|
|
303
|
+
thisArg?: ThisArg,
|
|
304
|
+
...args: Args
|
|
305
|
+
): Result;
|
|
301
306
|
}
|
|
302
307
|
interface TracingChannelSubscribers<ContextType extends object> {
|
|
303
308
|
start: (message: ContextType) => void;
|
|
@@ -441,12 +446,12 @@ declare module "diagnostics_channel" {
|
|
|
441
446
|
* @param args Optional arguments to pass to the function
|
|
442
447
|
* @return The return value of the given function
|
|
443
448
|
*/
|
|
444
|
-
traceSync<ThisArg = any, Args extends any[] = any[]>(
|
|
445
|
-
fn: (this: ThisArg, ...args: Args) =>
|
|
449
|
+
traceSync<ThisArg = any, Args extends any[] = any[], Result = any>(
|
|
450
|
+
fn: (this: ThisArg, ...args: Args) => Result,
|
|
446
451
|
context?: ContextType,
|
|
447
452
|
thisArg?: ThisArg,
|
|
448
453
|
...args: Args
|
|
449
|
-
):
|
|
454
|
+
): Result;
|
|
450
455
|
/**
|
|
451
456
|
* Trace a promise-returning function call. This will always produce a `start event` and `end event` around the synchronous portion of the
|
|
452
457
|
* function execution, and will produce an `asyncStart event` and `asyncEnd event` when a promise continuation is reached. It may also
|
|
@@ -476,12 +481,12 @@ declare module "diagnostics_channel" {
|
|
|
476
481
|
* @param args Optional arguments to pass to the function
|
|
477
482
|
* @return Chained from promise returned by the given function
|
|
478
483
|
*/
|
|
479
|
-
tracePromise<ThisArg = any, Args extends any[] = any[]>(
|
|
480
|
-
fn: (this: ThisArg, ...args: Args) => Promise<
|
|
484
|
+
tracePromise<ThisArg = any, Args extends any[] = any[], Result = any>(
|
|
485
|
+
fn: (this: ThisArg, ...args: Args) => Promise<Result>,
|
|
481
486
|
context?: ContextType,
|
|
482
487
|
thisArg?: ThisArg,
|
|
483
488
|
...args: Args
|
|
484
|
-
):
|
|
489
|
+
): Promise<Result>;
|
|
485
490
|
/**
|
|
486
491
|
* Trace a callback-receiving function call. This will always produce a `start event` and `end event` around the synchronous portion of the
|
|
487
492
|
* 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 +545,13 @@ declare module "diagnostics_channel" {
|
|
|
540
545
|
* @param args Optional arguments to pass to the function
|
|
541
546
|
* @return The return value of the given function
|
|
542
547
|
*/
|
|
543
|
-
traceCallback<
|
|
544
|
-
fn:
|
|
548
|
+
traceCallback<ThisArg = any, Args extends any[] = any[], Result = any>(
|
|
549
|
+
fn: (this: ThisArg, ...args: Args) => Result,
|
|
545
550
|
position?: number,
|
|
546
551
|
context?: ContextType,
|
|
547
|
-
thisArg?:
|
|
548
|
-
...args:
|
|
549
|
-
):
|
|
552
|
+
thisArg?: ThisArg,
|
|
553
|
+
...args: Args
|
|
554
|
+
): Result;
|
|
550
555
|
/**
|
|
551
556
|
* `true` if any of the individual channels has a subscriber, `false` if not.
|
|
552
557
|
*
|
|
@@ -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 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
|
/**
|
|
@@ -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
|
|
@@ -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 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
|
|
@@ -777,7 +829,12 @@ 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.
|
|
@@ -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
|
/**
|
|
@@ -36,39 +36,6 @@
|
|
|
36
36
|
*/
|
|
37
37
|
declare module "events" {
|
|
38
38
|
import { AsyncResource, AsyncResourceOptions } from "node:async_hooks";
|
|
39
|
-
// NOTE: This class is in the docs but is **not actually exported** by Node.
|
|
40
|
-
// If https://github.com/nodejs/node/issues/39903 gets resolved and Node
|
|
41
|
-
// actually starts exporting the class, uncomment below.
|
|
42
|
-
// import { EventListener, EventListenerObject } from '__dom-events';
|
|
43
|
-
// /** The NodeEventTarget is a Node.js-specific extension to EventTarget that emulates a subset of the EventEmitter API. */
|
|
44
|
-
// interface NodeEventTarget extends EventTarget {
|
|
45
|
-
// /**
|
|
46
|
-
// * Node.js-specific extension to the `EventTarget` class that emulates the equivalent `EventEmitter` API.
|
|
47
|
-
// * The only difference between `addListener()` and `addEventListener()` is that addListener() will return a reference to the EventTarget.
|
|
48
|
-
// */
|
|
49
|
-
// addListener(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this;
|
|
50
|
-
// /** Node.js-specific extension to the `EventTarget` class that returns an array of event `type` names for which event listeners are registered. */
|
|
51
|
-
// eventNames(): string[];
|
|
52
|
-
// /** Node.js-specific extension to the `EventTarget` class that returns the number of event listeners registered for the `type`. */
|
|
53
|
-
// listenerCount(type: string): number;
|
|
54
|
-
// /** Node.js-specific alias for `eventTarget.removeListener()`. */
|
|
55
|
-
// off(type: string, listener: EventListener | EventListenerObject): this;
|
|
56
|
-
// /** Node.js-specific alias for `eventTarget.addListener()`. */
|
|
57
|
-
// on(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this;
|
|
58
|
-
// /** Node.js-specific extension to the `EventTarget` class that adds a `once` listener for the given event `type`. This is equivalent to calling `on` with the `once` option set to `true`. */
|
|
59
|
-
// once(type: string, listener: EventListener | EventListenerObject): this;
|
|
60
|
-
// /**
|
|
61
|
-
// * Node.js-specific extension to the `EventTarget` class.
|
|
62
|
-
// * If `type` is specified, removes all registered listeners for `type`,
|
|
63
|
-
// * otherwise removes all registered listeners.
|
|
64
|
-
// */
|
|
65
|
-
// removeAllListeners(type: string): this;
|
|
66
|
-
// /**
|
|
67
|
-
// * Node.js-specific extension to the `EventTarget` class that removes the listener for the given `type`.
|
|
68
|
-
// * The only difference between `removeListener()` and `removeEventListener()` is that `removeListener()` will return a reference to the `EventTarget`.
|
|
69
|
-
// */
|
|
70
|
-
// removeListener(type: string, listener: EventListener | EventListenerObject): this;
|
|
71
|
-
// }
|
|
72
39
|
interface EventEmitterOptions {
|
|
73
40
|
/**
|
|
74
41
|
* Enables automatic capturing of promise rejection.
|
|
@@ -431,7 +398,6 @@ declare module "events" {
|
|
|
431
398
|
* }
|
|
432
399
|
* ```
|
|
433
400
|
* @since v20.5.0
|
|
434
|
-
* @experimental
|
|
435
401
|
* @return Disposable that removes the `abort` listener.
|
|
436
402
|
*/
|
|
437
403
|
static addAbortListener(signal: AbortSignal, resource: (event: Event) => void): Disposable;
|
|
@@ -518,7 +484,7 @@ declare module "events" {
|
|
|
518
484
|
* directly rather than as a child class.
|
|
519
485
|
* @default new.target.name if instantiated as a child class.
|
|
520
486
|
*/
|
|
521
|
-
name?: string;
|
|
487
|
+
name?: string | undefined;
|
|
522
488
|
}
|
|
523
489
|
|
|
524
490
|
/**
|
|
@@ -585,6 +551,85 @@ declare module "events" {
|
|
|
585
551
|
*/
|
|
586
552
|
readonly asyncResource: EventEmitterReferencingAsyncResource;
|
|
587
553
|
}
|
|
554
|
+
/**
|
|
555
|
+
* The `NodeEventTarget` is a Node.js-specific extension to `EventTarget`
|
|
556
|
+
* that emulates a subset of the `EventEmitter` API.
|
|
557
|
+
* @since v14.5.0
|
|
558
|
+
*/
|
|
559
|
+
export interface NodeEventTarget extends EventTarget {
|
|
560
|
+
/**
|
|
561
|
+
* Node.js-specific extension to the `EventTarget` class that emulates the
|
|
562
|
+
* equivalent `EventEmitter` API. The only difference between `addListener()` and
|
|
563
|
+
* `addEventListener()` is that `addListener()` will return a reference to the
|
|
564
|
+
* `EventTarget`.
|
|
565
|
+
* @since v14.5.0
|
|
566
|
+
*/
|
|
567
|
+
addListener(type: string, listener: (arg: any) => void): this;
|
|
568
|
+
/**
|
|
569
|
+
* Node.js-specific extension to the `EventTarget` class that dispatches the
|
|
570
|
+
* `arg` to the list of handlers for `type`.
|
|
571
|
+
* @since v15.2.0
|
|
572
|
+
* @returns `true` if event listeners registered for the `type` exist,
|
|
573
|
+
* otherwise `false`.
|
|
574
|
+
*/
|
|
575
|
+
emit(type: string, arg: any): boolean;
|
|
576
|
+
/**
|
|
577
|
+
* Node.js-specific extension to the `EventTarget` class that returns an array
|
|
578
|
+
* of event `type` names for which event listeners are registered.
|
|
579
|
+
* @since 14.5.0
|
|
580
|
+
*/
|
|
581
|
+
eventNames(): string[];
|
|
582
|
+
/**
|
|
583
|
+
* Node.js-specific extension to the `EventTarget` class that returns the number
|
|
584
|
+
* of event listeners registered for the `type`.
|
|
585
|
+
* @since v14.5.0
|
|
586
|
+
*/
|
|
587
|
+
listenerCount(type: string): number;
|
|
588
|
+
/**
|
|
589
|
+
* Node.js-specific extension to the `EventTarget` class that sets the number
|
|
590
|
+
* of max event listeners as `n`.
|
|
591
|
+
* @since v14.5.0
|
|
592
|
+
*/
|
|
593
|
+
setMaxListeners(n: number): void;
|
|
594
|
+
/**
|
|
595
|
+
* Node.js-specific extension to the `EventTarget` class that returns the number
|
|
596
|
+
* of max event listeners.
|
|
597
|
+
* @since v14.5.0
|
|
598
|
+
*/
|
|
599
|
+
getMaxListeners(): number;
|
|
600
|
+
/**
|
|
601
|
+
* Node.js-specific alias for `eventTarget.removeEventListener()`.
|
|
602
|
+
* @since v14.5.0
|
|
603
|
+
*/
|
|
604
|
+
off(type: string, listener: (arg: any) => void, options?: EventListenerOptions): this;
|
|
605
|
+
/**
|
|
606
|
+
* Node.js-specific alias for `eventTarget.addEventListener()`.
|
|
607
|
+
* @since v14.5.0
|
|
608
|
+
*/
|
|
609
|
+
on(type: string, listener: (arg: any) => void): this;
|
|
610
|
+
/**
|
|
611
|
+
* Node.js-specific extension to the `EventTarget` class that adds a `once`
|
|
612
|
+
* listener for the given event `type`. This is equivalent to calling `on`
|
|
613
|
+
* with the `once` option set to `true`.
|
|
614
|
+
* @since v14.5.0
|
|
615
|
+
*/
|
|
616
|
+
once(type: string, listener: (arg: any) => void): this;
|
|
617
|
+
/**
|
|
618
|
+
* Node.js-specific extension to the `EventTarget` class. If `type` is specified,
|
|
619
|
+
* removes all registered listeners for `type`, otherwise removes all registered
|
|
620
|
+
* listeners.
|
|
621
|
+
* @since v14.5.0
|
|
622
|
+
*/
|
|
623
|
+
removeAllListeners(type?: string): this;
|
|
624
|
+
/**
|
|
625
|
+
* Node.js-specific extension to the `EventTarget` class that removes the
|
|
626
|
+
* `listener` for the given `type`. The only difference between `removeListener()`
|
|
627
|
+
* and `removeEventListener()` is that `removeListener()` will return a reference
|
|
628
|
+
* to the `EventTarget`.
|
|
629
|
+
* @since v14.5.0
|
|
630
|
+
*/
|
|
631
|
+
removeListener(type: string, listener: (arg: any) => void, options?: EventListenerOptions): this;
|
|
632
|
+
}
|
|
588
633
|
}
|
|
589
634
|
global {
|
|
590
635
|
namespace NodeJS {
|