@types/node 20.6.2 → 20.6.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/README.md +1 -1
- node/assert/strict.d.ts +4 -4
- node/assert.d.ts +48 -24
- node/async_hooks.d.ts +13 -6
- node/buffer.d.ts +32 -34
- node/child_process.d.ts +262 -122
- node/cluster.d.ts +107 -89
- node/console.d.ts +7 -7
- node/constants.d.ts +12 -11
- node/crypto.d.ts +746 -268
- node/dgram.d.ts +81 -45
- node/diagnostics_channel.d.ts +3 -3
- node/dns/promises.d.ts +28 -25
- node/dns.d.ts +203 -62
- node/dom-events.d.ts +67 -71
- node/domain.d.ts +4 -4
- node/events.d.ts +15 -7
- node/fs/promises.d.ts +102 -73
- node/fs.d.ts +513 -311
- node/globals.d.ts +18 -20
- node/http.d.ts +238 -186
- node/http2.d.ts +628 -376
- node/https.d.ts +221 -112
- node/inspector.d.ts +3 -3
- node/module.d.ts +16 -9
- node/net.d.ts +112 -93
- node/os.d.ts +7 -7
- node/package.json +2 -2
- node/path.d.ts +13 -13
- node/perf_hooks.d.ts +19 -18
- node/process.d.ts +155 -125
- node/punycode.d.ts +3 -3
- node/querystring.d.ts +14 -4
- node/readline/promises.d.ts +12 -7
- node/readline.d.ts +69 -56
- node/repl.d.ts +67 -61
- node/stream/consumers.d.ts +5 -5
- node/stream/promises.d.ts +56 -15
- node/stream/web.d.ts +26 -20
- node/stream.d.ts +361 -228
- node/string_decoder.d.ts +3 -3
- node/test.d.ts +78 -93
- node/timers/promises.d.ts +4 -4
- node/timers.d.ts +23 -8
- node/tls.d.ts +151 -71
- node/trace_events.d.ts +3 -3
- node/ts4.8/assert/strict.d.ts +4 -4
- node/ts4.8/assert.d.ts +48 -24
- node/ts4.8/async_hooks.d.ts +13 -6
- node/ts4.8/buffer.d.ts +32 -34
- node/ts4.8/child_process.d.ts +262 -122
- node/ts4.8/cluster.d.ts +107 -89
- node/ts4.8/console.d.ts +7 -7
- node/ts4.8/constants.d.ts +12 -11
- node/ts4.8/crypto.d.ts +746 -268
- node/ts4.8/dgram.d.ts +81 -45
- node/ts4.8/diagnostics_channel.d.ts +3 -3
- node/ts4.8/dns/promises.d.ts +28 -25
- node/ts4.8/dns.d.ts +203 -62
- node/ts4.8/dom-events.d.ts +67 -71
- node/ts4.8/domain.d.ts +4 -4
- node/ts4.8/events.d.ts +15 -7
- node/ts4.8/fs/promises.d.ts +102 -73
- node/ts4.8/fs.d.ts +513 -311
- node/ts4.8/globals.d.ts +18 -20
- node/ts4.8/http.d.ts +238 -186
- node/ts4.8/http2.d.ts +628 -376
- node/ts4.8/https.d.ts +221 -112
- node/ts4.8/inspector.d.ts +3 -3
- node/ts4.8/module.d.ts +16 -9
- node/ts4.8/net.d.ts +112 -93
- node/ts4.8/os.d.ts +7 -7
- node/ts4.8/path.d.ts +13 -13
- node/ts4.8/perf_hooks.d.ts +19 -18
- node/ts4.8/process.d.ts +155 -125
- node/ts4.8/punycode.d.ts +3 -3
- node/ts4.8/querystring.d.ts +14 -4
- node/ts4.8/readline/promises.d.ts +12 -7
- node/ts4.8/readline.d.ts +69 -56
- node/ts4.8/repl.d.ts +67 -61
- node/ts4.8/stream/consumers.d.ts +5 -5
- node/ts4.8/stream/promises.d.ts +56 -15
- node/ts4.8/stream/web.d.ts +26 -20
- node/ts4.8/stream.d.ts +326 -219
- node/ts4.8/string_decoder.d.ts +3 -3
- node/ts4.8/test.d.ts +78 -93
- node/ts4.8/timers/promises.d.ts +4 -4
- node/ts4.8/timers.d.ts +23 -8
- node/ts4.8/tls.d.ts +151 -71
- node/ts4.8/trace_events.d.ts +3 -3
- node/ts4.8/tty.d.ts +10 -10
- node/ts4.8/url.d.ts +26 -14
- node/ts4.8/util.d.ts +178 -116
- node/ts4.8/v8.d.ts +4 -4
- node/ts4.8/vm.d.ts +52 -46
- node/ts4.8/wasi.d.ts +3 -3
- node/ts4.8/worker_threads.d.ts +81 -84
- node/ts4.8/zlib.d.ts +9 -9
- node/tty.d.ts +10 -10
- node/url.d.ts +26 -14
- node/util.d.ts +178 -116
- node/v8.d.ts +4 -4
- node/vm.d.ts +52 -46
- node/wasi.d.ts +3 -3
- node/worker_threads.d.ts +81 -84
- node/zlib.d.ts +9 -9
node/tls.d.ts
CHANGED
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
* ```
|
|
9
9
|
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/tls.js)
|
|
10
10
|
*/
|
|
11
|
-
declare module
|
|
12
|
-
import { X509Certificate } from
|
|
13
|
-
import * as net from
|
|
14
|
-
import * as stream from
|
|
11
|
+
declare module "tls" {
|
|
12
|
+
import { X509Certificate } from "node:crypto";
|
|
13
|
+
import * as net from "node:net";
|
|
14
|
+
import * as stream from "stream";
|
|
15
15
|
const CLIENT_RENEG_LIMIT: number;
|
|
16
16
|
const CLIENT_RENEG_WINDOW: number;
|
|
17
17
|
interface Certificate {
|
|
@@ -396,7 +396,7 @@ declare module 'node:tls' {
|
|
|
396
396
|
rejectUnauthorized?: boolean | undefined;
|
|
397
397
|
requestCert?: boolean | undefined;
|
|
398
398
|
},
|
|
399
|
-
callback: (err: Error | null) => void
|
|
399
|
+
callback: (err: Error | null) => void,
|
|
400
400
|
): undefined | boolean;
|
|
401
401
|
/**
|
|
402
402
|
* The `tlsSocket.setMaxSendFragment()` method sets the maximum TLS fragment size.
|
|
@@ -472,35 +472,35 @@ declare module 'node:tls' {
|
|
|
472
472
|
*/
|
|
473
473
|
exportKeyingMaterial(length: number, label: string, context: Buffer): Buffer;
|
|
474
474
|
addListener(event: string, listener: (...args: any[]) => void): this;
|
|
475
|
-
addListener(event:
|
|
476
|
-
addListener(event:
|
|
477
|
-
addListener(event:
|
|
478
|
-
addListener(event:
|
|
475
|
+
addListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
|
|
476
|
+
addListener(event: "secureConnect", listener: () => void): this;
|
|
477
|
+
addListener(event: "session", listener: (session: Buffer) => void): this;
|
|
478
|
+
addListener(event: "keylog", listener: (line: Buffer) => void): this;
|
|
479
479
|
emit(event: string | symbol, ...args: any[]): boolean;
|
|
480
|
-
emit(event:
|
|
481
|
-
emit(event:
|
|
482
|
-
emit(event:
|
|
483
|
-
emit(event:
|
|
480
|
+
emit(event: "OCSPResponse", response: Buffer): boolean;
|
|
481
|
+
emit(event: "secureConnect"): boolean;
|
|
482
|
+
emit(event: "session", session: Buffer): boolean;
|
|
483
|
+
emit(event: "keylog", line: Buffer): boolean;
|
|
484
484
|
on(event: string, listener: (...args: any[]) => void): this;
|
|
485
|
-
on(event:
|
|
486
|
-
on(event:
|
|
487
|
-
on(event:
|
|
488
|
-
on(event:
|
|
485
|
+
on(event: "OCSPResponse", listener: (response: Buffer) => void): this;
|
|
486
|
+
on(event: "secureConnect", listener: () => void): this;
|
|
487
|
+
on(event: "session", listener: (session: Buffer) => void): this;
|
|
488
|
+
on(event: "keylog", listener: (line: Buffer) => void): this;
|
|
489
489
|
once(event: string, listener: (...args: any[]) => void): this;
|
|
490
|
-
once(event:
|
|
491
|
-
once(event:
|
|
492
|
-
once(event:
|
|
493
|
-
once(event:
|
|
490
|
+
once(event: "OCSPResponse", listener: (response: Buffer) => void): this;
|
|
491
|
+
once(event: "secureConnect", listener: () => void): this;
|
|
492
|
+
once(event: "session", listener: (session: Buffer) => void): this;
|
|
493
|
+
once(event: "keylog", listener: (line: Buffer) => void): this;
|
|
494
494
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
495
|
-
prependListener(event:
|
|
496
|
-
prependListener(event:
|
|
497
|
-
prependListener(event:
|
|
498
|
-
prependListener(event:
|
|
495
|
+
prependListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
|
|
496
|
+
prependListener(event: "secureConnect", listener: () => void): this;
|
|
497
|
+
prependListener(event: "session", listener: (session: Buffer) => void): this;
|
|
498
|
+
prependListener(event: "keylog", listener: (line: Buffer) => void): this;
|
|
499
499
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
500
|
-
prependOnceListener(event:
|
|
501
|
-
prependOnceListener(event:
|
|
502
|
-
prependOnceListener(event:
|
|
503
|
-
prependOnceListener(event:
|
|
500
|
+
prependOnceListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
|
|
501
|
+
prependOnceListener(event: "secureConnect", listener: () => void): this;
|
|
502
|
+
prependOnceListener(event: "session", listener: (session: Buffer) => void): this;
|
|
503
|
+
prependOnceListener(event: "keylog", listener: (line: Buffer) => void): this;
|
|
504
504
|
}
|
|
505
505
|
interface CommonConnectionOptions {
|
|
506
506
|
/**
|
|
@@ -561,7 +561,6 @@ declare module 'node:tls' {
|
|
|
561
561
|
*/
|
|
562
562
|
ticketKeys?: Buffer | undefined;
|
|
563
563
|
/**
|
|
564
|
-
*
|
|
565
564
|
* @param socket
|
|
566
565
|
* @param identity identity parameter sent from the client.
|
|
567
566
|
* @return pre-shared key that must either be
|
|
@@ -677,47 +676,118 @@ declare module 'node:tls' {
|
|
|
677
676
|
* 6. keylog
|
|
678
677
|
*/
|
|
679
678
|
addListener(event: string, listener: (...args: any[]) => void): this;
|
|
680
|
-
addListener(event:
|
|
681
|
-
addListener(
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
addListener(
|
|
679
|
+
addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
|
680
|
+
addListener(
|
|
681
|
+
event: "newSession",
|
|
682
|
+
listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
|
|
683
|
+
): this;
|
|
684
|
+
addListener(
|
|
685
|
+
event: "OCSPRequest",
|
|
686
|
+
listener: (
|
|
687
|
+
certificate: Buffer,
|
|
688
|
+
issuer: Buffer,
|
|
689
|
+
callback: (err: Error | null, resp: Buffer) => void,
|
|
690
|
+
) => void,
|
|
691
|
+
): this;
|
|
692
|
+
addListener(
|
|
693
|
+
event: "resumeSession",
|
|
694
|
+
listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
|
|
695
|
+
): this;
|
|
696
|
+
addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
|
697
|
+
addListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
|
|
686
698
|
emit(event: string | symbol, ...args: any[]): boolean;
|
|
687
|
-
emit(event:
|
|
688
|
-
emit(event:
|
|
689
|
-
emit(
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
699
|
+
emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean;
|
|
700
|
+
emit(event: "newSession", sessionId: Buffer, sessionData: Buffer, callback: () => void): boolean;
|
|
701
|
+
emit(
|
|
702
|
+
event: "OCSPRequest",
|
|
703
|
+
certificate: Buffer,
|
|
704
|
+
issuer: Buffer,
|
|
705
|
+
callback: (err: Error | null, resp: Buffer) => void,
|
|
706
|
+
): boolean;
|
|
707
|
+
emit(
|
|
708
|
+
event: "resumeSession",
|
|
709
|
+
sessionId: Buffer,
|
|
710
|
+
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
711
|
+
): boolean;
|
|
712
|
+
emit(event: "secureConnection", tlsSocket: TLSSocket): boolean;
|
|
713
|
+
emit(event: "keylog", line: Buffer, tlsSocket: TLSSocket): boolean;
|
|
693
714
|
on(event: string, listener: (...args: any[]) => void): this;
|
|
694
|
-
on(event:
|
|
695
|
-
on(event:
|
|
696
|
-
on(
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
715
|
+
on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
|
716
|
+
on(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this;
|
|
717
|
+
on(
|
|
718
|
+
event: "OCSPRequest",
|
|
719
|
+
listener: (
|
|
720
|
+
certificate: Buffer,
|
|
721
|
+
issuer: Buffer,
|
|
722
|
+
callback: (err: Error | null, resp: Buffer) => void,
|
|
723
|
+
) => void,
|
|
724
|
+
): this;
|
|
725
|
+
on(
|
|
726
|
+
event: "resumeSession",
|
|
727
|
+
listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
|
|
728
|
+
): this;
|
|
729
|
+
on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
|
730
|
+
on(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
|
|
700
731
|
once(event: string, listener: (...args: any[]) => void): this;
|
|
701
|
-
once(event:
|
|
702
|
-
once(
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
once(
|
|
732
|
+
once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
|
733
|
+
once(
|
|
734
|
+
event: "newSession",
|
|
735
|
+
listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
|
|
736
|
+
): this;
|
|
737
|
+
once(
|
|
738
|
+
event: "OCSPRequest",
|
|
739
|
+
listener: (
|
|
740
|
+
certificate: Buffer,
|
|
741
|
+
issuer: Buffer,
|
|
742
|
+
callback: (err: Error | null, resp: Buffer) => void,
|
|
743
|
+
) => void,
|
|
744
|
+
): this;
|
|
745
|
+
once(
|
|
746
|
+
event: "resumeSession",
|
|
747
|
+
listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
|
|
748
|
+
): this;
|
|
749
|
+
once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
|
750
|
+
once(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
|
|
707
751
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
708
|
-
prependListener(event:
|
|
709
|
-
prependListener(
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
prependListener(
|
|
752
|
+
prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
|
753
|
+
prependListener(
|
|
754
|
+
event: "newSession",
|
|
755
|
+
listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
|
|
756
|
+
): this;
|
|
757
|
+
prependListener(
|
|
758
|
+
event: "OCSPRequest",
|
|
759
|
+
listener: (
|
|
760
|
+
certificate: Buffer,
|
|
761
|
+
issuer: Buffer,
|
|
762
|
+
callback: (err: Error | null, resp: Buffer) => void,
|
|
763
|
+
) => void,
|
|
764
|
+
): this;
|
|
765
|
+
prependListener(
|
|
766
|
+
event: "resumeSession",
|
|
767
|
+
listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
|
|
768
|
+
): this;
|
|
769
|
+
prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
|
770
|
+
prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
|
|
714
771
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
715
|
-
prependOnceListener(event:
|
|
716
|
-
prependOnceListener(
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
prependOnceListener(
|
|
772
|
+
prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
|
773
|
+
prependOnceListener(
|
|
774
|
+
event: "newSession",
|
|
775
|
+
listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
|
|
776
|
+
): this;
|
|
777
|
+
prependOnceListener(
|
|
778
|
+
event: "OCSPRequest",
|
|
779
|
+
listener: (
|
|
780
|
+
certificate: Buffer,
|
|
781
|
+
issuer: Buffer,
|
|
782
|
+
callback: (err: Error | null, resp: Buffer) => void,
|
|
783
|
+
) => void,
|
|
784
|
+
): this;
|
|
785
|
+
prependOnceListener(
|
|
786
|
+
event: "resumeSession",
|
|
787
|
+
listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
|
|
788
|
+
): this;
|
|
789
|
+
prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
|
790
|
+
prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
|
|
721
791
|
}
|
|
722
792
|
/**
|
|
723
793
|
* @deprecated since v0.11.3 Use `tls.TLSSocket` instead.
|
|
@@ -726,7 +796,7 @@ declare module 'node:tls' {
|
|
|
726
796
|
encrypted: TLSSocket;
|
|
727
797
|
cleartext: TLSSocket;
|
|
728
798
|
}
|
|
729
|
-
type SecureVersion =
|
|
799
|
+
type SecureVersion = "TLSv1.3" | "TLSv1.2" | "TLSv1.1" | "TLSv1";
|
|
730
800
|
interface SecureContextOptions {
|
|
731
801
|
/**
|
|
732
802
|
* If set, this will be called when a client opens a connection using the ALPN extension.
|
|
@@ -1008,7 +1078,12 @@ declare module 'node:tls' {
|
|
|
1008
1078
|
* @since v0.11.3
|
|
1009
1079
|
*/
|
|
1010
1080
|
function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
|
|
1011
|
-
function connect(
|
|
1081
|
+
function connect(
|
|
1082
|
+
port: number,
|
|
1083
|
+
host?: string,
|
|
1084
|
+
options?: ConnectionOptions,
|
|
1085
|
+
secureConnectListener?: () => void,
|
|
1086
|
+
): TLSSocket;
|
|
1012
1087
|
function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
|
|
1013
1088
|
/**
|
|
1014
1089
|
* Creates a new secure pair object with two streams, one of which reads and writes
|
|
@@ -1043,7 +1118,12 @@ declare module 'node:tls' {
|
|
|
1043
1118
|
* @param requestCert `true` to specify whether a server should request a certificate from a connecting client. Only applies when `isServer` is `true`.
|
|
1044
1119
|
* @param rejectUnauthorized If not `false` a server automatically reject clients with invalid certificates. Only applies when `isServer` is `true`.
|
|
1045
1120
|
*/
|
|
1046
|
-
function createSecurePair(
|
|
1121
|
+
function createSecurePair(
|
|
1122
|
+
context?: SecureContext,
|
|
1123
|
+
isServer?: boolean,
|
|
1124
|
+
requestCert?: boolean,
|
|
1125
|
+
rejectUnauthorized?: boolean,
|
|
1126
|
+
): SecurePair;
|
|
1047
1127
|
/**
|
|
1048
1128
|
* {@link createServer} sets the default value of the `honorCipherOrder` option
|
|
1049
1129
|
* to `true`, other APIs that create secure contexts leave it unset.
|
|
@@ -1125,6 +1205,6 @@ declare module 'node:tls' {
|
|
|
1125
1205
|
*/
|
|
1126
1206
|
const rootCertificates: ReadonlyArray<string>;
|
|
1127
1207
|
}
|
|
1128
|
-
declare module
|
|
1129
|
-
export * from
|
|
1208
|
+
declare module "node:tls" {
|
|
1209
|
+
export * from "tls";
|
|
1130
1210
|
}
|
node/trace_events.d.ts
CHANGED
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
* @experimental
|
|
97
97
|
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/trace_events.js)
|
|
98
98
|
*/
|
|
99
|
-
declare module
|
|
99
|
+
declare module "trace_events" {
|
|
100
100
|
/**
|
|
101
101
|
* The `Tracing` object is used to enable or disable tracing for sets of
|
|
102
102
|
* categories. Instances are created using the
|
|
@@ -177,6 +177,6 @@ declare module 'node:trace_events' {
|
|
|
177
177
|
*/
|
|
178
178
|
function getEnabledCategories(): string | undefined;
|
|
179
179
|
}
|
|
180
|
-
declare module
|
|
181
|
-
export * from
|
|
180
|
+
declare module "node:trace_events" {
|
|
181
|
+
export * from "trace_events";
|
|
182
182
|
}
|
node/ts4.8/assert/strict.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
declare module
|
|
2
|
-
import { strict } from
|
|
1
|
+
declare module "assert/strict" {
|
|
2
|
+
import { strict } from "node:assert";
|
|
3
3
|
export = strict;
|
|
4
4
|
}
|
|
5
|
-
declare module
|
|
6
|
-
import { strict } from
|
|
5
|
+
declare module "node:assert/strict" {
|
|
6
|
+
import { strict } from "node:assert";
|
|
7
7
|
export = strict;
|
|
8
8
|
}
|
node/ts4.8/assert.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* invariants.
|
|
4
4
|
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/assert.js)
|
|
5
5
|
*/
|
|
6
|
-
declare module
|
|
6
|
+
declare module "assert" {
|
|
7
7
|
/**
|
|
8
8
|
* An alias of {@link ok}.
|
|
9
9
|
* @since v0.5.9
|
|
@@ -34,7 +34,7 @@ declare module 'node:assert' {
|
|
|
34
34
|
/**
|
|
35
35
|
* Value is always `ERR_ASSERTION` to show that the error is an assertion error.
|
|
36
36
|
*/
|
|
37
|
-
code:
|
|
37
|
+
code: "ERR_ASSERTION";
|
|
38
38
|
constructor(options?: {
|
|
39
39
|
/** If provided, the error message is set to this value. */
|
|
40
40
|
message?: string | undefined;
|
|
@@ -197,7 +197,7 @@ declare module 'node:assert' {
|
|
|
197
197
|
/** A stack trace of the function. */
|
|
198
198
|
stack: object;
|
|
199
199
|
}
|
|
200
|
-
type AssertPredicate = RegExp | (new
|
|
200
|
+
type AssertPredicate = RegExp | (new() => object) | ((thrown: unknown) => boolean) | object | Error;
|
|
201
201
|
/**
|
|
202
202
|
* Throws an `AssertionError` with the provided error message or a default
|
|
203
203
|
* error message. If the `message` parameter is an instance of an `Error` then
|
|
@@ -229,7 +229,7 @@ declare module 'node:assert' {
|
|
|
229
229
|
message?: string | Error,
|
|
230
230
|
operator?: string,
|
|
231
231
|
// tslint:disable-next-line:ban-types
|
|
232
|
-
stackStartFn?: Function
|
|
232
|
+
stackStartFn?: Function,
|
|
233
233
|
): never;
|
|
234
234
|
/**
|
|
235
235
|
* Tests if `value` is truthy. It is equivalent to`assert.equal(!!value, true, message)`.
|
|
@@ -857,7 +857,11 @@ declare module 'node:assert' {
|
|
|
857
857
|
* @since v10.0.0
|
|
858
858
|
*/
|
|
859
859
|
function rejects(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
|
|
860
|
-
function rejects(
|
|
860
|
+
function rejects(
|
|
861
|
+
block: (() => Promise<unknown>) | Promise<unknown>,
|
|
862
|
+
error: AssertPredicate,
|
|
863
|
+
message?: string | Error,
|
|
864
|
+
): Promise<void>;
|
|
861
865
|
/**
|
|
862
866
|
* Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately
|
|
863
867
|
* calls the function and awaits the returned promise to complete. It will then
|
|
@@ -900,8 +904,15 @@ declare module 'node:assert' {
|
|
|
900
904
|
* ```
|
|
901
905
|
* @since v10.0.0
|
|
902
906
|
*/
|
|
903
|
-
function doesNotReject(
|
|
904
|
-
|
|
907
|
+
function doesNotReject(
|
|
908
|
+
block: (() => Promise<unknown>) | Promise<unknown>,
|
|
909
|
+
message?: string | Error,
|
|
910
|
+
): Promise<void>;
|
|
911
|
+
function doesNotReject(
|
|
912
|
+
block: (() => Promise<unknown>) | Promise<unknown>,
|
|
913
|
+
error: AssertPredicate,
|
|
914
|
+
message?: string | Error,
|
|
915
|
+
): Promise<void>;
|
|
905
916
|
/**
|
|
906
917
|
* Expects the `string` input to match the regular expression.
|
|
907
918
|
*
|
|
@@ -948,25 +959,38 @@ declare module 'node:assert' {
|
|
|
948
959
|
* @since v13.6.0, v12.16.0
|
|
949
960
|
*/
|
|
950
961
|
function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
|
|
951
|
-
const strict:
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
962
|
+
const strict:
|
|
963
|
+
& Omit<
|
|
964
|
+
typeof assert,
|
|
965
|
+
| "equal"
|
|
966
|
+
| "notEqual"
|
|
967
|
+
| "deepEqual"
|
|
968
|
+
| "notDeepEqual"
|
|
969
|
+
| "ok"
|
|
970
|
+
| "strictEqual"
|
|
971
|
+
| "deepStrictEqual"
|
|
972
|
+
| "ifError"
|
|
973
|
+
| "strict"
|
|
974
|
+
>
|
|
975
|
+
& {
|
|
976
|
+
(value: unknown, message?: string | Error): asserts value;
|
|
977
|
+
equal: typeof strictEqual;
|
|
978
|
+
notEqual: typeof notStrictEqual;
|
|
979
|
+
deepEqual: typeof deepStrictEqual;
|
|
980
|
+
notDeepEqual: typeof notDeepStrictEqual;
|
|
981
|
+
// Mapped types and assertion functions are incompatible?
|
|
982
|
+
// TS2775: Assertions require every name in the call target
|
|
983
|
+
// to be declared with an explicit type annotation.
|
|
984
|
+
ok: typeof ok;
|
|
985
|
+
strictEqual: typeof strictEqual;
|
|
986
|
+
deepStrictEqual: typeof deepStrictEqual;
|
|
987
|
+
ifError: typeof ifError;
|
|
988
|
+
strict: typeof strict;
|
|
989
|
+
};
|
|
966
990
|
}
|
|
967
991
|
export = assert;
|
|
968
992
|
}
|
|
969
|
-
declare module
|
|
970
|
-
import assert = require(
|
|
993
|
+
declare module "node:assert" {
|
|
994
|
+
import assert = require("assert");
|
|
971
995
|
export = assert;
|
|
972
996
|
}
|
node/ts4.8/async_hooks.d.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* @experimental
|
|
15
15
|
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/async_hooks.js)
|
|
16
16
|
*/
|
|
17
|
-
declare module
|
|
17
|
+
declare module "async_hooks" {
|
|
18
18
|
/**
|
|
19
19
|
* ```js
|
|
20
20
|
* import { executionAsyncId } from 'node:async_hooks';
|
|
@@ -275,7 +275,11 @@ declare module 'node:async_hooks' {
|
|
|
275
275
|
* @param fn The function to bind to the current execution context.
|
|
276
276
|
* @param type An optional name to associate with the underlying `AsyncResource`.
|
|
277
277
|
*/
|
|
278
|
-
static bind<Func extends (this: ThisArg, ...args: any[]) => any, ThisArg>(
|
|
278
|
+
static bind<Func extends (this: ThisArg, ...args: any[]) => any, ThisArg>(
|
|
279
|
+
fn: Func,
|
|
280
|
+
type?: string,
|
|
281
|
+
thisArg?: ThisArg,
|
|
282
|
+
): Func;
|
|
279
283
|
/**
|
|
280
284
|
* Binds the given function to execute to this `AsyncResource`'s scope.
|
|
281
285
|
* @since v14.8.0, v12.19.0
|
|
@@ -292,7 +296,11 @@ declare module 'node:async_hooks' {
|
|
|
292
296
|
* @param thisArg The receiver to be used for the function call.
|
|
293
297
|
* @param args Optional arguments to pass to the function.
|
|
294
298
|
*/
|
|
295
|
-
runInAsyncScope<This, Result>(
|
|
299
|
+
runInAsyncScope<This, Result>(
|
|
300
|
+
fn: (this: This, ...args: any[]) => Result,
|
|
301
|
+
thisArg?: This,
|
|
302
|
+
...args: any[]
|
|
303
|
+
): Result;
|
|
296
304
|
/**
|
|
297
305
|
* Call all `destroy` hooks. This should only ever be called once. An error will
|
|
298
306
|
* be thrown if it is called more than once. This **must** be manually called. If
|
|
@@ -306,7 +314,6 @@ declare module 'node:async_hooks' {
|
|
|
306
314
|
*/
|
|
307
315
|
asyncId(): number;
|
|
308
316
|
/**
|
|
309
|
-
*
|
|
310
317
|
* @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor.
|
|
311
318
|
*/
|
|
312
319
|
triggerAsyncId(): number;
|
|
@@ -527,6 +534,6 @@ declare module 'node:async_hooks' {
|
|
|
527
534
|
enterWith(store: T): void;
|
|
528
535
|
}
|
|
529
536
|
}
|
|
530
|
-
declare module
|
|
531
|
-
export * from
|
|
537
|
+
declare module "node:async_hooks" {
|
|
538
|
+
export * from "async_hooks";
|
|
532
539
|
}
|