@types/node 20.17.13 → 20.17.14

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 v20.17/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/v20.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Tue, 14 Jan 2025 18:36:43 GMT
11
+ * Last updated: Thu, 16 Jan 2025 00:46:49 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": "20.17.13",
3
+ "version": "20.17.14",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -215,6 +215,6 @@
215
215
  "undici-types": "~6.19.2"
216
216
  },
217
217
  "peerDependencies": {},
218
- "typesPublisherContentHash": "5062a11f68be44f12fd124f1d3bd5b91cb71ffa29386adb3cfa12a9f7d68c927",
218
+ "typesPublisherContentHash": "c1f5d6013164feab9e63c9f5a71f03189b6b7e1c1c281b65f868159b161d5344",
219
219
  "typeScriptVersion": "5.0"
220
220
  }
@@ -273,11 +273,43 @@ declare module "process" {
273
273
  TZ?: string;
274
274
  }
275
275
  interface HRTime {
276
+ /**
277
+ * This is the legacy version of {@link process.hrtime.bigint()}
278
+ * before bigint was introduced in JavaScript.
279
+ *
280
+ * The `process.hrtime()` method returns the current high-resolution real time in a `[seconds, nanoseconds]` tuple `Array`,
281
+ * where `nanoseconds` is the remaining part of the real time that can't be represented in second precision.
282
+ *
283
+ * `time` is an optional parameter that must be the result of a previous `process.hrtime()` call to diff with the current time.
284
+ * If the parameter passed in is not a tuple `Array`, a TypeError will be thrown.
285
+ * Passing in a user-defined array instead of the result of a previous call to `process.hrtime()` will lead to undefined behavior.
286
+ *
287
+ * These times are relative to an arbitrary time in the past,
288
+ * and not related to the time of day and therefore not subject to clock drift.
289
+ * The primary use is for measuring performance between intervals:
290
+ * ```js
291
+ * const { hrtime } = require('node:process');
292
+ * const NS_PER_SEC = 1e9;
293
+ * const time = hrtime();
294
+ * // [ 1800216, 25 ]
295
+ *
296
+ * setTimeout(() => {
297
+ * const diff = hrtime(time);
298
+ * // [ 1, 552 ]
299
+ *
300
+ * console.log(`Benchmark took ${diff[0] * NS_PER_SEC + diff[1]} nanoseconds`);
301
+ * // Benchmark took 1000000552 nanoseconds
302
+ * }, 1000);
303
+ * ```
304
+ * @since 0.7.6
305
+ * @legacy Use {@link process.hrtime.bigint()} instead.
306
+ * @param time The result of a previous call to `process.hrtime()`
307
+ */
276
308
  (time?: [number, number]): [number, number];
277
309
  /**
278
- * The `bigint` version of the `{@link hrtime()}` method returning the current high-resolution real time in nanoseconds as a `bigint`.
310
+ * The `bigint` version of the {@link process.hrtime()} method returning the current high-resolution real time in nanoseconds as a `bigint`.
279
311
  *
280
- * Unlike `{@link hrtime()}`, it does not support an additional time argument since the difference can just be computed directly by subtraction of the two `bigint`s.
312
+ * Unlike {@link process.hrtime()}, it does not support an additional time argument since the difference can just be computed directly by subtraction of the two `bigint`s.
281
313
  * ```js
282
314
  * import { hrtime } from 'node:process';
283
315
  *
@@ -292,6 +324,7 @@ declare module "process" {
292
324
  * // Benchmark took 1154389282 nanoseconds
293
325
  * }, 1000);
294
326
  * ```
327
+ * @since v10.7.0
295
328
  */
296
329
  bigint(): bigint;
297
330
  }