@types/node 16.18.103 → 16.18.105

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 v16.18/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/v16.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Thu, 18 Jul 2024 18:38:10 GMT
11
+ * Last updated: Fri, 09 Aug 2024 18:08:59 GMT
12
12
  * Dependencies: none
13
13
 
14
14
  # Credits
node v16.18/buffer.d.ts CHANGED
@@ -2114,31 +2114,6 @@ declare module "buffer" {
2114
2114
  * @return The index of the last occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`.
2115
2115
  */
2116
2116
  lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
2117
- /**
2118
- * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `[index, byte]` pairs from the contents
2119
- * of `buf`.
2120
- *
2121
- * ```js
2122
- * import { Buffer } from 'node:buffer';
2123
- *
2124
- * // Log the entire contents of a `Buffer`.
2125
- *
2126
- * const buf = Buffer.from('buffer');
2127
- *
2128
- * for (const pair of buf.entries()) {
2129
- * console.log(pair);
2130
- * }
2131
- * // Prints:
2132
- * // [0, 98]
2133
- * // [1, 117]
2134
- * // [2, 102]
2135
- * // [3, 102]
2136
- * // [4, 101]
2137
- * // [5, 114]
2138
- * ```
2139
- * @since v1.1.0
2140
- */
2141
- entries(): IterableIterator<[number, number]>;
2142
2117
  /**
2143
2118
  * Equivalent to `buf.indexOf() !== -1`.
2144
2119
  *
@@ -2169,62 +2144,6 @@ declare module "buffer" {
2169
2144
  * @return `true` if `value` was found in `buf`, `false` otherwise.
2170
2145
  */
2171
2146
  includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean;
2172
- /**
2173
- * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `buf` keys (indices).
2174
- *
2175
- * ```js
2176
- * import { Buffer } from 'node:buffer';
2177
- *
2178
- * const buf = Buffer.from('buffer');
2179
- *
2180
- * for (const key of buf.keys()) {
2181
- * console.log(key);
2182
- * }
2183
- * // Prints:
2184
- * // 0
2185
- * // 1
2186
- * // 2
2187
- * // 3
2188
- * // 4
2189
- * // 5
2190
- * ```
2191
- * @since v1.1.0
2192
- */
2193
- keys(): IterableIterator<number>;
2194
- /**
2195
- * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) for `buf` values (bytes). This function is
2196
- * called automatically when a `Buffer` is used in a `for..of` statement.
2197
- *
2198
- * ```js
2199
- * import { Buffer } from 'node:buffer';
2200
- *
2201
- * const buf = Buffer.from('buffer');
2202
- *
2203
- * for (const value of buf.values()) {
2204
- * console.log(value);
2205
- * }
2206
- * // Prints:
2207
- * // 98
2208
- * // 117
2209
- * // 102
2210
- * // 102
2211
- * // 101
2212
- * // 114
2213
- *
2214
- * for (const value of buf) {
2215
- * console.log(value);
2216
- * }
2217
- * // Prints:
2218
- * // 98
2219
- * // 117
2220
- * // 102
2221
- * // 102
2222
- * // 101
2223
- * // 114
2224
- * ```
2225
- * @since v1.1.0
2226
- */
2227
- values(): IterableIterator<number>;
2228
2147
  }
2229
2148
  var Buffer: BufferConstructor;
2230
2149
  /**
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "16.18.103",
3
+ "version": "16.18.105",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -210,6 +210,6 @@
210
210
  },
211
211
  "scripts": {},
212
212
  "dependencies": {},
213
- "typesPublisherContentHash": "ae435c06d80fefd29e8912da780485466353336a512ae7a4f7a89ac8baf60714",
213
+ "typesPublisherContentHash": "874d7cf34debf8ade03f10fb7f16085564a36a3b023ae4a14d539655bc0dbfb4",
214
214
  "typeScriptVersion": "4.8"
215
215
  }
@@ -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
@@ -231,6 +241,24 @@ declare module "perf_hooks" {
231
241
  * @param name
232
242
  */
233
243
  mark(name?: string, options?: MarkOptions): void;
244
+ /**
245
+ * Creates a new `PerformanceResourceTiming` entry in the Resource Timeline.
246
+ * A `PerformanceResourceTiming` is a subclass of `PerformanceEntry` whose `performanceEntry.entryType` is always `'resource'`.
247
+ * Performance resources are used to mark moments in the Resource Timeline.
248
+ * @param timingInfo [Fetch Timing Info](https://fetch.spec.whatwg.org/#fetch-timing-info)
249
+ * @param requestedUrl The resource url
250
+ * @param initiatorType The initiator name, e.g: 'fetch'
251
+ * @param global
252
+ * @param cacheMode The cache mode must be an empty string ('') or 'local'
253
+ * @since v16.17.0
254
+ */
255
+ markResourceTiming(
256
+ timingInfo: object,
257
+ requestedUrl: string,
258
+ initiatorType: string,
259
+ global: object,
260
+ cacheMode: "" | "local",
261
+ ): PerformanceResourceTiming;
234
262
  /**
235
263
  * Creates a new PerformanceMeasure entry in the Performance Timeline.
236
264
  * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure',
@@ -437,6 +465,104 @@ declare module "perf_hooks" {
437
465
  },
438
466
  ): void;
439
467
  }
468
+ /**
469
+ * Provides detailed network timing data regarding the loading of an application's resources.
470
+ *
471
+ * The constructor of this class is not exposed to users directly.
472
+ * @since v16.17.0
473
+ */
474
+ class PerformanceResourceTiming extends PerformanceEntry {
475
+ readonly entryType: "resource";
476
+ protected constructor();
477
+ /**
478
+ * The high resolution millisecond timestamp at immediately before dispatching the `fetch`
479
+ * request. If the resource is not intercepted by a worker the property will always return 0.
480
+ * @since v16.17.0
481
+ */
482
+ readonly workerStart: number;
483
+ /**
484
+ * The high resolution millisecond timestamp that represents the start time of the fetch which
485
+ * initiates the redirect.
486
+ * @since v16.17.0
487
+ */
488
+ readonly redirectStart: number;
489
+ /**
490
+ * The high resolution millisecond timestamp that will be created immediately after receiving
491
+ * the last byte of the response of the last redirect.
492
+ * @since v16.17.0
493
+ */
494
+ readonly redirectEnd: number;
495
+ /**
496
+ * The high resolution millisecond timestamp immediately before the Node.js starts to fetch the resource.
497
+ * @since v16.17.0
498
+ */
499
+ readonly fetchStart: number;
500
+ /**
501
+ * The high resolution millisecond timestamp immediately before the Node.js starts the domain name lookup
502
+ * for the resource.
503
+ * @since v16.17.0
504
+ */
505
+ readonly domainLookupStart: number;
506
+ /**
507
+ * The high resolution millisecond timestamp representing the time immediately after the Node.js finished
508
+ * the domain name lookup for the resource.
509
+ * @since v16.17.0
510
+ */
511
+ readonly domainLookupEnd: number;
512
+ /**
513
+ * The high resolution millisecond timestamp representing the time immediately before Node.js starts to
514
+ * establish the connection to the server to retrieve the resource.
515
+ * @since v16.17.0
516
+ */
517
+ readonly connectStart: number;
518
+ /**
519
+ * The high resolution millisecond timestamp representing the time immediately after Node.js finishes
520
+ * establishing the connection to the server to retrieve the resource.
521
+ * @since v16.17.0
522
+ */
523
+ readonly connectEnd: number;
524
+ /**
525
+ * The high resolution millisecond timestamp representing the time immediately before Node.js starts the
526
+ * handshake process to secure the current connection.
527
+ * @since v16.17.0
528
+ */
529
+ readonly secureConnectionStart: number;
530
+ /**
531
+ * The high resolution millisecond timestamp representing the time immediately before Node.js receives the
532
+ * first byte of the response from the server.
533
+ * @since v16.17.0
534
+ */
535
+ readonly requestStart: number;
536
+ /**
537
+ * The high resolution millisecond timestamp representing the time immediately after Node.js receives the
538
+ * last byte of the resource or immediately before the transport connection is closed, whichever comes first.
539
+ * @since v16.17.0
540
+ */
541
+ readonly responseEnd: number;
542
+ /**
543
+ * A number representing the size (in octets) of the fetched resource. The size includes the response header
544
+ * fields plus the response payload body.
545
+ * @since v16.17.0
546
+ */
547
+ readonly transferSize: number;
548
+ /**
549
+ * A number representing the size (in octets) received from the fetch (HTTP or cache), of the payload body, before
550
+ * removing any applied content-codings.
551
+ * @since v16.17.0
552
+ */
553
+ readonly encodedBodySize: number;
554
+ /**
555
+ * A number representing the size (in octets) received from the fetch (HTTP or cache), of the message body, after
556
+ * removing any applied content-codings.
557
+ * @since v16.17.0
558
+ */
559
+ readonly decodedBodySize: number;
560
+ /**
561
+ * Returns a `object` that is the JSON representation of the `PerformanceResourceTiming` object
562
+ * @since v16.17.0
563
+ */
564
+ toJSON(): any;
565
+ }
440
566
  namespace constants {
441
567
  const NODE_PERFORMANCE_GC_MAJOR: number;
442
568
  const NODE_PERFORMANCE_GC_MINOR: number;