@types/node 16.0.0 → 16.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/README.md +1 -1
- node/assert.d.ts +5 -5
- node/async_hooks.d.ts +2 -2
- node/buffer.d.ts +2 -2
- node/child_process.d.ts +49 -49
- node/cluster.d.ts +10 -10
- node/console.d.ts +4 -4
- node/crypto.d.ts +61 -61
- node/dgram.d.ts +9 -9
- node/dns.d.ts +11 -11
- node/events.d.ts +3 -3
- node/fs/promises.d.ts +21 -17
- node/fs.d.ts +64 -60
- node/globals.d.ts +8 -8
- node/http.d.ts +97 -97
- node/http2.d.ts +65 -65
- node/https.d.ts +4 -4
- node/inspector.d.ts +148 -148
- node/net.d.ts +30 -30
- node/package.json +2 -2
- node/path.d.ts +5 -5
- node/perf_hooks.d.ts +14 -14
- node/process.d.ts +13 -13
- node/querystring.d.ts +3 -3
- node/readline.d.ts +15 -15
- node/repl.d.ts +14 -14
- node/stream.d.ts +17 -17
- node/timers.d.ts +1 -1
- node/tls.d.ts +50 -50
- node/url.d.ts +15 -15
- node/util.d.ts +13 -13
- node/vm.d.ts +24 -24
- node/wasi.d.ts +7 -7
- node/worker_threads.d.ts +15 -15
- node/zlib.d.ts +16 -16
node/tls.d.ts
CHANGED
|
@@ -76,7 +76,7 @@ declare module 'tls' {
|
|
|
76
76
|
/**
|
|
77
77
|
* The name property is available only when type is 'ECDH'.
|
|
78
78
|
*/
|
|
79
|
-
name?: string;
|
|
79
|
+
name?: string | undefined;
|
|
80
80
|
/**
|
|
81
81
|
* The size of parameter of an ephemeral key exchange.
|
|
82
82
|
*/
|
|
@@ -91,7 +91,7 @@ declare module 'tls' {
|
|
|
91
91
|
/**
|
|
92
92
|
* Optional passphrase.
|
|
93
93
|
*/
|
|
94
|
-
passphrase?: string;
|
|
94
|
+
passphrase?: string | undefined;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
interface PxfObject {
|
|
@@ -102,7 +102,7 @@ declare module 'tls' {
|
|
|
102
102
|
/**
|
|
103
103
|
* Optional passphrase.
|
|
104
104
|
*/
|
|
105
|
-
passphrase?: string;
|
|
105
|
+
passphrase?: string | undefined;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions {
|
|
@@ -110,22 +110,22 @@ declare module 'tls' {
|
|
|
110
110
|
* If true the TLS socket will be instantiated in server-mode.
|
|
111
111
|
* Defaults to false.
|
|
112
112
|
*/
|
|
113
|
-
isServer?: boolean;
|
|
113
|
+
isServer?: boolean | undefined;
|
|
114
114
|
/**
|
|
115
115
|
* An optional net.Server instance.
|
|
116
116
|
*/
|
|
117
|
-
server?: net.Server;
|
|
117
|
+
server?: net.Server | undefined;
|
|
118
118
|
|
|
119
119
|
/**
|
|
120
120
|
* An optional Buffer instance containing a TLS session.
|
|
121
121
|
*/
|
|
122
|
-
session?: Buffer;
|
|
122
|
+
session?: Buffer | undefined;
|
|
123
123
|
/**
|
|
124
124
|
* If true, specifies that the OCSP status request extension will be
|
|
125
125
|
* added to the client hello and an 'OCSPResponse' event will be
|
|
126
126
|
* emitted on the socket before establishing a secure communication
|
|
127
127
|
*/
|
|
128
|
-
requestOCSP?: boolean;
|
|
128
|
+
requestOCSP?: boolean | undefined;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
class TLSSocket extends net.Socket {
|
|
@@ -153,7 +153,7 @@ declare module 'tls' {
|
|
|
153
153
|
* String containing the selected ALPN protocol.
|
|
154
154
|
* When ALPN has no selected protocol, tlsSocket.alpnProtocol equals false.
|
|
155
155
|
*/
|
|
156
|
-
alpnProtocol?: string;
|
|
156
|
+
alpnProtocol?: string | undefined;
|
|
157
157
|
|
|
158
158
|
/**
|
|
159
159
|
* Returns an object representing the local certificate. The returned
|
|
@@ -265,7 +265,7 @@ declare module 'tls' {
|
|
|
265
265
|
* is successfully completed.
|
|
266
266
|
* @return `undefined` when socket is destroy, `false` if negotiaion can't be initiated.
|
|
267
267
|
*/
|
|
268
|
-
renegotiate(options: { rejectUnauthorized?: boolean, requestCert?: boolean }, callback: (err: Error | null) => void): undefined | boolean;
|
|
268
|
+
renegotiate(options: { rejectUnauthorized?: boolean | undefined, requestCert?: boolean | undefined }, callback: (err: Error | null) => void): undefined | boolean;
|
|
269
269
|
/**
|
|
270
270
|
* Set maximum TLS fragment size (default and maximum value is: 16384, minimum is: 512).
|
|
271
271
|
* Smaller fragment size decreases buffering latency on the client: large fragments are buffered by
|
|
@@ -355,25 +355,25 @@ declare module 'tls' {
|
|
|
355
355
|
/**
|
|
356
356
|
* An optional TLS context object from tls.createSecureContext()
|
|
357
357
|
*/
|
|
358
|
-
secureContext?: SecureContext;
|
|
358
|
+
secureContext?: SecureContext | undefined;
|
|
359
359
|
|
|
360
360
|
/**
|
|
361
361
|
* When enabled, TLS packet trace information is written to `stderr`. This can be
|
|
362
362
|
* used to debug TLS connection problems.
|
|
363
363
|
* @default false
|
|
364
364
|
*/
|
|
365
|
-
enableTrace?: boolean;
|
|
365
|
+
enableTrace?: boolean | undefined;
|
|
366
366
|
/**
|
|
367
367
|
* If true the server will request a certificate from clients that
|
|
368
368
|
* connect and attempt to verify that certificate. Defaults to
|
|
369
369
|
* false.
|
|
370
370
|
*/
|
|
371
|
-
requestCert?: boolean;
|
|
371
|
+
requestCert?: boolean | undefined;
|
|
372
372
|
/**
|
|
373
373
|
* An array of strings or a Buffer naming possible ALPN protocols.
|
|
374
374
|
* (Protocols should be ordered by their priority.)
|
|
375
375
|
*/
|
|
376
|
-
ALPNProtocols?: string[] | Uint8Array[] | Uint8Array;
|
|
376
|
+
ALPNProtocols?: string[] | Uint8Array[] | Uint8Array | undefined;
|
|
377
377
|
/**
|
|
378
378
|
* SNICallback(servername, cb) <Function> A function that will be
|
|
379
379
|
* called if the client supports SNI TLS extension. Two arguments
|
|
@@ -383,14 +383,14 @@ declare module 'tls' {
|
|
|
383
383
|
* SecureContext.) If SNICallback wasn't provided the default callback
|
|
384
384
|
* with high-level API will be used (see below).
|
|
385
385
|
*/
|
|
386
|
-
SNICallback?: (servername: string, cb: (err: Error | null, ctx: SecureContext) => void) => void;
|
|
386
|
+
SNICallback?: ((servername: string, cb: (err: Error | null, ctx: SecureContext) => void) => void) | undefined;
|
|
387
387
|
/**
|
|
388
388
|
* If true the server will reject any connection which is not
|
|
389
389
|
* authorized with the list of supplied CAs. This option only has an
|
|
390
390
|
* effect if requestCert is true.
|
|
391
391
|
* @default true
|
|
392
392
|
*/
|
|
393
|
-
rejectUnauthorized?: boolean;
|
|
393
|
+
rejectUnauthorized?: boolean | undefined;
|
|
394
394
|
}
|
|
395
395
|
|
|
396
396
|
interface TlsOptions extends SecureContextOptions, CommonConnectionOptions, net.ServerOpts {
|
|
@@ -400,17 +400,17 @@ declare module 'tls' {
|
|
|
400
400
|
* the tls.Server object whenever a handshake times out. Default:
|
|
401
401
|
* 120000 (120 seconds).
|
|
402
402
|
*/
|
|
403
|
-
handshakeTimeout?: number;
|
|
403
|
+
handshakeTimeout?: number | undefined;
|
|
404
404
|
/**
|
|
405
405
|
* The number of seconds after which a TLS session created by the
|
|
406
406
|
* server will no longer be resumable. See Session Resumption for more
|
|
407
407
|
* information. Default: 300.
|
|
408
408
|
*/
|
|
409
|
-
sessionTimeout?: number;
|
|
409
|
+
sessionTimeout?: number | undefined;
|
|
410
410
|
/**
|
|
411
411
|
* 48-bytes of cryptographically strong pseudo-random data.
|
|
412
412
|
*/
|
|
413
|
-
ticketKeys?: Buffer;
|
|
413
|
+
ticketKeys?: Buffer | undefined;
|
|
414
414
|
|
|
415
415
|
/**
|
|
416
416
|
*
|
|
@@ -439,7 +439,7 @@ declare module 'tls' {
|
|
|
439
439
|
* in TLS 1.3. Upon failing to set pskIdentityHint `tlsClientError` will be
|
|
440
440
|
* emitted with `ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED` code.
|
|
441
441
|
*/
|
|
442
|
-
pskIdentityHint?: string;
|
|
442
|
+
pskIdentityHint?: string | undefined;
|
|
443
443
|
}
|
|
444
444
|
|
|
445
445
|
interface PSKCallbackNegotation {
|
|
@@ -448,16 +448,16 @@ declare module 'tls' {
|
|
|
448
448
|
}
|
|
449
449
|
|
|
450
450
|
interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions {
|
|
451
|
-
host?: string;
|
|
452
|
-
port?: number;
|
|
453
|
-
path?: string; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored.
|
|
454
|
-
socket?: net.Socket; // Establish secure connection on a given socket rather than creating a new socket
|
|
455
|
-
checkServerIdentity?: typeof checkServerIdentity;
|
|
456
|
-
servername?: string; // SNI TLS Extension
|
|
457
|
-
session?: Buffer;
|
|
458
|
-
minDHSize?: number;
|
|
459
|
-
lookup?: net.LookupFunction;
|
|
460
|
-
timeout?: number;
|
|
451
|
+
host?: string | undefined;
|
|
452
|
+
port?: number | undefined;
|
|
453
|
+
path?: string | undefined; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored.
|
|
454
|
+
socket?: net.Socket | undefined; // Establish secure connection on a given socket rather than creating a new socket
|
|
455
|
+
checkServerIdentity?: typeof checkServerIdentity | undefined;
|
|
456
|
+
servername?: string | undefined; // SNI TLS Extension
|
|
457
|
+
session?: Buffer | undefined;
|
|
458
|
+
minDHSize?: number | undefined;
|
|
459
|
+
lookup?: net.LookupFunction | undefined;
|
|
460
|
+
timeout?: number | undefined;
|
|
461
461
|
/**
|
|
462
462
|
* When negotiating TLS-PSK (pre-shared keys), this function is called
|
|
463
463
|
* with optional identity `hint` provided by the server or `null`
|
|
@@ -580,7 +580,7 @@ declare module 'tls' {
|
|
|
580
580
|
* the well-known CAs curated by Mozilla. Mozilla's CAs are completely
|
|
581
581
|
* replaced when CAs are explicitly specified using this option.
|
|
582
582
|
*/
|
|
583
|
-
ca?: string | Buffer | Array<string | Buffer
|
|
583
|
+
ca?: string | Buffer | Array<string | Buffer> | undefined;
|
|
584
584
|
/**
|
|
585
585
|
* Cert chains in PEM format. One cert chain should be provided per
|
|
586
586
|
* private key. Each cert chain should consist of the PEM formatted
|
|
@@ -592,29 +592,29 @@ declare module 'tls' {
|
|
|
592
592
|
* intermediate certificates are not provided, the peer will not be
|
|
593
593
|
* able to validate the certificate, and the handshake will fail.
|
|
594
594
|
*/
|
|
595
|
-
cert?: string | Buffer | Array<string | Buffer
|
|
595
|
+
cert?: string | Buffer | Array<string | Buffer> | undefined;
|
|
596
596
|
/**
|
|
597
597
|
* Colon-separated list of supported signature algorithms. The list
|
|
598
598
|
* can contain digest algorithms (SHA256, MD5 etc.), public key
|
|
599
599
|
* algorithms (RSA-PSS, ECDSA etc.), combination of both (e.g
|
|
600
600
|
* 'RSA+SHA384') or TLS v1.3 scheme names (e.g. rsa_pss_pss_sha512).
|
|
601
601
|
*/
|
|
602
|
-
sigalgs?: string;
|
|
602
|
+
sigalgs?: string | undefined;
|
|
603
603
|
/**
|
|
604
604
|
* Cipher suite specification, replacing the default. For more
|
|
605
605
|
* information, see modifying the default cipher suite. Permitted
|
|
606
606
|
* ciphers can be obtained via tls.getCiphers(). Cipher names must be
|
|
607
607
|
* uppercased in order for OpenSSL to accept them.
|
|
608
608
|
*/
|
|
609
|
-
ciphers?: string;
|
|
609
|
+
ciphers?: string | undefined;
|
|
610
610
|
/**
|
|
611
611
|
* Name of an OpenSSL engine which can provide the client certificate.
|
|
612
612
|
*/
|
|
613
|
-
clientCertEngine?: string;
|
|
613
|
+
clientCertEngine?: string | undefined;
|
|
614
614
|
/**
|
|
615
615
|
* PEM formatted CRLs (Certificate Revocation Lists).
|
|
616
616
|
*/
|
|
617
|
-
crl?: string | Buffer | Array<string | Buffer
|
|
617
|
+
crl?: string | Buffer | Array<string | Buffer> | undefined;
|
|
618
618
|
/**
|
|
619
619
|
* Diffie Hellman parameters, required for Perfect Forward Secrecy. Use
|
|
620
620
|
* openssl dhparam to create the parameters. The key length must be
|
|
@@ -623,7 +623,7 @@ declare module 'tls' {
|
|
|
623
623
|
* stronger security. If omitted or invalid, the parameters are
|
|
624
624
|
* silently discarded and DHE ciphers will not be available.
|
|
625
625
|
*/
|
|
626
|
-
dhparam?: string | Buffer;
|
|
626
|
+
dhparam?: string | Buffer | undefined;
|
|
627
627
|
/**
|
|
628
628
|
* A string describing a named curve or a colon separated list of curve
|
|
629
629
|
* NIDs or names, for example P-521:P-384:P-256, to use for ECDH key
|
|
@@ -633,13 +633,13 @@ declare module 'tls' {
|
|
|
633
633
|
* name and description of each available elliptic curve. Default:
|
|
634
634
|
* tls.DEFAULT_ECDH_CURVE.
|
|
635
635
|
*/
|
|
636
|
-
ecdhCurve?: string;
|
|
636
|
+
ecdhCurve?: string | undefined;
|
|
637
637
|
/**
|
|
638
638
|
* Attempt to use the server's cipher suite preferences instead of the
|
|
639
639
|
* client's. When true, causes SSL_OP_CIPHER_SERVER_PREFERENCE to be
|
|
640
640
|
* set in secureOptions
|
|
641
641
|
*/
|
|
642
|
-
honorCipherOrder?: boolean;
|
|
642
|
+
honorCipherOrder?: boolean | undefined;
|
|
643
643
|
/**
|
|
644
644
|
* Private keys in PEM format. PEM allows the option of private keys
|
|
645
645
|
* being encrypted. Encrypted keys will be decrypted with
|
|
@@ -650,18 +650,18 @@ declare module 'tls' {
|
|
|
650
650
|
* object.passphrase is optional. Encrypted keys will be decrypted with
|
|
651
651
|
* object.passphrase if provided, or options.passphrase if it is not.
|
|
652
652
|
*/
|
|
653
|
-
key?: string | Buffer | Array<Buffer | KeyObject
|
|
653
|
+
key?: string | Buffer | Array<Buffer | KeyObject> | undefined;
|
|
654
654
|
/**
|
|
655
655
|
* Name of an OpenSSL engine to get private key from. Should be used
|
|
656
656
|
* together with privateKeyIdentifier.
|
|
657
657
|
*/
|
|
658
|
-
privateKeyEngine?: string;
|
|
658
|
+
privateKeyEngine?: string | undefined;
|
|
659
659
|
/**
|
|
660
660
|
* Identifier of a private key managed by an OpenSSL engine. Should be
|
|
661
661
|
* used together with privateKeyEngine. Should not be set together with
|
|
662
662
|
* key, because both options define a private key in different ways.
|
|
663
663
|
*/
|
|
664
|
-
privateKeyIdentifier?: string;
|
|
664
|
+
privateKeyIdentifier?: string | undefined;
|
|
665
665
|
/**
|
|
666
666
|
* Optionally set the maximum TLS version to allow. One
|
|
667
667
|
* of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the
|
|
@@ -670,7 +670,7 @@ declare module 'tls' {
|
|
|
670
670
|
* `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to
|
|
671
671
|
* `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used.
|
|
672
672
|
*/
|
|
673
|
-
maxVersion?: SecureVersion;
|
|
673
|
+
maxVersion?: SecureVersion | undefined;
|
|
674
674
|
/**
|
|
675
675
|
* Optionally set the minimum TLS version to allow. One
|
|
676
676
|
* of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the
|
|
@@ -681,11 +681,11 @@ declare module 'tls' {
|
|
|
681
681
|
* `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to
|
|
682
682
|
* 'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used.
|
|
683
683
|
*/
|
|
684
|
-
minVersion?: SecureVersion;
|
|
684
|
+
minVersion?: SecureVersion | undefined;
|
|
685
685
|
/**
|
|
686
686
|
* Shared passphrase used for a single private key and/or a PFX.
|
|
687
687
|
*/
|
|
688
|
-
passphrase?: string;
|
|
688
|
+
passphrase?: string | undefined;
|
|
689
689
|
/**
|
|
690
690
|
* PFX or PKCS12 encoded private key and certificate chain. pfx is an
|
|
691
691
|
* alternative to providing key and cert individually. PFX is usually
|
|
@@ -696,13 +696,13 @@ declare module 'tls' {
|
|
|
696
696
|
* object.passphrase is optional. Encrypted PFX will be decrypted with
|
|
697
697
|
* object.passphrase if provided, or options.passphrase if it is not.
|
|
698
698
|
*/
|
|
699
|
-
pfx?: string | Buffer | Array<string | Buffer | PxfObject
|
|
699
|
+
pfx?: string | Buffer | Array<string | Buffer | PxfObject> | undefined;
|
|
700
700
|
/**
|
|
701
701
|
* Optionally affect the OpenSSL protocol behavior, which is not
|
|
702
702
|
* usually necessary. This should be used carefully if at all! Value is
|
|
703
703
|
* a numeric bitmask of the SSL_OP_* options from OpenSSL Options
|
|
704
704
|
*/
|
|
705
|
-
secureOptions?: number; // Value is a numeric bitmask of the `SSL_OP_*` options
|
|
705
|
+
secureOptions?: number | undefined; // Value is a numeric bitmask of the `SSL_OP_*` options
|
|
706
706
|
/**
|
|
707
707
|
* Legacy mechanism to select the TLS protocol version to use, it does
|
|
708
708
|
* not support independent control of the minimum and maximum version,
|
|
@@ -714,23 +714,23 @@ declare module 'tls' {
|
|
|
714
714
|
* TLS versions less than 1.2, but it may be required for
|
|
715
715
|
* interoperability. Default: none, see minVersion.
|
|
716
716
|
*/
|
|
717
|
-
secureProtocol?: string;
|
|
717
|
+
secureProtocol?: string | undefined;
|
|
718
718
|
/**
|
|
719
719
|
* Opaque identifier used by servers to ensure session state is not
|
|
720
720
|
* shared between applications. Unused by clients.
|
|
721
721
|
*/
|
|
722
|
-
sessionIdContext?: string;
|
|
722
|
+
sessionIdContext?: string | undefined;
|
|
723
723
|
/**
|
|
724
724
|
* 48-bytes of cryptographically strong pseudo-random data.
|
|
725
725
|
* See Session Resumption for more information.
|
|
726
726
|
*/
|
|
727
|
-
ticketKeys?: Buffer;
|
|
727
|
+
ticketKeys?: Buffer | undefined;
|
|
728
728
|
/**
|
|
729
729
|
* The number of seconds after which a TLS session created by the
|
|
730
730
|
* server will no longer be resumable. See Session Resumption for more
|
|
731
731
|
* information. Default: 300.
|
|
732
732
|
*/
|
|
733
|
-
sessionTimeout?: number;
|
|
733
|
+
sessionTimeout?: number | undefined;
|
|
734
734
|
}
|
|
735
735
|
|
|
736
736
|
interface SecureContext {
|
node/url.d.ts
CHANGED
|
@@ -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 | undefined;
|
|
7
|
+
hash?: string | null | undefined;
|
|
8
|
+
host?: string | null | undefined;
|
|
9
|
+
hostname?: string | null | undefined;
|
|
10
|
+
href?: string | null | undefined;
|
|
11
|
+
pathname?: string | null | undefined;
|
|
12
|
+
protocol?: string | null | undefined;
|
|
13
|
+
search?: string | null | undefined;
|
|
14
|
+
slashes?: boolean | null | undefined;
|
|
15
|
+
port?: string | number | null | undefined;
|
|
16
|
+
query?: string | null | ParsedUrlQueryInput | undefined;
|
|
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 | undefined;
|
|
77
|
+
fragment?: boolean | undefined;
|
|
78
|
+
search?: boolean | undefined;
|
|
79
|
+
unicode?: boolean | undefined;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
class URL {
|
node/util.d.ts
CHANGED
|
@@ -10,24 +10,24 @@ declare module 'util' {
|
|
|
10
10
|
* the getter function.
|
|
11
11
|
* @default `false`
|
|
12
12
|
*/
|
|
13
|
-
getters?: 'get' | 'set' | boolean;
|
|
14
|
-
showHidden?: boolean;
|
|
13
|
+
getters?: 'get' | 'set' | boolean | undefined;
|
|
14
|
+
showHidden?: boolean | undefined;
|
|
15
15
|
/**
|
|
16
16
|
* @default 2
|
|
17
17
|
*/
|
|
18
|
-
depth?: number | null;
|
|
19
|
-
colors?: boolean;
|
|
20
|
-
customInspect?: boolean;
|
|
21
|
-
showProxy?: boolean;
|
|
22
|
-
maxArrayLength?: number | null;
|
|
18
|
+
depth?: number | null | undefined;
|
|
19
|
+
colors?: boolean | undefined;
|
|
20
|
+
customInspect?: boolean | undefined;
|
|
21
|
+
showProxy?: boolean | undefined;
|
|
22
|
+
maxArrayLength?: number | null | undefined;
|
|
23
23
|
/**
|
|
24
24
|
* Specifies the maximum number of characters to
|
|
25
25
|
* include when formatting. Set to `null` or `Infinity` to show all elements.
|
|
26
26
|
* Set to `0` or negative to show no characters.
|
|
27
27
|
* @default 10000
|
|
28
28
|
*/
|
|
29
|
-
maxStringLength?: number | null;
|
|
30
|
-
breakLength?: number;
|
|
29
|
+
maxStringLength?: number | null | undefined;
|
|
30
|
+
breakLength?: number | undefined;
|
|
31
31
|
/**
|
|
32
32
|
* Setting this to `false` causes each object key
|
|
33
33
|
* to be displayed on a new line. It will also add new lines to text that is
|
|
@@ -38,8 +38,8 @@ declare module 'util' {
|
|
|
38
38
|
* For more information, see the example below.
|
|
39
39
|
* @default `true`
|
|
40
40
|
*/
|
|
41
|
-
compact?: boolean | number;
|
|
42
|
-
sorted?: boolean | ((a: string, b: string) => number);
|
|
41
|
+
compact?: boolean | number | undefined;
|
|
42
|
+
sorted?: boolean | ((a: string, b: string) => number) | undefined;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
export type Style = 'special' | 'number' | 'bigint' | 'boolean' | 'undefined' | 'null' | 'string' | 'symbol' | 'date' | 'regexp' | 'module';
|
|
@@ -168,11 +168,11 @@ declare module 'util' {
|
|
|
168
168
|
readonly ignoreBOM: boolean;
|
|
169
169
|
constructor(
|
|
170
170
|
encoding?: string,
|
|
171
|
-
options?: { fatal?: boolean; ignoreBOM?: boolean }
|
|
171
|
+
options?: { fatal?: boolean | undefined; ignoreBOM?: boolean | undefined }
|
|
172
172
|
);
|
|
173
173
|
decode(
|
|
174
174
|
input?: NodeJS.ArrayBufferView | ArrayBuffer | null,
|
|
175
|
-
options?: { stream?: boolean }
|
|
175
|
+
options?: { stream?: boolean | undefined }
|
|
176
176
|
): string;
|
|
177
177
|
}
|
|
178
178
|
|
node/vm.d.ts
CHANGED
|
@@ -5,67 +5,67 @@ declare module 'vm' {
|
|
|
5
5
|
* Specifies the filename used in stack traces produced by this script.
|
|
6
6
|
* Default: `''`.
|
|
7
7
|
*/
|
|
8
|
-
filename?: string;
|
|
8
|
+
filename?: string | undefined;
|
|
9
9
|
/**
|
|
10
10
|
* Specifies the line number offset that is displayed in stack traces produced by this script.
|
|
11
11
|
* Default: `0`.
|
|
12
12
|
*/
|
|
13
|
-
lineOffset?: number;
|
|
13
|
+
lineOffset?: number | undefined;
|
|
14
14
|
/**
|
|
15
15
|
* Specifies the column number offset that is displayed in stack traces produced by this script.
|
|
16
16
|
* @default 0
|
|
17
17
|
*/
|
|
18
|
-
columnOffset?: number;
|
|
18
|
+
columnOffset?: number | undefined;
|
|
19
19
|
}
|
|
20
20
|
interface ScriptOptions extends BaseOptions {
|
|
21
|
-
displayErrors?: boolean;
|
|
22
|
-
timeout?: number;
|
|
23
|
-
cachedData?: Buffer;
|
|
21
|
+
displayErrors?: boolean | undefined;
|
|
22
|
+
timeout?: number | undefined;
|
|
23
|
+
cachedData?: Buffer | undefined;
|
|
24
24
|
/** @deprecated in favor of `script.createCachedData()` */
|
|
25
|
-
produceCachedData?: boolean;
|
|
25
|
+
produceCachedData?: boolean | undefined;
|
|
26
26
|
}
|
|
27
27
|
interface RunningScriptOptions extends BaseOptions {
|
|
28
28
|
/**
|
|
29
29
|
* When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace.
|
|
30
30
|
* Default: `true`.
|
|
31
31
|
*/
|
|
32
|
-
displayErrors?: boolean;
|
|
32
|
+
displayErrors?: boolean | undefined;
|
|
33
33
|
/**
|
|
34
34
|
* Specifies the number of milliseconds to execute code before terminating execution.
|
|
35
35
|
* If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer.
|
|
36
36
|
*/
|
|
37
|
-
timeout?: number;
|
|
37
|
+
timeout?: number | undefined;
|
|
38
38
|
/**
|
|
39
39
|
* If `true`, the execution will be terminated when `SIGINT` (Ctrl+C) is received.
|
|
40
40
|
* Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that.
|
|
41
41
|
* If execution is terminated, an `Error` will be thrown.
|
|
42
42
|
* Default: `false`.
|
|
43
43
|
*/
|
|
44
|
-
breakOnSigint?: boolean;
|
|
44
|
+
breakOnSigint?: boolean | undefined;
|
|
45
45
|
/**
|
|
46
46
|
* If set to `afterEvaluate`, microtasks will be run immediately after the script has run.
|
|
47
47
|
*/
|
|
48
|
-
microtaskMode?: 'afterEvaluate';
|
|
48
|
+
microtaskMode?: 'afterEvaluate' | undefined;
|
|
49
49
|
}
|
|
50
50
|
interface CompileFunctionOptions extends BaseOptions {
|
|
51
51
|
/**
|
|
52
52
|
* Provides an optional data with V8's code cache data for the supplied source.
|
|
53
53
|
*/
|
|
54
|
-
cachedData?: Buffer;
|
|
54
|
+
cachedData?: Buffer | undefined;
|
|
55
55
|
/**
|
|
56
56
|
* Specifies whether to produce new cache data.
|
|
57
57
|
* Default: `false`,
|
|
58
58
|
*/
|
|
59
|
-
produceCachedData?: boolean;
|
|
59
|
+
produceCachedData?: boolean | undefined;
|
|
60
60
|
/**
|
|
61
61
|
* The sandbox/context in which the said function should be compiled in.
|
|
62
62
|
*/
|
|
63
|
-
parsingContext?: Context;
|
|
63
|
+
parsingContext?: Context | undefined;
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
66
|
* An array containing a collection of context extensions (objects wrapping the current scope) to be applied while compiling
|
|
67
67
|
*/
|
|
68
|
-
contextExtensions?: Object[];
|
|
68
|
+
contextExtensions?: Object[] | undefined;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
interface CreateContextOptions {
|
|
@@ -73,7 +73,7 @@ declare module 'vm' {
|
|
|
73
73
|
* Human-readable name of the newly created context.
|
|
74
74
|
* @default 'VM Context i' Where i is an ascending numerical index of the created context.
|
|
75
75
|
*/
|
|
76
|
-
name?: string;
|
|
76
|
+
name?: string | undefined;
|
|
77
77
|
/**
|
|
78
78
|
* Corresponds to the newly created context for display purposes.
|
|
79
79
|
* The origin should be formatted like a `URL`, but with only the scheme, host, and port (if necessary),
|
|
@@ -81,24 +81,24 @@ declare module 'vm' {
|
|
|
81
81
|
* Most notably, this string should omit the trailing slash, as that denotes a path.
|
|
82
82
|
* @default ''
|
|
83
83
|
*/
|
|
84
|
-
origin?: string;
|
|
84
|
+
origin?: string | undefined;
|
|
85
85
|
codeGeneration?: {
|
|
86
86
|
/**
|
|
87
87
|
* If set to false any calls to eval or function constructors (Function, GeneratorFunction, etc)
|
|
88
88
|
* will throw an EvalError.
|
|
89
89
|
* @default true
|
|
90
90
|
*/
|
|
91
|
-
strings?: boolean;
|
|
91
|
+
strings?: boolean | undefined;
|
|
92
92
|
/**
|
|
93
93
|
* If set to false any attempt to compile a WebAssembly module will throw a WebAssembly.CompileError.
|
|
94
94
|
* @default true
|
|
95
95
|
*/
|
|
96
|
-
wasm?: boolean;
|
|
97
|
-
};
|
|
96
|
+
wasm?: boolean | undefined;
|
|
97
|
+
} | undefined;
|
|
98
98
|
/**
|
|
99
99
|
* If set to `afterEvaluate`, microtasks will be run immediately after the script has run.
|
|
100
100
|
*/
|
|
101
|
-
microtaskMode?: 'afterEvaluate';
|
|
101
|
+
microtaskMode?: 'afterEvaluate' | undefined;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
type MeasureMemoryMode = 'summary' | 'detailed';
|
|
@@ -107,8 +107,8 @@ declare module 'vm' {
|
|
|
107
107
|
/**
|
|
108
108
|
* @default 'summary'
|
|
109
109
|
*/
|
|
110
|
-
mode?: MeasureMemoryMode;
|
|
111
|
-
context?: Context;
|
|
110
|
+
mode?: MeasureMemoryMode | undefined;
|
|
111
|
+
context?: Context | undefined;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
interface MemoryMeasurement {
|
|
@@ -124,7 +124,7 @@ declare module 'vm' {
|
|
|
124
124
|
runInNewContext(sandbox?: Context, options?: RunningScriptOptions): any;
|
|
125
125
|
runInThisContext(options?: RunningScriptOptions): any;
|
|
126
126
|
createCachedData(): Buffer;
|
|
127
|
-
cachedDataRejected?: boolean;
|
|
127
|
+
cachedDataRejected?: boolean | undefined;
|
|
128
128
|
}
|
|
129
129
|
function createContext(sandbox?: Context, options?: CreateContextOptions): Context;
|
|
130
130
|
function isContext(sandbox: Context): boolean;
|
node/wasi.d.ts
CHANGED
|
@@ -5,13 +5,13 @@ declare module 'wasi' {
|
|
|
5
5
|
* see as command line arguments. The first argument is the virtual path to the
|
|
6
6
|
* WASI command itself.
|
|
7
7
|
*/
|
|
8
|
-
args?: string[];
|
|
8
|
+
args?: string[] | undefined;
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* An object similar to `process.env` that the WebAssembly
|
|
12
12
|
* application will see as its environment.
|
|
13
13
|
*/
|
|
14
|
-
env?: object;
|
|
14
|
+
env?: object | undefined;
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* This object represents the WebAssembly application's
|
|
@@ -19,7 +19,7 @@ declare module 'wasi' {
|
|
|
19
19
|
* directories within the sandbox. The corresponding values in `preopens` are
|
|
20
20
|
* the real paths to those directories on the host machine.
|
|
21
21
|
*/
|
|
22
|
-
preopens?: NodeJS.Dict<string
|
|
22
|
+
preopens?: NodeJS.Dict<string> | undefined;
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* By default, WASI applications terminate the Node.js
|
|
@@ -28,25 +28,25 @@ declare module 'wasi' {
|
|
|
28
28
|
* process.
|
|
29
29
|
* @default false
|
|
30
30
|
*/
|
|
31
|
-
returnOnExit?: boolean;
|
|
31
|
+
returnOnExit?: boolean | undefined;
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* The file descriptor used as standard input in the WebAssembly application.
|
|
35
35
|
* @default 0
|
|
36
36
|
*/
|
|
37
|
-
stdin?: number;
|
|
37
|
+
stdin?: number | undefined;
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* The file descriptor used as standard output in the WebAssembly application.
|
|
41
41
|
* @default 1
|
|
42
42
|
*/
|
|
43
|
-
stdout?: number;
|
|
43
|
+
stdout?: number | undefined;
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* The file descriptor used as standard error in the WebAssembly application.
|
|
47
47
|
* @default 2
|
|
48
48
|
*/
|
|
49
|
-
stderr?: number;
|
|
49
|
+
stderr?: number | undefined;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
class WASI {
|