@types/node 16.4.7 → 16.4.11

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 (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: Thu, 29 Jul 2021 13:01:18 GMT
11
+ * Last updated: Wed, 04 Aug 2021 09:01:24 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), [Hoàng Văn Khải](https://github.com/KSXGitHub), [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), and [NodeJS Contributors](https://github.com/NodeJS).
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), [Hoàng Văn Khải](https://github.com/KSXGitHub), [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), and [Linus Unnebäck](https://github.com/LinusU).
node/assert.d.ts CHANGED
@@ -72,6 +72,8 @@ declare module 'assert' {
72
72
  * const callsfunc = tracker.calls(func);
73
73
  * ```
74
74
  * @since v14.2.0, v12.19.0
75
+ * @param [fn='A no-op function']
76
+ * @param [exact=1]
75
77
  * @return that wraps `fn`.
76
78
  */
77
79
  calls(exact?: number): () => void;
@@ -228,6 +230,7 @@ declare module 'assert' {
228
230
  * Using `assert.fail()` with more than two arguments is possible but deprecated.
229
231
  * See below for further details.
230
232
  * @since v0.1.21
233
+ * @param [message='Failed']
231
234
  */
232
235
  function fail(message?: string | Error): never;
233
236
  /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
node/buffer.d.ts CHANGED
@@ -330,9 +330,9 @@ declare module 'buffer' {
330
330
  * ```
331
331
  * @since v0.1.90
332
332
  * @param string String to write to `buf`.
333
- * @param offset Number of bytes to skip before starting to write `string`.
334
- * @param length Maximum number of bytes to write (written bytes will not exceed `buf.length - offset`).
335
- * @param encoding The character encoding of `string`.
333
+ * @param [offset=0] Number of bytes to skip before starting to write `string`.
334
+ * @param [length=buf.length - offset] Maximum number of bytes to write (written bytes will not exceed `buf.length - offset`).
335
+ * @param [encoding='utf8'] The character encoding of `string`.
336
336
  * @return Number of bytes written.
337
337
  */
338
338
  write(string: string, encoding?: BufferEncoding): number;
@@ -370,9 +370,9 @@ declare module 'buffer' {
370
370
  * // Prints: té
371
371
  * ```
372
372
  * @since v0.1.90
373
- * @param encoding The character encoding to use.
374
- * @param start The byte offset to start decoding at.
375
- * @param end The byte offset to stop decoding at (not inclusive).
373
+ * @param [encoding='utf8'] The character encoding to use.
374
+ * @param [start=0] The byte offset to start decoding at.
375
+ * @param [end=buf.length] The byte offset to stop decoding at (not inclusive).
376
376
  */
377
377
  toString(encoding?: BufferEncoding, start?: number, end?: number): string;
378
378
  /**
@@ -466,10 +466,10 @@ declare module 'buffer' {
466
466
  * `ERR_OUT_OF_RANGE` is thrown if `targetStart < 0`, `sourceStart < 0`,`targetEnd > target.byteLength`, or `sourceEnd > source.byteLength`.
467
467
  * @since v0.11.13
468
468
  * @param target A `Buffer` or {@link Uint8Array} with which to compare `buf`.
469
- * @param targetStart The offset within `target` at which to begin comparison.
470
- * @param targetEnd The offset within `target` at which to end comparison (not inclusive).
471
- * @param sourceStart The offset within `buf` at which to begin comparison.
472
- * @param sourceEnd The offset within `buf` at which to end comparison (not inclusive).
469
+ * @param [targetStart=0] The offset within `target` at which to begin comparison.
470
+ * @param [targetEnd=target.length] The offset within `target` at which to end comparison (not inclusive).
471
+ * @param [sourceStart=0] The offset within `buf` at which to begin comparison.
472
+ * @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive).
473
473
  */
474
474
  compare(target: Uint8Array, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number;
475
475
  /**
@@ -516,9 +516,9 @@ declare module 'buffer' {
516
516
  * ```
517
517
  * @since v0.1.90
518
518
  * @param target A `Buffer` or {@link Uint8Array} to copy into.
519
- * @param targetStart The offset within `target` at which to begin writing.
520
- * @param sourceStart The offset within `buf` from which to begin copying.
521
- * @param sourceEnd The offset within `buf` at which to stop copying (not inclusive).
519
+ * @param [targetStart=0] The offset within `target` at which to begin writing.
520
+ * @param [sourceStart=0] The offset within `buf` from which to begin copying.
521
+ * @param [sourceEnd=buf.length] The offset within `buf` at which to stop copying (not inclusive).
522
522
  * @return The number of bytes copied.
523
523
  */
524
524
  copy(target: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
@@ -543,8 +543,8 @@ declare module 'buffer' {
543
543
  * // Prints: buffer
544
544
  * ```
545
545
  * @since v0.3.0
546
- * @param start Where the new `Buffer` will start.
547
- * @param end Where the new `Buffer` will end (not inclusive).
546
+ * @param [start=0] Where the new `Buffer` will start.
547
+ * @param [end=buf.length] Where the new `Buffer` will end (not inclusive).
548
548
  */
549
549
  slice(start?: number, end?: number): Buffer;
550
550
  /**
@@ -599,8 +599,8 @@ declare module 'buffer' {
599
599
  * // (Equivalent to buf.subarray(1, 4).)
600
600
  * ```
601
601
  * @since v3.0.0
602
- * @param start Where the new `Buffer` will start.
603
- * @param end Where the new `Buffer` will end (not inclusive).
602
+ * @param [start=0] Where the new `Buffer` will start.
603
+ * @param [end=buf.length] Where the new `Buffer` will end (not inclusive).
604
604
  */
605
605
  subarray(start?: number, end?: number): Buffer;
606
606
  /**
@@ -618,7 +618,7 @@ declare module 'buffer' {
618
618
  * ```
619
619
  * @since v12.0.0, v10.20.0
620
620
  * @param value Number to be written to `buf`.
621
- * @param offset Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
621
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
622
622
  * @return `offset` plus the number of bytes written.
623
623
  */
624
624
  writeBigInt64BE(value: bigint, offset?: number): number;
@@ -637,7 +637,7 @@ declare module 'buffer' {
637
637
  * ```
638
638
  * @since v12.0.0, v10.20.0
639
639
  * @param value Number to be written to `buf`.
640
- * @param offset Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
640
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
641
641
  * @return `offset` plus the number of bytes written.
642
642
  */
643
643
  writeBigInt64LE(value: bigint, offset?: number): number;
@@ -656,7 +656,7 @@ declare module 'buffer' {
656
656
  * ```
657
657
  * @since v12.0.0, v10.20.0
658
658
  * @param value Number to be written to `buf`.
659
- * @param offset Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
659
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
660
660
  * @return `offset` plus the number of bytes written.
661
661
  */
662
662
  writeBigUInt64BE(value: bigint, offset?: number): number;
@@ -675,7 +675,7 @@ declare module 'buffer' {
675
675
  * This function is also available under the `writeBigUint64LE` alias.
676
676
  * @since v12.0.0, v10.20.0
677
677
  * @param value Number to be written to `buf`.
678
- * @param offset Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
678
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
679
679
  * @return `offset` plus the number of bytes written.
680
680
  */
681
681
  writeBigUInt64LE(value: bigint, offset?: number): number;
@@ -771,7 +771,7 @@ declare module 'buffer' {
771
771
  * // Prints: 4294967295n
772
772
  * ```
773
773
  * @since v12.0.0, v10.20.0
774
- * @param offset Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
774
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
775
775
  */
776
776
  readBigUInt64BE(offset?: number): bigint;
777
777
  /**
@@ -786,7 +786,7 @@ declare module 'buffer' {
786
786
  * // Prints: 18446744069414584320n
787
787
  * ```
788
788
  * @since v12.0.0, v10.20.0
789
- * @param offset Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
789
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
790
790
  */
791
791
  readBigUInt64LE(offset?: number): bigint;
792
792
  /**
@@ -795,7 +795,7 @@ declare module 'buffer' {
795
795
  * Integers read from a `Buffer` are interpreted as two's complement signed
796
796
  * values.
797
797
  * @since v12.0.0, v10.20.0
798
- * @param offset Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
798
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
799
799
  */
800
800
  readBigInt64BE(offset?: number): bigint;
801
801
  /**
@@ -804,7 +804,7 @@ declare module 'buffer' {
804
804
  * Integers read from a `Buffer` are interpreted as two's complement signed
805
805
  * values.
806
806
  * @since v12.0.0, v10.20.0
807
- * @param offset Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
807
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
808
808
  */
809
809
  readBigInt64LE(offset?: number): bigint;
810
810
  /**
@@ -893,7 +893,7 @@ declare module 'buffer' {
893
893
  * // Throws ERR_OUT_OF_RANGE.
894
894
  * ```
895
895
  * @since v0.5.0
896
- * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`.
896
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`.
897
897
  */
898
898
  readUInt8(offset?: number): number;
899
899
  /**
@@ -912,7 +912,7 @@ declare module 'buffer' {
912
912
  * // Throws ERR_OUT_OF_RANGE.
913
913
  * ```
914
914
  * @since v0.5.5
915
- * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
915
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
916
916
  */
917
917
  readUInt16LE(offset?: number): number;
918
918
  /**
@@ -929,7 +929,7 @@ declare module 'buffer' {
929
929
  * // Prints: 3456
930
930
  * ```
931
931
  * @since v0.5.5
932
- * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
932
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
933
933
  */
934
934
  readUInt16BE(offset?: number): number;
935
935
  /**
@@ -946,7 +946,7 @@ declare module 'buffer' {
946
946
  * // Throws ERR_OUT_OF_RANGE.
947
947
  * ```
948
948
  * @since v0.5.5
949
- * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
949
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
950
950
  */
951
951
  readUInt32LE(offset?: number): number;
952
952
  /**
@@ -961,7 +961,7 @@ declare module 'buffer' {
961
961
  * // Prints: 12345678
962
962
  * ```
963
963
  * @since v0.5.5
964
- * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
964
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
965
965
  */
966
966
  readUInt32BE(offset?: number): number;
967
967
  /**
@@ -980,7 +980,7 @@ declare module 'buffer' {
980
980
  * // Throws ERR_OUT_OF_RANGE.
981
981
  * ```
982
982
  * @since v0.5.0
983
- * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`.
983
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`.
984
984
  */
985
985
  readInt8(offset?: number): number;
986
986
  /**
@@ -997,7 +997,7 @@ declare module 'buffer' {
997
997
  * // Throws ERR_OUT_OF_RANGE.
998
998
  * ```
999
999
  * @since v0.5.5
1000
- * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
1000
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
1001
1001
  */
1002
1002
  readInt16LE(offset?: number): number;
1003
1003
  /**
@@ -1012,7 +1012,7 @@ declare module 'buffer' {
1012
1012
  * // Prints: 5
1013
1013
  * ```
1014
1014
  * @since v0.5.5
1015
- * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
1015
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
1016
1016
  */
1017
1017
  readInt16BE(offset?: number): number;
1018
1018
  /**
@@ -1029,7 +1029,7 @@ declare module 'buffer' {
1029
1029
  * // Throws ERR_OUT_OF_RANGE.
1030
1030
  * ```
1031
1031
  * @since v0.5.5
1032
- * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
1032
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
1033
1033
  */
1034
1034
  readInt32LE(offset?: number): number;
1035
1035
  /**
@@ -1044,7 +1044,7 @@ declare module 'buffer' {
1044
1044
  * // Prints: 5
1045
1045
  * ```
1046
1046
  * @since v0.5.5
1047
- * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
1047
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
1048
1048
  */
1049
1049
  readInt32BE(offset?: number): number;
1050
1050
  /**
@@ -1059,7 +1059,7 @@ declare module 'buffer' {
1059
1059
  * // Throws ERR_OUT_OF_RANGE.
1060
1060
  * ```
1061
1061
  * @since v0.11.15
1062
- * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
1062
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
1063
1063
  */
1064
1064
  readFloatLE(offset?: number): number;
1065
1065
  /**
@@ -1072,7 +1072,7 @@ declare module 'buffer' {
1072
1072
  * // Prints: 2.387939260590663e-38
1073
1073
  * ```
1074
1074
  * @since v0.11.15
1075
- * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
1075
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
1076
1076
  */
1077
1077
  readFloatBE(offset?: number): number;
1078
1078
  /**
@@ -1087,7 +1087,7 @@ declare module 'buffer' {
1087
1087
  * // Throws ERR_OUT_OF_RANGE.
1088
1088
  * ```
1089
1089
  * @since v0.11.15
1090
- * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`.
1090
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`.
1091
1091
  */
1092
1092
  readDoubleLE(offset?: number): number;
1093
1093
  /**
@@ -1100,7 +1100,7 @@ declare module 'buffer' {
1100
1100
  * // Prints: 8.20788039913184e-304
1101
1101
  * ```
1102
1102
  * @since v0.11.15
1103
- * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`.
1103
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`.
1104
1104
  */
1105
1105
  readDoubleBE(offset?: number): number;
1106
1106
  reverse(): this;
@@ -1204,7 +1204,7 @@ declare module 'buffer' {
1204
1204
  * ```
1205
1205
  * @since v0.5.0
1206
1206
  * @param value Number to be written to `buf`.
1207
- * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`.
1207
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`.
1208
1208
  * @return `offset` plus the number of bytes written.
1209
1209
  */
1210
1210
  writeUInt8(value: number, offset?: number): number;
@@ -1225,7 +1225,7 @@ declare module 'buffer' {
1225
1225
  * ```
1226
1226
  * @since v0.5.5
1227
1227
  * @param value Number to be written to `buf`.
1228
- * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
1228
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
1229
1229
  * @return `offset` plus the number of bytes written.
1230
1230
  */
1231
1231
  writeUInt16LE(value: number, offset?: number): number;
@@ -1246,7 +1246,7 @@ declare module 'buffer' {
1246
1246
  * ```
1247
1247
  * @since v0.5.5
1248
1248
  * @param value Number to be written to `buf`.
1249
- * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
1249
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
1250
1250
  * @return `offset` plus the number of bytes written.
1251
1251
  */
1252
1252
  writeUInt16BE(value: number, offset?: number): number;
@@ -1266,7 +1266,7 @@ declare module 'buffer' {
1266
1266
  * ```
1267
1267
  * @since v0.5.5
1268
1268
  * @param value Number to be written to `buf`.
1269
- * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
1269
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
1270
1270
  * @return `offset` plus the number of bytes written.
1271
1271
  */
1272
1272
  writeUInt32LE(value: number, offset?: number): number;
@@ -1286,7 +1286,7 @@ declare module 'buffer' {
1286
1286
  * ```
1287
1287
  * @since v0.5.5
1288
1288
  * @param value Number to be written to `buf`.
1289
- * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
1289
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
1290
1290
  * @return `offset` plus the number of bytes written.
1291
1291
  */
1292
1292
  writeUInt32BE(value: number, offset?: number): number;
@@ -1308,7 +1308,7 @@ declare module 'buffer' {
1308
1308
  * ```
1309
1309
  * @since v0.5.0
1310
1310
  * @param value Number to be written to `buf`.
1311
- * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`.
1311
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`.
1312
1312
  * @return `offset` plus the number of bytes written.
1313
1313
  */
1314
1314
  writeInt8(value: number, offset?: number): number;
@@ -1328,7 +1328,7 @@ declare module 'buffer' {
1328
1328
  * ```
1329
1329
  * @since v0.5.5
1330
1330
  * @param value Number to be written to `buf`.
1331
- * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
1331
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
1332
1332
  * @return `offset` plus the number of bytes written.
1333
1333
  */
1334
1334
  writeInt16LE(value: number, offset?: number): number;
@@ -1348,7 +1348,7 @@ declare module 'buffer' {
1348
1348
  * ```
1349
1349
  * @since v0.5.5
1350
1350
  * @param value Number to be written to `buf`.
1351
- * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
1351
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
1352
1352
  * @return `offset` plus the number of bytes written.
1353
1353
  */
1354
1354
  writeInt16BE(value: number, offset?: number): number;
@@ -1368,7 +1368,7 @@ declare module 'buffer' {
1368
1368
  * ```
1369
1369
  * @since v0.5.5
1370
1370
  * @param value Number to be written to `buf`.
1371
- * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
1371
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
1372
1372
  * @return `offset` plus the number of bytes written.
1373
1373
  */
1374
1374
  writeInt32LE(value: number, offset?: number): number;
@@ -1388,7 +1388,7 @@ declare module 'buffer' {
1388
1388
  * ```
1389
1389
  * @since v0.5.5
1390
1390
  * @param value Number to be written to `buf`.
1391
- * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
1391
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
1392
1392
  * @return `offset` plus the number of bytes written.
1393
1393
  */
1394
1394
  writeInt32BE(value: number, offset?: number): number;
@@ -1406,7 +1406,7 @@ declare module 'buffer' {
1406
1406
  * ```
1407
1407
  * @since v0.11.15
1408
1408
  * @param value Number to be written to `buf`.
1409
- * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
1409
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
1410
1410
  * @return `offset` plus the number of bytes written.
1411
1411
  */
1412
1412
  writeFloatLE(value: number, offset?: number): number;
@@ -1424,7 +1424,7 @@ declare module 'buffer' {
1424
1424
  * ```
1425
1425
  * @since v0.11.15
1426
1426
  * @param value Number to be written to `buf`.
1427
- * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
1427
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
1428
1428
  * @return `offset` plus the number of bytes written.
1429
1429
  */
1430
1430
  writeFloatBE(value: number, offset?: number): number;
@@ -1442,7 +1442,7 @@ declare module 'buffer' {
1442
1442
  * ```
1443
1443
  * @since v0.11.15
1444
1444
  * @param value Number to be written to `buf`.
1445
- * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`.
1445
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`.
1446
1446
  * @return `offset` plus the number of bytes written.
1447
1447
  */
1448
1448
  writeDoubleLE(value: number, offset?: number): number;
@@ -1460,7 +1460,7 @@ declare module 'buffer' {
1460
1460
  * ```
1461
1461
  * @since v0.11.15
1462
1462
  * @param value Number to be written to `buf`.
1463
- * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`.
1463
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`.
1464
1464
  * @return `offset` plus the number of bytes written.
1465
1465
  */
1466
1466
  writeDoubleBE(value: number, offset?: number): number;
@@ -1506,9 +1506,9 @@ declare module 'buffer' {
1506
1506
  * ```
1507
1507
  * @since v0.5.0
1508
1508
  * @param value The value with which to fill `buf`.
1509
- * @param offset Number of bytes to skip before starting to fill `buf`.
1510
- * @param end Where to stop filling `buf` (not inclusive).
1511
- * @param encoding The encoding for `value` if `value` is a string.
1509
+ * @param [offset=0] Number of bytes to skip before starting to fill `buf`.
1510
+ * @param [end=buf.length] Where to stop filling `buf` (not inclusive).
1511
+ * @param [encoding='utf8'] The encoding for `value` if `value` is a string.
1512
1512
  * @return A reference to `buf`.
1513
1513
  */
1514
1514
  fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this;
@@ -1572,8 +1572,8 @@ declare module 'buffer' {
1572
1572
  * than `buf.length`, `byteOffset` will be returned. If `value` is empty and`byteOffset` is at least `buf.length`, `buf.length` will be returned.
1573
1573
  * @since v1.5.0
1574
1574
  * @param value What to search for.
1575
- * @param byteOffset Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.
1576
- * @param encoding If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`.
1575
+ * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.
1576
+ * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`.
1577
1577
  * @return The index of the first occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`.
1578
1578
  */
1579
1579
  indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
@@ -1636,8 +1636,8 @@ declare module 'buffer' {
1636
1636
  * If `value` is an empty string or empty `Buffer`, `byteOffset` will be returned.
1637
1637
  * @since v6.0.0
1638
1638
  * @param value What to search for.
1639
- * @param byteOffset Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.
1640
- * @param encoding If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`.
1639
+ * @param [byteOffset=buf.length - 1] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.
1640
+ * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`.
1641
1641
  * @return The index of the last occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`.
1642
1642
  */
1643
1643
  lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
@@ -1687,8 +1687,8 @@ declare module 'buffer' {
1687
1687
  * ```
1688
1688
  * @since v5.3.0
1689
1689
  * @param value What to search for.
1690
- * @param byteOffset Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.
1691
- * @param encoding If `value` is a string, this is its encoding.
1690
+ * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.
1691
+ * @param [encoding='utf8'] If `value` is a string, this is its encoding.
1692
1692
  * @return `true` if `value` was found in `buf`, `false` otherwise.
1693
1693
  */
1694
1694
  includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean;
node/cluster.d.ts CHANGED
@@ -137,7 +137,7 @@ declare module 'cluster' {
137
137
  * In a worker, `process.kill()` exists, but it is not this function;
138
138
  * it is `kill()`.
139
139
  * @since v0.9.12
140
- * @param signal Name of the kill signal to send to the worker process.
140
+ * @param [signal='SIGTERM'] Name of the kill signal to send to the worker process.
141
141
  */
142
142
  kill(signal?: string): void;
143
143
  destroy(signal?: string): void;
node/crypto.d.ts CHANGED
@@ -1133,6 +1133,7 @@ declare module 'crypto' {
1133
1133
  *
1134
1134
  * The `cipher.setAutoPadding()` method must be called before `cipher.final()`.
1135
1135
  * @since v0.7.1
1136
+ * @param [autoPadding=true]
1136
1137
  * @return for method chaining.
1137
1138
  */
1138
1139
  setAutoPadding(autoPadding?: boolean): this;
@@ -1441,6 +1442,7 @@ declare module 'crypto' {
1441
1442
  *
1442
1443
  * The `decipher.setAutoPadding()` method must be called before `decipher.final()`.
1443
1444
  * @since v0.7.1
1445
+ * @param [autoPadding=true]
1444
1446
  * @return for method chaining.
1445
1447
  */
1446
1448
  setAutoPadding(auto_padding?: boolean): this;
@@ -1790,6 +1792,7 @@ declare module 'crypto' {
1790
1792
  * otherwise a number, `Buffer`, `TypedArray`, or `DataView` is expected.
1791
1793
  * @since v0.11.12
1792
1794
  * @param primeEncoding The `encoding` of the `prime` string.
1795
+ * @param [generator=2]
1793
1796
  * @param generatorEncoding The `encoding` of the `generator` string.
1794
1797
  */
1795
1798
  function createDiffieHellman(primeLength: number, generator?: number | NodeJS.ArrayBufferView): DiffieHellman;
@@ -2279,7 +2282,7 @@ declare module 'crypto' {
2279
2282
  * console.log(`The dice rolled: ${n}`);
2280
2283
  * ```
2281
2284
  * @since v14.10.0, v12.19.0
2282
- * @param min Start of random range (inclusive).
2285
+ * @param [min=0] Start of random range (inclusive).
2283
2286
  * @param max End of random range (exclusive).
2284
2287
  * @param callback `function(err, n) {}`.
2285
2288
  */
@@ -2359,6 +2362,8 @@ declare module 'crypto' {
2359
2362
  * ```
2360
2363
  * @since v7.10.0, v6.13.0
2361
2364
  * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`.
2365
+ * @param [offset=0]
2366
+ * @param [size=buffer.length - offset]
2362
2367
  * @return The object passed as `buffer` argument.
2363
2368
  */
2364
2369
  function randomFillSync<T extends NodeJS.ArrayBufferView>(buffer: T, offset?: number, size?: number): T;
@@ -2484,6 +2489,8 @@ declare module 'crypto' {
2484
2489
  * request.
2485
2490
  * @since v7.10.0, v6.13.0
2486
2491
  * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`.
2492
+ * @param [offset=0]
2493
+ * @param [size=buffer.length - offset]
2487
2494
  * @param callback `function(err, buf) {}`.
2488
2495
  */
2489
2496
  function randomFill<T extends NodeJS.ArrayBufferView>(buffer: T, callback: (err: Error | null, buf: T) => void): void;
@@ -2832,6 +2839,7 @@ declare module 'crypto' {
2832
2839
  * @since v10.0.0
2833
2840
  * @param inputEncoding The `encoding` of the `key` string.
2834
2841
  * @param outputEncoding The `encoding` of the return value.
2842
+ * @param [format='uncompressed']
2835
2843
  */
2836
2844
  static convertKey(
2837
2845
  key: BinaryLike,
@@ -2850,6 +2858,7 @@ declare module 'crypto' {
2850
2858
  * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned.
2851
2859
  * @since v0.11.14
2852
2860
  * @param encoding The `encoding` of the return value.
2861
+ * @param [format='uncompressed']
2853
2862
  */
2854
2863
  generateKeys(): Buffer;
2855
2864
  generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
@@ -2890,6 +2899,7 @@ declare module 'crypto' {
2890
2899
  * returned.
2891
2900
  * @since v0.11.14
2892
2901
  * @param encoding The `encoding` of the return value.
2902
+ * @param [format='uncompressed']
2893
2903
  * @return The EC Diffie-Hellman public key in the specified `encoding` and `format`.
2894
2904
  */
2895
2905
  getPublicKey(): Buffer;
node/dns/promises.d.ts CHANGED
@@ -122,7 +122,7 @@ declare module 'dns/promises' {
122
122
  * On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`.
123
123
  * @since v10.6.0
124
124
  * @param hostname Host name to resolve.
125
- * @param rrtype Resource record type.
125
+ * @param [rrtype='A'] Resource record type.
126
126
  */
127
127
  function resolve(hostname: string): Promise<string[]>;
128
128
  function resolve(hostname: string, rrtype: 'A'): Promise<string[]>;
node/dns.d.ts CHANGED
@@ -244,7 +244,7 @@ declare module 'dns' {
244
244
  * On error, `err` is an `Error` object, where `err.code` is one of the `DNS error codes`.
245
245
  * @since v0.1.27
246
246
  * @param hostname Host name to resolve.
247
- * @param rrtype Resource record type.
247
+ * @param [rrtype='A'] Resource record type.
248
248
  */
249
249
  export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
250
250
  export function resolve(hostname: string, rrtype: 'A', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
@@ -626,8 +626,8 @@ declare module 'dns' {
626
626
  * servers, and the v6 local address when making requests to IPv6 DNS servers.
627
627
  * The `rrtype` of resolution requests has no impact on the local address used.
628
628
  * @since v15.1.0
629
- * @param ipv4 A string representation of an IPv4 address.
630
- * @param ipv6 A string representation of an IPv6 address.
629
+ * @param [ipv4='0.0.0.0'] A string representation of an IPv4 address.
630
+ * @param [ipv6='::0'] A string representation of an IPv6 address.
631
631
  */
632
632
  setLocalAddress(ipv4?: string, ipv6?: string): void;
633
633
  setServers: typeof setServers;
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
@@ -516,6 +516,7 @@ declare module 'fs' {
516
516
  *
517
517
  * See the POSIX [`truncate(2)`](http://man7.org/linux/man-pages/man2/truncate.2.html) documentation for more details.
518
518
  * @since v0.8.6
519
+ * @param [len=0]
519
520
  */
520
521
  export function truncate(path: PathLike, len: number | undefined | null, callback: NoParamCallback): void;
521
522
  /**
@@ -538,6 +539,7 @@ declare module 'fs' {
538
539
  * Passing a file descriptor is deprecated and may result in an error being thrown
539
540
  * in the future.
540
541
  * @since v0.8.6
542
+ * @param [len=0]
541
543
  */
542
544
  export function truncateSync(path: PathLike, len?: number | null): void;
543
545
  /**
@@ -581,6 +583,7 @@ declare module 'fs' {
581
583
  *
582
584
  * If `len` is negative then `0` will be used.
583
585
  * @since v0.8.6
586
+ * @param [len=0]
584
587
  */
585
588
  export function ftruncate(fd: number, len: number | undefined | null, callback: NoParamCallback): void;
586
589
  /**
@@ -602,6 +605,7 @@ declare module 'fs' {
602
605
  * For detailed information, see the documentation of the asynchronous version of
603
606
  * this API: {@link ftruncate}.
604
607
  * @since v0.8.6
608
+ * @param [len=0]
605
609
  */
606
610
  export function ftruncateSync(fd: number, len?: number | null): void;
607
611
  /**
@@ -1952,7 +1956,8 @@ declare module 'fs' {
1952
1956
  *
1953
1957
  * Functions based on `fs.open()` exhibit this behavior as well:`fs.writeFile()`, `fs.readFile()`, etc.
1954
1958
  * @since v0.0.2
1955
- * @param flags See `support of file system `flags``.
1959
+ * @param [flags='r'] See `support of file system `flags``.
1960
+ * @param [mode=0o666]
1956
1961
  */
1957
1962
  export function open(path: PathLike, flags: OpenMode, mode: Mode | undefined | null, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
1958
1963
  /**
@@ -1974,6 +1979,8 @@ declare module 'fs' {
1974
1979
  * For detailed information, see the documentation of the asynchronous version of
1975
1980
  * this API: {@link open}.
1976
1981
  * @since v0.1.21
1982
+ * @param [flags='r']
1983
+ * @param [mode=0o666]
1977
1984
  */
1978
1985
  export function openSync(path: PathLike, flags: OpenMode, mode?: Mode | null): number;
1979
1986
  /**
@@ -2196,9 +2203,9 @@ declare module 'fs' {
2196
2203
  * If this method is invoked as its `util.promisify()` ed version, it returns
2197
2204
  * a promise for an `Object` with `bytesRead` and `buffer` properties.
2198
2205
  * @since v0.0.2
2199
- * @param buffer The buffer that the data will be written to.
2200
- * @param offset The position in `buffer` to write the data to.
2201
- * @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.
2202
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
2203
2210
  * `position` is an integer, the file position will be unchanged.
2204
2211
  */
@@ -2347,7 +2354,7 @@ declare module 'fs' {
2347
2354
  encoding: BufferEncoding;
2348
2355
  flag?: string | undefined;
2349
2356
  } & Abortable)
2350
- | string,
2357
+ | BufferEncoding,
2351
2358
  callback: (err: NodeJS.ErrnoException | null, data: string) => void
2352
2359
  ): void;
2353
2360
  /**
@@ -2363,7 +2370,7 @@ declare module 'fs' {
2363
2370
  | (ObjectEncodingOptions & {
2364
2371
  flag?: string | undefined;
2365
2372
  } & Abortable)
2366
- | string
2373
+ | BufferEncoding
2367
2374
  | undefined
2368
2375
  | null,
2369
2376
  callback: (err: NodeJS.ErrnoException | null, data: string | Buffer) => void
@@ -2404,7 +2411,7 @@ declare module 'fs' {
2404
2411
  encoding: BufferEncoding;
2405
2412
  flag?: string | undefined;
2406
2413
  }
2407
- | string
2414
+ | BufferEncoding
2408
2415
  ): Promise<string>;
2409
2416
  /**
2410
2417
  * Asynchronously reads the entire contents of a file.
@@ -2420,7 +2427,7 @@ declare module 'fs' {
2420
2427
  | (ObjectEncodingOptions & {
2421
2428
  flag?: string | undefined;
2422
2429
  })
2423
- | string
2430
+ | BufferEncoding
2424
2431
  | null
2425
2432
  ): Promise<string | Buffer>;
2426
2433
  }
@@ -2493,7 +2500,7 @@ declare module 'fs' {
2493
2500
  mode?: Mode | undefined;
2494
2501
  flag?: string | undefined;
2495
2502
  })
2496
- | string
2503
+ | BufferEncoding
2497
2504
  | null;
2498
2505
  /**
2499
2506
  * When `file` is a filename, asynchronously writes data to the file, replacing the
@@ -2803,6 +2810,7 @@ declare module 'fs' {
2803
2810
  * If a `signal` is passed, aborting the corresponding AbortController will close
2804
2811
  * the returned `<fs.FSWatcher>`.
2805
2812
  * @since v0.5.10
2813
+ * @param listener
2806
2814
  */
2807
2815
  export function watch(
2808
2816
  filename: PathLike,
@@ -3268,6 +3276,7 @@ declare module 'fs' {
3268
3276
  * ACL and therefore may report that a path is accessible even if the ACL restricts
3269
3277
  * the user from reading or writing to it.
3270
3278
  * @since v0.11.15
3279
+ * @param [mode=fs.constants.F_OK]
3271
3280
  */
3272
3281
  export function access(path: PathLike, mode: number | undefined, callback: NoParamCallback): void;
3273
3282
  /**
@@ -3305,6 +3314,7 @@ declare module 'fs' {
3305
3314
  * }
3306
3315
  * ```
3307
3316
  * @since v0.11.15
3317
+ * @param [mode=fs.constants.F_OK]
3308
3318
  */
3309
3319
  export function accessSync(path: PathLike, mode?: number): void;
3310
3320
  interface StreamOptions {
@@ -3387,7 +3397,7 @@ declare module 'fs' {
3387
3397
  * @since v0.1.31
3388
3398
  * @return See `Readable Stream`.
3389
3399
  */
3390
- export function createReadStream(path: PathLike, options?: string | ReadStreamOptions): ReadStream;
3400
+ export function createReadStream(path: PathLike, options?: BufferEncoding | ReadStreamOptions): ReadStream;
3391
3401
  /**
3392
3402
  * `options` may also include a `start` option to allow writing data at some
3393
3403
  * position past the beginning of the file, allowed values are in the
@@ -3415,7 +3425,7 @@ declare module 'fs' {
3415
3425
  * @since v0.1.31
3416
3426
  * @return See `Writable Stream`.
3417
3427
  */
3418
- export function createWriteStream(path: PathLike, options?: string | StreamOptions): WriteStream;
3428
+ export function createWriteStream(path: PathLike, options?: BufferEncoding | StreamOptions): WriteStream;
3419
3429
  /**
3420
3430
  * Forces all currently queued I/O operations associated with the file to the
3421
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
@@ -3474,7 +3484,7 @@ declare module 'fs' {
3474
3484
  * @since v8.5.0
3475
3485
  * @param src source filename to copy
3476
3486
  * @param dest destination filename of the copy operation
3477
- * @param mode modifiers for copy operation.
3487
+ * @param [mode=0] modifiers for copy operation.
3478
3488
  */
3479
3489
  export function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void;
3480
3490
  export function copyFile(src: PathLike, dest: PathLike, mode: number, callback: NoParamCallback): void;
@@ -3513,7 +3523,7 @@ declare module 'fs' {
3513
3523
  * @since v8.5.0
3514
3524
  * @param src source filename to copy
3515
3525
  * @param dest destination filename of the copy operation
3516
- * @param mode modifiers for copy operation.
3526
+ * @param [mode=0] modifiers for copy operation.
3517
3527
  */
3518
3528
  export function copyFileSync(src: PathLike, dest: PathLike, mode?: number): void;
3519
3529
  /**
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;
node/index.d.ts CHANGED
@@ -42,6 +42,7 @@
42
42
  // Victor Perin <https://github.com/victorperin>
43
43
  // Yongsheng Zhang <https://github.com/ZYSzys>
44
44
  // NodeJS Contributors <https://github.com/NodeJS>
45
+ // Linus Unnebäck <https://github.com/LinusU>
45
46
  // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
46
47
 
47
48
  /**
node/net.d.ts CHANGED
@@ -87,7 +87,7 @@ declare module 'net' {
87
87
  * See `Writable` stream `write()` method for more
88
88
  * information.
89
89
  * @since v0.1.90
90
- * @param encoding Only used when data is `string`.
90
+ * @param [encoding='utf8'] Only used when data is `string`.
91
91
  */
92
92
  write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean;
93
93
  write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error) => void): boolean;
@@ -165,6 +165,7 @@ declare module 'net' {
165
165
  * algorithm for the socket. Passing `false` for `noDelay` will enable Nagle's
166
166
  * algorithm.
167
167
  * @since v0.1.90
168
+ * @param [noDelay=true]
168
169
  * @return The socket itself.
169
170
  */
170
171
  setNoDelay(noDelay?: boolean): this;
@@ -183,6 +184,8 @@ declare module 'net' {
183
184
  * * `TCP_KEEPCNT=10`
184
185
  * * `TCP_KEEPINTVL=1`
185
186
  * @since v0.1.92
187
+ * @param [enable=false]
188
+ * @param [initialDelay=0]
186
189
  * @return The socket itself.
187
190
  */
188
191
  setKeepAlive(enable?: boolean, initialDelay?: number): this;
@@ -280,7 +283,7 @@ declare module 'net' {
280
283
  *
281
284
  * See `writable.end()` for further details.
282
285
  * @since v0.1.90
283
- * @param encoding Only used when data is `string`.
286
+ * @param [encoding='utf8'] Only used when data is `string`.
284
287
  * @param callback Optional callback for when the socket is finished.
285
288
  * @return The socket itself.
286
289
  */
@@ -306,6 +309,7 @@ declare module 'net' {
306
309
  addListener(event: 'end', listener: () => void): this;
307
310
  addListener(event: 'error', listener: (err: Error) => void): this;
308
311
  addListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this;
312
+ addListener(event: 'ready', listener: () => void): this;
309
313
  addListener(event: 'timeout', listener: () => void): this;
310
314
  emit(event: string | symbol, ...args: any[]): boolean;
311
315
  emit(event: 'close', hadError: boolean): boolean;
@@ -315,6 +319,7 @@ declare module 'net' {
315
319
  emit(event: 'end'): boolean;
316
320
  emit(event: 'error', err: Error): boolean;
317
321
  emit(event: 'lookup', err: Error, address: string, family: string | number, host: string): boolean;
322
+ emit(event: 'ready'): boolean;
318
323
  emit(event: 'timeout'): boolean;
319
324
  on(event: string, listener: (...args: any[]) => void): this;
320
325
  on(event: 'close', listener: (hadError: boolean) => void): this;
@@ -324,6 +329,7 @@ declare module 'net' {
324
329
  on(event: 'end', listener: () => void): this;
325
330
  on(event: 'error', listener: (err: Error) => void): this;
326
331
  on(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this;
332
+ on(event: 'ready', listener: () => void): this;
327
333
  on(event: 'timeout', listener: () => void): this;
328
334
  once(event: string, listener: (...args: any[]) => void): this;
329
335
  once(event: 'close', listener: (hadError: boolean) => void): this;
@@ -333,6 +339,7 @@ declare module 'net' {
333
339
  once(event: 'end', listener: () => void): this;
334
340
  once(event: 'error', listener: (err: Error) => void): this;
335
341
  once(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this;
342
+ once(event: 'ready', listener: () => void): this;
336
343
  once(event: 'timeout', listener: () => void): this;
337
344
  prependListener(event: string, listener: (...args: any[]) => void): this;
338
345
  prependListener(event: 'close', listener: (hadError: boolean) => void): this;
@@ -342,6 +349,7 @@ declare module 'net' {
342
349
  prependListener(event: 'end', listener: () => void): this;
343
350
  prependListener(event: 'error', listener: (err: Error) => void): this;
344
351
  prependListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this;
352
+ prependListener(event: 'ready', listener: () => void): this;
345
353
  prependListener(event: 'timeout', listener: () => void): this;
346
354
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
347
355
  prependOnceListener(event: 'close', listener: (hadError: boolean) => void): this;
@@ -351,6 +359,7 @@ declare module 'net' {
351
359
  prependOnceListener(event: 'end', listener: () => void): this;
352
360
  prependOnceListener(event: 'error', listener: (err: Error) => void): this;
353
361
  prependOnceListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this;
362
+ prependOnceListener(event: 'ready', listener: () => void): this;
354
363
  prependOnceListener(event: 'timeout', listener: () => void): this;
355
364
  }
356
365
  interface ListenOptions extends Abortable {
@@ -558,7 +567,7 @@ declare module 'net' {
558
567
  * Adds a rule to block the given IP address.
559
568
  * @since v15.0.0
560
569
  * @param address An IPv4 or IPv6 address.
561
- * @param type Either `'ipv4'` or `'ipv6'`.
570
+ * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
562
571
  */
563
572
  addAddress(address: string, type?: IPVersion): void;
564
573
  addAddress(address: SocketAddress): void;
@@ -567,7 +576,7 @@ declare module 'net' {
567
576
  * @since v15.0.0
568
577
  * @param start The starting IPv4 or IPv6 address in the range.
569
578
  * @param end The ending IPv4 or IPv6 address in the range.
570
- * @param type Either `'ipv4'` or `'ipv6'`.
579
+ * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
571
580
  */
572
581
  addRange(start: string, end: string, type?: IPVersion): void;
573
582
  addRange(start: SocketAddress, end: SocketAddress): void;
@@ -576,7 +585,7 @@ declare module 'net' {
576
585
  * @since v15.0.0
577
586
  * @param net The network IPv4 or IPv6 address.
578
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`.
579
- * @param type Either `'ipv4'` or `'ipv6'`.
588
+ * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
580
589
  */
581
590
  addSubnet(net: SocketAddress, prefix: number): void;
582
591
  addSubnet(net: string, prefix: number, type?: IPVersion): void;
@@ -599,7 +608,7 @@ declare module 'net' {
599
608
  * ```
600
609
  * @since v15.0.0
601
610
  * @param address The IP address to check
602
- * @param type Either `'ipv4'` or `'ipv6'`.
611
+ * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
603
612
  */
604
613
  check(address: SocketAddress): boolean;
605
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.7",
3
+ "version": "16.4.11",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -214,6 +214,11 @@
214
214
  "name": "NodeJS Contributors",
215
215
  "url": "https://github.com/NodeJS",
216
216
  "githubUsername": "NodeJS"
217
+ },
218
+ {
219
+ "name": "Linus Unnebäck",
220
+ "url": "https://github.com/LinusU",
221
+ "githubUsername": "LinusU"
217
222
  }
218
223
  ],
219
224
  "main": "",
@@ -232,6 +237,6 @@
232
237
  },
233
238
  "scripts": {},
234
239
  "dependencies": {},
235
- "typesPublisherContentHash": "15db94446f7f1e160948be1b1ecb14684eef4f4a29dc0fd41a570f2f071209d1",
240
+ "typesPublisherContentHash": "893f047790f417f590b7efe0927ac74b4ba3c14be787d1ec6ba9476effb7c83c",
236
241
  "typeScriptVersion": "3.6"
237
242
  }
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
  /**
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
@@ -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
  /**
node/tty.d.ts CHANGED
@@ -149,7 +149,7 @@ declare module 'tty' {
149
149
  *
150
150
  * Disabling color support is also possible by using the `NO_COLOR` and`NODE_DISABLE_COLORS` environment variables.
151
151
  * @since v9.9.0
152
- * @param env An object containing the environment variables to check. This enables simulating the usage of a specific terminal.
152
+ * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal.
153
153
  */
154
154
  getColorDepth(env?: object): number;
155
155
  /**
@@ -169,8 +169,8 @@ declare module 'tty' {
169
169
  * // Returns false (the environment setting pretends to support 2 ** 8 colors).
170
170
  * ```
171
171
  * @since v11.13.0, v10.16.0
172
- * @param count The number of colors that are requested (minimum 2).
173
- * @param env An object containing the environment variables to check. This enables simulating the usage of a specific terminal.
172
+ * @param [count=16] The number of colors that are requested (minimum 2).
173
+ * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal.
174
174
  */
175
175
  hasColors(count?: number): boolean;
176
176
  hasColors(env?: object): boolean;
node/url.d.ts CHANGED
@@ -65,10 +65,10 @@ declare module 'url' {
65
65
  * @since v0.1.25
66
66
  * @deprecated Legacy: Use the WHATWG URL API instead.
67
67
  * @param urlString The URL string to parse.
68
- * @param parseQueryString If `true`, the `query` property will always be set to an object returned by the {@link querystring} module's `parse()` method. If `false`, the `query` property on the
69
- * returned URL object will be an unparsed, undecoded string.
70
- * @param slashesDenoteHost If `true`, the first token after the literal string `//` and preceding the next `/` will be interpreted as the `host`. For instance, given `//foo/bar`, the result
71
- * would be `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`.
68
+ * @param [parseQueryString=false] If `true`, the `query` property will always be set to an object returned by the {@link querystring} module's `parse()` method. If `false`, the `query` property
69
+ * on the returned URL object will be an unparsed, undecoded string.
70
+ * @param [slashesDenoteHost=false] If `true`, the first token after the literal string `//` and preceding the next `/` will be interpreted as the `host`. For instance, given `//foo/bar`, the
71
+ * result would be `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`.
72
72
  */
73
73
  function parse(urlString: string): UrlWithStringQuery;
74
74
  function parse(urlString: string, parseQueryString: false | undefined, slashesDenoteHost?: boolean): UrlWithStringQuery;
node/util.d.ts CHANGED
@@ -1038,7 +1038,7 @@ declare module 'util' {
1038
1038
  /**
1039
1039
  * UTF-8 encodes the `input` string and returns a `Uint8Array` containing the
1040
1040
  * encoded bytes.
1041
- * @param input The text to encode.
1041
+ * @param [input='an empty string'] The text to encode.
1042
1042
  */
1043
1043
  encode(input?: string): Uint8Array;
1044
1044
  /**