@types/node 20.15.0 → 20.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. {node v20.15 → node v20.16}/README.md +1 -1
  2. {node v20.15 → node v20.16}/buffer.d.ts +12 -0
  3. {node v20.15 → node v20.16}/package.json +3 -3
  4. {node v20.15 → node v20.16}/process.d.ts +143 -17
  5. {node v20.15 → node v20.16}/test.d.ts +19 -6
  6. {node v20.15 → node v20.16}/util.d.ts +6 -0
  7. {node v20.15 → node v20.16}/LICENSE +0 -0
  8. {node v20.15 → node v20.16}/assert/strict.d.ts +0 -0
  9. {node v20.15 → node v20.16}/assert.d.ts +0 -0
  10. {node v20.15 → node v20.16}/async_hooks.d.ts +0 -0
  11. {node v20.15 → node v20.16}/child_process.d.ts +0 -0
  12. {node v20.15 → node v20.16}/cluster.d.ts +0 -0
  13. {node v20.15 → node v20.16}/console.d.ts +0 -0
  14. {node v20.15 → node v20.16}/constants.d.ts +0 -0
  15. {node v20.15 → node v20.16}/crypto.d.ts +0 -0
  16. {node v20.15 → node v20.16}/dgram.d.ts +0 -0
  17. {node v20.15 → node v20.16}/diagnostics_channel.d.ts +0 -0
  18. {node v20.15 → node v20.16}/dns/promises.d.ts +0 -0
  19. {node v20.15 → node v20.16}/dns.d.ts +0 -0
  20. {node v20.15 → node v20.16}/dom-events.d.ts +0 -0
  21. {node v20.15 → node v20.16}/domain.d.ts +0 -0
  22. {node v20.15 → node v20.16}/events.d.ts +0 -0
  23. {node v20.15 → node v20.16}/fs/promises.d.ts +0 -0
  24. {node v20.15 → node v20.16}/fs.d.ts +0 -0
  25. {node v20.15 → node v20.16}/globals.d.ts +0 -0
  26. {node v20.15 → node v20.16}/globals.global.d.ts +0 -0
  27. {node v20.15 → node v20.16}/http.d.ts +0 -0
  28. {node v20.15 → node v20.16}/http2.d.ts +0 -0
  29. {node v20.15 → node v20.16}/https.d.ts +0 -0
  30. {node v20.15 → node v20.16}/index.d.ts +0 -0
  31. {node v20.15 → node v20.16}/inspector.d.ts +0 -0
  32. {node v20.15 → node v20.16}/module.d.ts +0 -0
  33. {node v20.15 → node v20.16}/net.d.ts +0 -0
  34. {node v20.15 → node v20.16}/os.d.ts +0 -0
  35. {node v20.15 → node v20.16}/path.d.ts +0 -0
  36. {node v20.15 → node v20.16}/perf_hooks.d.ts +0 -0
  37. {node v20.15 → node v20.16}/punycode.d.ts +0 -0
  38. {node v20.15 → node v20.16}/querystring.d.ts +0 -0
  39. {node v20.15 → node v20.16}/readline/promises.d.ts +0 -0
  40. {node v20.15 → node v20.16}/readline.d.ts +0 -0
  41. {node v20.15 → node v20.16}/repl.d.ts +0 -0
  42. {node v20.15 → node v20.16}/sea.d.ts +0 -0
  43. {node v20.15 → node v20.16}/stream/consumers.d.ts +0 -0
  44. {node v20.15 → node v20.16}/stream/promises.d.ts +0 -0
  45. {node v20.15 → node v20.16}/stream/web.d.ts +0 -0
  46. {node v20.15 → node v20.16}/stream.d.ts +0 -0
  47. {node v20.15 → node v20.16}/string_decoder.d.ts +0 -0
  48. {node v20.15 → node v20.16}/timers/promises.d.ts +0 -0
  49. {node v20.15 → node v20.16}/timers.d.ts +0 -0
  50. {node v20.15 → node v20.16}/tls.d.ts +0 -0
  51. {node v20.15 → node v20.16}/trace_events.d.ts +0 -0
  52. {node v20.15 → node v20.16}/tty.d.ts +0 -0
  53. {node v20.15 → node v20.16}/url.d.ts +0 -0
  54. {node v20.15 → node v20.16}/v8.d.ts +0 -0
  55. {node v20.15 → node v20.16}/vm.d.ts +0 -0
  56. {node v20.15 → node v20.16}/wasi.d.ts +0 -0
  57. {node v20.15 → node v20.16}/worker_threads.d.ts +0 -0
  58. {node v20.15 → node v20.16}/zlib.d.ts +0 -0
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v20.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Fri, 16 Aug 2024 18:09:07 GMT
11
+ * Last updated: Mon, 19 Aug 2024 02:45:10 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
@@ -170,6 +170,18 @@ declare module "buffer" {
170
170
  * @since v15.7.0, v14.18.0
171
171
  */
172
172
  arrayBuffer(): Promise<ArrayBuffer>;
173
+ /**
174
+ * The `blob.bytes()` method returns the byte of the `Blob` object as a `Promise<Uint8Array>`.
175
+ *
176
+ * ```js
177
+ * const blob = new Blob(['hello']);
178
+ * blob.bytes().then((bytes) => {
179
+ * console.log(bytes); // Outputs: Uint8Array(5) [ 104, 101, 108, 108, 111 ]
180
+ * });
181
+ * ```
182
+ * @since v20.16.0
183
+ */
184
+ bytes(): Promise<Uint8Array>;
173
185
  /**
174
186
  * Creates and returns a new `Blob` containing a subset of this `Blob` objects
175
187
  * data. The original `Blob` is not altered.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "20.15.0",
3
+ "version": "20.16.1",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -210,8 +210,8 @@
210
210
  },
211
211
  "scripts": {},
212
212
  "dependencies": {
213
- "undici-types": "~6.13.0"
213
+ "undici-types": "~6.19.2"
214
214
  },
215
- "typesPublisherContentHash": "05c96cc6164ffac54523a987511995996b7543e44ab3bc3c65d7ee41452cae81",
215
+ "typesPublisherContentHash": "23269633633d0c39ffe71f0bf8b54a4ac3382fcfca61cb727c06e71494d2244b",
216
216
  "typeScriptVersion": "4.8"
217
217
  }
@@ -1,8 +1,122 @@
1
1
  declare module "process" {
2
- import * as net from "node:net";
3
- import * as os from "node:os";
4
2
  import * as tty from "node:tty";
5
3
  import { Worker } from "node:worker_threads";
4
+
5
+ interface BuiltInModule {
6
+ "assert": typeof import("assert");
7
+ "node:assert": typeof import("node:assert");
8
+ "assert/strict": typeof import("assert/strict");
9
+ "node:assert/strict": typeof import("node:assert/strict");
10
+ "async_hooks": typeof import("async_hooks");
11
+ "node:async_hooks": typeof import("node:async_hooks");
12
+ "buffer": typeof import("buffer");
13
+ "node:buffer": typeof import("node:buffer");
14
+ "child_process": typeof import("child_process");
15
+ "node:child_process": typeof import("node:child_process");
16
+ "cluster": typeof import("cluster");
17
+ "node:cluster": typeof import("node:cluster");
18
+ "console": typeof import("console");
19
+ "node:console": typeof import("node:console");
20
+ "constants": typeof import("constants");
21
+ "node:constants": typeof import("node:constants");
22
+ "crypto": typeof import("crypto");
23
+ "node:crypto": typeof import("node:crypto");
24
+ "dgram": typeof import("dgram");
25
+ "node:dgram": typeof import("node:dgram");
26
+ "diagnostics_channel": typeof import("diagnostics_channel");
27
+ "node:diagnostics_channel": typeof import("node:diagnostics_channel");
28
+ "dns": typeof import("dns");
29
+ "node:dns": typeof import("node:dns");
30
+ "dns/promises": typeof import("dns/promises");
31
+ "node:dns/promises": typeof import("node:dns/promises");
32
+ "domain": typeof import("domain");
33
+ "node:domain": typeof import("node:domain");
34
+ "events": typeof import("events");
35
+ "node:events": typeof import("node:events");
36
+ "fs": typeof import("fs");
37
+ "node:fs": typeof import("node:fs");
38
+ "fs/promises": typeof import("fs/promises");
39
+ "node:fs/promises": typeof import("node:fs/promises");
40
+ "http": typeof import("http");
41
+ "node:http": typeof import("node:http");
42
+ "http2": typeof import("http2");
43
+ "node:http2": typeof import("node:http2");
44
+ "https": typeof import("https");
45
+ "node:https": typeof import("node:https");
46
+ "inspector": typeof import("inspector");
47
+ "node:inspector": typeof import("node:inspector");
48
+ // FIXME: module is missed
49
+ // "inspector/promises": typeof import("inspector/promises");
50
+ // "node:inspector/promises": typeof import("node:inspector/promises");
51
+ "module": typeof import("module");
52
+ "node:module": typeof import("node:module");
53
+ "net": typeof import("net");
54
+ "node:net": typeof import("node:net");
55
+ "os": typeof import("os");
56
+ "node:os": typeof import("node:os");
57
+ "path": typeof import("path");
58
+ "node:path": typeof import("node:path");
59
+ "path/posix": typeof import("path/posix");
60
+ "node:path/posix": typeof import("node:path/posix");
61
+ "path/win32": typeof import("path/win32");
62
+ "node:path/win32": typeof import("node:path/win32");
63
+ "perf_hooks": typeof import("perf_hooks");
64
+ "node:perf_hooks": typeof import("node:perf_hooks");
65
+ "process": typeof import("process");
66
+ "node:process": typeof import("node:process");
67
+ "punycode": typeof import("punycode");
68
+ "node:punycode": typeof import("node:punycode");
69
+ "querystring": typeof import("querystring");
70
+ "node:querystring": typeof import("node:querystring");
71
+ "readline": typeof import("readline");
72
+ "node:readline": typeof import("node:readline");
73
+ "readline/promises": typeof import("readline/promises");
74
+ "node:readline/promises": typeof import("node:readline/promises");
75
+ "repl": typeof import("repl");
76
+ "node:repl": typeof import("node:repl");
77
+ "node:sea": typeof import("node:sea");
78
+ "stream": typeof import("stream");
79
+ "node:stream": typeof import("node:stream");
80
+ "stream/consumers": typeof import("stream/consumers");
81
+ "node:stream/consumers": typeof import("node:stream/consumers");
82
+ "stream/promises": typeof import("stream/promises");
83
+ "node:stream/promises": typeof import("node:stream/promises");
84
+ "stream/web": typeof import("stream/web");
85
+ "node:stream/web": typeof import("node:stream/web");
86
+ "string_decoder": typeof import("string_decoder");
87
+ "node:string_decoder": typeof import("node:string_decoder");
88
+ "node:test": typeof import("node:test");
89
+ "node:test/reporters": typeof import("node:test/reporters");
90
+ "timers": typeof import("timers");
91
+ "node:timers": typeof import("node:timers");
92
+ "timers/promises": typeof import("timers/promises");
93
+ "node:timers/promises": typeof import("node:timers/promises");
94
+ "tls": typeof import("tls");
95
+ "node:tls": typeof import("node:tls");
96
+ "trace_events": typeof import("trace_events");
97
+ "node:trace_events": typeof import("node:trace_events");
98
+ "tty": typeof import("tty");
99
+ "node:tty": typeof import("node:tty");
100
+ "url": typeof import("url");
101
+ "node:url": typeof import("node:url");
102
+ "util": typeof import("util");
103
+ "node:util": typeof import("node:util");
104
+ "sys": typeof import("util");
105
+ "node:sys": typeof import("node:util");
106
+ "util/types": typeof import("util/types");
107
+ "node:util/types": typeof import("node:util/types");
108
+ "v8": typeof import("v8");
109
+ "node:v8": typeof import("node:v8");
110
+ "vm": typeof import("vm");
111
+ "node:vm": typeof import("node:vm");
112
+ "wasi": typeof import("wasi");
113
+ "node:wasi": typeof import("node:wasi");
114
+ "worker_threads": typeof import("worker_threads");
115
+ "node:worker_threads": typeof import("node:worker_threads");
116
+ "zlib": typeof import("zlib");
117
+ "node:zlib": typeof import("node:zlib");
118
+ }
119
+
6
120
  global {
7
121
  var process: NodeJS.Process;
8
122
  namespace NodeJS {
@@ -209,24 +323,28 @@ declare module "process" {
209
323
  has(scope: string, reference?: string): boolean;
210
324
  }
211
325
  interface ProcessReport {
326
+ /**
327
+ * Write reports in a compact format, single-line JSON, more easily consumable by log processing systems
328
+ * than the default multi-line format designed for human consumption.
329
+ * @since v13.12.0, v12.17.0
330
+ */
331
+ compact: boolean;
212
332
  /**
213
333
  * Directory where the report is written.
334
+ * The default value is the empty string, indicating that reports are written to the current
214
335
  * working directory of the Node.js process.
215
- * @default '' indicating that reports are written to the current
216
336
  */
217
337
  directory: string;
218
338
  /**
219
- * Filename where the report is written.
220
- * The default value is the empty string.
221
- * @default '' the output filename will be comprised of a timestamp,
222
- * PID, and sequence number.
339
+ * Filename where the report is written. If set to the empty string, the output filename will be comprised
340
+ * of a timestamp, PID, and sequence number. The default value is the empty string.
223
341
  */
224
342
  filename: string;
225
343
  /**
226
- * Returns a JSON-formatted diagnostic report for the running process.
227
- * The report's JavaScript stack trace is taken from err, if present.
344
+ * Returns a JavaScript Object representation of a diagnostic report for the running process.
345
+ * The report's JavaScript stack trace is taken from `err`, if present.
228
346
  */
229
- getReport(err?: Error): string;
347
+ getReport(err?: Error): object;
230
348
  /**
231
349
  * If true, a diagnostic report is generated on fatal errors,
232
350
  * such as out of memory errors or failed C++ assertions.
@@ -252,18 +370,19 @@ declare module "process" {
252
370
  /**
253
371
  * Writes a diagnostic report to a file. If filename is not provided, the default filename
254
372
  * includes the date, time, PID, and a sequence number.
255
- * The report's JavaScript stack trace is taken from err, if present.
373
+ * The report's JavaScript stack trace is taken from `err`, if present.
256
374
  *
375
+ * If the value of filename is set to `'stdout'` or `'stderr'`, the report is written
376
+ * to the stdout or stderr of the process respectively.
257
377
  * @param fileName Name of the file where the report is written.
258
378
  * This should be a relative path, that will be appended to the directory specified in
259
379
  * `process.report.directory`, or the current working directory of the Node.js process,
260
380
  * if unspecified.
261
- * @param error A custom error used for reporting the JavaScript stack.
381
+ * @param err A custom error used for reporting the JavaScript stack.
262
382
  * @return Filename of the generated report.
263
383
  */
264
- writeReport(fileName?: string): string;
265
- writeReport(error?: Error): string;
266
384
  writeReport(fileName?: string, err?: Error): string;
385
+ writeReport(err?: Error): string;
267
386
  }
268
387
  interface ResourceUsage {
269
388
  fsRead: number;
@@ -793,6 +912,13 @@ declare module "process" {
793
912
  * @since v17.3.0, v16.14.0
794
913
  */
795
914
  getActiveResourcesInfo(): string[];
915
+ /**
916
+ * Provides a way to load built-in modules in a globally available function.
917
+ * @param id ID of the built-in module being requested.
918
+ * @since v20.16.0
919
+ */
920
+ getBuiltinModule<ID extends keyof BuiltInModule>(id: ID): BuiltInModule[ID];
921
+ getBuiltinModule(id: string): object | undefined;
796
922
  /**
797
923
  * The `process.getgid()` method returns the numerical group identity of the
798
924
  * process. (See [`getgid(2)`](http://man7.org/linux/man-pages/man2/getgid.2.html).)
@@ -1585,11 +1711,11 @@ declare module "process" {
1585
1711
  */
1586
1712
  allowedNodeEnvironmentFlags: ReadonlySet<string>;
1587
1713
  /**
1588
- * `process.report` is an object whose methods are used to generate diagnostic
1589
- * reports for the current process. Additional documentation is available in the `report documentation`.
1714
+ * `process.report` is an object whose methods are used to generate diagnostic reports for the current process.
1715
+ * Additional documentation is available in the [report documentation](https://nodejs.org/docs/latest-v20.x/api/report.html).
1590
1716
  * @since v11.8.0
1591
1717
  */
1592
- report?: ProcessReport | undefined;
1718
+ report: ProcessReport;
1593
1719
  /**
1594
1720
  * ```js
1595
1721
  * import { resourceUsage } from 'node:process';
@@ -500,6 +500,11 @@ declare module "node:test" {
500
500
  * @param message Message to be reported.
501
501
  */
502
502
  diagnostic(message: string): void;
503
+ /**
504
+ * The name of the test and each of its ancestors, separated by `>`.
505
+ * @since v20.16.0
506
+ */
507
+ readonly fullName: string;
503
508
  /**
504
509
  * The name of the test.
505
510
  * @since v18.8.0, v16.18.0
@@ -1826,27 +1831,35 @@ declare module "node:test/reporters" {
1826
1831
  * The `dot` reporter outputs the test results in a compact format,
1827
1832
  * where each passing test is represented by a `.`,
1828
1833
  * and each failing test is represented by a `X`.
1834
+ * @since v20.0.0
1829
1835
  */
1830
1836
  function dot(source: TestEventGenerator): AsyncGenerator<"\n" | "." | "X", void>;
1831
1837
  /**
1832
1838
  * The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format.
1839
+ * @since v20.0.0
1833
1840
  */
1834
1841
  function tap(source: TestEventGenerator): AsyncGenerator<string, void>;
1835
1842
  /**
1836
1843
  * The `spec` reporter outputs the test results in a human-readable format.
1844
+ * @since v20.0.0
1837
1845
  */
1838
- class Spec extends Transform {
1846
+ class SpecReporter extends Transform {
1839
1847
  constructor();
1840
1848
  }
1841
1849
  /**
1842
1850
  * The `junit` reporter outputs test results in a jUnit XML format.
1851
+ * @since v21.0.0
1843
1852
  */
1844
1853
  function junit(source: TestEventGenerator): AsyncGenerator<string, void>;
1854
+ class LcovReporter extends Transform {
1855
+ constructor(opts?: Omit<TransformOptions, "writableObjectMode">);
1856
+ }
1845
1857
  /**
1846
- * The `lcov` reporter outputs test coverage when used with the [`--experimental-test-coverage`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--experimental-test-coverage) flag.
1858
+ * The `lcov` reporter outputs test coverage when used with the
1859
+ * [`--experimental-test-coverage`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--experimental-test-coverage) flag.
1860
+ * @since v22.0.0
1847
1861
  */
1848
- class Lcov extends Transform {
1849
- constructor(opts?: TransformOptions);
1850
- }
1851
- export { dot, junit, Lcov as lcov, Spec as spec, tap, TestEvent };
1862
+ const lcov: LcovReporter;
1863
+
1864
+ export { dot, junit, lcov, SpecReporter as spec, tap, TestEvent };
1852
1865
  }
@@ -1480,6 +1480,12 @@ declare module "util" {
1480
1480
  * Whether this command accepts positional arguments.
1481
1481
  */
1482
1482
  allowPositionals?: boolean | undefined;
1483
+ /**
1484
+ * If `true`, allows explicitly setting boolean options to `false` by prefixing the option name with `--no-`.
1485
+ * @default false
1486
+ * @since v20.16.0
1487
+ */
1488
+ allowNegative?: boolean | undefined;
1483
1489
  /**
1484
1490
  * Return the parsed tokens. This is useful for extending the built-in behavior,
1485
1491
  * from adding additional checks through to reprocessing the tokens in different ways.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes