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