@types/node 14.18.8 → 15.0.2
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 v14.18 → node}/LICENSE +0 -0
- node/README.md +16 -0
- node/assert/strict.d.ts +4 -0
- node v14.18/assert.d.ts → node/assert.d.ts +3 -7
- node v14.18/async_hooks.d.ts → node/async_hooks.d.ts +4 -7
- node/base.d.ts +19 -0
- node/buffer.d.ts +22 -0
- node v14.18/child_process.d.ts → node/child_process.d.ts +63 -67
- node v14.18/cluster.d.ts → node/cluster.d.ts +10 -13
- node v14.18/console.d.ts → node/console.d.ts +13 -22
- node v14.18/constants.d.ts → node/constants.d.ts +0 -5
- node v14.18/crypto.d.ts → node/crypto.d.ts +134 -53
- node v14.18/dgram.d.ts → node/dgram.d.ts +17 -20
- node/dns/promises.d.ts +97 -0
- node/dns.d.ts +322 -0
- node v14.18/domain.d.ts → node/domain.d.ts +0 -3
- node v14.18/events.d.ts → node/events.d.ts +8 -8
- node v14.18/fs/promises.d.ts → node/fs/promises.d.ts +18 -29
- node v14.18/fs.d.ts → node/fs.d.ts +77 -93
- node v14.18/globals.d.ts → node/globals.d.ts +60 -24
- {node v14.18 → node}/globals.global.d.ts +0 -0
- node v14.18/http.d.ts → node/http.d.ts +108 -176
- node v14.18/http2.d.ts → node/http2.d.ts +74 -71
- node/https.d.ts +36 -0
- node v14.18/index.d.ts → node/index.d.ts +15 -55
- node v14.18/inspector.d.ts → node/inspector.d.ts +151 -161
- node v14.18/module.d.ts → node/module.d.ts +0 -4
- node v14.18/net.d.ts → node/net.d.ts +70 -42
- node v14.18/os.d.ts → node/os.d.ts +0 -3
- node v14.18/package.json → node/package.json +25 -19
- node v14.18/path.d.ts → node/path.d.ts +5 -9
- node v14.18/perf_hooks.d.ts → node/perf_hooks.d.ts +5 -8
- node v14.18/process.d.ts → node/process.d.ts +53 -17
- node v14.18/punycode.d.ts → node/punycode.d.ts +0 -3
- node v14.18/querystring.d.ts → node/querystring.d.ts +3 -6
- node v14.18/readline.d.ts → node/readline.d.ts +14 -18
- node v14.18/repl.d.ts → node/repl.d.ts +17 -20
- node/stream/promises.d.ts +67 -0
- node v14.18/stream.d.ts → node/stream.d.ts +164 -60
- node v14.18/string_decoder.d.ts → node/string_decoder.d.ts +0 -3
- node/timers/promises.d.ts +13 -0
- node v14.18/timers.d.ts → node/timers.d.ts +16 -5
- node v14.18/tls.d.ts → node/tls.d.ts +51 -56
- node v14.18/trace_events.d.ts → node/trace_events.d.ts +0 -3
- node/ts3.6/assert.d.ts +98 -0
- node/ts3.6/base.d.ts +66 -0
- node/ts3.6/index.d.ts +7 -0
- node v14.18/tty.d.ts → node/tty.d.ts +0 -3
- node v14.18/url.d.ts → node/url.d.ts +16 -19
- node v14.18/util.d.ts → node/util.d.ts +3 -12
- node v14.18/v8.d.ts → node/v8.d.ts +0 -3
- node v14.18/vm.d.ts → node/vm.d.ts +25 -28
- node v14.18/wasi.d.ts → node/wasi.d.ts +7 -10
- node v14.18/worker_threads.d.ts → node/worker_threads.d.ts +18 -18
- node v14.18/zlib.d.ts → node/zlib.d.ts +16 -19
- node v14.18/README.md +0 -16
- node v14.18/buffer.d.ts +0 -89
- node v14.18/dns.d.ts +0 -387
- node v14.18/https.d.ts +0 -142
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
declare module 'tls' {
|
|
2
2
|
import * as net from 'net';
|
|
3
|
-
import * as stream from 'stream';
|
|
4
3
|
|
|
5
4
|
const CLIENT_RENEG_LIMIT: number;
|
|
6
5
|
const CLIENT_RENEG_WINDOW: number;
|
|
@@ -76,7 +75,7 @@ declare module 'tls' {
|
|
|
76
75
|
/**
|
|
77
76
|
* The name property is available only when type is 'ECDH'.
|
|
78
77
|
*/
|
|
79
|
-
name?: string
|
|
78
|
+
name?: string;
|
|
80
79
|
/**
|
|
81
80
|
* The size of parameter of an ephemeral key exchange.
|
|
82
81
|
*/
|
|
@@ -91,7 +90,7 @@ declare module 'tls' {
|
|
|
91
90
|
/**
|
|
92
91
|
* Optional passphrase.
|
|
93
92
|
*/
|
|
94
|
-
passphrase?: string
|
|
93
|
+
passphrase?: string;
|
|
95
94
|
}
|
|
96
95
|
|
|
97
96
|
interface PxfObject {
|
|
@@ -102,7 +101,7 @@ declare module 'tls' {
|
|
|
102
101
|
/**
|
|
103
102
|
* Optional passphrase.
|
|
104
103
|
*/
|
|
105
|
-
passphrase?: string
|
|
104
|
+
passphrase?: string;
|
|
106
105
|
}
|
|
107
106
|
|
|
108
107
|
interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions {
|
|
@@ -110,22 +109,22 @@ declare module 'tls' {
|
|
|
110
109
|
* If true the TLS socket will be instantiated in server-mode.
|
|
111
110
|
* Defaults to false.
|
|
112
111
|
*/
|
|
113
|
-
isServer?: boolean
|
|
112
|
+
isServer?: boolean;
|
|
114
113
|
/**
|
|
115
114
|
* An optional net.Server instance.
|
|
116
115
|
*/
|
|
117
|
-
server?: net.Server
|
|
116
|
+
server?: net.Server;
|
|
118
117
|
|
|
119
118
|
/**
|
|
120
119
|
* An optional Buffer instance containing a TLS session.
|
|
121
120
|
*/
|
|
122
|
-
session?: Buffer
|
|
121
|
+
session?: Buffer;
|
|
123
122
|
/**
|
|
124
123
|
* If true, specifies that the OCSP status request extension will be
|
|
125
124
|
* added to the client hello and an 'OCSPResponse' event will be
|
|
126
125
|
* emitted on the socket before establishing a secure communication
|
|
127
126
|
*/
|
|
128
|
-
requestOCSP?: boolean
|
|
127
|
+
requestOCSP?: boolean;
|
|
129
128
|
}
|
|
130
129
|
|
|
131
130
|
class TLSSocket extends net.Socket {
|
|
@@ -151,10 +150,9 @@ declare module 'tls' {
|
|
|
151
150
|
|
|
152
151
|
/**
|
|
153
152
|
* String containing the selected ALPN protocol.
|
|
154
|
-
*
|
|
155
|
-
* When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false.
|
|
153
|
+
* When ALPN has no selected protocol, tlsSocket.alpnProtocol equals false.
|
|
156
154
|
*/
|
|
157
|
-
alpnProtocol
|
|
155
|
+
alpnProtocol?: string;
|
|
158
156
|
|
|
159
157
|
/**
|
|
160
158
|
* Returns an object representing the local certificate. The returned
|
|
@@ -266,7 +264,7 @@ declare module 'tls' {
|
|
|
266
264
|
* is successfully completed.
|
|
267
265
|
* @return `undefined` when socket is destroy, `false` if negotiaion can't be initiated.
|
|
268
266
|
*/
|
|
269
|
-
renegotiate(options: { rejectUnauthorized?: boolean
|
|
267
|
+
renegotiate(options: { rejectUnauthorized?: boolean, requestCert?: boolean }, callback: (err: Error | null) => void): undefined | boolean;
|
|
270
268
|
/**
|
|
271
269
|
* Set maximum TLS fragment size (default and maximum value is: 16384, minimum is: 512).
|
|
272
270
|
* Smaller fragment size decreases buffering latency on the client: large fragments are buffered by
|
|
@@ -346,25 +344,25 @@ declare module 'tls' {
|
|
|
346
344
|
/**
|
|
347
345
|
* An optional TLS context object from tls.createSecureContext()
|
|
348
346
|
*/
|
|
349
|
-
secureContext?: SecureContext
|
|
347
|
+
secureContext?: SecureContext;
|
|
350
348
|
|
|
351
349
|
/**
|
|
352
350
|
* When enabled, TLS packet trace information is written to `stderr`. This can be
|
|
353
351
|
* used to debug TLS connection problems.
|
|
354
352
|
* @default false
|
|
355
353
|
*/
|
|
356
|
-
enableTrace?: boolean
|
|
354
|
+
enableTrace?: boolean;
|
|
357
355
|
/**
|
|
358
356
|
* If true the server will request a certificate from clients that
|
|
359
357
|
* connect and attempt to verify that certificate. Defaults to
|
|
360
358
|
* false.
|
|
361
359
|
*/
|
|
362
|
-
requestCert?: boolean
|
|
360
|
+
requestCert?: boolean;
|
|
363
361
|
/**
|
|
364
362
|
* An array of strings or a Buffer naming possible ALPN protocols.
|
|
365
363
|
* (Protocols should be ordered by their priority.)
|
|
366
364
|
*/
|
|
367
|
-
ALPNProtocols?: string[] | Uint8Array[] | Uint8Array
|
|
365
|
+
ALPNProtocols?: string[] | Uint8Array[] | Uint8Array;
|
|
368
366
|
/**
|
|
369
367
|
* SNICallback(servername, cb) <Function> A function that will be
|
|
370
368
|
* called if the client supports SNI TLS extension. Two arguments
|
|
@@ -374,14 +372,14 @@ declare module 'tls' {
|
|
|
374
372
|
* SecureContext.) If SNICallback wasn't provided the default callback
|
|
375
373
|
* with high-level API will be used (see below).
|
|
376
374
|
*/
|
|
377
|
-
SNICallback?: (
|
|
375
|
+
SNICallback?: (servername: string, cb: (err: Error | null, ctx: SecureContext) => void) => void;
|
|
378
376
|
/**
|
|
379
377
|
* If true the server will reject any connection which is not
|
|
380
378
|
* authorized with the list of supplied CAs. This option only has an
|
|
381
379
|
* effect if requestCert is true.
|
|
382
380
|
* @default true
|
|
383
381
|
*/
|
|
384
|
-
rejectUnauthorized?: boolean
|
|
382
|
+
rejectUnauthorized?: boolean;
|
|
385
383
|
}
|
|
386
384
|
|
|
387
385
|
interface TlsOptions extends SecureContextOptions, CommonConnectionOptions, net.ServerOpts {
|
|
@@ -391,17 +389,17 @@ declare module 'tls' {
|
|
|
391
389
|
* the tls.Server object whenever a handshake times out. Default:
|
|
392
390
|
* 120000 (120 seconds).
|
|
393
391
|
*/
|
|
394
|
-
handshakeTimeout?: number
|
|
392
|
+
handshakeTimeout?: number;
|
|
395
393
|
/**
|
|
396
394
|
* The number of seconds after which a TLS session created by the
|
|
397
395
|
* server will no longer be resumable. See Session Resumption for more
|
|
398
396
|
* information. Default: 300.
|
|
399
397
|
*/
|
|
400
|
-
sessionTimeout?: number
|
|
398
|
+
sessionTimeout?: number;
|
|
401
399
|
/**
|
|
402
400
|
* 48-bytes of cryptographically strong pseudo-random data.
|
|
403
401
|
*/
|
|
404
|
-
ticketKeys?: Buffer
|
|
402
|
+
ticketKeys?: Buffer;
|
|
405
403
|
|
|
406
404
|
/**
|
|
407
405
|
*
|
|
@@ -430,7 +428,7 @@ declare module 'tls' {
|
|
|
430
428
|
* in TLS 1.3. Upon failing to set pskIdentityHint `tlsClientError` will be
|
|
431
429
|
* emitted with `ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED` code.
|
|
432
430
|
*/
|
|
433
|
-
pskIdentityHint?: string
|
|
431
|
+
pskIdentityHint?: string;
|
|
434
432
|
}
|
|
435
433
|
|
|
436
434
|
interface PSKCallbackNegotation {
|
|
@@ -439,16 +437,16 @@ declare module 'tls' {
|
|
|
439
437
|
}
|
|
440
438
|
|
|
441
439
|
interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions {
|
|
442
|
-
host?: string
|
|
443
|
-
port?: number
|
|
444
|
-
path?: string
|
|
445
|
-
socket?:
|
|
446
|
-
checkServerIdentity?: typeof checkServerIdentity
|
|
447
|
-
servername?: string
|
|
448
|
-
session?: Buffer
|
|
449
|
-
minDHSize?: number
|
|
450
|
-
lookup?: net.LookupFunction
|
|
451
|
-
timeout?: number
|
|
440
|
+
host?: string;
|
|
441
|
+
port?: number;
|
|
442
|
+
path?: string; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored.
|
|
443
|
+
socket?: net.Socket; // Establish secure connection on a given socket rather than creating a new socket
|
|
444
|
+
checkServerIdentity?: typeof checkServerIdentity;
|
|
445
|
+
servername?: string; // SNI TLS Extension
|
|
446
|
+
session?: Buffer;
|
|
447
|
+
minDHSize?: number;
|
|
448
|
+
lookup?: net.LookupFunction;
|
|
449
|
+
timeout?: number;
|
|
452
450
|
/**
|
|
453
451
|
* When negotiating TLS-PSK (pre-shared keys), this function is called
|
|
454
452
|
* with optional identity `hint` provided by the server or `null`
|
|
@@ -568,7 +566,7 @@ declare module 'tls' {
|
|
|
568
566
|
* the well-known CAs curated by Mozilla. Mozilla's CAs are completely
|
|
569
567
|
* replaced when CAs are explicitly specified using this option.
|
|
570
568
|
*/
|
|
571
|
-
ca?: string | Buffer | Array<string | Buffer
|
|
569
|
+
ca?: string | Buffer | Array<string | Buffer>;
|
|
572
570
|
/**
|
|
573
571
|
* Cert chains in PEM format. One cert chain should be provided per
|
|
574
572
|
* private key. Each cert chain should consist of the PEM formatted
|
|
@@ -580,29 +578,29 @@ declare module 'tls' {
|
|
|
580
578
|
* intermediate certificates are not provided, the peer will not be
|
|
581
579
|
* able to validate the certificate, and the handshake will fail.
|
|
582
580
|
*/
|
|
583
|
-
cert?: string | Buffer | Array<string | Buffer
|
|
581
|
+
cert?: string | Buffer | Array<string | Buffer>;
|
|
584
582
|
/**
|
|
585
583
|
* Colon-separated list of supported signature algorithms. The list
|
|
586
584
|
* can contain digest algorithms (SHA256, MD5 etc.), public key
|
|
587
585
|
* algorithms (RSA-PSS, ECDSA etc.), combination of both (e.g
|
|
588
586
|
* 'RSA+SHA384') or TLS v1.3 scheme names (e.g. rsa_pss_pss_sha512).
|
|
589
587
|
*/
|
|
590
|
-
sigalgs?: string
|
|
588
|
+
sigalgs?: string;
|
|
591
589
|
/**
|
|
592
590
|
* Cipher suite specification, replacing the default. For more
|
|
593
591
|
* information, see modifying the default cipher suite. Permitted
|
|
594
592
|
* ciphers can be obtained via tls.getCiphers(). Cipher names must be
|
|
595
593
|
* uppercased in order for OpenSSL to accept them.
|
|
596
594
|
*/
|
|
597
|
-
ciphers?: string
|
|
595
|
+
ciphers?: string;
|
|
598
596
|
/**
|
|
599
597
|
* Name of an OpenSSL engine which can provide the client certificate.
|
|
600
598
|
*/
|
|
601
|
-
clientCertEngine?: string
|
|
599
|
+
clientCertEngine?: string;
|
|
602
600
|
/**
|
|
603
601
|
* PEM formatted CRLs (Certificate Revocation Lists).
|
|
604
602
|
*/
|
|
605
|
-
crl?: string | Buffer | Array<string | Buffer
|
|
603
|
+
crl?: string | Buffer | Array<string | Buffer>;
|
|
606
604
|
/**
|
|
607
605
|
* Diffie Hellman parameters, required for Perfect Forward Secrecy. Use
|
|
608
606
|
* openssl dhparam to create the parameters. The key length must be
|
|
@@ -611,7 +609,7 @@ declare module 'tls' {
|
|
|
611
609
|
* stronger security. If omitted or invalid, the parameters are
|
|
612
610
|
* silently discarded and DHE ciphers will not be available.
|
|
613
611
|
*/
|
|
614
|
-
dhparam?: string | Buffer
|
|
612
|
+
dhparam?: string | Buffer;
|
|
615
613
|
/**
|
|
616
614
|
* A string describing a named curve or a colon separated list of curve
|
|
617
615
|
* NIDs or names, for example P-521:P-384:P-256, to use for ECDH key
|
|
@@ -621,13 +619,13 @@ declare module 'tls' {
|
|
|
621
619
|
* name and description of each available elliptic curve. Default:
|
|
622
620
|
* tls.DEFAULT_ECDH_CURVE.
|
|
623
621
|
*/
|
|
624
|
-
ecdhCurve?: string
|
|
622
|
+
ecdhCurve?: string;
|
|
625
623
|
/**
|
|
626
624
|
* Attempt to use the server's cipher suite preferences instead of the
|
|
627
625
|
* client's. When true, causes SSL_OP_CIPHER_SERVER_PREFERENCE to be
|
|
628
626
|
* set in secureOptions
|
|
629
627
|
*/
|
|
630
|
-
honorCipherOrder?: boolean
|
|
628
|
+
honorCipherOrder?: boolean;
|
|
631
629
|
/**
|
|
632
630
|
* Private keys in PEM format. PEM allows the option of private keys
|
|
633
631
|
* being encrypted. Encrypted keys will be decrypted with
|
|
@@ -638,18 +636,18 @@ declare module 'tls' {
|
|
|
638
636
|
* object.passphrase is optional. Encrypted keys will be decrypted with
|
|
639
637
|
* object.passphrase if provided, or options.passphrase if it is not.
|
|
640
638
|
*/
|
|
641
|
-
key?: string | Buffer | Array<Buffer | KeyObject
|
|
639
|
+
key?: string | Buffer | Array<Buffer | KeyObject>;
|
|
642
640
|
/**
|
|
643
641
|
* Name of an OpenSSL engine to get private key from. Should be used
|
|
644
642
|
* together with privateKeyIdentifier.
|
|
645
643
|
*/
|
|
646
|
-
privateKeyEngine?: string
|
|
644
|
+
privateKeyEngine?: string;
|
|
647
645
|
/**
|
|
648
646
|
* Identifier of a private key managed by an OpenSSL engine. Should be
|
|
649
647
|
* used together with privateKeyEngine. Should not be set together with
|
|
650
648
|
* key, because both options define a private key in different ways.
|
|
651
649
|
*/
|
|
652
|
-
privateKeyIdentifier?: string
|
|
650
|
+
privateKeyIdentifier?: string;
|
|
653
651
|
/**
|
|
654
652
|
* Optionally set the maximum TLS version to allow. One
|
|
655
653
|
* of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the
|
|
@@ -658,7 +656,7 @@ declare module 'tls' {
|
|
|
658
656
|
* `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to
|
|
659
657
|
* `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used.
|
|
660
658
|
*/
|
|
661
|
-
maxVersion?: SecureVersion
|
|
659
|
+
maxVersion?: SecureVersion;
|
|
662
660
|
/**
|
|
663
661
|
* Optionally set the minimum TLS version to allow. One
|
|
664
662
|
* of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the
|
|
@@ -669,11 +667,11 @@ declare module 'tls' {
|
|
|
669
667
|
* `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to
|
|
670
668
|
* 'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used.
|
|
671
669
|
*/
|
|
672
|
-
minVersion?: SecureVersion
|
|
670
|
+
minVersion?: SecureVersion;
|
|
673
671
|
/**
|
|
674
672
|
* Shared passphrase used for a single private key and/or a PFX.
|
|
675
673
|
*/
|
|
676
|
-
passphrase?: string
|
|
674
|
+
passphrase?: string;
|
|
677
675
|
/**
|
|
678
676
|
* PFX or PKCS12 encoded private key and certificate chain. pfx is an
|
|
679
677
|
* alternative to providing key and cert individually. PFX is usually
|
|
@@ -684,13 +682,13 @@ declare module 'tls' {
|
|
|
684
682
|
* object.passphrase is optional. Encrypted PFX will be decrypted with
|
|
685
683
|
* object.passphrase if provided, or options.passphrase if it is not.
|
|
686
684
|
*/
|
|
687
|
-
pfx?: string | Buffer | Array<string | Buffer | PxfObject
|
|
685
|
+
pfx?: string | Buffer | Array<string | Buffer | PxfObject>;
|
|
688
686
|
/**
|
|
689
687
|
* Optionally affect the OpenSSL protocol behavior, which is not
|
|
690
688
|
* usually necessary. This should be used carefully if at all! Value is
|
|
691
689
|
* a numeric bitmask of the SSL_OP_* options from OpenSSL Options
|
|
692
690
|
*/
|
|
693
|
-
secureOptions?: number
|
|
691
|
+
secureOptions?: number; // Value is a numeric bitmask of the `SSL_OP_*` options
|
|
694
692
|
/**
|
|
695
693
|
* Legacy mechanism to select the TLS protocol version to use, it does
|
|
696
694
|
* not support independent control of the minimum and maximum version,
|
|
@@ -702,23 +700,23 @@ declare module 'tls' {
|
|
|
702
700
|
* TLS versions less than 1.2, but it may be required for
|
|
703
701
|
* interoperability. Default: none, see minVersion.
|
|
704
702
|
*/
|
|
705
|
-
secureProtocol?: string
|
|
703
|
+
secureProtocol?: string;
|
|
706
704
|
/**
|
|
707
705
|
* Opaque identifier used by servers to ensure session state is not
|
|
708
706
|
* shared between applications. Unused by clients.
|
|
709
707
|
*/
|
|
710
|
-
sessionIdContext?: string
|
|
708
|
+
sessionIdContext?: string;
|
|
711
709
|
/**
|
|
712
710
|
* 48-bytes of cryptographically strong pseudo-random data.
|
|
713
711
|
* See Session Resumption for more information.
|
|
714
712
|
*/
|
|
715
|
-
ticketKeys?: Buffer
|
|
713
|
+
ticketKeys?: Buffer;
|
|
716
714
|
/**
|
|
717
715
|
* The number of seconds after which a TLS session created by the
|
|
718
716
|
* server will no longer be resumable. See Session Resumption for more
|
|
719
717
|
* information. Default: 300.
|
|
720
718
|
*/
|
|
721
|
-
sessionTimeout?: number
|
|
719
|
+
sessionTimeout?: number;
|
|
722
720
|
}
|
|
723
721
|
|
|
724
722
|
interface SecureContext {
|
|
@@ -779,6 +777,3 @@ declare module 'tls' {
|
|
|
779
777
|
*/
|
|
780
778
|
const rootCertificates: ReadonlyArray<string>;
|
|
781
779
|
}
|
|
782
|
-
declare module 'node:tls' {
|
|
783
|
-
export * from 'tls';
|
|
784
|
-
}
|
node/ts3.6/assert.d.ts
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
declare module 'assert' {
|
|
2
|
+
/** An alias of `assert.ok()`. */
|
|
3
|
+
function assert(value: any, message?: string | Error): void;
|
|
4
|
+
namespace assert {
|
|
5
|
+
class AssertionError extends Error {
|
|
6
|
+
actual: any;
|
|
7
|
+
expected: any;
|
|
8
|
+
operator: string;
|
|
9
|
+
generatedMessage: boolean;
|
|
10
|
+
code: 'ERR_ASSERTION';
|
|
11
|
+
|
|
12
|
+
constructor(options?: {
|
|
13
|
+
/** If provided, the error message is set to this value. */
|
|
14
|
+
message?: string;
|
|
15
|
+
/** The `actual` property on the error instance. */
|
|
16
|
+
actual?: any;
|
|
17
|
+
/** The `expected` property on the error instance. */
|
|
18
|
+
expected?: any;
|
|
19
|
+
/** The `operator` property on the error instance. */
|
|
20
|
+
operator?: string;
|
|
21
|
+
/** If provided, the generated stack trace omits frames before this function. */
|
|
22
|
+
// tslint:disable-next-line:ban-types
|
|
23
|
+
stackStartFn?: Function;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
class CallTracker {
|
|
28
|
+
calls(exact?: number): () => void;
|
|
29
|
+
calls<Func extends (...args: any[]) => any>(fn?: Func, exact?: number): Func;
|
|
30
|
+
report(): CallTrackerReportInformation[];
|
|
31
|
+
verify(): void;
|
|
32
|
+
}
|
|
33
|
+
interface CallTrackerReportInformation {
|
|
34
|
+
message: string;
|
|
35
|
+
/** The actual number of times the function was called. */
|
|
36
|
+
actual: number;
|
|
37
|
+
/** The number of times the function was expected to be called. */
|
|
38
|
+
expected: number;
|
|
39
|
+
/** The name of the function that is wrapped. */
|
|
40
|
+
operator: string;
|
|
41
|
+
/** A stack trace of the function. */
|
|
42
|
+
stack: object;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
type AssertPredicate = RegExp | (new () => object) | ((thrown: any) => boolean) | object | Error;
|
|
46
|
+
|
|
47
|
+
function fail(message?: string | Error): never;
|
|
48
|
+
/** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
|
|
49
|
+
function fail(
|
|
50
|
+
actual: any,
|
|
51
|
+
expected: any,
|
|
52
|
+
message?: string | Error,
|
|
53
|
+
operator?: string,
|
|
54
|
+
// tslint:disable-next-line:ban-types
|
|
55
|
+
stackStartFn?: Function,
|
|
56
|
+
): never;
|
|
57
|
+
function ok(value: any, message?: string | Error): void;
|
|
58
|
+
/** @deprecated since v9.9.0 - use strictEqual() instead. */
|
|
59
|
+
function equal(actual: any, expected: any, message?: string | Error): void;
|
|
60
|
+
/** @deprecated since v9.9.0 - use notStrictEqual() instead. */
|
|
61
|
+
function notEqual(actual: any, expected: any, message?: string | Error): void;
|
|
62
|
+
/** @deprecated since v9.9.0 - use deepStrictEqual() instead. */
|
|
63
|
+
function deepEqual(actual: any, expected: any, message?: string | Error): void;
|
|
64
|
+
/** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */
|
|
65
|
+
function notDeepEqual(actual: any, expected: any, message?: string | Error): void;
|
|
66
|
+
function strictEqual(actual: any, expected: any, message?: string | Error): void;
|
|
67
|
+
function notStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
|
68
|
+
function deepStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
|
69
|
+
function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
|
70
|
+
|
|
71
|
+
function throws(block: () => any, message?: string | Error): void;
|
|
72
|
+
function throws(block: () => any, error: AssertPredicate, message?: string | Error): void;
|
|
73
|
+
function doesNotThrow(block: () => any, message?: string | Error): void;
|
|
74
|
+
function doesNotThrow(block: () => any, error: AssertPredicate, message?: string | Error): void;
|
|
75
|
+
|
|
76
|
+
function ifError(value: any): void;
|
|
77
|
+
|
|
78
|
+
function rejects(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
|
|
79
|
+
function rejects(
|
|
80
|
+
block: (() => Promise<any>) | Promise<any>,
|
|
81
|
+
error: AssertPredicate,
|
|
82
|
+
message?: string | Error,
|
|
83
|
+
): Promise<void>;
|
|
84
|
+
function doesNotReject(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
|
|
85
|
+
function doesNotReject(
|
|
86
|
+
block: (() => Promise<any>) | Promise<any>,
|
|
87
|
+
error: AssertPredicate,
|
|
88
|
+
message?: string | Error,
|
|
89
|
+
): Promise<void>;
|
|
90
|
+
|
|
91
|
+
function match(value: string, regExp: RegExp, message?: string | Error): void;
|
|
92
|
+
function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
|
|
93
|
+
|
|
94
|
+
const strict: typeof assert;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export = assert;
|
|
98
|
+
}
|
node/ts3.6/base.d.ts
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// NOTE: These definitions support NodeJS and TypeScript 3.6 and earlier.
|
|
2
|
+
|
|
3
|
+
// NOTE: TypeScript version-specific augmentations can be found in the following paths:
|
|
4
|
+
// - ~/base.d.ts - Shared definitions common to all TypeScript versions
|
|
5
|
+
// - ~/index.d.ts - Definitions specific to TypeScript 3.7 and above
|
|
6
|
+
// - ~/ts3.5/base.d.ts - Definitions specific to TypeScript 3.6 and earlier
|
|
7
|
+
// - ~/ts3.5/index.d.ts - Definitions specific to TypeScript 3.6 and earlier with assert pulled in
|
|
8
|
+
|
|
9
|
+
// Reference required types from the default lib:
|
|
10
|
+
/// <reference lib="es2018" />
|
|
11
|
+
/// <reference lib="esnext.asynciterable" />
|
|
12
|
+
/// <reference lib="esnext.intl" />
|
|
13
|
+
/// <reference lib="esnext.bigint" />
|
|
14
|
+
|
|
15
|
+
// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
|
|
16
|
+
/// <reference path="../assert/strict.d.ts" />
|
|
17
|
+
/// <reference path="../globals.d.ts" />
|
|
18
|
+
/// <reference path="../async_hooks.d.ts" />
|
|
19
|
+
/// <reference path="../buffer.d.ts" />
|
|
20
|
+
/// <reference path="../child_process.d.ts" />
|
|
21
|
+
/// <reference path="../cluster.d.ts" />
|
|
22
|
+
/// <reference path="../console.d.ts" />
|
|
23
|
+
/// <reference path="../constants.d.ts" />
|
|
24
|
+
/// <reference path="../crypto.d.ts" />
|
|
25
|
+
/// <reference path="../dgram.d.ts" />
|
|
26
|
+
/// <reference path="../dns.d.ts" />
|
|
27
|
+
/// <reference path="../dns/promises.d.ts" />
|
|
28
|
+
/// <reference path="../dns/promises.d.ts" />
|
|
29
|
+
/// <reference path="../domain.d.ts" />
|
|
30
|
+
/// <reference path="../events.d.ts" />
|
|
31
|
+
/// <reference path="../fs.d.ts" />
|
|
32
|
+
/// <reference path="../fs/promises.d.ts" />
|
|
33
|
+
/// <reference path="../http.d.ts" />
|
|
34
|
+
/// <reference path="../http2.d.ts" />
|
|
35
|
+
/// <reference path="../https.d.ts" />
|
|
36
|
+
/// <reference path="../inspector.d.ts" />
|
|
37
|
+
/// <reference path="../module.d.ts" />
|
|
38
|
+
/// <reference path="../net.d.ts" />
|
|
39
|
+
/// <reference path="../os.d.ts" />
|
|
40
|
+
/// <reference path="../path.d.ts" />
|
|
41
|
+
/// <reference path="../perf_hooks.d.ts" />
|
|
42
|
+
/// <reference path="../process.d.ts" />
|
|
43
|
+
/// <reference path="../punycode.d.ts" />
|
|
44
|
+
/// <reference path="../querystring.d.ts" />
|
|
45
|
+
/// <reference path="../readline.d.ts" />
|
|
46
|
+
/// <reference path="../repl.d.ts" />
|
|
47
|
+
/// <reference path="../stream.d.ts" />
|
|
48
|
+
/// <reference path="../stream/promises.d.ts" />
|
|
49
|
+
/// <reference path="../string_decoder.d.ts" />
|
|
50
|
+
/// <reference path="../timers.d.ts" />
|
|
51
|
+
/// <reference path="../timers/promises.d.ts" />
|
|
52
|
+
/// <reference path="../tls.d.ts" />
|
|
53
|
+
/// <reference path="../trace_events.d.ts" />
|
|
54
|
+
/// <reference path="../tty.d.ts" />
|
|
55
|
+
/// <reference path="../url.d.ts" />
|
|
56
|
+
/// <reference path="../util.d.ts" />
|
|
57
|
+
/// <reference path="../v8.d.ts" />
|
|
58
|
+
/// <reference path="../vm.d.ts" />
|
|
59
|
+
/// <reference path="../worker_threads.d.ts" />
|
|
60
|
+
/// <reference path="../zlib.d.ts" />
|
|
61
|
+
|
|
62
|
+
// TypeScript 3.5-specific augmentations:
|
|
63
|
+
/// <reference path="../globals.global.d.ts" />
|
|
64
|
+
|
|
65
|
+
// TypeScript 3.5-specific augmentations:
|
|
66
|
+
/// <reference path="../wasi.d.ts" />
|
node/ts3.6/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// NOTE: These definitions support NodeJS and TypeScript 3.5 - 3.6.
|
|
2
|
+
// This is required to enable typing assert in ts3.7 without causing errors
|
|
3
|
+
// Typically type modifications should be made in base.d.ts instead of here
|
|
4
|
+
|
|
5
|
+
/// <reference path="base.d.ts" />
|
|
6
|
+
|
|
7
|
+
/// <reference path="assert.d.ts" />
|
|
@@ -3,17 +3,17 @@ declare module 'url' {
|
|
|
3
3
|
|
|
4
4
|
// Input to `url.format`
|
|
5
5
|
interface UrlObject {
|
|
6
|
-
auth?: string | null
|
|
7
|
-
hash?: string | null
|
|
8
|
-
host?: string | null
|
|
9
|
-
hostname?: string | null
|
|
10
|
-
href?: string | null
|
|
11
|
-
pathname?: string | null
|
|
12
|
-
protocol?: string | null
|
|
13
|
-
search?: string | null
|
|
14
|
-
slashes?: boolean | null
|
|
15
|
-
port?: string | number | null
|
|
16
|
-
query?: string | null | ParsedUrlQueryInput
|
|
6
|
+
auth?: string | null;
|
|
7
|
+
hash?: string | null;
|
|
8
|
+
host?: string | null;
|
|
9
|
+
hostname?: string | null;
|
|
10
|
+
href?: string | null;
|
|
11
|
+
pathname?: string | null;
|
|
12
|
+
protocol?: string | null;
|
|
13
|
+
search?: string | null;
|
|
14
|
+
slashes?: boolean | null;
|
|
15
|
+
port?: string | number | null;
|
|
16
|
+
query?: string | null | ParsedUrlQueryInput;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
// Output of `url.parse`
|
|
@@ -73,10 +73,10 @@ declare module 'url' {
|
|
|
73
73
|
function pathToFileURL(url: string): URL;
|
|
74
74
|
|
|
75
75
|
interface URLFormatOptions {
|
|
76
|
-
auth?: boolean
|
|
77
|
-
fragment?: boolean
|
|
78
|
-
search?: boolean
|
|
79
|
-
unicode?: boolean
|
|
76
|
+
auth?: boolean;
|
|
77
|
+
fragment?: boolean;
|
|
78
|
+
search?: boolean;
|
|
79
|
+
unicode?: boolean;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
class URL {
|
|
@@ -98,7 +98,7 @@ declare module 'url' {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
class URLSearchParams implements Iterable<[string, string]> {
|
|
101
|
-
constructor(init?: URLSearchParams | string |
|
|
101
|
+
constructor(init?: URLSearchParams | string | NodeJS.Dict<string | ReadonlyArray<string>> | Iterable<[string, string]> | ReadonlyArray<[string, string]>);
|
|
102
102
|
append(name: string, value: string): void;
|
|
103
103
|
delete(name: string): void;
|
|
104
104
|
entries(): IterableIterator<[string, string]>;
|
|
@@ -114,6 +114,3 @@ declare module 'url' {
|
|
|
114
114
|
[Symbol.iterator](): IterableIterator<[string, string]>;
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
declare module 'node:url' {
|
|
118
|
-
export * from 'url';
|
|
119
|
-
}
|
|
@@ -7,7 +7,6 @@ declare module 'util' {
|
|
|
7
7
|
}
|
|
8
8
|
function format(format?: any, ...param: any[]): string;
|
|
9
9
|
function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string;
|
|
10
|
-
function getSystemErrorName(err: number): string;
|
|
11
10
|
/** @deprecated since v0.11.3 - use a third party module instead. */
|
|
12
11
|
function log(string: string): void;
|
|
13
12
|
function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string;
|
|
@@ -33,12 +32,7 @@ declare module 'util' {
|
|
|
33
32
|
/** @deprecated since v4.0.0 - use `util.types.isNativeError()` instead. */
|
|
34
33
|
function isError(object: any): object is Error;
|
|
35
34
|
function inherits(constructor: any, superConstructor: any): void;
|
|
36
|
-
|
|
37
|
-
interface DebugLogger extends DebugLoggerFunction {
|
|
38
|
-
enabled: boolean;
|
|
39
|
-
}
|
|
40
|
-
function debuglog(key: string, callback?: (fn: DebugLoggerFunction) => void): DebugLogger;
|
|
41
|
-
const debug: typeof debuglog;
|
|
35
|
+
function debuglog(key: string): (msg: string, ...param: any[]) => void;
|
|
42
36
|
/** @deprecated since v4.0.0 - use `typeof value === 'boolean'` instead. */
|
|
43
37
|
function isBoolean(object: any): object is boolean;
|
|
44
38
|
/** @deprecated since v4.0.0 - use `Buffer.isBuffer()` instead. */
|
|
@@ -185,11 +179,11 @@ declare module 'util' {
|
|
|
185
179
|
readonly ignoreBOM: boolean;
|
|
186
180
|
constructor(
|
|
187
181
|
encoding?: string,
|
|
188
|
-
options?: { fatal?: boolean
|
|
182
|
+
options?: { fatal?: boolean; ignoreBOM?: boolean }
|
|
189
183
|
);
|
|
190
184
|
decode(
|
|
191
185
|
input?: NodeJS.ArrayBufferView | ArrayBuffer | null,
|
|
192
|
-
options?: { stream?: boolean
|
|
186
|
+
options?: { stream?: boolean }
|
|
193
187
|
): string;
|
|
194
188
|
}
|
|
195
189
|
|
|
@@ -211,6 +205,3 @@ declare module 'util' {
|
|
|
211
205
|
encodeInto(input: string, output: Uint8Array): EncodeIntoResult;
|
|
212
206
|
}
|
|
213
207
|
}
|
|
214
|
-
declare module 'node:util' {
|
|
215
|
-
export * from 'util';
|
|
216
|
-
}
|