@types/node 16.4.6 → 16.4.10

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/fs/promises.d.ts CHANGED
@@ -108,8 +108,8 @@ declare module 'fs/promises' {
108
108
  * number of bytes read is zero.
109
109
  * @since v10.0.0
110
110
  * @param buffer A buffer that will be filled with the file data read.
111
- * @param offset The location in the buffer at which to start filling.
112
- * @param length The number of bytes to read.
111
+ * @param [offset=0] The location in the buffer at which to start filling.
112
+ * @param [length=buffer.byteLength] The number of bytes to read.
113
113
  * @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
114
114
  * integer, the current file position will remain unchanged.
115
115
  * @return Fulfills upon success with an object with two properties:
@@ -204,6 +204,7 @@ declare module 'fs/promises' {
204
204
  *
205
205
  * If `len` is negative then `0` will be used.
206
206
  * @since v10.0.0
207
+ * @param [len=0]
207
208
  * @return Fulfills with `undefined` upon success.
208
209
  */
209
210
  truncate(len?: number): Promise<void>;
@@ -242,8 +243,8 @@ declare module 'fs/promises' {
242
243
  * The kernel ignores the position argument and always appends the data to
243
244
  * the end of the file.
244
245
  * @since v10.0.0
245
- * @param offset The start position from within `buffer` where the data to write begins.
246
- * @param length The number of bytes from `buffer` to write.
246
+ * @param [offset=0] The start position from within `buffer` where the data to write begins.
247
+ * @param [length=buffer.byteLength] The number of bytes from `buffer` to write.
247
248
  * @param position The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current position.
248
249
  * See the POSIX pwrite(2) documentation for more detail.
249
250
  */
@@ -336,6 +337,7 @@ declare module 'fs/promises' {
336
337
  * calls. Instead, user code should open/read/write the file directly and handle
337
338
  * the error raised if the file is not accessible.
338
339
  * @since v10.0.0
340
+ * @param [mode=fs.constants.F_OK]
339
341
  * @return Fulfills with `undefined` upon success.
340
342
  */
341
343
  function access(path: PathLike, mode?: number): Promise<void>;
@@ -369,7 +371,7 @@ declare module 'fs/promises' {
369
371
  * @since v10.0.0
370
372
  * @param src source filename to copy
371
373
  * @param dest destination filename of the copy operation
372
- * @param mode Optional modifiers that specify the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g.
374
+ * @param [mode=0] Optional modifiers that specify the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g.
373
375
  * `fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`)
374
376
  * @return Fulfills with `undefined` upon success.
375
377
  */
@@ -383,8 +385,8 @@ declare module 'fs/promises' {
383
385
  * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains
384
386
  * a colon, Node.js will open a file system stream, as described by[this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams).
385
387
  * @since v10.0.0
386
- * @param flags See `support of file system `flags``.
387
- * @param mode Sets the file mode (permission and sticky bits) if the file is created.
388
+ * @param [flags='r'] See `support of file system `flags``.
389
+ * @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created.
388
390
  * @return Fulfills with a {FileHandle} object.
389
391
  */
390
392
  function open(path: PathLike, flags: string | number, mode?: Mode): Promise<FileHandle>;
@@ -397,6 +399,7 @@ declare module 'fs/promises' {
397
399
  /**
398
400
  * Truncates (shortens or extends the length) of the content at `path` to `len`bytes.
399
401
  * @since v10.0.0
402
+ * @param [len=0]
400
403
  * @return Fulfills with `undefined` upon success.
401
404
  */
402
405
  function truncate(path: PathLike, len?: number): Promise<void>;
@@ -558,6 +561,7 @@ declare module 'fs/promises' {
558
561
  * to be absolute. When using `'junction'`, the `target` argument will
559
562
  * automatically be normalized to absolute path.
560
563
  * @since v10.0.0
564
+ * @param [type='file']
561
565
  * @return Fulfills with `undefined` upon success.
562
566
  */
563
567
  function symlink(target: PathLike, path: PathLike, type?: string | null): Promise<void>;
node/fs.d.ts CHANGED
@@ -305,8 +305,6 @@ declare module 'fs' {
305
305
  prependOnceListener(event: 'close', listener: () => void): this;
306
306
  }
307
307
  /**
308
- * * Extends: `<stream.Readable>`
309
- *
310
308
  * Instances of `<fs.ReadStream>` are created and returned using the {@link createReadStream} function.
311
309
  * @since v0.1.93
312
310
  */
@@ -518,6 +516,7 @@ declare module 'fs' {
518
516
  *
519
517
  * See the POSIX [`truncate(2)`](http://man7.org/linux/man-pages/man2/truncate.2.html) documentation for more details.
520
518
  * @since v0.8.6
519
+ * @param [len=0]
521
520
  */
522
521
  export function truncate(path: PathLike, len: number | undefined | null, callback: NoParamCallback): void;
523
522
  /**
@@ -540,6 +539,7 @@ declare module 'fs' {
540
539
  * Passing a file descriptor is deprecated and may result in an error being thrown
541
540
  * in the future.
542
541
  * @since v0.8.6
542
+ * @param [len=0]
543
543
  */
544
544
  export function truncateSync(path: PathLike, len?: number | null): void;
545
545
  /**
@@ -583,6 +583,7 @@ declare module 'fs' {
583
583
  *
584
584
  * If `len` is negative then `0` will be used.
585
585
  * @since v0.8.6
586
+ * @param [len=0]
586
587
  */
587
588
  export function ftruncate(fd: number, len: number | undefined | null, callback: NoParamCallback): void;
588
589
  /**
@@ -604,6 +605,7 @@ declare module 'fs' {
604
605
  * For detailed information, see the documentation of the asynchronous version of
605
606
  * this API: {@link ftruncate}.
606
607
  * @since v0.8.6
608
+ * @param [len=0]
607
609
  */
608
610
  export function ftruncateSync(fd: number, len?: number | null): void;
609
611
  /**
@@ -1954,7 +1956,8 @@ declare module 'fs' {
1954
1956
  *
1955
1957
  * Functions based on `fs.open()` exhibit this behavior as well:`fs.writeFile()`, `fs.readFile()`, etc.
1956
1958
  * @since v0.0.2
1957
- * @param flags See `support of file system `flags``.
1959
+ * @param [flags='r'] See `support of file system `flags``.
1960
+ * @param [mode=0o666]
1958
1961
  */
1959
1962
  export function open(path: PathLike, flags: OpenMode, mode: Mode | undefined | null, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
1960
1963
  /**
@@ -1976,6 +1979,8 @@ declare module 'fs' {
1976
1979
  * For detailed information, see the documentation of the asynchronous version of
1977
1980
  * this API: {@link open}.
1978
1981
  * @since v0.1.21
1982
+ * @param [flags='r']
1983
+ * @param [mode=0o666]
1979
1984
  */
1980
1985
  export function openSync(path: PathLike, flags: OpenMode, mode?: Mode | null): number;
1981
1986
  /**
@@ -2198,9 +2203,9 @@ declare module 'fs' {
2198
2203
  * If this method is invoked as its `util.promisify()` ed version, it returns
2199
2204
  * a promise for an `Object` with `bytesRead` and `buffer` properties.
2200
2205
  * @since v0.0.2
2201
- * @param buffer The buffer that the data will be written to.
2202
- * @param offset The position in `buffer` to write the data to.
2203
- * @param length The number of bytes to read.
2206
+ * @param [buffer=Buffer.alloc(16384)] The buffer that the data will be written to.
2207
+ * @param [offset=0] The position in `buffer` to write the data to.
2208
+ * @param [length=buffer.byteLength] The number of bytes to read.
2204
2209
  * @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
2205
2210
  * `position` is an integer, the file position will be unchanged.
2206
2211
  */
@@ -2805,6 +2810,7 @@ declare module 'fs' {
2805
2810
  * If a `signal` is passed, aborting the corresponding AbortController will close
2806
2811
  * the returned `<fs.FSWatcher>`.
2807
2812
  * @since v0.5.10
2813
+ * @param listener
2808
2814
  */
2809
2815
  export function watch(
2810
2816
  filename: PathLike,
@@ -3270,6 +3276,7 @@ declare module 'fs' {
3270
3276
  * ACL and therefore may report that a path is accessible even if the ACL restricts
3271
3277
  * the user from reading or writing to it.
3272
3278
  * @since v0.11.15
3279
+ * @param [mode=fs.constants.F_OK]
3273
3280
  */
3274
3281
  export function access(path: PathLike, mode: number | undefined, callback: NoParamCallback): void;
3275
3282
  /**
@@ -3307,6 +3314,7 @@ declare module 'fs' {
3307
3314
  * }
3308
3315
  * ```
3309
3316
  * @since v0.11.15
3317
+ * @param [mode=fs.constants.F_OK]
3310
3318
  */
3311
3319
  export function accessSync(path: PathLike, mode?: number): void;
3312
3320
  interface StreamOptions {
@@ -3389,7 +3397,7 @@ declare module 'fs' {
3389
3397
  * @since v0.1.31
3390
3398
  * @return See `Readable Stream`.
3391
3399
  */
3392
- export function createReadStream(path: PathLike, options?: string | ReadStreamOptions): ReadStream;
3400
+ export function createReadStream(path: PathLike, options?: BufferEncoding | ReadStreamOptions): ReadStream;
3393
3401
  /**
3394
3402
  * `options` may also include a `start` option to allow writing data at some
3395
3403
  * position past the beginning of the file, allowed values are in the
@@ -3417,7 +3425,7 @@ declare module 'fs' {
3417
3425
  * @since v0.1.31
3418
3426
  * @return See `Writable Stream`.
3419
3427
  */
3420
- export function createWriteStream(path: PathLike, options?: string | StreamOptions): WriteStream;
3428
+ export function createWriteStream(path: PathLike, options?: BufferEncoding | StreamOptions): WriteStream;
3421
3429
  /**
3422
3430
  * Forces all currently queued I/O operations associated with the file to the
3423
3431
  * operating system's synchronized I/O completion state. Refer to the POSIX[`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. No arguments other
@@ -3476,7 +3484,7 @@ declare module 'fs' {
3476
3484
  * @since v8.5.0
3477
3485
  * @param src source filename to copy
3478
3486
  * @param dest destination filename of the copy operation
3479
- * @param mode modifiers for copy operation.
3487
+ * @param [mode=0] modifiers for copy operation.
3480
3488
  */
3481
3489
  export function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void;
3482
3490
  export function copyFile(src: PathLike, dest: PathLike, mode: number, callback: NoParamCallback): void;
@@ -3515,7 +3523,7 @@ declare module 'fs' {
3515
3523
  * @since v8.5.0
3516
3524
  * @param src source filename to copy
3517
3525
  * @param dest destination filename of the copy operation
3518
- * @param mode modifiers for copy operation.
3526
+ * @param [mode=0] modifiers for copy operation.
3519
3527
  */
3520
3528
  export function copyFileSync(src: PathLike, dest: PathLike, mode?: number): void;
3521
3529
  /**
node/http.d.ts CHANGED
@@ -182,7 +182,6 @@ declare module 'http' {
182
182
  }
183
183
  interface Server extends HttpBase {}
184
184
  /**
185
- * * Extends: `<net.Server>`
186
185
  * @since v0.1.17
187
186
  */
188
187
  class Server extends NetServer {
@@ -620,8 +619,6 @@ declare module 'http' {
620
619
  prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
621
620
  }
622
621
  /**
623
- * * Extends: `<stream.Readable>`
624
- *
625
622
  * An `IncomingMessage` object is created by {@link Server} or {@link ClientRequest} and passed as the first argument to the `'request'` and `'response'` event respectively. It may be used to
626
623
  * access response
627
624
  * status, headers and data.
@@ -677,7 +674,7 @@ declare module 'http' {
677
674
  /**
678
675
  * Alias for `message.socket`.
679
676
  * @since v0.1.90
680
- * @deprecated Since v16.0.0 - Deprecated. Use `socket`.
677
+ * @deprecated Since v16.0.0 - Use `socket`.
681
678
  */
682
679
  connection: Socket;
683
680
  /**
node/http2.d.ts CHANGED
@@ -140,7 +140,7 @@ declare module 'http2' {
140
140
  * Closes the `Http2Stream` instance by sending an `RST_STREAM` frame to the
141
141
  * connected HTTP/2 peer.
142
142
  * @since v8.4.0
143
- * @param code Unsigned 32-bit integer identifying the error code.
143
+ * @param [code=http2.constants.NGHTTP2_NO_ERROR] Unsigned 32-bit integer identifying the error code.
144
144
  * @param callback An optional function registered to listen for the `'close'` event.
145
145
  */
146
146
  close(code?: number, callback?: () => void): void;
@@ -1170,8 +1170,6 @@ declare module 'http2' {
1170
1170
  prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
1171
1171
  }
1172
1172
  /**
1173
- * * Extends: `<stream.Readable>`
1174
- *
1175
1173
  * A `Http2ServerRequest` object is created by {@link Server} or {@link SecureServer} and passed as the first argument to the `'request'` event. It may be used to access a request status,
1176
1174
  * headers, and
1177
1175
  * data.
@@ -1194,7 +1192,7 @@ declare module 'http2' {
1194
1192
  /**
1195
1193
  * See `request.socket`.
1196
1194
  * @since v8.4.0
1197
- * @deprecated Since v13.0.0 - Deprecated. Use `socket`.
1195
+ * @deprecated Since v13.0.0 - Use `socket`.
1198
1196
  */
1199
1197
  readonly connection: net.Socket | tls.TLSSocket;
1200
1198
  /**
@@ -1417,14 +1415,14 @@ declare module 'http2' {
1417
1415
  /**
1418
1416
  * See `response.socket`.
1419
1417
  * @since v8.4.0
1420
- * @deprecated Since v13.0.0 - Deprecated. Use `socket`.
1418
+ * @deprecated Since v13.0.0 - Use `socket`.
1421
1419
  */
1422
1420
  readonly connection: net.Socket | tls.TLSSocket;
1423
1421
  /**
1424
1422
  * Boolean value that indicates whether the response has completed. Starts
1425
1423
  * as `false`. After `response.end()` executes, the value will be `true`.
1426
1424
  * @since v8.4.0
1427
- * @deprecated Since v13.4.0,v12.16.0 - Deprecated. Use `writableEnded`.
1425
+ * @deprecated Since v13.4.0,v12.16.0 - Use `writableEnded`.
1428
1426
  */
1429
1427
  readonly finished: boolean;
1430
1428
  /**
@@ -1437,10 +1435,66 @@ declare module 'http2' {
1437
1435
  * @since v15.7.0
1438
1436
  */
1439
1437
  readonly req: Http2ServerRequest;
1438
+ /**
1439
+ * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but
1440
+ * applies getters, setters, and methods based on HTTP/2 logic.
1441
+ *
1442
+ * `destroyed`, `readable`, and `writable` properties will be retrieved from and
1443
+ * set on `response.stream`.
1444
+ *
1445
+ * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`response.stream`.
1446
+ *
1447
+ * `setTimeout` method will be called on `response.stream.session`.
1448
+ *
1449
+ * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for
1450
+ * more information.
1451
+ *
1452
+ * All other interactions will be routed directly to the socket.
1453
+ *
1454
+ * ```js
1455
+ * const http2 = require('http2');
1456
+ * const server = http2.createServer((req, res) => {
1457
+ * const ip = req.socket.remoteAddress;
1458
+ * const port = req.socket.remotePort;
1459
+ * res.end(`Your IP address is ${ip} and your source port is ${port}.`);
1460
+ * }).listen(3000);
1461
+ * ```
1462
+ * @since v8.4.0
1463
+ */
1440
1464
  readonly socket: net.Socket | tls.TLSSocket;
1465
+ /**
1466
+ * The `Http2Stream` object backing the response.
1467
+ * @since v8.4.0
1468
+ */
1441
1469
  readonly stream: ServerHttp2Stream;
1470
+ /**
1471
+ * When true, the Date header will be automatically generated and sent in
1472
+ * the response if it is not already present in the headers. Defaults to true.
1473
+ *
1474
+ * This should only be disabled for testing; HTTP requires the Date header
1475
+ * in responses.
1476
+ * @since v8.4.0
1477
+ */
1442
1478
  sendDate: boolean;
1479
+ /**
1480
+ * When using implicit headers (not calling `response.writeHead()` explicitly),
1481
+ * this property controls the status code that will be sent to the client when
1482
+ * the headers get flushed.
1483
+ *
1484
+ * ```js
1485
+ * response.statusCode = 404;
1486
+ * ```
1487
+ *
1488
+ * After response header was sent to the client, this property indicates the
1489
+ * status code which was sent out.
1490
+ * @since v8.4.0
1491
+ */
1443
1492
  statusCode: number;
1493
+ /**
1494
+ * Status message is not supported by HTTP/2 (RFC 7540 8.1.2.4). It returns
1495
+ * an empty string.
1496
+ * @since v8.4.0
1497
+ */
1444
1498
  statusMessage: '';
1445
1499
  /**
1446
1500
  * This method adds HTTP trailing headers (a header but at the end of the
node/https.d.ts CHANGED
@@ -27,8 +27,6 @@ declare module 'https' {
27
27
  }
28
28
  interface Server extends http.HttpBase {}
29
29
  /**
30
- * * Extends: `<tls.Server>`
31
- *
32
30
  * See `http.Server` for more information.
33
31
  * @since v0.3.4
34
32
  */
node/module.d.ts CHANGED
@@ -66,6 +66,9 @@ declare module 'module' {
66
66
  * @since v13.7.0, v12.17.0
67
67
  */
68
68
  class SourceMap {
69
+ /**
70
+ * Getter for the payload used to construct the `SourceMap` instance.
71
+ */
69
72
  readonly payload: SourceMapPayload;
70
73
  constructor(payload: SourceMapPayload);
71
74
  /**
node/net.d.ts CHANGED
@@ -59,8 +59,6 @@ declare module 'net' {
59
59
  }
60
60
  type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts;
61
61
  /**
62
- * * Extends: `<stream.Duplex>`
63
- *
64
62
  * This class is an abstraction of a TCP socket or a streaming `IPC` endpoint
65
63
  * (uses named pipes on Windows, and Unix domain sockets otherwise). It is also
66
64
  * an `EventEmitter`.
@@ -89,7 +87,7 @@ declare module 'net' {
89
87
  * See `Writable` stream `write()` method for more
90
88
  * information.
91
89
  * @since v0.1.90
92
- * @param encoding Only used when data is `string`.
90
+ * @param [encoding='utf8'] Only used when data is `string`.
93
91
  */
94
92
  write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean;
95
93
  write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error) => void): boolean;
@@ -167,6 +165,7 @@ declare module 'net' {
167
165
  * algorithm for the socket. Passing `false` for `noDelay` will enable Nagle's
168
166
  * algorithm.
169
167
  * @since v0.1.90
168
+ * @param [noDelay=true]
170
169
  * @return The socket itself.
171
170
  */
172
171
  setNoDelay(noDelay?: boolean): this;
@@ -185,6 +184,8 @@ declare module 'net' {
185
184
  * * `TCP_KEEPCNT=10`
186
185
  * * `TCP_KEEPINTVL=1`
187
186
  * @since v0.1.92
187
+ * @param [enable=false]
188
+ * @param [initialDelay=0]
188
189
  * @return The socket itself.
189
190
  */
190
191
  setKeepAlive(enable?: boolean, initialDelay?: number): this;
@@ -282,7 +283,7 @@ declare module 'net' {
282
283
  *
283
284
  * See `writable.end()` for further details.
284
285
  * @since v0.1.90
285
- * @param encoding Only used when data is `string`.
286
+ * @param [encoding='utf8'] Only used when data is `string`.
286
287
  * @param callback Optional callback for when the socket is finished.
287
288
  * @return The socket itself.
288
289
  */
@@ -308,6 +309,7 @@ declare module 'net' {
308
309
  addListener(event: 'end', listener: () => void): this;
309
310
  addListener(event: 'error', listener: (err: Error) => void): this;
310
311
  addListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this;
312
+ addListener(event: 'ready', listener: () => void): this;
311
313
  addListener(event: 'timeout', listener: () => void): this;
312
314
  emit(event: string | symbol, ...args: any[]): boolean;
313
315
  emit(event: 'close', hadError: boolean): boolean;
@@ -317,6 +319,7 @@ declare module 'net' {
317
319
  emit(event: 'end'): boolean;
318
320
  emit(event: 'error', err: Error): boolean;
319
321
  emit(event: 'lookup', err: Error, address: string, family: string | number, host: string): boolean;
322
+ emit(event: 'ready'): boolean;
320
323
  emit(event: 'timeout'): boolean;
321
324
  on(event: string, listener: (...args: any[]) => void): this;
322
325
  on(event: 'close', listener: (hadError: boolean) => void): this;
@@ -326,6 +329,7 @@ declare module 'net' {
326
329
  on(event: 'end', listener: () => void): this;
327
330
  on(event: 'error', listener: (err: Error) => void): this;
328
331
  on(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this;
332
+ on(event: 'ready', listener: () => void): this;
329
333
  on(event: 'timeout', listener: () => void): this;
330
334
  once(event: string, listener: (...args: any[]) => void): this;
331
335
  once(event: 'close', listener: (hadError: boolean) => void): this;
@@ -335,6 +339,7 @@ declare module 'net' {
335
339
  once(event: 'end', listener: () => void): this;
336
340
  once(event: 'error', listener: (err: Error) => void): this;
337
341
  once(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this;
342
+ once(event: 'ready', listener: () => void): this;
338
343
  once(event: 'timeout', listener: () => void): this;
339
344
  prependListener(event: string, listener: (...args: any[]) => void): this;
340
345
  prependListener(event: 'close', listener: (hadError: boolean) => void): this;
@@ -344,6 +349,7 @@ declare module 'net' {
344
349
  prependListener(event: 'end', listener: () => void): this;
345
350
  prependListener(event: 'error', listener: (err: Error) => void): this;
346
351
  prependListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this;
352
+ prependListener(event: 'ready', listener: () => void): this;
347
353
  prependListener(event: 'timeout', listener: () => void): this;
348
354
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
349
355
  prependOnceListener(event: 'close', listener: (hadError: boolean) => void): this;
@@ -353,6 +359,7 @@ declare module 'net' {
353
359
  prependOnceListener(event: 'end', listener: () => void): this;
354
360
  prependOnceListener(event: 'error', listener: (err: Error) => void): this;
355
361
  prependOnceListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this;
362
+ prependOnceListener(event: 'ready', listener: () => void): this;
356
363
  prependOnceListener(event: 'timeout', listener: () => void): this;
357
364
  }
358
365
  interface ListenOptions extends Abortable {
@@ -560,7 +567,7 @@ declare module 'net' {
560
567
  * Adds a rule to block the given IP address.
561
568
  * @since v15.0.0
562
569
  * @param address An IPv4 or IPv6 address.
563
- * @param type Either `'ipv4'` or `'ipv6'`.
570
+ * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
564
571
  */
565
572
  addAddress(address: string, type?: IPVersion): void;
566
573
  addAddress(address: SocketAddress): void;
@@ -569,7 +576,7 @@ declare module 'net' {
569
576
  * @since v15.0.0
570
577
  * @param start The starting IPv4 or IPv6 address in the range.
571
578
  * @param end The ending IPv4 or IPv6 address in the range.
572
- * @param type Either `'ipv4'` or `'ipv6'`.
579
+ * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
573
580
  */
574
581
  addRange(start: string, end: string, type?: IPVersion): void;
575
582
  addRange(start: SocketAddress, end: SocketAddress): void;
@@ -578,7 +585,7 @@ declare module 'net' {
578
585
  * @since v15.0.0
579
586
  * @param net The network IPv4 or IPv6 address.
580
587
  * @param prefix The number of CIDR prefix bits. For IPv4, this must be a value between `0` and `32`. For IPv6, this must be between `0` and `128`.
581
- * @param type Either `'ipv4'` or `'ipv6'`.
588
+ * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
582
589
  */
583
590
  addSubnet(net: SocketAddress, prefix: number): void;
584
591
  addSubnet(net: string, prefix: number, type?: IPVersion): void;
@@ -601,7 +608,7 @@ declare module 'net' {
601
608
  * ```
602
609
  * @since v15.0.0
603
610
  * @param address The IP address to check
604
- * @param type Either `'ipv4'` or `'ipv6'`.
611
+ * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
605
612
  */
606
613
  check(address: SocketAddress): boolean;
607
614
  check(address: string, type?: IPVersion): boolean;
node/os.d.ts CHANGED
@@ -430,7 +430,7 @@ declare module 'os' {
430
430
  * Returns the scheduling priority for the process specified by `pid`. If `pid` is
431
431
  * not provided or is `0`, the priority of the current process is returned.
432
432
  * @since v10.10.0
433
- * @param pid The process ID to retrieve scheduling priority for.
433
+ * @param [pid=0] The process ID to retrieve scheduling priority for.
434
434
  */
435
435
  function getPriority(pid?: number): number;
436
436
  /**
@@ -444,7 +444,7 @@ declare module 'os' {
444
444
  * On Windows, setting priority to `PRIORITY_HIGHEST` requires elevated user
445
445
  * privileges. Otherwise the set priority will be silently reduced to`PRIORITY_HIGH`.
446
446
  * @since v10.10.0
447
- * @param pid The process ID to set scheduling priority for.
447
+ * @param [pid=0] The process ID to set scheduling priority for.
448
448
  * @param priority The scheduling priority to assign to the process.
449
449
  */
450
450
  function setPriority(priority: number): void;
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "16.4.6",
3
+ "version": "16.4.10",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -232,6 +232,6 @@
232
232
  },
233
233
  "scripts": {},
234
234
  "dependencies": {},
235
- "typesPublisherContentHash": "409fea0ec0757dc100114c6d35fe3b616cdf1e1095e08f5e2f83bd9336035435",
235
+ "typesPublisherContentHash": "9cf7378268559fe669acee51f22c860ed9146ba1d1de171f48e6c74c851194b6",
236
236
  "typeScriptVersion": "3.6"
237
237
  }
node/process.d.ts CHANGED
@@ -579,7 +579,7 @@ declare module 'process' {
579
579
  * In `Worker` threads, this function stops the current thread rather
580
580
  * than the current process.
581
581
  * @since v0.1.13
582
- * @param code The exit code.
582
+ * @param [code=0] The exit code.
583
583
  */
584
584
  exit(code?: number): never;
585
585
  /**
@@ -935,7 +935,7 @@ declare module 'process' {
935
935
  * debugger. See `Signal Events`.
936
936
  * @since v0.0.6
937
937
  * @param pid A process ID
938
- * @param signal The signal to send, either as a string or number.
938
+ * @param [signal='SIGTERM'] The signal to send, either as a string or number.
939
939
  */
940
940
  kill(pid: number, signal?: string | number): true;
941
941
  /**
@@ -1165,8 +1165,8 @@ declare module 'process' {
1165
1165
  * `process.umask()` returns the Node.js process's file mode creation mask. Child
1166
1166
  * processes inherit the mask from the parent process.
1167
1167
  * @since v0.1.19
1168
- * @deprecated Deprecated. Calling `process.umask()` with no argument causes the process-wide umask to be written twice. This introduces a race condition between threads, and is a *
1169
- * potential security vulnerability. There is no safe, cross-platform alternative API.
1168
+ * @deprecated Calling `process.umask()` with no argument causes the process-wide umask to be written twice. This introduces a race condition between threads, and is a potential *
1169
+ * security vulnerability. There is no safe, cross-platform alternative API.
1170
1170
  */
1171
1171
  umask(): number;
1172
1172
  /**
node/querystring.d.ts CHANGED
@@ -54,8 +54,8 @@ declare module 'querystring' {
54
54
  * ```
55
55
  * @since v0.1.25
56
56
  * @param obj The object to serialize into a URL query string
57
- * @param sep The substring used to delimit key and value pairs in the query string.
58
- * @param eq . The substring used to delimit keys and values in the query string.
57
+ * @param [sep='&'] The substring used to delimit key and value pairs in the query string.
58
+ * @param [eq='='] . The substring used to delimit keys and values in the query string.
59
59
  */
60
60
  function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string;
61
61
  /**
@@ -87,8 +87,8 @@ declare module 'querystring' {
87
87
  * ```
88
88
  * @since v0.1.25
89
89
  * @param str The URL query string to parse
90
- * @param sep The substring used to delimit key and value pairs in the query string.
91
- * @param eq . The substring used to delimit keys and values in the query string.
90
+ * @param [sep='&'] The substring used to delimit key and value pairs in the query string.
91
+ * @param [eq='='] . The substring used to delimit keys and values in the query string.
92
92
  */
93
93
  function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery;
94
94
  /**
node/stream.d.ts CHANGED
@@ -587,7 +587,7 @@ declare module 'stream' {
587
587
  * @since v0.9.4
588
588
  * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any
589
589
  * JavaScript value other than `null`.
590
- * @param encoding The encoding, if `chunk` is a string.
590
+ * @param [encoding='utf8'] The encoding, if `chunk` is a string.
591
591
  * @param callback Callback for when this chunk of data is flushed.
592
592
  * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
593
593
  */
node/timers/promises.d.ts CHANGED
@@ -42,7 +42,7 @@ declare module 'timers/promises' {
42
42
  * });
43
43
  * ```
44
44
  * @since v15.0.0
45
- * @param delay The number of milliseconds to wait before fulfilling the promise.
45
+ * @param [delay=1] The number of milliseconds to wait before fulfilling the promise.
46
46
  * @param value A value with which the promise is fulfilled.
47
47
  */
48
48
  function setTimeout<T = void>(delay?: number, value?: T, options?: TimerOptions): Promise<T>;
node/tls.d.ts CHANGED
@@ -127,8 +127,6 @@ declare module 'tls' {
127
127
  requestOCSP?: boolean | undefined;
128
128
  }
129
129
  /**
130
- * * Extends: `<net.Socket>`
131
- *
132
130
  * Performs transparent encryption of written data and all required TLS
133
131
  * negotiation.
134
132
  *
@@ -144,7 +142,9 @@ declare module 'tls' {
144
142
  */
145
143
  constructor(socket: net.Socket, options?: TLSSocketOptions);
146
144
  /**
147
- * A boolean that is true if the peer certificate was signed by one of the specified CAs, otherwise false.
145
+ * Returns `true` if the peer certificate was signed by one of the CAs specified
146
+ * when creating the `tls.TLSSocket` instance, otherwise `false`.
147
+ * @since v0.11.4
148
148
  */
149
149
  authorized: boolean;
150
150
  /**
@@ -328,7 +328,7 @@ declare module 'tls' {
328
328
  * smaller fragments add extra TLS framing bytes and CPU overhead, which may
329
329
  * decrease overall server throughput.
330
330
  * @since v0.11.11
331
- * @param size The maximum TLS fragment size. The maximum value is `16384`.
331
+ * @param [size=16384] The maximum TLS fragment size. The maximum value is `16384`.
332
332
  */
333
333
  setMaxSendFragment(size: number): boolean;
334
334
  /**
@@ -542,8 +542,6 @@ declare module 'tls' {
542
542
  pskCallback?(hint: string | null): PSKCallbackNegotation | null;
543
543
  }
544
544
  /**
545
- * * Extends: `<net.Server>`
546
- *
547
545
  * Accepts encrypted connections using TLS or SSL.
548
546
  * @since v0.3.2
549
547
  */