@types/node 16.18.123 → 16.18.124

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: Wed, 01 Jan 2025 01:30:02 GMT
11
+ * Last updated: Thu, 16 Jan 2025 00:46:49 GMT
12
12
  * Dependencies: none
13
13
 
14
14
  # Credits
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "16.18.123",
3
+ "version": "16.18.124",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -213,6 +213,6 @@
213
213
  "scripts": {},
214
214
  "dependencies": {},
215
215
  "peerDependencies": {},
216
- "typesPublisherContentHash": "0a9fc0d15f5d36c3976156d5a997a2b648b37ab58acb6d82cab2187773434457",
216
+ "typesPublisherContentHash": "c149ed757397ebbcfa0bfa4ab71ad584da145b24919b91236b02e505d03e950a",
217
217
  "typeScriptVersion": "5.0"
218
218
  }
@@ -130,7 +130,59 @@ declare module "process" {
130
130
  TZ?: string;
131
131
  }
132
132
  interface HRTime {
133
+ /**
134
+ * This is the legacy version of {@link process.hrtime.bigint()}
135
+ * before bigint was introduced in JavaScript.
136
+ *
137
+ * The `process.hrtime()` method returns the current high-resolution real time in a `[seconds, nanoseconds]` tuple `Array`,
138
+ * where `nanoseconds` is the remaining part of the real time that can't be represented in second precision.
139
+ *
140
+ * `time` is an optional parameter that must be the result of a previous `process.hrtime()` call to diff with the current time.
141
+ * If the parameter passed in is not a tuple `Array`, a TypeError will be thrown.
142
+ * Passing in a user-defined array instead of the result of a previous call to `process.hrtime()` will lead to undefined behavior.
143
+ *
144
+ * These times are relative to an arbitrary time in the past,
145
+ * and not related to the time of day and therefore not subject to clock drift.
146
+ * The primary use is for measuring performance between intervals:
147
+ * ```js
148
+ * const { hrtime } = require('node:process');
149
+ * const NS_PER_SEC = 1e9;
150
+ * const time = hrtime();
151
+ * // [ 1800216, 25 ]
152
+ *
153
+ * setTimeout(() => {
154
+ * const diff = hrtime(time);
155
+ * // [ 1, 552 ]
156
+ *
157
+ * console.log(`Benchmark took ${diff[0] * NS_PER_SEC + diff[1]} nanoseconds`);
158
+ * // Benchmark took 1000000552 nanoseconds
159
+ * }, 1000);
160
+ * ```
161
+ * @since 0.7.6
162
+ * @legacy Use {@link process.hrtime.bigint()} instead.
163
+ * @param time The result of a previous call to `process.hrtime()`
164
+ */
133
165
  (time?: [number, number]): [number, number];
166
+ /**
167
+ * The `bigint` version of the {@link process.hrtime()} method returning the current high-resolution real time in nanoseconds as a `bigint`.
168
+ *
169
+ * 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.
170
+ * ```js
171
+ * import { hrtime } from 'node:process';
172
+ *
173
+ * const start = hrtime.bigint();
174
+ * // 191051479007711n
175
+ *
176
+ * setTimeout(() => {
177
+ * const end = hrtime.bigint();
178
+ * // 191052633396993n
179
+ *
180
+ * console.log(`Benchmark took ${end - start} nanoseconds`);
181
+ * // Benchmark took 1154389282 nanoseconds
182
+ * }, 1000);
183
+ * ```
184
+ * @since v10.7.0
185
+ */
134
186
  bigint(): bigint;
135
187
  }
136
188
  interface ProcessReport {