@types/node 15.6.2 → 15.9.0

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 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.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Wed, 02 Jun 2021 07:31:33 GMT
11
+ * Last updated: Wed, 02 Jun 2021 22:31:36 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `AbortController`, `AbortSignal`, `Buffer`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout`
14
14
 
node/buffer.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  declare module 'buffer' {
2
+ import { BinaryLike } from 'crypto';
3
+
2
4
  export const INSPECT_MAX_BYTES: number;
3
5
  export const kMaxLength: number;
4
6
  export const kStringMaxLength: number;
@@ -19,4 +21,64 @@ declare module 'buffer' {
19
21
  };
20
22
 
21
23
  export { BuffType as Buffer };
24
+
25
+ /**
26
+ * @experimental
27
+ */
28
+ export interface BlobOptions {
29
+ /**
30
+ * @default 'utf8'
31
+ */
32
+ encoding?: BufferEncoding;
33
+
34
+ /**
35
+ * The Blob content-type. The intent is for `type` to convey
36
+ * the MIME media type of the data, however no validation of the type format
37
+ * is performed.
38
+ */
39
+ type?: string;
40
+ }
41
+
42
+ /**
43
+ * @experimental
44
+ */
45
+ export class Blob {
46
+ /**
47
+ * Returns a promise that fulfills with an {ArrayBuffer} containing a copy of the `Blob` data.
48
+ */
49
+ readonly size: number;
50
+
51
+ /**
52
+ * The content-type of the `Blob`.
53
+ */
54
+ readonly type: string;
55
+
56
+ /**
57
+ * Creates a new `Blob` object containing a concatenation of the given sources.
58
+ *
59
+ * {ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into
60
+ * the 'Blob' and can therefore be safely modified after the 'Blob' is created.
61
+ *
62
+ * String sources are also copied into the `Blob`.
63
+ */
64
+ constructor(sources: Array<(BinaryLike | Blob)>, options?: BlobOptions);
65
+
66
+ arrayBuffer(): Promise<ArrayBuffer>;
67
+
68
+ /**
69
+ * @param start The starting index.
70
+ * @param end The ending index.
71
+ * @param type The content-type for the new `Blob`
72
+ */
73
+ slice(start?: number, end?: number, type?: string): Blob;
74
+
75
+ /**
76
+ * Returns a promise that resolves the contents of the `Blob` decoded as a UTF-8 string.
77
+ */
78
+ text(): Promise<string>;
79
+ }
80
+ }
81
+
82
+ declare module 'node:buffer' {
83
+ export * from 'buffer';
22
84
  }
node/crypto.d.ts CHANGED
@@ -1163,8 +1163,8 @@ declare module 'crypto' {
1163
1163
  * algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is
1164
1164
  * dependent upon the key type (especially Ed25519 and Ed448).
1165
1165
  *
1166
- * If `key` is not a [`KeyObject`][], this function behaves as if `key` had been
1167
- * passed to [`crypto.createPrivateKey()`][].
1166
+ * If `key` is not a `KeyObject`, this function behaves as if `key` had been
1167
+ * passed to `crypto.createPrivateKey().
1168
1168
  */
1169
1169
  function sign(
1170
1170
  algorithm: string | null | undefined,
@@ -1177,8 +1177,8 @@ declare module 'crypto' {
1177
1177
  * algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is
1178
1178
  * dependent upon the key type (especially Ed25519 and Ed448).
1179
1179
  *
1180
- * If `key` is not a [`KeyObject`][], this function behaves as if `key` had been
1181
- * passed to [`crypto.createPublicKey()`][].
1180
+ * If `key` is not a `KeyObject`, this function behaves as if `key` had been
1181
+ * passed to `crypto.createPublicKey()`.
1182
1182
  */
1183
1183
  function verify(
1184
1184
  algorithm: string | null | undefined,
@@ -1254,7 +1254,7 @@ declare module 'crypto' {
1254
1254
  *
1255
1255
  * The supplied `callback` function is called with two arguments: `err` and `derivedKey`.
1256
1256
  * If an errors occurs while deriving the key, `err` will be set; otherwise `err` will be `null`.
1257
- * The successfully generated `derivedKey` will be passed to the callback as an [`ArrayBuffer`][].
1257
+ * The successfully generated `derivedKey` will be passed to the callback as an `ArrayBuffer`.
1258
1258
  * An error will be thrown if any of the input aguments specify invalid values or types.
1259
1259
  */
1260
1260
  function hkdf(digest: string, key: BinaryLike | KeyObject, salt: BinaryLike, info: BinaryLike, keylen: number, callback: (err: Error | null, derivedKey: ArrayBuffer) => any): void;
@@ -1263,7 +1263,7 @@ declare module 'crypto' {
1263
1263
  * Provides a synchronous HKDF key derivation function as defined in RFC 5869.
1264
1264
  * The given `key`, `salt` and `info` are used with the `digest` to derive a key of `keylen` bytes.
1265
1265
  *
1266
- * The successfully generated `derivedKey` will be returned as an [`ArrayBuffer`][].
1266
+ * The successfully generated `derivedKey` will be returned as an `ArrayBuffer`.
1267
1267
  * An error will be thrown if any of the input aguments specify invalid values or types,
1268
1268
  * or if the derived key cannot be generated.
1269
1269
  */
@@ -1372,6 +1372,16 @@ declare module 'crypto' {
1372
1372
  */
1373
1373
  readonly keyUsage: string[];
1374
1374
 
1375
+ /**
1376
+ * The issuer identification included in this certificate.
1377
+ */
1378
+ readonly issuer: string;
1379
+
1380
+ /**
1381
+ * The issuer certificate or `undefined` if the issuer certificate is not available.
1382
+ */
1383
+ readonly issuerCertificate?: X509Certificate;
1384
+
1375
1385
  /**
1376
1386
  * The public key for this certificate.
1377
1387
  */
@@ -1438,7 +1448,7 @@ declare module 'crypto' {
1438
1448
  toJSON(): string;
1439
1449
 
1440
1450
  /**
1441
- * Returns information about this certificate using the legacy [certificate object][] encoding.
1451
+ * Returns information about this certificate using the legacy certificate object encoding.
1442
1452
  */
1443
1453
  toLegacyObject(): PeerCertificate;
1444
1454
 
@@ -1453,4 +1463,57 @@ declare module 'crypto' {
1453
1463
  */
1454
1464
  verify(publicKey: KeyObject): boolean;
1455
1465
  }
1466
+
1467
+ type LargeNumberLike = NodeJS.ArrayBufferView | SharedArrayBuffer | ArrayBuffer | bigint;
1468
+
1469
+ interface GeneratePrimeOptions {
1470
+ add?: LargeNumberLike;
1471
+ rem?: LargeNumberLike;
1472
+ /**
1473
+ * @default false
1474
+ */
1475
+ safe?: boolean;
1476
+ bigint?: boolean;
1477
+ }
1478
+
1479
+ interface GeneratePrimeOptionsBigInt extends GeneratePrimeOptions {
1480
+ bigint: true;
1481
+ }
1482
+
1483
+ interface GeneratePrimeOptionsArrayBuffer extends GeneratePrimeOptions {
1484
+ bigint?: false;
1485
+ }
1486
+
1487
+ function generatePrime(size: number, callback: (err: Error | null, prime: ArrayBuffer) => void): void;
1488
+ function generatePrime(size: number, options: GeneratePrimeOptionsBigInt, callback: (err: Error | null, prime: bigint) => void): void;
1489
+ function generatePrime(size: number, options: GeneratePrimeOptionsArrayBuffer, callback: (err: Error | null, prime: ArrayBuffer) => void): void;
1490
+ function generatePrime(size: number, options: GeneratePrimeOptions, callback: (err: Error | null, prime: ArrayBuffer | bigint) => void): void;
1491
+
1492
+ function generatePrimeSync(size: number): ArrayBuffer;
1493
+ function generatePrimeSync(size: number, options: GeneratePrimeOptionsBigInt): bigint;
1494
+ function generatePrimeSync(size: number, options: GeneratePrimeOptionsArrayBuffer): ArrayBuffer;
1495
+ function generatePrimeSync(size: number, options: GeneratePrimeOptions): ArrayBuffer | bigint;
1496
+
1497
+ interface CheckPrimeOptions {
1498
+ /**
1499
+ * The number of Miller-Rabin probabilistic primality iterations to perform.
1500
+ * When the value is 0 (zero), a number of checks is used that yields a false positive rate of at most 2-64 for random input.
1501
+ * Care must be used when selecting a number of checks.
1502
+ * Refer to the OpenSSL documentation for the BN_is_prime_ex function nchecks options for more details.
1503
+ *
1504
+ * @default 0
1505
+ */
1506
+ checks?: number;
1507
+ }
1508
+
1509
+ /**
1510
+ * Checks the primality of the candidate.
1511
+ */
1512
+ function checkPrime(value: LargeNumberLike, callback: (err: Error | null, result: boolean) => void): void;
1513
+ function checkPrime(value: LargeNumberLike, options: CheckPrimeOptions, callback: (err: Error | null, result: boolean) => void): void;
1514
+
1515
+ /**
1516
+ * Checks the primality of the candidate.
1517
+ */
1518
+ function checkPrimeSync(value: LargeNumberLike, options?: CheckPrimeOptions): boolean;
1456
1519
  }
node/dgram.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  declare module 'dgram' {
2
2
  import { AddressInfo } from 'net';
3
3
  import * as dns from 'dns';
4
- import EventEmitter = require('events');
4
+ import { EventEmitter, Abortable } from 'events';
5
5
 
6
6
  interface RemoteInfo {
7
7
  address: string;
@@ -19,7 +19,7 @@ declare module 'dgram' {
19
19
 
20
20
  type SocketType = "udp4" | "udp6";
21
21
 
22
- interface SocketOptions {
22
+ interface SocketOptions extends Abortable {
23
23
  type: SocketType;
24
24
  reuseAddr?: boolean;
25
25
  /**
node/fs/promises.d.ts CHANGED
@@ -17,6 +17,7 @@ declare module 'fs/promises' {
17
17
  BufferEncodingOption,
18
18
  OpenMode,
19
19
  Mode,
20
+ WatchOptions,
20
21
  } from 'fs';
21
22
 
22
23
  interface FileHandle {
@@ -555,4 +556,37 @@ declare module 'fs/promises' {
555
556
  function readFile(path: PathLike | FileHandle, options?: BaseEncodingOptions & Abortable & { flag?: OpenMode } | BufferEncoding | null): Promise<string | Buffer>;
556
557
 
557
558
  function opendir(path: string, options?: OpenDirOptions): Promise<Dir>;
559
+
560
+ /**
561
+ * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
562
+ * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
563
+ * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
564
+ * If `encoding` is not supplied, the default of `'utf8'` is used.
565
+ * If `persistent` is not supplied, the default of `true` is used.
566
+ * If `recursive` is not supplied, the default of `false` is used.
567
+ */
568
+ function watch(filename: PathLike, options: WatchOptions & { encoding: "buffer" } | "buffer"): AsyncIterable<Buffer>;
569
+
570
+ /**
571
+ * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
572
+ * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
573
+ * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
574
+ * If `encoding` is not supplied, the default of `'utf8'` is used.
575
+ * If `persistent` is not supplied, the default of `true` is used.
576
+ * If `recursive` is not supplied, the default of `false` is used.
577
+ */
578
+ function watch(
579
+ filename: PathLike,
580
+ options?: WatchOptions | BufferEncoding
581
+ ): AsyncIterable<string>;
582
+
583
+ /**
584
+ * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
585
+ * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
586
+ * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
587
+ * If `encoding` is not supplied, the default of `'utf8'` is used.
588
+ * If `persistent` is not supplied, the default of `true` is used.
589
+ * If `recursive` is not supplied, the default of `false` is used.
590
+ */
591
+ function watch(filename: PathLike, options: WatchOptions | string): AsyncIterable<string> | AsyncIterable<Buffer>;
558
592
  }
node/fs.d.ts CHANGED
@@ -276,9 +276,7 @@ declare module 'fs' {
276
276
  /**
277
277
  * Asynchronous rename(2) - Change the name or location of a file or directory.
278
278
  * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol.
279
- * URL support is _experimental_.
280
279
  * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol.
281
- * URL support is _experimental_.
282
280
  */
283
281
  export function rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback): void;
284
282
 
@@ -297,9 +295,7 @@ declare module 'fs' {
297
295
  /**
298
296
  * Synchronous rename(2) - Change the name or location of a file or directory.
299
297
  * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol.
300
- * URL support is _experimental_.
301
298
  * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol.
302
- * URL support is _experimental_.
303
299
  */
304
300
  export function renameSync(oldPath: PathLike, newPath: PathLike): void;
305
301
 
@@ -313,7 +309,6 @@ declare module 'fs' {
313
309
  /**
314
310
  * Asynchronous truncate(2) - Truncate a file to a specified length.
315
311
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
316
- * URL support is _experimental_.
317
312
  */
318
313
  export function truncate(path: PathLike, callback: NoParamCallback): void;
319
314
 
@@ -1242,7 +1237,7 @@ declare module 'fs' {
1242
1237
  * Asynchronous close(2) - close a file descriptor.
1243
1238
  * @param fd A file descriptor.
1244
1239
  */
1245
- export function close(fd: number, callback: NoParamCallback): void;
1240
+ export function close(fd: number, callback?: NoParamCallback): void;
1246
1241
 
1247
1242
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
1248
1243
  export namespace close {
@@ -1487,6 +1482,8 @@ declare module 'fs' {
1487
1482
  */
1488
1483
  export function writeSync(fd: number, string: string, position?: number | null, encoding?: BufferEncoding | null): number;
1489
1484
 
1485
+ export type ReadPosition = number | bigint;
1486
+
1490
1487
  /**
1491
1488
  * Asynchronously reads data from the file referenced by the supplied file descriptor.
1492
1489
  * @param fd A file descriptor.
@@ -1500,7 +1497,7 @@ declare module 'fs' {
1500
1497
  buffer: TBuffer,
1501
1498
  offset: number,
1502
1499
  length: number,
1503
- position: number | null,
1500
+ position: ReadPosition | null,
1504
1501
  callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void,
1505
1502
  ): void;
1506
1503
 
@@ -1534,7 +1531,7 @@ declare module 'fs' {
1534
1531
  /**
1535
1532
  * @default null
1536
1533
  */
1537
- position?: number | null;
1534
+ position?: ReadPosition | null;
1538
1535
  }
1539
1536
 
1540
1537
  /**
@@ -1545,7 +1542,7 @@ declare module 'fs' {
1545
1542
  * @param length The number of bytes to read.
1546
1543
  * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position.
1547
1544
  */
1548
- export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, offset: number, length: number, position: number | null): number;
1545
+ export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, offset: number, length: number, position: ReadPosition | null): number;
1549
1546
 
1550
1547
  /**
1551
1548
  * Similar to the above `fs.readSync` function, this version takes an optional `options` object.
@@ -1569,7 +1566,6 @@ declare module 'fs' {
1569
1566
  /**
1570
1567
  * Asynchronously reads the entire contents of a file.
1571
1568
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1572
- * URL support is _experimental_.
1573
1569
  * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
1574
1570
  * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
1575
1571
  * If a flag is not provided, it defaults to `'r'`.
@@ -1583,7 +1579,6 @@ declare module 'fs' {
1583
1579
  /**
1584
1580
  * Asynchronously reads the entire contents of a file.
1585
1581
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1586
- * URL support is _experimental_.
1587
1582
  * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
1588
1583
  * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
1589
1584
  * If a flag is not provided, it defaults to `'r'`.
@@ -1637,7 +1632,6 @@ declare module 'fs' {
1637
1632
  /**
1638
1633
  * Synchronously reads the entire contents of a file.
1639
1634
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1640
- * URL support is _experimental_.
1641
1635
  * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
1642
1636
  * @param options An object that may contain an optional flag. If a flag is not provided, it defaults to `'r'`.
1643
1637
  */
@@ -1646,7 +1640,6 @@ declare module 'fs' {
1646
1640
  /**
1647
1641
  * Synchronously reads the entire contents of a file.
1648
1642
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1649
- * URL support is _experimental_.
1650
1643
  * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
1651
1644
  * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
1652
1645
  * If a flag is not provided, it defaults to `'r'`.
@@ -1656,7 +1649,6 @@ declare module 'fs' {
1656
1649
  /**
1657
1650
  * Synchronously reads the entire contents of a file.
1658
1651
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1659
- * URL support is _experimental_.
1660
1652
  * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
1661
1653
  * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
1662
1654
  * If a flag is not provided, it defaults to `'r'`.
@@ -1668,7 +1660,6 @@ declare module 'fs' {
1668
1660
  /**
1669
1661
  * Asynchronously writes data to a file, replacing the file if it already exists.
1670
1662
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1671
- * URL support is _experimental_.
1672
1663
  * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
1673
1664
  * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
1674
1665
  * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag.
@@ -1682,7 +1673,6 @@ declare module 'fs' {
1682
1673
  /**
1683
1674
  * Asynchronously writes data to a file, replacing the file if it already exists.
1684
1675
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1685
- * URL support is _experimental_.
1686
1676
  * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
1687
1677
  * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
1688
1678
  */
@@ -1708,7 +1698,6 @@ declare module 'fs' {
1708
1698
  /**
1709
1699
  * Synchronously writes data to a file, replacing the file if it already exists.
1710
1700
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1711
- * URL support is _experimental_.
1712
1701
  * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
1713
1702
  * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
1714
1703
  * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag.
@@ -1722,7 +1711,6 @@ declare module 'fs' {
1722
1711
  /**
1723
1712
  * Asynchronously append data to a file, creating the file if it does not exist.
1724
1713
  * @param file A path to a file. If a URL is provided, it must use the `file:` protocol.
1725
- * URL support is _experimental_.
1726
1714
  * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
1727
1715
  * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
1728
1716
  * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag.
@@ -1736,7 +1724,6 @@ declare module 'fs' {
1736
1724
  /**
1737
1725
  * Asynchronously append data to a file, creating the file if it does not exist.
1738
1726
  * @param file A path to a file. If a URL is provided, it must use the `file:` protocol.
1739
- * URL support is _experimental_.
1740
1727
  * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
1741
1728
  * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
1742
1729
  */
@@ -1762,7 +1749,6 @@ declare module 'fs' {
1762
1749
  /**
1763
1750
  * Synchronously append data to a file, creating the file if it does not exist.
1764
1751
  * @param file A path to a file. If a URL is provided, it must use the `file:` protocol.
1765
- * URL support is _experimental_.
1766
1752
  * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
1767
1753
  * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
1768
1754
  * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag.
@@ -1781,36 +1767,36 @@ declare module 'fs' {
1781
1767
  /**
1782
1768
  * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed.
1783
1769
  * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
1784
- * URL support is _experimental_.
1785
1770
  */
1786
1771
  export function watchFile(filename: PathLike, listener: (curr: Stats, prev: Stats) => void): void;
1787
1772
 
1788
1773
  /**
1789
1774
  * Stop watching for changes on `filename`.
1790
1775
  * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
1791
- * URL support is _experimental_.
1792
1776
  */
1793
1777
  export function unwatchFile(filename: PathLike, listener?: (curr: Stats, prev: Stats) => void): void;
1794
1778
 
1779
+ export interface WatchOptions extends Abortable {
1780
+ encoding?: BufferEncoding | "buffer";
1781
+ persistent?: boolean;
1782
+ recursive?: boolean;
1783
+ }
1784
+
1785
+ export type WatchListener<T> = (event: "rename" | "change", filename: T) => void;
1786
+
1795
1787
  /**
1796
1788
  * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
1797
1789
  * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
1798
- * URL support is _experimental_.
1799
1790
  * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
1800
1791
  * If `encoding` is not supplied, the default of `'utf8'` is used.
1801
1792
  * If `persistent` is not supplied, the default of `true` is used.
1802
1793
  * If `recursive` is not supplied, the default of `false` is used.
1803
1794
  */
1804
- export function watch(
1805
- filename: PathLike,
1806
- options: { encoding?: BufferEncoding | null, persistent?: boolean, recursive?: boolean } | BufferEncoding | undefined | null,
1807
- listener?: (event: "rename" | "change", filename: string) => void,
1808
- ): FSWatcher;
1795
+ export function watch(filename: PathLike, options: WatchOptions & { encoding: "buffer" } | "buffer", listener?: WatchListener<Buffer>): FSWatcher;
1809
1796
 
1810
1797
  /**
1811
1798
  * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
1812
1799
  * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
1813
- * URL support is _experimental_.
1814
1800
  * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
1815
1801
  * If `encoding` is not supplied, the default of `'utf8'` is used.
1816
1802
  * If `persistent` is not supplied, the default of `true` is used.
@@ -1818,37 +1804,30 @@ declare module 'fs' {
1818
1804
  */
1819
1805
  export function watch(
1820
1806
  filename: PathLike,
1821
- options: { encoding: "buffer", persistent?: boolean, recursive?: boolean; } | "buffer",
1822
- listener?: (event: "rename" | "change", filename: Buffer) => void
1807
+ options?: WatchOptions | BufferEncoding | null,
1808
+ listener?: WatchListener<string>,
1823
1809
  ): FSWatcher;
1824
1810
 
1825
1811
  /**
1826
1812
  * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
1827
1813
  * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
1828
- * URL support is _experimental_.
1829
1814
  * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
1830
1815
  * If `encoding` is not supplied, the default of `'utf8'` is used.
1831
1816
  * If `persistent` is not supplied, the default of `true` is used.
1832
1817
  * If `recursive` is not supplied, the default of `false` is used.
1833
1818
  */
1834
- export function watch(
1835
- filename: PathLike,
1836
- options: { encoding?: BufferEncoding | null, persistent?: boolean, recursive?: boolean } | string | null,
1837
- listener?: (event: "rename" | "change", filename: string | Buffer) => void,
1838
- ): FSWatcher;
1819
+ export function watch(filename: PathLike, options: WatchOptions | string, listener?: WatchListener<string | Buffer>): FSWatcher;
1839
1820
 
1840
1821
  /**
1841
1822
  * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
1842
1823
  * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
1843
- * URL support is _experimental_.
1844
1824
  */
1845
- export function watch(filename: PathLike, listener?: (event: "rename" | "change", filename: string) => any): FSWatcher;
1825
+ export function watch(filename: PathLike, listener?: WatchListener<string>): FSWatcher;
1846
1826
 
1847
1827
  /**
1848
1828
  * Asynchronously tests whether or not the given path exists by checking with the file system.
1849
1829
  * @deprecated since v1.0.0 Use `fs.stat()` or `fs.access()` instead
1850
1830
  * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
1851
- * URL support is _experimental_.
1852
1831
  */
1853
1832
  export function exists(path: PathLike, callback: (exists: boolean) => void): void;
1854
1833
 
@@ -1864,7 +1843,6 @@ declare module 'fs' {
1864
1843
  /**
1865
1844
  * Synchronously tests whether or not the given path exists by checking with the file system.
1866
1845
  * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
1867
- * URL support is _experimental_.
1868
1846
  */
1869
1847
  export function existsSync(path: PathLike): boolean;
1870
1848
 
@@ -2034,14 +2012,12 @@ declare module 'fs' {
2034
2012
  /**
2035
2013
  * Asynchronously tests a user's permissions for the file specified by path.
2036
2014
  * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
2037
- * URL support is _experimental_.
2038
2015
  */
2039
2016
  export function access(path: PathLike, mode: number | undefined, callback: NoParamCallback): void;
2040
2017
 
2041
2018
  /**
2042
2019
  * Asynchronously tests a user's permissions for the file specified by path.
2043
2020
  * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
2044
- * URL support is _experimental_.
2045
2021
  */
2046
2022
  export function access(path: PathLike, callback: NoParamCallback): void;
2047
2023
 
@@ -2058,7 +2034,6 @@ declare module 'fs' {
2058
2034
  /**
2059
2035
  * Synchronously tests a user's permissions for the file specified by path.
2060
2036
  * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
2061
- * URL support is _experimental_.
2062
2037
  */
2063
2038
  export function accessSync(path: PathLike, mode?: number): void;
2064
2039
 
@@ -2083,14 +2058,12 @@ declare module 'fs' {
2083
2058
  /**
2084
2059
  * Returns a new `ReadStream` object.
2085
2060
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2086
- * URL support is _experimental_.
2087
2061
  */
2088
2062
  export function createReadStream(path: PathLike, options?: string | ReadStreamOptions): ReadStream;
2089
2063
 
2090
2064
  /**
2091
2065
  * Returns a new `WriteStream` object.
2092
2066
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2093
- * URL support is _experimental_.
2094
2067
  */
2095
2068
  export function createWriteStream(path: PathLike, options?: string | StreamOptions): WriteStream;
2096
2069
 
node/http.d.ts CHANGED
@@ -107,7 +107,7 @@ declare module 'http' {
107
107
  ServerResponse?: typeof ServerResponse;
108
108
  /**
109
109
  * Optionally overrides the value of
110
- * [`--max-http-header-size`][] for requests received by this server, i.e.
110
+ * `--max-http-header-size` for requests received by this server, i.e.
111
111
  * the maximum length of request headers in bytes.
112
112
  * @default 8192
113
113
  */
@@ -156,7 +156,8 @@ declare module 'http' {
156
156
 
157
157
  // https://github.com/nodejs/node/blob/master/lib/_http_outgoing.js
158
158
  class OutgoingMessage extends stream.Writable {
159
- upgrading: boolean;
159
+ readonly req: IncomingMessage;
160
+
160
161
  chunkedEncoding: boolean;
161
162
  shouldKeepAlive: boolean;
162
163
  useChunkedEncodingByDefault: boolean;
@@ -165,12 +166,12 @@ declare module 'http' {
165
166
  * @deprecated Use `writableEnded` instead.
166
167
  */
167
168
  finished: boolean;
168
- headersSent: boolean;
169
+ readonly headersSent: boolean;
169
170
  /**
170
171
  * @deprecated Use `socket` instead.
171
172
  */
172
- connection: Socket | null;
173
- socket: Socket | null;
173
+ readonly connection: Socket | null;
174
+ readonly socket: Socket | null;
174
175
 
175
176
  constructor();
176
177
 
@@ -420,7 +421,14 @@ declare module 'http' {
420
421
 
421
422
  /**
422
423
  * Read-only property specifying the maximum allowed size of HTTP headers in bytes.
423
- * Defaults to 16KB. Configurable using the [`--max-http-header-size`][] CLI option.
424
+ * Defaults to 16KB. Configurable using the `--max-http-header-size` CLI option.
424
425
  */
425
426
  const maxHeaderSize: number;
427
+
428
+ /**
429
+ *
430
+ * This utility function converts a URL object into an ordinary options object as
431
+ * expected by the `http.request()` and `https.request()` APIs.
432
+ */
433
+ function urlToHttpOptions(url: URL): ClientRequestArgs;
426
434
  }
node/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for non-npm package Node.js 15.6
1
+ // Type definitions for non-npm package Node.js 15.9
2
2
  // Project: http://nodejs.org/
3
3
  // Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
4
4
  // DefinitelyTyped <https://github.com/DefinitelyTyped>
node/os.d.ts CHANGED
@@ -212,7 +212,7 @@ declare module 'os' {
212
212
  /**
213
213
  * Returns a string identifying the kernel version.
214
214
  * On POSIX systems, the operating system release is determined by calling
215
- * [uname(3)][]. On Windows, `pRtlGetVersion` is used, and if it is not available,
215
+ * uname(3). On Windows, `pRtlGetVersion` is used, and if it is not available,
216
216
  * `GetVersionExW()` will be used. See
217
217
  * https://en.wikipedia.org/wiki/Uname#Examples for more information.
218
218
  */
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "15.6.2",
3
+ "version": "15.9.0",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -227,6 +227,6 @@
227
227
  },
228
228
  "scripts": {},
229
229
  "dependencies": {},
230
- "typesPublisherContentHash": "f62422deccbd466260cb63740d207022259eb7fc7b6e7c406be463b9d1b0cd19",
230
+ "typesPublisherContentHash": "cb014fbf92870923982004e4fca76f59150c147625c5fc51365d369f858eb620",
231
231
  "typeScriptVersion": "3.6"
232
232
  }
node/perf_hooks.d.ts CHANGED
@@ -3,7 +3,8 @@ declare module 'perf_hooks' {
3
3
 
4
4
  type EntryType = 'node' | 'mark' | 'measure' | 'gc' | 'function' | 'http2' | 'http';
5
5
 
6
- interface PerformanceEntry {
6
+ class PerformanceEntry {
7
+ protected constructor();
7
8
  /**
8
9
  * The total number of milliseconds elapsed for this entry.
9
10
  * This value will not be meaningful for all Performance Entry types.
@@ -41,7 +42,7 @@ declare module 'perf_hooks' {
41
42
  readonly flags?: number;
42
43
  }
43
44
 
44
- interface PerformanceNodeTiming extends PerformanceEntry {
45
+ class PerformanceNodeTiming extends PerformanceEntry {
45
46
  /**
46
47
  * The high resolution millisecond timestamp at which the Node.js process completed bootstrap.
47
48
  */
@@ -221,15 +222,36 @@ declare module 'perf_hooks' {
221
222
  resolution?: number;
222
223
  }
223
224
 
224
- interface EventLoopDelayMonitor {
225
+ interface Histogram {
225
226
  /**
226
- * Enables the event loop delay sample timer. Returns `true` if the timer was started, `false` if it was already started.
227
+ * A `Map` object detailing the accumulated percentile distribution.
227
228
  */
228
- enable(): boolean;
229
+ readonly percentiles: Map<number, number>;
230
+
229
231
  /**
230
- * Disables the event loop delay sample timer. Returns `true` if the timer was stopped, `false` if it was already stopped.
232
+ * The number of times the event loop delay exceeded the maximum 1 hour eventloop delay threshold.
231
233
  */
232
- disable(): boolean;
234
+ readonly exceeds: number;
235
+
236
+ /**
237
+ * The minimum recorded event loop delay.
238
+ */
239
+ readonly min: number;
240
+
241
+ /**
242
+ * The maximum recorded event loop delay.
243
+ */
244
+ readonly max: number;
245
+
246
+ /**
247
+ * The mean of the recorded event loop delays.
248
+ */
249
+ readonly mean: number;
250
+
251
+ /**
252
+ * The standard deviation of the recorded event loop delays.
253
+ */
254
+ readonly stddev: number;
233
255
 
234
256
  /**
235
257
  * Resets the collected histogram data.
@@ -241,37 +263,48 @@ declare module 'perf_hooks' {
241
263
  * @param percentile A percentile value between 1 and 100.
242
264
  */
243
265
  percentile(percentile: number): number;
266
+ }
244
267
 
268
+ interface IntervalHistogram extends Histogram {
245
269
  /**
246
- * A `Map` object detailing the accumulated percentile distribution.
270
+ * Enables the event loop delay sample timer. Returns `true` if the timer was started, `false` if it was already started.
247
271
  */
248
- readonly percentiles: Map<number, number>;
249
-
272
+ enable(): boolean;
250
273
  /**
251
- * The number of times the event loop delay exceeded the maximum 1 hour eventloop delay threshold.
274
+ * Disables the event loop delay sample timer. Returns `true` if the timer was stopped, `false` if it was already stopped.
252
275
  */
253
- readonly exceeds: number;
276
+ disable(): boolean;
277
+ }
278
+
279
+ interface RecordableHistogram extends Histogram {
280
+ record(val: number | bigint): void;
254
281
 
255
282
  /**
256
- * The minimum recorded event loop delay.
283
+ * Calculates the amount of time (in nanoseconds) that has passed since the previous call to recordDelta() and records that amount in the histogram.
257
284
  */
258
- readonly min: number;
285
+ recordDelta(): void;
286
+ }
287
+
288
+ function monitorEventLoopDelay(options?: EventLoopMonitorOptions): IntervalHistogram;
259
289
 
290
+ interface CreateHistogramOptions {
260
291
  /**
261
- * The maximum recorded event loop delay.
292
+ * The minimum recordable value. Must be an integer value greater than 0.
293
+ * @default 1
262
294
  */
263
- readonly max: number;
295
+ min?: number | bigint;
264
296
 
265
297
  /**
266
- * The mean of the recorded event loop delays.
298
+ * The maximum recordable value. Must be an integer value greater than min.
299
+ * @default Number.MAX_SAFE_INTEGER
267
300
  */
268
- readonly mean: number;
269
-
301
+ max?: number | bigint;
270
302
  /**
271
- * The standard deviation of the recorded event loop delays.
303
+ * The number of accuracy digits. Must be a number between 1 and 5.
304
+ * @default 3
272
305
  */
273
- readonly stddev: number;
306
+ figures?: number;
274
307
  }
275
308
 
276
- function monitorEventLoopDelay(options?: EventLoopMonitorOptions): EventLoopDelayMonitor;
309
+ function createHistogram(options?: CreateHistogramOptions): RecordableHistogram;
277
310
  }
node/process.d.ts CHANGED
@@ -336,7 +336,7 @@ declare module 'process' {
336
336
 
337
337
  /**
338
338
  * The `process.allowedNodeEnvironmentFlags` property is a special,
339
- * read-only `Set` of flags allowable within the [`NODE_OPTIONS`][]
339
+ * read-only `Set` of flags allowable within the `NODE_OPTIONS`
340
340
  * environment variable.
341
341
  */
342
342
  allowedNodeEnvironmentFlags: ReadonlySet<string>;
node/readline.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  declare module 'readline' {
2
- import EventEmitter = require('events');
2
+ import { Abortable, EventEmitter } from 'events';
3
3
 
4
4
  interface Key {
5
5
  sequence?: string;
@@ -42,6 +42,7 @@ declare module 'readline' {
42
42
  setPrompt(prompt: string): void;
43
43
  prompt(preserveCursor?: boolean): void;
44
44
  question(query: string, callback: (answer: string) => void): void;
45
+ question(query: string, options: Abortable, callback: (answer: string) => void): void;
45
46
  pause(): this;
46
47
  resume(): this;
47
48
  close(): void;
@@ -63,8 +64,8 @@ declare module 'readline' {
63
64
  * 5. SIGCONT
64
65
  * 6. SIGINT
65
66
  * 7. SIGTSTP
67
+ * 8. history
66
68
  */
67
-
68
69
  addListener(event: string, listener: (...args: any[]) => void): this;
69
70
  addListener(event: "close", listener: () => void): this;
70
71
  addListener(event: "line", listener: (input: string) => void): this;
@@ -73,6 +74,7 @@ declare module 'readline' {
73
74
  addListener(event: "SIGCONT", listener: () => void): this;
74
75
  addListener(event: "SIGINT", listener: () => void): this;
75
76
  addListener(event: "SIGTSTP", listener: () => void): this;
77
+ addListener(event: "history", listener: (history: string[]) => void): this;
76
78
 
77
79
  emit(event: string | symbol, ...args: any[]): boolean;
78
80
  emit(event: "close"): boolean;
@@ -82,6 +84,7 @@ declare module 'readline' {
82
84
  emit(event: "SIGCONT"): boolean;
83
85
  emit(event: "SIGINT"): boolean;
84
86
  emit(event: "SIGTSTP"): boolean;
87
+ emit(event: "history", history: string[]): boolean;
85
88
 
86
89
  on(event: string, listener: (...args: any[]) => void): this;
87
90
  on(event: "close", listener: () => void): this;
@@ -91,6 +94,7 @@ declare module 'readline' {
91
94
  on(event: "SIGCONT", listener: () => void): this;
92
95
  on(event: "SIGINT", listener: () => void): this;
93
96
  on(event: "SIGTSTP", listener: () => void): this;
97
+ on(event: "history", listener: (history: string[]) => void): this;
94
98
 
95
99
  once(event: string, listener: (...args: any[]) => void): this;
96
100
  once(event: "close", listener: () => void): this;
@@ -100,6 +104,7 @@ declare module 'readline' {
100
104
  once(event: "SIGCONT", listener: () => void): this;
101
105
  once(event: "SIGINT", listener: () => void): this;
102
106
  once(event: "SIGTSTP", listener: () => void): this;
107
+ once(event: "history", listener: (history: string[]) => void): this;
103
108
 
104
109
  prependListener(event: string, listener: (...args: any[]) => void): this;
105
110
  prependListener(event: "close", listener: () => void): this;
@@ -109,6 +114,7 @@ declare module 'readline' {
109
114
  prependListener(event: "SIGCONT", listener: () => void): this;
110
115
  prependListener(event: "SIGINT", listener: () => void): this;
111
116
  prependListener(event: "SIGTSTP", listener: () => void): this;
117
+ prependListener(event: "history", listener: (history: string[]) => void): this;
112
118
 
113
119
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
114
120
  prependOnceListener(event: "close", listener: () => void): this;
@@ -118,6 +124,8 @@ declare module 'readline' {
118
124
  prependOnceListener(event: "SIGCONT", listener: () => void): this;
119
125
  prependOnceListener(event: "SIGINT", listener: () => void): this;
120
126
  prependOnceListener(event: "SIGTSTP", listener: () => void): this;
127
+ prependOnceListener(event: "history", listener: (history: string[]) => void): this;
128
+
121
129
  [Symbol.asyncIterator](): AsyncIterableIterator<string>;
122
130
  }
123
131
 
@@ -133,9 +141,22 @@ declare module 'readline' {
133
141
  output?: NodeJS.WritableStream;
134
142
  completer?: Completer | AsyncCompleter;
135
143
  terminal?: boolean;
144
+ /**
145
+ * Initial list of history lines. This option makes sense
146
+ * only if `terminal` is set to `true` by the user or by an internal `output`
147
+ * check, otherwise the history caching mechanism is not initialized at all.
148
+ * @default []
149
+ */
150
+ history?: string[];
136
151
  historySize?: number;
137
152
  prompt?: string;
138
153
  crlfDelay?: number;
154
+ /**
155
+ * If `true`, when a new input line added
156
+ * to the history list duplicates an older one, this removes the older line
157
+ * from the list.
158
+ * @default false
159
+ */
139
160
  removeHistoryDuplicates?: boolean;
140
161
  escapeCodeTimeout?: number;
141
162
  tabSize?: number;
node/timers/promises.d.ts CHANGED
@@ -3,11 +3,19 @@ declare module 'timers/promises' {
3
3
 
4
4
  /**
5
5
  * Returns a promise that resolves after the specified delay in milliseconds.
6
+ * @param delay defaults to 1
6
7
  */
7
- function setTimeout<T>(delay: number, value?: T, options?: TimerOptions): Promise<T>;
8
+ function setTimeout<T = void>(delay?: number, value?: T, options?: TimerOptions): Promise<T>;
8
9
 
9
10
  /**
10
11
  * Returns a promise that resolves in the next tick.
11
12
  */
12
- function setImmediate<T>(value: T, options?: TimerOptions): Promise<T>;
13
+ function setImmediate<T = void>(value?: T, options?: TimerOptions): Promise<T>;
14
+
15
+ /**
16
+ *
17
+ * Returns an async iterator that generates values in an interval of delay ms.
18
+ * @param delay defaults to 1
19
+ */
20
+ function setInterval<T = void>(delay?: number, value?: T, options?: TimerOptions): AsyncIterable<T>;
13
21
  }
node/timers.d.ts CHANGED
@@ -1,16 +1,13 @@
1
1
  declare module 'timers' {
2
- interface TimerOptions {
2
+ import { Abortable } from 'events';
3
+
4
+ interface TimerOptions extends Abortable {
3
5
  /**
4
6
  * Set to `false` to indicate that the scheduled `Timeout`
5
7
  * should not require the Node.js event loop to remain active.
6
8
  * @default true
7
9
  */
8
10
  ref?: boolean;
9
-
10
- /**
11
- * An optional `AbortSignal` that can be used to cancel the scheduled `Timeout`.
12
- */
13
- signal?: AbortSignal;
14
11
  }
15
12
 
16
13
  function setTimeout(callback: (...args: any[]) => void, ms?: number, ...args: any[]): NodeJS.Timeout;
node/tls.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  declare module 'tls' {
2
+ import { X509Certificate } from 'crypto';
2
3
  import * as net from 'net';
3
4
 
4
5
  const CLIENT_RENEG_LIMIT: number;
@@ -295,6 +296,16 @@ declare module 'tls' {
295
296
  */
296
297
  enableTrace(): void;
297
298
 
299
+ /**
300
+ * If there is no peer certificate, or the socket has been destroyed, `undefined` will be returned.
301
+ */
302
+ getPeerX509Certificate(): X509Certificate | undefined;
303
+
304
+ /**
305
+ * If there is no local certificate, or the socket has been destroyed, `undefined` will be returned.
306
+ */
307
+ getX509Certificate(): X509Certificate | undefined;
308
+
298
309
  /**
299
310
  * @param length number of bytes to retrieve from keying material
300
311
  * @param label an application specific label, typically this will be a value from the
node/wasi.d.ts CHANGED
@@ -58,7 +58,7 @@ declare module 'wasi' {
58
58
  * invoke the `__wasi_unstable_reactor_start()` export. If neither of those exports
59
59
  * is present on `instance`, then `start()` does nothing.
60
60
  *
61
- * `start()` requires that `instance` exports a [`WebAssembly.Memory`][] named
61
+ * `start()` requires that `instance` exports a `WebAssembly.Memory` named
62
62
  * `memory`. If `instance` does not have a `memory` export an exception is thrown.
63
63
  *
64
64
  * If `start()` is called more than once, an exception is thrown.
@@ -69,7 +69,7 @@ declare module 'wasi' {
69
69
  * Attempt to initialize `instance` as a WASI reactor by invoking its `_initialize()` export, if it is present.
70
70
  * If `instance` contains a `_start()` export, then an exception is thrown.
71
71
  *
72
- * `start()` requires that `instance` exports a [`WebAssembly.Memory`][] named
72
+ * `start()` requires that `instance` exports a `WebAssembly.Memory` named
73
73
  * `memory`. If `instance` does not have a `memory` export an exception is thrown.
74
74
  *
75
75
  * If `initialize()` is called more than once, an exception is thrown.
@@ -79,7 +79,7 @@ declare module 'wasi' {
79
79
  /**
80
80
  * Is an object that implements the WASI system call API. This object
81
81
  * should be passed as the `wasi_snapshot_preview1` import during the instantiation of a
82
- * [`WebAssembly.Instance`][].
82
+ * `WebAssembly.Instance`.
83
83
  */
84
84
  readonly wasiImport: NodeJS.Dict<any>; // TODO: Narrow to DOM types
85
85
  }
node/worker_threads.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  declare module 'worker_threads' {
2
+ import { Blob } from 'node:buffer';
2
3
  import { Context } from 'vm';
3
4
  import { EventEmitter } from 'events';
4
5
  import { EventLoopUtilityFunction } from 'perf_hooks';
@@ -23,7 +24,7 @@ declare module 'worker_threads' {
23
24
  eventLoopUtilization: EventLoopUtilityFunction;
24
25
  }
25
26
 
26
- type TransferListItem = ArrayBuffer | MessagePort | FileHandle | X509Certificate;
27
+ type TransferListItem = ArrayBuffer | MessagePort | FileHandle | X509Certificate | Blob;
27
28
 
28
29
  class MessagePort extends EventEmitter {
29
30
  close(): void;
@@ -145,11 +146,11 @@ declare module 'worker_threads' {
145
146
 
146
147
  /**
147
148
  * Returns a readable stream for a V8 snapshot of the current state of the Worker.
148
- * See [`v8.getHeapSnapshot()`][] for more details.
149
+ * See `v8.getHeapSnapshot()` for more details.
149
150
  *
150
151
  * If the Worker thread is no longer running, which may occur before the
151
- * [`'exit'` event][] is emitted, the returned `Promise` will be rejected
152
- * immediately with an [`ERR_WORKER_NOT_RUNNING`][] error
152
+ * `'exit'` event is emitted, the returned `Promise` will be rejected
153
+ * immediately with an `ERR_WORKER_NOT_RUNNING` error
153
154
  */
154
155
  getHeapSnapshot(): Promise<Readable>;
155
156