@types/node 22.15.21 → 22.18.10
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.18/README.md +15 -0
- node/assert.d.ts → node v22.18/assert.d.ts +19 -0
- node/buffer.d.ts → node v22.18/buffer.d.ts +6 -2
- node/child_process.d.ts → node v22.18/child_process.d.ts +41 -131
- node/cluster.d.ts → node v22.18/cluster.d.ts +3 -4
- node/compatibility/disposable.d.ts → node v22.18/compatibility/disposable.d.ts +0 -2
- node/compatibility/indexable.d.ts → node v22.18/compatibility/indexable.d.ts +0 -3
- node/compatibility/iterators.d.ts → node v22.18/compatibility/iterators.d.ts +0 -1
- node/crypto.d.ts → node v22.18/crypto.d.ts +52 -36
- node/diagnostics_channel.d.ts → node v22.18/diagnostics_channel.d.ts +17 -12
- node/dns/promises.d.ts → node v22.18/dns/promises.d.ts +36 -9
- node/dns.d.ts → node v22.18/dns.d.ts +74 -21
- node/events.d.ts → node v22.18/events.d.ts +80 -35
- node/fs/promises.d.ts → node v22.18/fs/promises.d.ts +44 -39
- node/fs.d.ts → node v22.18/fs.d.ts +67 -56
- node v22.18/globals.d.ts +172 -0
- node/http.d.ts → node v22.18/http.d.ts +71 -10
- node/http2.d.ts → node v22.18/http2.d.ts +85 -5
- node/https.d.ts → node v22.18/https.d.ts +14 -12
- node/index.d.ts → node v22.18/index.d.ts +7 -3
- node/inspector.d.ts → node v22.18/inspector.generated.d.ts +219 -10
- node/module.d.ts → node v22.18/module.d.ts +136 -17
- node/net.d.ts → node v22.18/net.d.ts +5 -5
- node/os.d.ts → node v22.18/os.d.ts +13 -3
- node/package.json → node v22.18/package.json +3 -83
- node/perf_hooks.d.ts → node v22.18/perf_hooks.d.ts +8 -10
- node/process.d.ts → node v22.18/process.d.ts +10 -23
- node/readline/promises.d.ts → node v22.18/readline/promises.d.ts +1 -2
- node/repl.d.ts → node v22.18/repl.d.ts +3 -5
- node/sqlite.d.ts → node v22.18/sqlite.d.ts +207 -0
- node/stream/web.d.ts → node v22.18/stream/web.d.ts +8 -0
- node/stream.d.ts → node v22.18/stream.d.ts +34 -32
- node v22.18/test.d.ts +2162 -0
- node/tls.d.ts → node v22.18/tls.d.ts +2 -2
- node/ts5.6/index.d.ts → node v22.18/ts5.6/index.d.ts +7 -3
- node/url.d.ts → node v22.18/url.d.ts +12 -3
- node/util.d.ts → node v22.18/util.d.ts +20 -5
- node/v8.d.ts → node v22.18/v8.d.ts +62 -32
- node/vm.d.ts → node v22.18/vm.d.ts +62 -54
- node v22.18/web-globals/abortcontroller.d.ts +34 -0
- node v22.18/web-globals/domexception.d.ts +68 -0
- node v22.18/web-globals/events.d.ts +97 -0
- node v22.18/web-globals/fetch.d.ts +46 -0
- node v22.18/web-globals/navigator.d.ts +22 -0
- node v22.18/web-globals/storage.d.ts +24 -0
- node/worker_threads.d.ts → node v22.18/worker_threads.d.ts +105 -74
- node/zlib.d.ts → node v22.18/zlib.d.ts +8 -2
- node/README.md +0 -15
- node/dom-events.d.ts +0 -124
- node/globals.d.ts +0 -371
- node/test.d.ts +0 -2280
- {node → node v22.18}/LICENSE +0 -0
- {node → node v22.18}/assert/strict.d.ts +0 -0
- node/async_hooks.d.ts → node v22.18/async_hooks.d.ts +1 -1
- {node → node v22.18}/buffer.buffer.d.ts +0 -0
- {node → node v22.18}/compatibility/index.d.ts +0 -0
- {node → node v22.18}/console.d.ts +0 -0
- {node → node v22.18}/constants.d.ts +0 -0
- {node → node v22.18}/dgram.d.ts +0 -0
- {node → node v22.18}/domain.d.ts +0 -0
- {node → node v22.18}/globals.typedarray.d.ts +0 -0
- {node → node v22.18}/path.d.ts +0 -0
- {node → node v22.18}/punycode.d.ts +0 -0
- {node → node v22.18}/querystring.d.ts +0 -0
- {node → node v22.18}/readline.d.ts +0 -0
- {node → node v22.18}/sea.d.ts +0 -0
- {node → node v22.18}/stream/consumers.d.ts +0 -0
- {node → node v22.18}/stream/promises.d.ts +0 -0
- {node → node v22.18}/string_decoder.d.ts +0 -0
- {node → node v22.18}/timers/promises.d.ts +0 -0
- {node → node v22.18}/timers.d.ts +0 -0
- {node → node v22.18}/trace_events.d.ts +0 -0
- {node → node v22.18}/ts5.6/buffer.buffer.d.ts +0 -0
- {node → node v22.18}/ts5.6/globals.typedarray.d.ts +0 -0
- {node → node v22.18}/tty.d.ts +0 -0
- {node → node v22.18}/wasi.d.ts +0 -0
|
@@ -510,50 +510,50 @@ declare module "crypto" {
|
|
|
510
510
|
format: "jwk";
|
|
511
511
|
}
|
|
512
512
|
interface JsonWebKey {
|
|
513
|
-
crv?: string
|
|
514
|
-
d?: string
|
|
515
|
-
dp?: string
|
|
516
|
-
dq?: string
|
|
517
|
-
e?: string
|
|
518
|
-
k?: string
|
|
519
|
-
kty?: string
|
|
520
|
-
n?: string
|
|
521
|
-
p?: string
|
|
522
|
-
q?: string
|
|
523
|
-
qi?: string
|
|
524
|
-
x?: string
|
|
525
|
-
y?: string
|
|
513
|
+
crv?: string;
|
|
514
|
+
d?: string;
|
|
515
|
+
dp?: string;
|
|
516
|
+
dq?: string;
|
|
517
|
+
e?: string;
|
|
518
|
+
k?: string;
|
|
519
|
+
kty?: string;
|
|
520
|
+
n?: string;
|
|
521
|
+
p?: string;
|
|
522
|
+
q?: string;
|
|
523
|
+
qi?: string;
|
|
524
|
+
x?: string;
|
|
525
|
+
y?: string;
|
|
526
526
|
[key: string]: unknown;
|
|
527
527
|
}
|
|
528
528
|
interface AsymmetricKeyDetails {
|
|
529
529
|
/**
|
|
530
530
|
* Key size in bits (RSA, DSA).
|
|
531
531
|
*/
|
|
532
|
-
modulusLength?: number
|
|
532
|
+
modulusLength?: number;
|
|
533
533
|
/**
|
|
534
534
|
* Public exponent (RSA).
|
|
535
535
|
*/
|
|
536
|
-
publicExponent?: bigint
|
|
536
|
+
publicExponent?: bigint;
|
|
537
537
|
/**
|
|
538
538
|
* Name of the message digest (RSA-PSS).
|
|
539
539
|
*/
|
|
540
|
-
hashAlgorithm?: string
|
|
540
|
+
hashAlgorithm?: string;
|
|
541
541
|
/**
|
|
542
542
|
* Name of the message digest used by MGF1 (RSA-PSS).
|
|
543
543
|
*/
|
|
544
|
-
mgf1HashAlgorithm?: string
|
|
544
|
+
mgf1HashAlgorithm?: string;
|
|
545
545
|
/**
|
|
546
546
|
* Minimal salt length in bytes (RSA-PSS).
|
|
547
547
|
*/
|
|
548
|
-
saltLength?: number
|
|
548
|
+
saltLength?: number;
|
|
549
549
|
/**
|
|
550
550
|
* Size of q in bits (DSA).
|
|
551
551
|
*/
|
|
552
|
-
divisorLength?: number
|
|
552
|
+
divisorLength?: number;
|
|
553
553
|
/**
|
|
554
554
|
* Name of the curve (EC).
|
|
555
555
|
*/
|
|
556
|
-
namedCurve?: string
|
|
556
|
+
namedCurve?: string;
|
|
557
557
|
}
|
|
558
558
|
/**
|
|
559
559
|
* Node.js uses a `KeyObject` class to represent a symmetric or asymmetric key,
|
|
@@ -608,7 +608,7 @@ declare module "crypto" {
|
|
|
608
608
|
* keys.
|
|
609
609
|
* @since v11.6.0
|
|
610
610
|
*/
|
|
611
|
-
asymmetricKeyType?: KeyType
|
|
611
|
+
asymmetricKeyType?: KeyType;
|
|
612
612
|
/**
|
|
613
613
|
* This property exists only on asymmetric keys. Depending on the type of the key,
|
|
614
614
|
* this object contains information about the key. None of the information obtained
|
|
@@ -622,7 +622,7 @@ declare module "crypto" {
|
|
|
622
622
|
* Other key details might be exposed via this API using additional attributes.
|
|
623
623
|
* @since v15.7.0
|
|
624
624
|
*/
|
|
625
|
-
asymmetricKeyDetails?: AsymmetricKeyDetails
|
|
625
|
+
asymmetricKeyDetails?: AsymmetricKeyDetails;
|
|
626
626
|
/**
|
|
627
627
|
* For symmetric keys, the following encoding options can be used:
|
|
628
628
|
*
|
|
@@ -661,7 +661,7 @@ declare module "crypto" {
|
|
|
661
661
|
* property is `undefined` for asymmetric keys.
|
|
662
662
|
* @since v11.6.0
|
|
663
663
|
*/
|
|
664
|
-
symmetricKeySize?: number
|
|
664
|
+
symmetricKeySize?: number;
|
|
665
665
|
/**
|
|
666
666
|
* Converts a `KeyObject` instance to a `CryptoKey`.
|
|
667
667
|
* @since 22.10.0
|
|
@@ -2505,15 +2505,15 @@ declare module "crypto" {
|
|
|
2505
2505
|
/**
|
|
2506
2506
|
* Name of the message digest
|
|
2507
2507
|
*/
|
|
2508
|
-
hashAlgorithm?: string;
|
|
2508
|
+
hashAlgorithm?: string | undefined;
|
|
2509
2509
|
/**
|
|
2510
2510
|
* Name of the message digest used by MGF1
|
|
2511
2511
|
*/
|
|
2512
|
-
mgf1HashAlgorithm?: string;
|
|
2512
|
+
mgf1HashAlgorithm?: string | undefined;
|
|
2513
2513
|
/**
|
|
2514
2514
|
* Minimal salt length in bytes
|
|
2515
2515
|
*/
|
|
2516
|
-
saltLength?: string;
|
|
2516
|
+
saltLength?: string | undefined;
|
|
2517
2517
|
}
|
|
2518
2518
|
interface DSAKeyPairKeyObjectOptions {
|
|
2519
2519
|
/**
|
|
@@ -2556,15 +2556,15 @@ declare module "crypto" {
|
|
|
2556
2556
|
/**
|
|
2557
2557
|
* Name of the message digest
|
|
2558
2558
|
*/
|
|
2559
|
-
hashAlgorithm?: string;
|
|
2559
|
+
hashAlgorithm?: string | undefined;
|
|
2560
2560
|
/**
|
|
2561
2561
|
* Name of the message digest used by MGF1
|
|
2562
2562
|
*/
|
|
2563
|
-
mgf1HashAlgorithm?: string;
|
|
2563
|
+
mgf1HashAlgorithm?: string | undefined;
|
|
2564
2564
|
/**
|
|
2565
2565
|
* Minimal salt length in bytes
|
|
2566
2566
|
*/
|
|
2567
|
-
saltLength?: string;
|
|
2567
|
+
saltLength?: string | undefined;
|
|
2568
2568
|
publicKeyEncoding: {
|
|
2569
2569
|
type: "spki";
|
|
2570
2570
|
format: PubF;
|
|
@@ -3554,23 +3554,23 @@ declare module "crypto" {
|
|
|
3554
3554
|
/**
|
|
3555
3555
|
* @default 'always'
|
|
3556
3556
|
*/
|
|
3557
|
-
subject?: "always" | "default" | "never";
|
|
3557
|
+
subject?: "always" | "default" | "never" | undefined;
|
|
3558
3558
|
/**
|
|
3559
3559
|
* @default true
|
|
3560
3560
|
*/
|
|
3561
|
-
wildcards?: boolean;
|
|
3561
|
+
wildcards?: boolean | undefined;
|
|
3562
3562
|
/**
|
|
3563
3563
|
* @default true
|
|
3564
3564
|
*/
|
|
3565
|
-
partialWildcards?: boolean;
|
|
3565
|
+
partialWildcards?: boolean | undefined;
|
|
3566
3566
|
/**
|
|
3567
3567
|
* @default false
|
|
3568
3568
|
*/
|
|
3569
|
-
multiLabelWildcards?: boolean;
|
|
3569
|
+
multiLabelWildcards?: boolean | undefined;
|
|
3570
3570
|
/**
|
|
3571
3571
|
* @default false
|
|
3572
3572
|
*/
|
|
3573
|
-
singleLabelSubdomains?: boolean;
|
|
3573
|
+
singleLabelSubdomains?: boolean | undefined;
|
|
3574
3574
|
}
|
|
3575
3575
|
/**
|
|
3576
3576
|
* Encapsulates an X509 certificate and provides read-only access to
|
|
@@ -3672,7 +3672,7 @@ declare module "crypto" {
|
|
|
3672
3672
|
* available.
|
|
3673
3673
|
* @since v15.9.0
|
|
3674
3674
|
*/
|
|
3675
|
-
readonly issuerCertificate
|
|
3675
|
+
readonly issuerCertificate: X509Certificate | undefined;
|
|
3676
3676
|
/**
|
|
3677
3677
|
* The public key `KeyObject` for this certificate.
|
|
3678
3678
|
* @since v15.6.0
|
|
@@ -3764,7 +3764,23 @@ declare module "crypto" {
|
|
|
3764
3764
|
*/
|
|
3765
3765
|
checkIP(ip: string): string | undefined;
|
|
3766
3766
|
/**
|
|
3767
|
-
* Checks whether this certificate was issued by the given `otherCert
|
|
3767
|
+
* Checks whether this certificate was potentially issued by the given `otherCert`
|
|
3768
|
+
* by comparing the certificate metadata.
|
|
3769
|
+
*
|
|
3770
|
+
* This is useful for pruning a list of possible issuer certificates which have been
|
|
3771
|
+
* selected using a more rudimentary filtering routine, i.e. just based on subject
|
|
3772
|
+
* and issuer names.
|
|
3773
|
+
*
|
|
3774
|
+
* Finally, to verify that this certificate's signature was produced by a private key
|
|
3775
|
+
* corresponding to `otherCert`'s public key use `x509.verify(publicKey)`
|
|
3776
|
+
* with `otherCert`'s public key represented as a `KeyObject`
|
|
3777
|
+
* like so
|
|
3778
|
+
*
|
|
3779
|
+
* ```js
|
|
3780
|
+
* if (!x509.verify(otherCert.publicKey)) {
|
|
3781
|
+
* throw new Error('otherCert did not issue x509');
|
|
3782
|
+
* }
|
|
3783
|
+
* ```
|
|
3768
3784
|
* @since v15.6.0
|
|
3769
3785
|
*/
|
|
3770
3786
|
checkIssued(otherCert: X509Certificate): boolean;
|
|
@@ -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,7 @@ 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;
|
|
781
833
|
}
|
|
782
834
|
/**
|
|
783
835
|
* An independent resolver for DNS requests.
|
|
@@ -838,6 +890,7 @@ declare module "dns" {
|
|
|
838
890
|
resolvePtr: typeof resolvePtr;
|
|
839
891
|
resolveSoa: typeof resolveSoa;
|
|
840
892
|
resolveSrv: typeof resolveSrv;
|
|
893
|
+
resolveTlsa: typeof resolveTlsa;
|
|
841
894
|
resolveTxt: typeof resolveTxt;
|
|
842
895
|
reverse: typeof reverse;
|
|
843
896
|
/**
|
|
@@ -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 {
|