@types/node 20.16.0 → 20.16.2

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "20.16.0",
3
+ "version": "20.16.2",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -212,6 +212,6 @@
212
212
  "dependencies": {
213
213
  "undici-types": "~6.19.2"
214
214
  },
215
- "typesPublisherContentHash": "ec5293eb52c87d6b8fbd3eaa5df2b64ce6e26111fc4e85e9eea24132add60f9e",
215
+ "typesPublisherContentHash": "bfa190547a4fe06159207f447a2b225d7ee753bec878cab8292ade89f64f3a06",
216
216
  "typeScriptVersion": "4.8"
217
217
  }
@@ -45,9 +45,8 @@ declare module "process" {
45
45
  "node:https": typeof import("node:https");
46
46
  "inspector": typeof import("inspector");
47
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");
48
+ "inspector/promises": typeof import("inspector/promises");
49
+ "node:inspector/promises": typeof import("node:inspector/promises");
51
50
  "module": typeof import("module");
52
51
  "node:module": typeof import("node:module");
53
52
  "net": typeof import("net");
@@ -323,24 +322,28 @@ declare module "process" {
323
322
  has(scope: string, reference?: string): boolean;
324
323
  }
325
324
  interface ProcessReport {
325
+ /**
326
+ * Write reports in a compact format, single-line JSON, more easily consumable by log processing systems
327
+ * than the default multi-line format designed for human consumption.
328
+ * @since v13.12.0, v12.17.0
329
+ */
330
+ compact: boolean;
326
331
  /**
327
332
  * Directory where the report is written.
333
+ * The default value is the empty string, indicating that reports are written to the current
328
334
  * working directory of the Node.js process.
329
- * @default '' indicating that reports are written to the current
330
335
  */
331
336
  directory: string;
332
337
  /**
333
- * Filename where the report is written.
334
- * The default value is the empty string.
335
- * @default '' the output filename will be comprised of a timestamp,
336
- * PID, and sequence number.
338
+ * Filename where the report is written. If set to the empty string, the output filename will be comprised
339
+ * of a timestamp, PID, and sequence number. The default value is the empty string.
337
340
  */
338
341
  filename: string;
339
342
  /**
340
- * Returns a JSON-formatted diagnostic report for the running process.
341
- * The report's JavaScript stack trace is taken from err, if present.
343
+ * Returns a JavaScript Object representation of a diagnostic report for the running process.
344
+ * The report's JavaScript stack trace is taken from `err`, if present.
342
345
  */
343
- getReport(err?: Error): string;
346
+ getReport(err?: Error): object;
344
347
  /**
345
348
  * If true, a diagnostic report is generated on fatal errors,
346
349
  * such as out of memory errors or failed C++ assertions.
@@ -366,18 +369,19 @@ declare module "process" {
366
369
  /**
367
370
  * Writes a diagnostic report to a file. If filename is not provided, the default filename
368
371
  * includes the date, time, PID, and a sequence number.
369
- * The report's JavaScript stack trace is taken from err, if present.
372
+ * The report's JavaScript stack trace is taken from `err`, if present.
370
373
  *
374
+ * If the value of filename is set to `'stdout'` or `'stderr'`, the report is written
375
+ * to the stdout or stderr of the process respectively.
371
376
  * @param fileName Name of the file where the report is written.
372
377
  * This should be a relative path, that will be appended to the directory specified in
373
378
  * `process.report.directory`, or the current working directory of the Node.js process,
374
379
  * if unspecified.
375
- * @param error A custom error used for reporting the JavaScript stack.
380
+ * @param err A custom error used for reporting the JavaScript stack.
376
381
  * @return Filename of the generated report.
377
382
  */
378
- writeReport(fileName?: string): string;
379
- writeReport(error?: Error): string;
380
383
  writeReport(fileName?: string, err?: Error): string;
384
+ writeReport(err?: Error): string;
381
385
  }
382
386
  interface ResourceUsage {
383
387
  fsRead: number;
@@ -1706,11 +1710,11 @@ declare module "process" {
1706
1710
  */
1707
1711
  allowedNodeEnvironmentFlags: ReadonlySet<string>;
1708
1712
  /**
1709
- * `process.report` is an object whose methods are used to generate diagnostic
1710
- * reports for the current process. Additional documentation is available in the `report documentation`.
1713
+ * `process.report` is an object whose methods are used to generate diagnostic reports for the current process.
1714
+ * Additional documentation is available in the [report documentation](https://nodejs.org/docs/latest-v20.x/api/report.html).
1711
1715
  * @since v11.8.0
1712
1716
  */
1713
- report?: ProcessReport | undefined;
1717
+ report: ProcessReport;
1714
1718
  /**
1715
1719
  * ```js
1716
1720
  * import { resourceUsage } from 'node:process';
node v20.16/test.d.ts CHANGED
@@ -1831,27 +1831,35 @@ declare module "node:test/reporters" {
1831
1831
  * The `dot` reporter outputs the test results in a compact format,
1832
1832
  * where each passing test is represented by a `.`,
1833
1833
  * and each failing test is represented by a `X`.
1834
+ * @since v20.0.0
1834
1835
  */
1835
1836
  function dot(source: TestEventGenerator): AsyncGenerator<"\n" | "." | "X", void>;
1836
1837
  /**
1837
1838
  * The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format.
1839
+ * @since v20.0.0
1838
1840
  */
1839
1841
  function tap(source: TestEventGenerator): AsyncGenerator<string, void>;
1840
1842
  /**
1841
1843
  * The `spec` reporter outputs the test results in a human-readable format.
1844
+ * @since v20.0.0
1842
1845
  */
1843
- class Spec extends Transform {
1846
+ class SpecReporter extends Transform {
1844
1847
  constructor();
1845
1848
  }
1846
1849
  /**
1847
1850
  * The `junit` reporter outputs test results in a jUnit XML format.
1851
+ * @since v21.0.0
1848
1852
  */
1849
1853
  function junit(source: TestEventGenerator): AsyncGenerator<string, void>;
1854
+ class LcovReporter extends Transform {
1855
+ constructor(opts?: Omit<TransformOptions, "writableObjectMode">);
1856
+ }
1850
1857
  /**
1851
- * 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
1852
1861
  */
1853
- class Lcov extends Transform {
1854
- constructor(opts?: TransformOptions);
1855
- }
1856
- 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 };
1857
1865
  }