@types/node 14.17.2 → 14.17.6

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.17/tls.d.ts CHANGED
@@ -75,7 +75,7 @@ declare module 'tls' {
75
75
  /**
76
76
  * The name property is available only when type is 'ECDH'.
77
77
  */
78
- name?: string;
78
+ name?: string | undefined;
79
79
  /**
80
80
  * The size of parameter of an ephemeral key exchange.
81
81
  */
@@ -90,7 +90,7 @@ declare module 'tls' {
90
90
  /**
91
91
  * Optional passphrase.
92
92
  */
93
- passphrase?: string;
93
+ passphrase?: string | undefined;
94
94
  }
95
95
 
96
96
  interface PxfObject {
@@ -101,7 +101,7 @@ declare module 'tls' {
101
101
  /**
102
102
  * Optional passphrase.
103
103
  */
104
- passphrase?: string;
104
+ passphrase?: string | undefined;
105
105
  }
106
106
 
107
107
  interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions {
@@ -109,22 +109,22 @@ declare module 'tls' {
109
109
  * If true the TLS socket will be instantiated in server-mode.
110
110
  * Defaults to false.
111
111
  */
112
- isServer?: boolean;
112
+ isServer?: boolean | undefined;
113
113
  /**
114
114
  * An optional net.Server instance.
115
115
  */
116
- server?: net.Server;
116
+ server?: net.Server | undefined;
117
117
 
118
118
  /**
119
119
  * An optional Buffer instance containing a TLS session.
120
120
  */
121
- session?: Buffer;
121
+ session?: Buffer | undefined;
122
122
  /**
123
123
  * If true, specifies that the OCSP status request extension will be
124
124
  * added to the client hello and an 'OCSPResponse' event will be
125
125
  * emitted on the socket before establishing a secure communication
126
126
  */
127
- requestOCSP?: boolean;
127
+ requestOCSP?: boolean | undefined;
128
128
  }
129
129
 
130
130
  class TLSSocket extends net.Socket {
@@ -152,7 +152,7 @@ declare module 'tls' {
152
152
  * String containing the selected ALPN protocol.
153
153
  * When ALPN has no selected protocol, tlsSocket.alpnProtocol equals false.
154
154
  */
155
- alpnProtocol?: string;
155
+ alpnProtocol?: string | undefined;
156
156
 
157
157
  /**
158
158
  * Returns an object representing the local certificate. The returned
@@ -264,7 +264,7 @@ declare module 'tls' {
264
264
  * is successfully completed.
265
265
  * @return `undefined` when socket is destroy, `false` if negotiaion can't be initiated.
266
266
  */
267
- renegotiate(options: { rejectUnauthorized?: boolean, requestCert?: boolean }, callback: (err: Error | null) => void): undefined | boolean;
267
+ renegotiate(options: { rejectUnauthorized?: boolean | undefined, requestCert?: boolean | undefined }, callback: (err: Error | null) => void): undefined | boolean;
268
268
  /**
269
269
  * Set maximum TLS fragment size (default and maximum value is: 16384, minimum is: 512).
270
270
  * Smaller fragment size decreases buffering latency on the client: large fragments are buffered by
@@ -344,25 +344,25 @@ declare module 'tls' {
344
344
  /**
345
345
  * An optional TLS context object from tls.createSecureContext()
346
346
  */
347
- secureContext?: SecureContext;
347
+ secureContext?: SecureContext | undefined;
348
348
 
349
349
  /**
350
350
  * When enabled, TLS packet trace information is written to `stderr`. This can be
351
351
  * used to debug TLS connection problems.
352
352
  * @default false
353
353
  */
354
- enableTrace?: boolean;
354
+ enableTrace?: boolean | undefined;
355
355
  /**
356
356
  * If true the server will request a certificate from clients that
357
357
  * connect and attempt to verify that certificate. Defaults to
358
358
  * false.
359
359
  */
360
- requestCert?: boolean;
360
+ requestCert?: boolean | undefined;
361
361
  /**
362
362
  * An array of strings or a Buffer naming possible ALPN protocols.
363
363
  * (Protocols should be ordered by their priority.)
364
364
  */
365
- ALPNProtocols?: string[] | Uint8Array[] | Uint8Array;
365
+ ALPNProtocols?: string[] | Uint8Array[] | Uint8Array | undefined;
366
366
  /**
367
367
  * SNICallback(servername, cb) <Function> A function that will be
368
368
  * called if the client supports SNI TLS extension. Two arguments
@@ -372,14 +372,14 @@ declare module 'tls' {
372
372
  * SecureContext.) If SNICallback wasn't provided the default callback
373
373
  * with high-level API will be used (see below).
374
374
  */
375
- SNICallback?: (servername: string, cb: (err: Error | null, ctx: SecureContext) => void) => void;
375
+ SNICallback?: ((servername: string, cb: (err: Error | null, ctx: SecureContext) => void) => void) | undefined;
376
376
  /**
377
377
  * If true the server will reject any connection which is not
378
378
  * authorized with the list of supplied CAs. This option only has an
379
379
  * effect if requestCert is true.
380
380
  * @default true
381
381
  */
382
- rejectUnauthorized?: boolean;
382
+ rejectUnauthorized?: boolean | undefined;
383
383
  }
384
384
 
385
385
  interface TlsOptions extends SecureContextOptions, CommonConnectionOptions, net.ServerOpts {
@@ -389,17 +389,17 @@ declare module 'tls' {
389
389
  * the tls.Server object whenever a handshake times out. Default:
390
390
  * 120000 (120 seconds).
391
391
  */
392
- handshakeTimeout?: number;
392
+ handshakeTimeout?: number | undefined;
393
393
  /**
394
394
  * The number of seconds after which a TLS session created by the
395
395
  * server will no longer be resumable. See Session Resumption for more
396
396
  * information. Default: 300.
397
397
  */
398
- sessionTimeout?: number;
398
+ sessionTimeout?: number | undefined;
399
399
  /**
400
400
  * 48-bytes of cryptographically strong pseudo-random data.
401
401
  */
402
- ticketKeys?: Buffer;
402
+ ticketKeys?: Buffer | undefined;
403
403
 
404
404
  /**
405
405
  *
@@ -428,7 +428,7 @@ declare module 'tls' {
428
428
  * in TLS 1.3. Upon failing to set pskIdentityHint `tlsClientError` will be
429
429
  * emitted with `ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED` code.
430
430
  */
431
- pskIdentityHint?: string;
431
+ pskIdentityHint?: string | undefined;
432
432
  }
433
433
 
434
434
  interface PSKCallbackNegotation {
@@ -437,16 +437,16 @@ declare module 'tls' {
437
437
  }
438
438
 
439
439
  interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions {
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;
440
+ host?: string | undefined;
441
+ port?: number | undefined;
442
+ path?: string | undefined; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored.
443
+ socket?: net.Socket | undefined; // Establish secure connection on a given socket rather than creating a new socket
444
+ checkServerIdentity?: typeof checkServerIdentity | undefined;
445
+ servername?: string | undefined; // SNI TLS Extension
446
+ session?: Buffer | undefined;
447
+ minDHSize?: number | undefined;
448
+ lookup?: net.LookupFunction | undefined;
449
+ timeout?: number | undefined;
450
450
  /**
451
451
  * When negotiating TLS-PSK (pre-shared keys), this function is called
452
452
  * with optional identity `hint` provided by the server or `null`
@@ -566,7 +566,7 @@ declare module 'tls' {
566
566
  * the well-known CAs curated by Mozilla. Mozilla's CAs are completely
567
567
  * replaced when CAs are explicitly specified using this option.
568
568
  */
569
- ca?: string | Buffer | Array<string | Buffer>;
569
+ ca?: string | Buffer | Array<string | Buffer> | undefined;
570
570
  /**
571
571
  * Cert chains in PEM format. One cert chain should be provided per
572
572
  * private key. Each cert chain should consist of the PEM formatted
@@ -578,29 +578,29 @@ declare module 'tls' {
578
578
  * intermediate certificates are not provided, the peer will not be
579
579
  * able to validate the certificate, and the handshake will fail.
580
580
  */
581
- cert?: string | Buffer | Array<string | Buffer>;
581
+ cert?: string | Buffer | Array<string | Buffer> | undefined;
582
582
  /**
583
583
  * Colon-separated list of supported signature algorithms. The list
584
584
  * can contain digest algorithms (SHA256, MD5 etc.), public key
585
585
  * algorithms (RSA-PSS, ECDSA etc.), combination of both (e.g
586
586
  * 'RSA+SHA384') or TLS v1.3 scheme names (e.g. rsa_pss_pss_sha512).
587
587
  */
588
- sigalgs?: string;
588
+ sigalgs?: string | undefined;
589
589
  /**
590
590
  * Cipher suite specification, replacing the default. For more
591
591
  * information, see modifying the default cipher suite. Permitted
592
592
  * ciphers can be obtained via tls.getCiphers(). Cipher names must be
593
593
  * uppercased in order for OpenSSL to accept them.
594
594
  */
595
- ciphers?: string;
595
+ ciphers?: string | undefined;
596
596
  /**
597
597
  * Name of an OpenSSL engine which can provide the client certificate.
598
598
  */
599
- clientCertEngine?: string;
599
+ clientCertEngine?: string | undefined;
600
600
  /**
601
601
  * PEM formatted CRLs (Certificate Revocation Lists).
602
602
  */
603
- crl?: string | Buffer | Array<string | Buffer>;
603
+ crl?: string | Buffer | Array<string | Buffer> | undefined;
604
604
  /**
605
605
  * Diffie Hellman parameters, required for Perfect Forward Secrecy. Use
606
606
  * openssl dhparam to create the parameters. The key length must be
@@ -609,7 +609,7 @@ declare module 'tls' {
609
609
  * stronger security. If omitted or invalid, the parameters are
610
610
  * silently discarded and DHE ciphers will not be available.
611
611
  */
612
- dhparam?: string | Buffer;
612
+ dhparam?: string | Buffer | undefined;
613
613
  /**
614
614
  * A string describing a named curve or a colon separated list of curve
615
615
  * NIDs or names, for example P-521:P-384:P-256, to use for ECDH key
@@ -619,13 +619,13 @@ declare module 'tls' {
619
619
  * name and description of each available elliptic curve. Default:
620
620
  * tls.DEFAULT_ECDH_CURVE.
621
621
  */
622
- ecdhCurve?: string;
622
+ ecdhCurve?: string | undefined;
623
623
  /**
624
624
  * Attempt to use the server's cipher suite preferences instead of the
625
625
  * client's. When true, causes SSL_OP_CIPHER_SERVER_PREFERENCE to be
626
626
  * set in secureOptions
627
627
  */
628
- honorCipherOrder?: boolean;
628
+ honorCipherOrder?: boolean | undefined;
629
629
  /**
630
630
  * Private keys in PEM format. PEM allows the option of private keys
631
631
  * being encrypted. Encrypted keys will be decrypted with
@@ -636,18 +636,18 @@ declare module 'tls' {
636
636
  * object.passphrase is optional. Encrypted keys will be decrypted with
637
637
  * object.passphrase if provided, or options.passphrase if it is not.
638
638
  */
639
- key?: string | Buffer | Array<Buffer | KeyObject>;
639
+ key?: string | Buffer | Array<Buffer | KeyObject> | undefined;
640
640
  /**
641
641
  * Name of an OpenSSL engine to get private key from. Should be used
642
642
  * together with privateKeyIdentifier.
643
643
  */
644
- privateKeyEngine?: string;
644
+ privateKeyEngine?: string | undefined;
645
645
  /**
646
646
  * Identifier of a private key managed by an OpenSSL engine. Should be
647
647
  * used together with privateKeyEngine. Should not be set together with
648
648
  * key, because both options define a private key in different ways.
649
649
  */
650
- privateKeyIdentifier?: string;
650
+ privateKeyIdentifier?: string | undefined;
651
651
  /**
652
652
  * Optionally set the maximum TLS version to allow. One
653
653
  * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the
@@ -656,7 +656,7 @@ declare module 'tls' {
656
656
  * `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to
657
657
  * `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used.
658
658
  */
659
- maxVersion?: SecureVersion;
659
+ maxVersion?: SecureVersion | undefined;
660
660
  /**
661
661
  * Optionally set the minimum TLS version to allow. One
662
662
  * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the
@@ -667,11 +667,11 @@ declare module 'tls' {
667
667
  * `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to
668
668
  * 'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used.
669
669
  */
670
- minVersion?: SecureVersion;
670
+ minVersion?: SecureVersion | undefined;
671
671
  /**
672
672
  * Shared passphrase used for a single private key and/or a PFX.
673
673
  */
674
- passphrase?: string;
674
+ passphrase?: string | undefined;
675
675
  /**
676
676
  * PFX or PKCS12 encoded private key and certificate chain. pfx is an
677
677
  * alternative to providing key and cert individually. PFX is usually
@@ -682,13 +682,13 @@ declare module 'tls' {
682
682
  * object.passphrase is optional. Encrypted PFX will be decrypted with
683
683
  * object.passphrase if provided, or options.passphrase if it is not.
684
684
  */
685
- pfx?: string | Buffer | Array<string | Buffer | PxfObject>;
685
+ pfx?: string | Buffer | Array<string | Buffer | PxfObject> | undefined;
686
686
  /**
687
687
  * Optionally affect the OpenSSL protocol behavior, which is not
688
688
  * usually necessary. This should be used carefully if at all! Value is
689
689
  * a numeric bitmask of the SSL_OP_* options from OpenSSL Options
690
690
  */
691
- secureOptions?: number; // Value is a numeric bitmask of the `SSL_OP_*` options
691
+ secureOptions?: number | undefined; // Value is a numeric bitmask of the `SSL_OP_*` options
692
692
  /**
693
693
  * Legacy mechanism to select the TLS protocol version to use, it does
694
694
  * not support independent control of the minimum and maximum version,
@@ -700,23 +700,23 @@ declare module 'tls' {
700
700
  * TLS versions less than 1.2, but it may be required for
701
701
  * interoperability. Default: none, see minVersion.
702
702
  */
703
- secureProtocol?: string;
703
+ secureProtocol?: string | undefined;
704
704
  /**
705
705
  * Opaque identifier used by servers to ensure session state is not
706
706
  * shared between applications. Unused by clients.
707
707
  */
708
- sessionIdContext?: string;
708
+ sessionIdContext?: string | undefined;
709
709
  /**
710
710
  * 48-bytes of cryptographically strong pseudo-random data.
711
711
  * See Session Resumption for more information.
712
712
  */
713
- ticketKeys?: Buffer;
713
+ ticketKeys?: Buffer | undefined;
714
714
  /**
715
715
  * The number of seconds after which a TLS session created by the
716
716
  * server will no longer be resumable. See Session Resumption for more
717
717
  * information. Default: 300.
718
718
  */
719
- sessionTimeout?: number;
719
+ sessionTimeout?: number | undefined;
720
720
  }
721
721
 
722
722
  interface SecureContext {
node v14.17/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 v14.17/util.d.ts CHANGED
@@ -179,11 +179,11 @@ declare module 'util' {
179
179
  readonly ignoreBOM: boolean;
180
180
  constructor(
181
181
  encoding?: string,
182
- options?: { fatal?: boolean; ignoreBOM?: boolean }
182
+ options?: { fatal?: boolean | undefined; ignoreBOM?: boolean | undefined }
183
183
  );
184
184
  decode(
185
185
  input?: NodeJS.ArrayBufferView | ArrayBuffer | null,
186
- options?: { stream?: boolean }
186
+ options?: { stream?: boolean | undefined }
187
187
  ): string;
188
188
  }
189
189
 
node v14.17/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 v14.17/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 {
@@ -74,40 +74,40 @@ declare module 'worker_threads' {
74
74
  * but the values will be available on the global `process.argv` as if they
75
75
  * were passed as CLI options to the script.
76
76
  */
77
- argv?: any[];
78
- env?: NodeJS.Dict<string> | typeof SHARE_ENV;
79
- eval?: boolean;
77
+ argv?: any[] | undefined;
78
+ env?: NodeJS.Dict<string> | typeof SHARE_ENV | undefined;
79
+ eval?: boolean | undefined;
80
80
  workerData?: any;
81
- stdin?: boolean;
82
- stdout?: boolean;
83
- stderr?: boolean;
84
- execArgv?: string[];
85
- resourceLimits?: ResourceLimits;
81
+ stdin?: boolean | undefined;
82
+ stdout?: boolean | undefined;
83
+ stderr?: boolean | undefined;
84
+ execArgv?: string[] | undefined;
85
+ resourceLimits?: ResourceLimits | undefined;
86
86
  /**
87
87
  * Additional data to send in the first worker message.
88
88
  */
89
- transferList?: TransferListItem[];
90
- trackUnmanagedFds?: boolean;
89
+ transferList?: TransferListItem[] | undefined;
90
+ trackUnmanagedFds?: boolean | undefined;
91
91
  }
92
92
 
93
93
  interface ResourceLimits {
94
94
  /**
95
95
  * The maximum size of a heap space for recently created objects.
96
96
  */
97
- maxYoungGenerationSizeMb?: number;
97
+ maxYoungGenerationSizeMb?: number | undefined;
98
98
  /**
99
99
  * The maximum size of the main heap in MB.
100
100
  */
101
- maxOldGenerationSizeMb?: number;
101
+ maxOldGenerationSizeMb?: number | undefined;
102
102
  /**
103
103
  * The size of a pre-allocated memory range used for generated code.
104
104
  */
105
- codeRangeSizeMb?: number;
105
+ codeRangeSizeMb?: number | undefined;
106
106
  /**
107
107
  * The default maximum stack size for the thread. Small values may lead to unusable Worker instances.
108
108
  * @default 4
109
109
  */
110
- stackSizeMb?: number;
110
+ stackSizeMb?: number | undefined;
111
111
  }
112
112
 
113
113
  class Worker extends EventEmitter {
@@ -115,7 +115,7 @@ declare module 'worker_threads' {
115
115
  readonly stdout: Readable;
116
116
  readonly stderr: Readable;
117
117
  readonly threadId: number;
118
- readonly resourceLimits?: ResourceLimits;
118
+ readonly resourceLimits?: ResourceLimits | undefined;
119
119
 
120
120
  /**
121
121
  * @param filename The path to the Worker’s main script or module.