@types/node 12.12.63 → 12.12.67

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 v12.12/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (http://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v12.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Tue, 06 Oct 2020 00:12:31 GMT
11
+ * Last updated: Fri, 09 Oct 2020 06:51:18 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `Buffer`, `NodeJS`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout`
14
14
 
node v12.12/assert.d.ts CHANGED
@@ -62,7 +62,29 @@ declare module 'assert' {
62
62
  message?: string | Error,
63
63
  ): Promise<void>;
64
64
 
65
- const strict: typeof assert;
65
+ const strict: Omit<
66
+ typeof assert,
67
+ | 'strict'
68
+ | 'deepEqual'
69
+ | 'notDeepEqual'
70
+ | 'equal'
71
+ | 'notEqual'
72
+ | 'ok'
73
+ | 'strictEqual'
74
+ | 'deepStrictEqual'
75
+ | 'ifError'
76
+ > & {
77
+ (value: any, message?: string | Error): asserts value;
78
+ strict: typeof strict;
79
+ deepEqual: typeof deepStrictEqual;
80
+ notDeepEqual: typeof notDeepStrictEqual;
81
+ equal: typeof strictEqual;
82
+ notEqual: typeof notStrictEqual;
83
+ ok(value: any, message?: string | Error): asserts value;
84
+ strictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
85
+ deepStrictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
86
+ ifError(value: any): asserts value is null | undefined;
87
+ };
66
88
  }
67
89
 
68
90
  export = assert;
node v12.12/crypto.d.ts CHANGED
@@ -277,7 +277,7 @@ declare module "crypto" {
277
277
 
278
278
  function createPrivateKey(key: PrivateKeyInput | string | Buffer): KeyObject;
279
279
  function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject): KeyObject;
280
- function createSecretKey(key: Buffer): KeyObject;
280
+ function createSecretKey(key: NodeJS.ArrayBufferView): KeyObject;
281
281
 
282
282
  function createSign(algorithm: string, options?: stream.WritableOptions): Signer;
283
283
 
@@ -442,7 +442,7 @@ declare module "crypto" {
442
442
  /** @deprecated since v10.0.0 */
443
443
  const DEFAULT_ENCODING: string;
444
444
 
445
- type KeyType = 'rsa' | 'dsa' | 'ec';
445
+ type KeyType = 'rsa' | 'dsa' | 'ec' | 'ed25519' | 'ed448' | 'x25519' | 'x448';
446
446
  type KeyFormat = 'pem' | 'der';
447
447
 
448
448
  interface BasePrivateKeyEncodingOptions<T extends KeyFormat> {
@@ -456,6 +456,30 @@ declare module "crypto" {
456
456
  privateKey: KeyObject;
457
457
  }
458
458
 
459
+ interface ED25519KeyPairKeyObjectOptions {
460
+ /**
461
+ * No options.
462
+ */
463
+ }
464
+
465
+ interface ED448KeyPairKeyObjectOptions {
466
+ /**
467
+ * No options.
468
+ */
469
+ }
470
+
471
+ interface X25519KeyPairKeyObjectOptions {
472
+ /**
473
+ * No options.
474
+ */
475
+ }
476
+
477
+ interface X448KeyPairKeyObjectOptions {
478
+ /**
479
+ * No options.
480
+ */
481
+ }
482
+
459
483
  interface ECKeyPairKeyObjectOptions {
460
484
  /**
461
485
  * Name of the curve to use.
@@ -540,6 +564,46 @@ declare module "crypto" {
540
564
  };
541
565
  }
542
566
 
567
+ interface ED25519KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
568
+ publicKeyEncoding: {
569
+ type: 'spki';
570
+ format: PubF;
571
+ };
572
+ privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
573
+ type: 'pkcs8';
574
+ };
575
+ }
576
+
577
+ interface ED448KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
578
+ publicKeyEncoding: {
579
+ type: 'spki';
580
+ format: PubF;
581
+ };
582
+ privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
583
+ type: 'pkcs8';
584
+ };
585
+ }
586
+
587
+ interface X25519KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
588
+ publicKeyEncoding: {
589
+ type: 'spki';
590
+ format: PubF;
591
+ };
592
+ privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
593
+ type: 'pkcs8';
594
+ };
595
+ }
596
+
597
+ interface X448KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
598
+ publicKeyEncoding: {
599
+ type: 'spki';
600
+ format: PubF;
601
+ };
602
+ privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
603
+ type: 'pkcs8';
604
+ };
605
+ }
606
+
543
607
  interface KeyPairSyncResult<T1 extends string | Buffer, T2 extends string | Buffer> {
544
608
  publicKey: T1;
545
609
  privateKey: T2;
@@ -563,6 +627,30 @@ declare module "crypto" {
563
627
  function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
564
628
  function generateKeyPairSync(type: 'ec', options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
565
629
 
630
+ function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
631
+ function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
632
+ function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
633
+ function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
634
+ function generateKeyPairSync(type: 'ed25519', options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
635
+
636
+ function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
637
+ function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
638
+ function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
639
+ function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
640
+ function generateKeyPairSync(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
641
+
642
+ function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
643
+ function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
644
+ function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
645
+ function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
646
+ function generateKeyPairSync(type: 'x25519', options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
647
+
648
+ function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
649
+ function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
650
+ function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
651
+ function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
652
+ function generateKeyPairSync(type: 'x448', options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
653
+
566
654
  function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
567
655
  function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
568
656
  function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
@@ -581,6 +669,30 @@ declare module "crypto" {
581
669
  function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
582
670
  function generateKeyPair(type: 'ec', options: ECKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
583
671
 
672
+ function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
673
+ function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
674
+ function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
675
+ function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
676
+ function generateKeyPair(type: 'ed25519', options: ED25519KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
677
+
678
+ function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
679
+ function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
680
+ function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
681
+ function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
682
+ function generateKeyPair(type: 'ed448', options: ED448KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
683
+
684
+ function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
685
+ function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
686
+ function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
687
+ function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
688
+ function generateKeyPair(type: 'x25519', options: X25519KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
689
+
690
+ function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
691
+ function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
692
+ function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
693
+ function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
694
+ function generateKeyPair(type: 'x448', options: X448KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
695
+
584
696
  namespace generateKeyPair {
585
697
  function __promisify__(type: "rsa", options: RSAKeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
586
698
  function __promisify__(type: "rsa", options: RSAKeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
@@ -599,6 +711,30 @@ declare module "crypto" {
599
711
  function __promisify__(type: "ec", options: ECKeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
600
712
  function __promisify__(type: "ec", options: ECKeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
601
713
  function __promisify__(type: "ec", options: ECKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
714
+
715
+ function __promisify__(type: "ed25519", options: ED25519KeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
716
+ function __promisify__(type: "ed25519", options: ED25519KeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
717
+ function __promisify__(type: "ed25519", options: ED25519KeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
718
+ function __promisify__(type: "ed25519", options: ED25519KeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
719
+ function __promisify__(type: "ed25519", options?: ED25519KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
720
+
721
+ function __promisify__(type: "ed448", options: ED448KeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
722
+ function __promisify__(type: "ed448", options: ED448KeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
723
+ function __promisify__(type: "ed448", options: ED448KeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
724
+ function __promisify__(type: "ed448", options: ED448KeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
725
+ function __promisify__(type: "ed448", options?: ED448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
726
+
727
+ function __promisify__(type: "x25519", options: X25519KeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
728
+ function __promisify__(type: "x25519", options: X25519KeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
729
+ function __promisify__(type: "x25519", options: X25519KeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
730
+ function __promisify__(type: "x25519", options: X25519KeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
731
+ function __promisify__(type: "x25519", options?: X25519KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
732
+
733
+ function __promisify__(type: "x448", options: X448KeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
734
+ function __promisify__(type: "x448", options: X448KeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
735
+ function __promisify__(type: "x448", options: X448KeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
736
+ function __promisify__(type: "x448", options: X448KeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
737
+ function __promisify__(type: "x448", options?: X448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
602
738
  }
603
739
 
604
740
  /**
@@ -1187,6 +1187,10 @@ declare namespace NodeJS {
1187
1187
  constructor(id: string, parent?: Module);
1188
1188
  }
1189
1189
 
1190
+ interface Dict<T> {
1191
+ [key: string]: T | undefined;
1192
+ }
1193
+
1190
1194
  type TypedArray = Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array;
1191
1195
  type ArrayBufferView = TypedArray | DataView;
1192
1196
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "12.12.63",
3
+ "version": "12.12.67",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -231,6 +231,6 @@
231
231
  },
232
232
  "scripts": {},
233
233
  "dependencies": {},
234
- "typesPublisherContentHash": "b806d4fda001e87467e8d89e5eaa9dab6907c8cf42dd701a56cea5e451274f6e",
234
+ "typesPublisherContentHash": "4c35ac73820460e6527d557019e42281a864eadfa089f4d6a9dc006801b48001",
235
235
  "typeScriptVersion": "3.2"
236
236
  }
@@ -1,12 +1,68 @@
1
1
  declare module "punycode" {
2
+ /**
3
+ * @deprecated since v7.0.0
4
+ * The version of the punycode module bundled in Node.js is being deprecated.
5
+ * In a future major version of Node.js this module will be removed.
6
+ * Users currently depending on the punycode module should switch to using
7
+ * the userland-provided Punycode.js module instead.
8
+ */
2
9
  function decode(string: string): string;
10
+ /**
11
+ * @deprecated since v7.0.0
12
+ * The version of the punycode module bundled in Node.js is being deprecated.
13
+ * In a future major version of Node.js this module will be removed.
14
+ * Users currently depending on the punycode module should switch to using
15
+ * the userland-provided Punycode.js module instead.
16
+ */
3
17
  function encode(string: string): string;
18
+ /**
19
+ * @deprecated since v7.0.0
20
+ * The version of the punycode module bundled in Node.js is being deprecated.
21
+ * In a future major version of Node.js this module will be removed.
22
+ * Users currently depending on the punycode module should switch to using
23
+ * the userland-provided Punycode.js module instead.
24
+ */
4
25
  function toUnicode(domain: string): string;
26
+ /**
27
+ * @deprecated since v7.0.0
28
+ * The version of the punycode module bundled in Node.js is being deprecated.
29
+ * In a future major version of Node.js this module will be removed.
30
+ * Users currently depending on the punycode module should switch to using
31
+ * the userland-provided Punycode.js module instead.
32
+ */
5
33
  function toASCII(domain: string): string;
34
+ /**
35
+ * @deprecated since v7.0.0
36
+ * The version of the punycode module bundled in Node.js is being deprecated.
37
+ * In a future major version of Node.js this module will be removed.
38
+ * Users currently depending on the punycode module should switch to using
39
+ * the userland-provided Punycode.js module instead.
40
+ */
6
41
  const ucs2: ucs2;
7
42
  interface ucs2 {
43
+ /**
44
+ * @deprecated since v7.0.0
45
+ * The version of the punycode module bundled in Node.js is being deprecated.
46
+ * In a future major version of Node.js this module will be removed.
47
+ * Users currently depending on the punycode module should switch to using
48
+ * the userland-provided Punycode.js module instead.
49
+ */
8
50
  decode(string: string): number[];
51
+ /**
52
+ * @deprecated since v7.0.0
53
+ * The version of the punycode module bundled in Node.js is being deprecated.
54
+ * In a future major version of Node.js this module will be removed.
55
+ * Users currently depending on the punycode module should switch to using
56
+ * the userland-provided Punycode.js module instead.
57
+ */
9
58
  encode(codePoints: number[]): string;
10
59
  }
60
+ /**
61
+ * @deprecated since v7.0.0
62
+ * The version of the punycode module bundled in Node.js is being deprecated.
63
+ * In a future major version of Node.js this module will be removed.
64
+ * Users currently depending on the punycode module should switch to using
65
+ * the userland-provided Punycode.js module instead.
66
+ */
11
67
  const version: string;
12
68
  }
@@ -18,3 +18,4 @@
18
18
 
19
19
  // TypeScript 3.5-specific augmentations:
20
20
  /// <reference path="../globals.global.d.ts" />
21
+ /// <reference path="../wasi.d.ts" />
@@ -0,0 +1,55 @@
1
+ declare module 'wasi' {
2
+ interface WASIOptions {
3
+ /**
4
+ * An array of strings that the WebAssembly application will
5
+ * see as command line arguments. The first argument is the virtual path to the
6
+ * WASI command itself.
7
+ */
8
+ args?: string[];
9
+
10
+ /**
11
+ * An object similar to `process.env` that the WebAssembly
12
+ * application will see as its environment.
13
+ */
14
+ env?: object;
15
+
16
+ /**
17
+ * This object represents the WebAssembly application's
18
+ * sandbox directory structure. The string keys of `preopens` are treated as
19
+ * directories within the sandbox. The corresponding values in `preopens` are
20
+ * the real paths to those directories on the host machine.
21
+ */
22
+ preopens?: NodeJS.Dict<string>;
23
+
24
+ /**
25
+ * By default, WASI applications terminate the Node.js
26
+ * process via the `__wasi_proc_exit()` function. Setting this option to `true`
27
+ * causes `wasi.start()` to return the exit code rather than terminate the
28
+ * process.
29
+ * @default false
30
+ */
31
+ returnOnExit?: boolean;
32
+ }
33
+
34
+ class WASI {
35
+ constructor(options?: WASIOptions);
36
+ /**
37
+ *
38
+ * Attempt to begin execution of `instance` by invoking its `_start()` export.
39
+ * If `instance` does not contain a `_start()` export, then `start()` attempts to
40
+ * invoke the `__wasi_unstable_reactor_start()` export. If neither of those exports
41
+ * is present on `instance`, then `start()` does nothing.
42
+ *
43
+ * `start()` requires that `instance` exports a [`WebAssembly.Memory`][] named
44
+ * `memory`. If `instance` does not have a `memory` export an exception is thrown.
45
+ */
46
+ start(instance: object): void; // TODO: avoid DOM dependency until WASM moved to own lib.
47
+
48
+ /**
49
+ * Is an object that implements the WASI system call API. This object
50
+ * should be passed as the `wasi_snapshot_preview1` import during the instantiation of a
51
+ * [`WebAssembly.Instance`][].
52
+ */
53
+ readonly wasiImport: NodeJS.Dict<any>; // TODO: Narrow to DOM types
54
+ }
55
+ }
@@ -5,6 +5,7 @@ declare module "worker_threads" {
5
5
 
6
6
  const isMainThread: boolean;
7
7
  const parentPort: null | MessagePort;
8
+ const resourceLimits: ResourceLimits;
8
9
  const SHARE_ENV: unique symbol;
9
10
  const threadId: number;
10
11
  const workerData: any;
@@ -14,9 +15,11 @@ declare module "worker_threads" {
14
15
  readonly port2: MessagePort;
15
16
  }
16
17
 
18
+ type TransferListItem = ArrayBuffer | MessagePort;
19
+
17
20
  class MessagePort extends EventEmitter {
18
21
  close(): void;
19
- postMessage(value: any, transferList?: Array<ArrayBuffer | MessagePort>): void;
22
+ postMessage(value: any, transferList?: TransferListItem[]): void;
20
23
  ref(): void;
21
24
  unref(): void;
22
25
  start(): void;
@@ -62,6 +65,26 @@ declare module "worker_threads" {
62
65
  stdout?: boolean;
63
66
  stderr?: boolean;
64
67
  execArgv?: string[];
68
+ resourceLimits?: ResourceLimits;
69
+ /**
70
+ * Additional data to send in the first worker message.
71
+ */
72
+ transferList?: TransferListItem[];
73
+ }
74
+
75
+ interface ResourceLimits {
76
+ /**
77
+ * The maximum size of a heap space for recently created objects.
78
+ */
79
+ maxYoungGenerationSizeMb?: number;
80
+ /**
81
+ * The maximum size of the main heap in MB.
82
+ */
83
+ maxOldGenerationSizeMb?: number;
84
+ /**
85
+ * The size of a pre-allocated memory range used for generated code.
86
+ */
87
+ codeRangeSizeMb?: number;
65
88
  }
66
89
 
67
90
  class Worker extends EventEmitter {
@@ -72,7 +95,7 @@ declare module "worker_threads" {
72
95
 
73
96
  constructor(filename: string, options?: WorkerOptions);
74
97
 
75
- postMessage(value: any, transferList?: Array<ArrayBuffer | MessagePort>): void;
98
+ postMessage(value: any, transferList?: TransferListItem[]): void;
76
99
  ref(): void;
77
100
  unref(): void;
78
101
  /**
node v12.12/zlib.d.ts CHANGED
@@ -19,6 +19,7 @@ declare module "zlib" {
19
19
  memLevel?: number; // compression only
20
20
  strategy?: number; // compression only
21
21
  dictionary?: NodeJS.ArrayBufferView | ArrayBuffer; // deflate/inflate only, empty dictionary by default
22
+ info?: boolean;
22
23
  }
23
24
 
24
25
  interface BrotliOptions {
@@ -111,6 +112,43 @@ declare module "zlib" {
111
112
  function unzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
112
113
  function unzipSync(buf: InputType, options?: ZlibOptions): Buffer;
113
114
 
115
+ namespace brotliCompress {
116
+ function __promisify__(buffer: InputType, options: BrotliOptions): Promise<Buffer>;
117
+ function __promisify__(buffer: InputType): Promise<Buffer>;
118
+ }
119
+ namespace brotliDecompress {
120
+ function __promisify__(buffer: InputType, options: BrotliOptions): Promise<Buffer>;
121
+ function __promisify__(buffer: InputType): Promise<Buffer>;
122
+ }
123
+ namespace deflate {
124
+ function __promisify__(buffer: InputType): Promise<Buffer>;
125
+ function __promisify__(buffer: InputType, options: ZlibOptions): Promise<Buffer>;
126
+ }
127
+ namespace deflateRaw {
128
+ function __promisify__(buffer: InputType): Promise<Buffer>;
129
+ function __promisify__(buffer: InputType, options: ZlibOptions): Promise<Buffer>;
130
+ }
131
+ namespace gzip {
132
+ function __promisify__(buffer: InputType): Promise<Buffer>;
133
+ function __promisify__(buffer: InputType, options: ZlibOptions): Promise<Buffer>;
134
+ }
135
+ namespace gunzip {
136
+ function __promisify__(buffer: InputType): Promise<Buffer>;
137
+ function __promisify__(buffer: InputType, options: ZlibOptions): Promise<Buffer>;
138
+ }
139
+ namespace inflate {
140
+ function __promisify__(buffer: InputType): Promise<Buffer>;
141
+ function __promisify__(buffer: InputType, options: ZlibOptions): Promise<Buffer>;
142
+ }
143
+ namespace inflateRaw {
144
+ function __promisify__(buffer: InputType): Promise<Buffer>;
145
+ function __promisify__(buffer: InputType, options: ZlibOptions): Promise<Buffer>;
146
+ }
147
+ namespace unzip {
148
+ function __promisify__(buffer: InputType): Promise<Buffer>;
149
+ function __promisify__(buffer: InputType, options: ZlibOptions): Promise<Buffer>;
150
+ }
151
+
114
152
  namespace constants {
115
153
  const BROTLI_DECODE: number;
116
154
  const BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: number;