@types/node 18.19.43 → 18.19.45

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 v18.19/README.md CHANGED
@@ -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/v18.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Fri, 02 Aug 2024 08:37:31 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "18.19.43",
3
+ "version": "18.19.45",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -217,6 +217,6 @@
217
217
  "dependencies": {
218
218
  "undici-types": "~5.26.4"
219
219
  },
220
- "typesPublisherContentHash": "7822f2e7f22f7070d22af915d93cb6dc4dcdf3e8a784cab073ce5b99d8a6f6bd",
220
+ "typesPublisherContentHash": "62e2e26824406f7498fe9575ed346df1db05eebb610cab4aadc5e2f1a1527e19",
221
221
  "typeScriptVersion": "4.8"
222
222
  }
@@ -30,7 +30,17 @@
30
30
  */
31
31
  declare module "perf_hooks" {
32
32
  import { AsyncResource } from "node:async_hooks";
33
- type EntryType = "node" | "mark" | "measure" | "gc" | "function" | "http2" | "http" | "dns";
33
+ type EntryType =
34
+ | "dns" // Node.js only
35
+ | "function" // Node.js only
36
+ | "gc" // Node.js only
37
+ | "http2" // Node.js only
38
+ | "http" // Node.js only
39
+ | "mark" // available on the Web
40
+ | "measure" // available on the Web
41
+ | "net" // Node.js only
42
+ | "node" // Node.js only
43
+ | "resource"; // available on the Web
34
44
  interface NodeGCPerformanceDetail {
35
45
  /**
36
46
  * When `performanceEntry.entryType` is equal to 'gc', `the performance.kind` property identifies
@@ -240,6 +250,24 @@ declare module "perf_hooks" {
240
250
  * @return The PerformanceMark entry that was created
241
251
  */
242
252
  mark(name?: string, options?: MarkOptions): PerformanceMark;
253
+ /**
254
+ * Creates a new `PerformanceResourceTiming` entry in the Resource Timeline.
255
+ * A `PerformanceResourceTiming` is a subclass of `PerformanceEntry` whose `performanceEntry.entryType` is always `'resource'`.
256
+ * Performance resources are used to mark moments in the Resource Timeline.
257
+ * @param timingInfo [Fetch Timing Info](https://fetch.spec.whatwg.org/#fetch-timing-info)
258
+ * @param requestedUrl The resource url
259
+ * @param initiatorType The initiator name, e.g: 'fetch'
260
+ * @param global
261
+ * @param cacheMode The cache mode must be an empty string ('') or 'local'
262
+ * @since v18.2.0, v16.17.0
263
+ */
264
+ markResourceTiming(
265
+ timingInfo: object,
266
+ requestedUrl: string,
267
+ initiatorType: string,
268
+ global: object,
269
+ cacheMode: "" | "local",
270
+ ): PerformanceResourceTiming;
243
271
  /**
244
272
  * Creates a new PerformanceMeasure entry in the Performance Timeline.
245
273
  * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure',
@@ -454,6 +482,105 @@ declare module "perf_hooks" {
454
482
  },
455
483
  ): void;
456
484
  }
485
+ /**
486
+ * Provides detailed network timing data regarding the loading of an application's resources.
487
+ *
488
+ * The constructor of this class is not exposed to users directly.
489
+ * @since v18.2.0, v16.17.0
490
+ */
491
+ class PerformanceResourceTiming extends PerformanceEntry {
492
+ readonly entryType: "resource";
493
+ protected constructor();
494
+ /**
495
+ * The high resolution millisecond timestamp at immediately before dispatching the `fetch`
496
+ * request. If the resource is not intercepted by a worker the property will always return 0.
497
+ * @since v18.2.0, v16.17.0
498
+ */
499
+ readonly workerStart: number;
500
+ /**
501
+ * The high resolution millisecond timestamp that represents the start time of the fetch which
502
+ * initiates the redirect.
503
+ * @since v18.2.0, v16.17.0
504
+ */
505
+ readonly redirectStart: number;
506
+ /**
507
+ * The high resolution millisecond timestamp that will be created immediately after receiving
508
+ * the last byte of the response of the last redirect.
509
+ * @since v18.2.0, v16.17.0
510
+ */
511
+ readonly redirectEnd: number;
512
+ /**
513
+ * The high resolution millisecond timestamp immediately before the Node.js starts to fetch the resource.
514
+ * @since v18.2.0, v16.17.0
515
+ */
516
+ readonly fetchStart: number;
517
+ /**
518
+ * The high resolution millisecond timestamp immediately before the Node.js starts the domain name lookup
519
+ * for the resource.
520
+ * @since v18.2.0, v16.17.0
521
+ */
522
+ readonly domainLookupStart: number;
523
+ /**
524
+ * The high resolution millisecond timestamp representing the time immediately after the Node.js finished
525
+ * the domain name lookup for the resource.
526
+ * @since v18.2.0, v16.17.0
527
+ */
528
+ readonly domainLookupEnd: number;
529
+ /**
530
+ * The high resolution millisecond timestamp representing the time immediately before Node.js starts to
531
+ * establish the connection to the server to retrieve the resource.
532
+ * @since v18.2.0, v16.17.0
533
+ */
534
+ readonly connectStart: number;
535
+ /**
536
+ * The high resolution millisecond timestamp representing the time immediately after Node.js finishes
537
+ * establishing the connection to the server to retrieve the resource.
538
+ * @since v18.2.0, v16.17.0
539
+ */
540
+ readonly connectEnd: number;
541
+ /**
542
+ * The high resolution millisecond timestamp representing the time immediately before Node.js starts the
543
+ * handshake process to secure the current connection.
544
+ * @since v18.2.0, v16.17.0
545
+ */
546
+ readonly secureConnectionStart: number;
547
+ /**
548
+ * The high resolution millisecond timestamp representing the time immediately before Node.js receives the
549
+ * first byte of the response from the server.
550
+ * @since v18.2.0, v16.17.0
551
+ */
552
+ readonly requestStart: number;
553
+ /**
554
+ * The high resolution millisecond timestamp representing the time immediately after Node.js receives the
555
+ * last byte of the resource or immediately before the transport connection is closed, whichever comes first.
556
+ * @since v18.2.0, v16.17.0
557
+ */
558
+ readonly responseEnd: number;
559
+ /**
560
+ * A number representing the size (in octets) of the fetched resource. The size includes the response header
561
+ * fields plus the response payload body.
562
+ * @since v18.2.0, v16.17.0
563
+ */
564
+ readonly transferSize: number;
565
+ /**
566
+ * A number representing the size (in octets) received from the fetch (HTTP or cache), of the payload body, before
567
+ * removing any applied content-codings.
568
+ * @since v18.2.0, v16.17.0
569
+ */
570
+ readonly encodedBodySize: number;
571
+ /**
572
+ * A number representing the size (in octets) received from the fetch (HTTP or cache), of the message body, after
573
+ * removing any applied content-codings.
574
+ * @since v18.2.0, v16.17.0
575
+ */
576
+ readonly decodedBodySize: number;
577
+ /**
578
+ * Returns a `object` that is the JSON representation of the `PerformanceResourceTiming` object
579
+ * @since v18.2.0, v16.17.0
580
+ */
581
+ toJSON(): any;
582
+ }
583
+
457
584
  namespace constants {
458
585
  const NODE_PERFORMANCE_GC_MAJOR: number;
459
586
  const NODE_PERFORMANCE_GC_MINOR: number;
@@ -145,24 +145,28 @@ declare module "process" {
145
145
  bigint(): bigint;
146
146
  }
147
147
  interface ProcessReport {
148
+ /**
149
+ * Write reports in a compact format, single-line JSON, more easily consumable by log processing systems
150
+ * than the default multi-line format designed for human consumption.
151
+ * @since v13.12.0, v12.17.0
152
+ */
153
+ compact: boolean;
148
154
  /**
149
155
  * Directory where the report is written.
156
+ * The default value is the empty string, indicating that reports are written to the current
150
157
  * working directory of the Node.js process.
151
- * @default '' indicating that reports are written to the current
152
158
  */
153
159
  directory: string;
154
160
  /**
155
- * Filename where the report is written.
156
- * The default value is the empty string.
157
- * @default '' the output filename will be comprised of a timestamp,
158
- * PID, and sequence number.
161
+ * Filename where the report is written. If set to the empty string, the output filename will be comprised
162
+ * of a timestamp, PID, and sequence number. The default value is the empty string.
159
163
  */
160
164
  filename: string;
161
165
  /**
162
- * Returns a JSON-formatted diagnostic report for the running process.
163
- * The report's JavaScript stack trace is taken from err, if present.
166
+ * Returns a JavaScript Object representation of a diagnostic report for the running process.
167
+ * The report's JavaScript stack trace is taken from `err`, if present.
164
168
  */
165
- getReport(err?: Error): string;
169
+ getReport(err?: Error): object;
166
170
  /**
167
171
  * If true, a diagnostic report is generated on fatal errors,
168
172
  * such as out of memory errors or failed C++ assertions.
@@ -188,18 +192,19 @@ declare module "process" {
188
192
  /**
189
193
  * Writes a diagnostic report to a file. If filename is not provided, the default filename
190
194
  * includes the date, time, PID, and a sequence number.
191
- * The report's JavaScript stack trace is taken from err, if present.
195
+ * The report's JavaScript stack trace is taken from `err`, if present.
192
196
  *
197
+ * If the value of filename is set to `'stdout'` or `'stderr'`, the report is written
198
+ * to the stdout or stderr of the process respectively.
193
199
  * @param fileName Name of the file where the report is written.
194
200
  * This should be a relative path, that will be appended to the directory specified in
195
201
  * `process.report.directory`, or the current working directory of the Node.js process,
196
202
  * if unspecified.
197
- * @param error A custom error used for reporting the JavaScript stack.
203
+ * @param err A custom error used for reporting the JavaScript stack.
198
204
  * @return Filename of the generated report.
199
205
  */
200
- writeReport(fileName?: string): string;
201
- writeReport(error?: Error): string;
202
206
  writeReport(fileName?: string, err?: Error): string;
207
+ writeReport(err?: Error): string;
203
208
  }
204
209
  interface ResourceUsage {
205
210
  fsRead: number;
@@ -1402,11 +1407,11 @@ declare module "process" {
1402
1407
  */
1403
1408
  allowedNodeEnvironmentFlags: ReadonlySet<string>;
1404
1409
  /**
1405
- * `process.report` is an object whose methods are used to generate diagnostic
1406
- * reports for the current process. Additional documentation is available in the `report documentation`.
1410
+ * `process.report` is an object whose methods are used to generate diagnostic reports for the current process.
1411
+ * Additional documentation is available in the [report documentation](https://nodejs.org/docs/latest-v18.x/api/report.html).
1407
1412
  * @since v11.8.0
1408
1413
  */
1409
- report?: ProcessReport | undefined;
1414
+ report: ProcessReport;
1410
1415
  /**
1411
1416
  * ```js
1412
1417
  * import { resourceUsage } from 'process';