@types/node 16.9.4 → 16.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
node/README.md CHANGED
@@ -8,9 +8,9 @@ This package contains type definitions for Node.js (https://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: Sun, 19 Sep 2021 18:01:23 GMT
11
+ * Last updated: Sat, 25 Sep 2021 11:01:23 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`
14
14
 
15
15
  # Credits
16
- These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Simon Schick](https://github.com/SimonSchick), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Minh Son Nguyen](https://github.com/nguymin4), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Surasak Chaisurin](https://github.com/Ryan-Willpower), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Jason Kwok](https://github.com/JasonHK), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), and [wafuwafu13](https://github.com/wafuwafu13).
16
+ These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Simon Schick](https://github.com/SimonSchick), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Minh Son Nguyen](https://github.com/nguymin4), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Surasak Chaisurin](https://github.com/Ryan-Willpower), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), and [wafuwafu13](https://github.com/wafuwafu13).
node/child_process.d.ts CHANGED
@@ -1279,12 +1279,13 @@ declare module 'child_process' {
1279
1279
  * @param args List of string arguments.
1280
1280
  */
1281
1281
  function spawnSync(command: string): SpawnSyncReturns<Buffer>;
1282
- function spawnSync(command: string, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
1283
- function spawnSync(command: string, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
1284
- function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<Buffer>;
1285
- function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
1286
- function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
1287
- function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptions): SpawnSyncReturns<Buffer>;
1282
+ function spawnSync(command: string, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
1283
+ function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
1284
+ function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<string | Buffer>;
1285
+ function spawnSync(command: string, args: ReadonlyArray<string>): SpawnSyncReturns<Buffer>;
1286
+ function spawnSync(command: string, args: ReadonlyArray<string>, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
1287
+ function spawnSync(command: string, args: ReadonlyArray<string>, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
1288
+ function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptions): SpawnSyncReturns<string | Buffer>;
1288
1289
  interface CommonExecOptions extends CommonOptions {
1289
1290
  input?: string | NodeJS.ArrayBufferView | undefined;
1290
1291
  stdio?: StdioOptions | undefined;
@@ -1318,9 +1319,9 @@ declare module 'child_process' {
1318
1319
  * @return The stdout from the command.
1319
1320
  */
1320
1321
  function execSync(command: string): Buffer;
1321
- function execSync(command: string, options?: ExecSyncOptionsWithStringEncoding): string;
1322
- function execSync(command: string, options?: ExecSyncOptionsWithBufferEncoding): Buffer;
1323
- function execSync(command: string, options?: ExecSyncOptions): Buffer;
1322
+ function execSync(command: string, options: ExecSyncOptionsWithStringEncoding): string;
1323
+ function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding): Buffer;
1324
+ function execSync(command: string, options?: ExecSyncOptions): string | Buffer;
1324
1325
  interface ExecFileSyncOptions extends CommonExecOptions {
1325
1326
  shell?: boolean | string | undefined;
1326
1327
  }
@@ -1328,7 +1329,7 @@ declare module 'child_process' {
1328
1329
  encoding: BufferEncoding;
1329
1330
  }
1330
1331
  interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions {
1331
- encoding: BufferEncoding; // specify `null`.
1332
+ encoding?: 'buffer' | null; // specify `null`.
1332
1333
  }
1333
1334
  /**
1334
1335
  * The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not
@@ -1351,12 +1352,13 @@ declare module 'child_process' {
1351
1352
  * @return The stdout from the command.
1352
1353
  */
1353
1354
  function execFileSync(file: string): Buffer;
1354
- function execFileSync(file: string, options?: ExecFileSyncOptionsWithStringEncoding): string;
1355
- function execFileSync(file: string, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
1356
- function execFileSync(file: string, options?: ExecFileSyncOptions): Buffer;
1357
- function execFileSync(file: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptionsWithStringEncoding): string;
1358
- function execFileSync(file: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
1359
- function execFileSync(file: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptions): Buffer;
1355
+ function execFileSync(file: string, options: ExecFileSyncOptionsWithStringEncoding): string;
1356
+ function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): Buffer;
1357
+ function execFileSync(file: string, options?: ExecFileSyncOptions): string | Buffer;
1358
+ function execFileSync(file: string, args: ReadonlyArray<string>): Buffer;
1359
+ function execFileSync(file: string, args: ReadonlyArray<string>, options: ExecFileSyncOptionsWithStringEncoding): string;
1360
+ function execFileSync(file: string, args: ReadonlyArray<string>, options: ExecFileSyncOptionsWithBufferEncoding): Buffer;
1361
+ function execFileSync(file: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptions): string | Buffer;
1360
1362
  }
1361
1363
  declare module 'node:child_process' {
1362
1364
  export * from 'child_process';
node/crypto.d.ts CHANGED
@@ -1167,6 +1167,26 @@ declare module 'crypto' {
1167
1167
  },
1168
1168
  callback: (err: Error | null, key: KeyObject) => void
1169
1169
  ): void;
1170
+ /**
1171
+ * Synchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`.
1172
+ *
1173
+ * ```js
1174
+ * const {
1175
+ * generateKeySync
1176
+ * } = await import('crypto');
1177
+ *
1178
+ * const key = generateKeySync('hmac', 64);
1179
+ * console.log(key.export().toString('hex')); // e89..........41e
1180
+ * ```
1181
+ * @since v15.0.0
1182
+ * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`.
1183
+ */
1184
+ function generateKeySync(
1185
+ type: 'hmac' | 'aes',
1186
+ options: {
1187
+ length: number;
1188
+ }
1189
+ ): KeyObject;
1170
1190
  interface JsonWebKeyInput {
1171
1191
  key: JsonWebKey;
1172
1192
  format: 'jwk';
@@ -2259,7 +2279,7 @@ declare module 'crypto' {
2259
2279
  interface X448KeyPairKeyObjectOptions {}
2260
2280
  interface ECKeyPairKeyObjectOptions {
2261
2281
  /**
2262
- * Name of the curve to use.
2282
+ * Name of the curve to use
2263
2283
  */
2264
2284
  namedCurve: string;
2265
2285
  }
@@ -2269,6 +2289,7 @@ declare module 'crypto' {
2269
2289
  */
2270
2290
  modulusLength: number;
2271
2291
  /**
2292
+ * Public exponent
2272
2293
  * @default 0x10001
2273
2294
  */
2274
2295
  publicExponent?: number | undefined;
@@ -2279,9 +2300,22 @@ declare module 'crypto' {
2279
2300
  */
2280
2301
  modulusLength: number;
2281
2302
  /**
2303
+ * Public exponent
2282
2304
  * @default 0x10001
2283
2305
  */
2284
2306
  publicExponent?: number | undefined;
2307
+ /**
2308
+ * Name of the message digest
2309
+ */
2310
+ hashAlgorithm?: string;
2311
+ /**
2312
+ * Name of the message digest used by MGF1
2313
+ */
2314
+ mgf1HashAlgorithm?: string;
2315
+ /**
2316
+ * Minimal salt length in bytes
2317
+ */
2318
+ saltLength?: string;
2285
2319
  }
2286
2320
  interface DSAKeyPairKeyObjectOptions {
2287
2321
  /**
@@ -2299,6 +2333,7 @@ declare module 'crypto' {
2299
2333
  */
2300
2334
  modulusLength: number;
2301
2335
  /**
2336
+ * Public exponent
2302
2337
  * @default 0x10001
2303
2338
  */
2304
2339
  publicExponent?: number | undefined;
@@ -2316,9 +2351,22 @@ declare module 'crypto' {
2316
2351
  */
2317
2352
  modulusLength: number;
2318
2353
  /**
2354
+ * Public exponent
2319
2355
  * @default 0x10001
2320
2356
  */
2321
2357
  publicExponent?: number | undefined;
2358
+ /**
2359
+ * Name of the message digest
2360
+ */
2361
+ hashAlgorithm?: string;
2362
+ /**
2363
+ * Name of the message digest used by MGF1
2364
+ */
2365
+ mgf1HashAlgorithm?: string;
2366
+ /**
2367
+ * Minimal salt length in bytes
2368
+ */
2369
+ saltLength?: string;
2322
2370
  publicKeyEncoding: {
2323
2371
  type: 'spki';
2324
2372
  format: PubF;
node/fs/promises.d.ts CHANGED
@@ -114,8 +114,8 @@ declare module 'fs/promises' {
114
114
  * number of bytes read is zero.
115
115
  * @since v10.0.0
116
116
  * @param buffer A buffer that will be filled with the file data read.
117
- * @param [offset=0] The location in the buffer at which to start filling.
118
- * @param [length=buffer.byteLength] The number of bytes to read.
117
+ * @param offset The location in the buffer at which to start filling.
118
+ * @param length The number of bytes to read.
119
119
  * @param position The location where to begin reading data from the file. If `null`, data will be read from the current file position, and the position will be updated. If `position` is an
120
120
  * integer, the current file position will remain unchanged.
121
121
  * @return Fulfills upon success with an object with two properties:
node/fs.d.ts CHANGED
@@ -904,42 +904,42 @@ declare module 'fs' {
904
904
  ): Promise<BigIntStats>;
905
905
  function __promisify__(path: PathLike, options?: StatOptions): Promise<Stats | BigIntStats>;
906
906
  }
907
- export interface StatSyncFn<TDescriptor = PathLike> extends Function {
908
- (path: TDescriptor, options?: undefined): Stats;
907
+ export interface StatSyncFn extends Function {
908
+ (path: PathLike, options?: undefined): Stats;
909
909
  (
910
- path: TDescriptor,
911
- options?: StatOptions & {
910
+ path: PathLike,
911
+ options?: StatSyncOptions & {
912
912
  bigint?: false | undefined;
913
913
  throwIfNoEntry: false;
914
914
  }
915
915
  ): Stats | undefined;
916
916
  (
917
- path: TDescriptor,
918
- options: StatOptions & {
917
+ path: PathLike,
918
+ options: StatSyncOptions & {
919
919
  bigint: true;
920
920
  throwIfNoEntry: false;
921
921
  }
922
922
  ): BigIntStats | undefined;
923
923
  (
924
- path: TDescriptor,
925
- options?: StatOptions & {
924
+ path: PathLike,
925
+ options?: StatSyncOptions & {
926
926
  bigint?: false | undefined;
927
927
  }
928
928
  ): Stats;
929
929
  (
930
- path: TDescriptor,
931
- options: StatOptions & {
930
+ path: PathLike,
931
+ options: StatSyncOptions & {
932
932
  bigint: true;
933
933
  }
934
934
  ): BigIntStats;
935
935
  (
936
- path: TDescriptor,
937
- options: StatOptions & {
936
+ path: PathLike,
937
+ options: StatSyncOptions & {
938
938
  bigint: boolean;
939
939
  throwIfNoEntry?: false | undefined;
940
940
  }
941
941
  ): Stats | BigIntStats;
942
- (path: TDescriptor, options?: StatOptions): Stats | BigIntStats | undefined;
942
+ (path: PathLike, options?: StatSyncOptions): Stats | BigIntStats | undefined;
943
943
  }
944
944
  /**
945
945
  * Synchronous stat(2) - Get file status.
@@ -993,7 +993,20 @@ declare module 'fs' {
993
993
  * Synchronous fstat(2) - Get file status.
994
994
  * @param fd A file descriptor.
995
995
  */
996
- export const fstatSync: StatSyncFn<number>;
996
+ export function fstatSync(
997
+ fd: number,
998
+ options?: StatOptions & {
999
+ bigint?: false | undefined;
1000
+ }
1001
+ ): Stats;
1002
+ export function fstatSync(
1003
+ fd: number,
1004
+ options: StatOptions & {
1005
+ bigint: true;
1006
+ }
1007
+ ): BigIntStats;
1008
+ export function fstatSync(fd: number, options?: StatOptions): Stats | BigIntStats;
1009
+
997
1010
  /**
998
1011
  * Retrieves the `fs.Stats` for the symbolic link referred to by the path.
999
1012
  * The callback gets two arguments `(err, stats)` where `stats` is a `fs.Stats` object. `lstat()` is identical to `stat()`, except that if `path` is a symbolic
@@ -1456,7 +1469,7 @@ declare module 'fs' {
1456
1469
  * Asynchronously creates a directory.
1457
1470
  *
1458
1471
  * The callback is given a possible exception and, if `recursive` is `true`, the
1459
- * first directory path created, `(err, [path])`.`path` can still be `undefined` when `recursive` is `true`, if no directory was
1472
+ * first directory path created, `(err[, path])`.`path` can still be `undefined` when `recursive` is `true`, if no directory was
1460
1473
  * created.
1461
1474
  *
1462
1475
  * The optional `options` argument can be an integer specifying `mode` (permission
@@ -2202,9 +2215,9 @@ declare module 'fs' {
2202
2215
  * If this method is invoked as its `util.promisify()` ed version, it returns
2203
2216
  * a promise for an `Object` with `bytesRead` and `buffer` properties.
2204
2217
  * @since v0.0.2
2205
- * @param [buffer=Buffer.alloc(16384)] The buffer that the data will be written to.
2206
- * @param [offset=0] The position in `buffer` to write the data to.
2207
- * @param [length=buffer.byteLength] The number of bytes to read.
2218
+ * @param buffer The buffer that the data will be written to.
2219
+ * @param offset The position in `buffer` to write the data to.
2220
+ * @param length The number of bytes to read.
2208
2221
  * @param position Specifies where to begin reading from in the file. If `position` is `null` or `-1 `, data will be read from the current file position, and the file position will be updated. If
2209
2222
  * `position` is an integer, the file position will be unchanged.
2210
2223
  */
@@ -3370,7 +3383,8 @@ declare module 'fs' {
3370
3383
  * destroyed, like most `Readable` streams. Set the `emitClose` option to`false` to change this behavior.
3371
3384
  *
3372
3385
  * By providing the `fs` option, it is possible to override the corresponding `fs`implementations for `open`, `read`, and `close`. When providing the `fs` option,
3373
- * overrides for `open`, `read`, and `close` are required.
3386
+ * an override for `read` is required. If no `fd` is provided, an override for`open` is also required. If `autoClose` is `true`, an override for `close` is
3387
+ * also required.
3374
3388
  *
3375
3389
  * ```js
3376
3390
  * import { createReadStream } from 'fs';
@@ -3428,7 +3442,8 @@ declare module 'fs' {
3428
3442
  *
3429
3443
  * By providing the `fs` option it is possible to override the corresponding `fs`implementations for `open`, `write`, `writev` and `close`. Overriding `write()`without `writev()` can reduce
3430
3444
  * performance as some optimizations (`_writev()`)
3431
- * will be disabled. When providing the `fs` option, overrides for `open`,`close`, and at least one of `write` and `writev` are required.
3445
+ * will be disabled. When providing the `fs` option, overrides for at least one of`write` and `writev` are required. If no `fd` option is supplied, an override
3446
+ * for `open` is also required. If `autoClose` is `true`, an override for `close`is also required.
3432
3447
  *
3433
3448
  * Like `fs.ReadStream`, if `fd` is specified, `fs.WriteStream` will ignore the`path` argument and will use the specified file descriptor. This means that no`'open'` event will be
3434
3449
  * emitted. `fd` should be blocking; non-blocking `fd`s
@@ -3662,6 +3677,8 @@ declare module 'fs' {
3662
3677
  }
3663
3678
  export interface StatOptions {
3664
3679
  bigint?: boolean | undefined;
3680
+ }
3681
+ export interface StatSyncOptions extends StatOptions {
3665
3682
  throwIfNoEntry?: boolean | undefined;
3666
3683
  }
3667
3684
  export interface CopyOptions {
node/http.d.ts CHANGED
@@ -183,6 +183,18 @@ declare module 'http' {
183
183
  * @since v0.7.0
184
184
  */
185
185
  maxHeadersCount: number | null;
186
+ /**
187
+ * The maximum number of requests socket can handle
188
+ * before closing keep alive connection.
189
+ *
190
+ * A value of `null` will disable the limit.
191
+ *
192
+ * When limit is reach it will set `Connection` header value to `closed`,
193
+ * but will not actually close the connection, subsequent requests sent
194
+ * after the limit is reached will get `503 Service Unavailable` as a response.
195
+ * @since v16.10.0
196
+ */
197
+ maxRequestsPerSocket: number | null;
186
198
  /**
187
199
  * The number of milliseconds of inactivity before a socket is presumed
188
200
  * to have timed out.
@@ -341,11 +353,9 @@ declare module 'http' {
341
353
  readonly socket: Socket | null;
342
354
  constructor();
343
355
  /**
344
- * occurs, Same as binding to the `timeout` event.
345
- *
346
356
  * Once a socket is associated with the message and is connected,`socket.setTimeout()` will be called with `msecs` as the first parameter.
347
357
  * @since v0.9.12
348
- * @param callback Optional function to be called when a timeout
358
+ * @param callback Optional function to be called when a timeout occurs. Same as binding to the `timeout` event.
349
359
  */
350
360
  setTimeout(msecs: number, callback?: () => void): this;
351
361
  /**
node/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for non-npm package Node.js 16.9
1
+ // Type definitions for non-npm package Node.js 16.10
2
2
  // Project: https://nodejs.org/
3
3
  // Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
4
4
  // DefinitelyTyped <https://github.com/DefinitelyTyped>
@@ -37,7 +37,6 @@
37
37
  // Surasak Chaisurin <https://github.com/Ryan-Willpower>
38
38
  // Piotr Błażejewicz <https://github.com/peterblazejewicz>
39
39
  // Anna Henningsen <https://github.com/addaleax>
40
- // Jason Kwok <https://github.com/JasonHK>
41
40
  // Victor Perin <https://github.com/victorperin>
42
41
  // Yongsheng Zhang <https://github.com/ZYSzys>
43
42
  // NodeJS Contributors <https://github.com/NodeJS>
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "16.9.4",
3
+ "version": "16.10.1",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -190,11 +190,6 @@
190
190
  "url": "https://github.com/addaleax",
191
191
  "githubUsername": "addaleax"
192
192
  },
193
- {
194
- "name": "Jason Kwok",
195
- "url": "https://github.com/JasonHK",
196
- "githubUsername": "JasonHK"
197
- },
198
193
  {
199
194
  "name": "Victor Perin",
200
195
  "url": "https://github.com/victorperin",
@@ -230,6 +225,6 @@
230
225
  },
231
226
  "scripts": {},
232
227
  "dependencies": {},
233
- "typesPublisherContentHash": "3a9ba9eedbc5a775925dde51f42ad45be2e4e6d760b8d1d2e767e82f91cc4d92",
228
+ "typesPublisherContentHash": "1637c5751f034c27c310fa63005fa559db0ab8fe309ae86094f8bc8fc215082c",
234
229
  "typeScriptVersion": "3.7"
235
230
  }
node/stream.d.ts CHANGED
@@ -1083,16 +1083,14 @@ declare module 'stream' {
1083
1083
  *
1084
1084
  * async function run() {
1085
1085
  * const ac = new AbortController();
1086
- * const options = {
1087
- * signal: ac.signal,
1088
- * };
1086
+ * const signal = ac.signal;
1089
1087
  *
1090
1088
  * setTimeout(() => ac.abort(), 1);
1091
1089
  * await pipeline(
1092
1090
  * fs.createReadStream('archive.tar'),
1093
1091
  * zlib.createGzip(),
1094
1092
  * fs.createWriteStream('archive.tar.gz'),
1095
- * options,
1093
+ * { signal },
1096
1094
  * );
1097
1095
  * }
1098
1096
  *
@@ -1108,10 +1106,10 @@ declare module 'stream' {
1108
1106
  * async function run() {
1109
1107
  * await pipeline(
1110
1108
  * fs.createReadStream('lowercase.txt'),
1111
- * async function* (source) {
1109
+ * async function* (source, signal) {
1112
1110
  * source.setEncoding('utf8'); // Work with strings rather than `Buffer`s.
1113
1111
  * for await (const chunk of source) {
1114
- * yield chunk.toUpperCase();
1112
+ * yield await processChunk(chunk, { signal });
1115
1113
  * }
1116
1114
  * },
1117
1115
  * fs.createWriteStream('uppercase.txt')
@@ -1122,6 +1120,28 @@ declare module 'stream' {
1122
1120
  * run().catch(console.error);
1123
1121
  * ```
1124
1122
  *
1123
+ * Remember to handle the `signal` argument passed into the async generator.
1124
+ * Especially in the case where the async generator is the source for the
1125
+ * pipeline (i.e. first argument) or the pipeline will never complete.
1126
+ *
1127
+ * ```js
1128
+ * const { pipeline } = require('stream/promises');
1129
+ * const fs = require('fs');
1130
+ *
1131
+ * async function run() {
1132
+ * await pipeline(
1133
+ * async function * (signal) {
1134
+ * await someLongRunningfn({ signal });
1135
+ * yield 'asd';
1136
+ * },
1137
+ * fs.createWriteStream('uppercase.txt')
1138
+ * );
1139
+ * console.log('Pipeline succeeded.');
1140
+ * }
1141
+ *
1142
+ * run().catch(console.error);
1143
+ * ```
1144
+ *
1125
1145
  * `stream.pipeline()` will call `stream.destroy(err)` on all streams except:
1126
1146
  *
1127
1147
  * * `Readable` streams which have emitted `'end'` or `'close'`.
node/tty.d.ts CHANGED
@@ -129,9 +129,7 @@ declare module 'tty' {
129
129
  * * `1` for 2,
130
130
  * * `4` for 16,
131
131
  * * `8` for 256,
132
- * * `24` for 16,777,216
133
- *
134
- * colors supported.
132
+ * * `24` for 16,777,216 colors supported.
135
133
  *
136
134
  * Use this to determine what colors the terminal supports. Due to the nature of
137
135
  * colors in terminals it is possible to either have false positives or false