@types/node 22.10.5 → 22.10.7
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/README.md +1 -1
- node/module.d.ts +2 -2
- node/package.json +2 -2
- node/process.d.ts +35 -2
node/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.
|
9
9
|
|
10
10
|
### Additional Details
|
11
|
-
* Last updated:
|
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
|
node/module.d.ts
CHANGED
@@ -203,7 +203,7 @@ declare module "module" {
|
|
203
203
|
context: ResolveHookContext,
|
204
204
|
nextResolve: (
|
205
205
|
specifier: string,
|
206
|
-
context?: ResolveHookContext
|
206
|
+
context?: Partial<ResolveHookContext>,
|
207
207
|
) => ResolveFnOutput | Promise<ResolveFnOutput>,
|
208
208
|
) => ResolveFnOutput | Promise<ResolveFnOutput>;
|
209
209
|
interface LoadHookContext {
|
@@ -243,7 +243,7 @@ declare module "module" {
|
|
243
243
|
type LoadHook = (
|
244
244
|
url: string,
|
245
245
|
context: LoadHookContext,
|
246
|
-
nextLoad: (url: string, context?: LoadHookContext) => LoadFnOutput | Promise<LoadFnOutput>,
|
246
|
+
nextLoad: (url: string, context?: Partial<LoadHookContext>) => LoadFnOutput | Promise<LoadFnOutput>,
|
247
247
|
) => LoadFnOutput | Promise<LoadFnOutput>;
|
248
248
|
namespace constants {
|
249
249
|
/**
|
node/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/node",
|
3
|
-
"version": "22.10.
|
3
|
+
"version": "22.10.7",
|
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.20.0"
|
216
216
|
},
|
217
217
|
"peerDependencies": {},
|
218
|
-
"typesPublisherContentHash": "
|
218
|
+
"typesPublisherContentHash": "0179bf8f3b9c8f59fbbc60e9561901be4c7e49c60dbc58088a1bf6f1f83564bc",
|
219
219
|
"typeScriptVersion": "5.0"
|
220
220
|
}
|
node/process.d.ts
CHANGED
@@ -333,11 +333,43 @@ declare module "process" {
|
|
333
333
|
TZ?: string;
|
334
334
|
}
|
335
335
|
interface HRTime {
|
336
|
+
/**
|
337
|
+
* This is the legacy version of {@link process.hrtime.bigint()}
|
338
|
+
* before bigint was introduced in JavaScript.
|
339
|
+
*
|
340
|
+
* The `process.hrtime()` method returns the current high-resolution real time in a `[seconds, nanoseconds]` tuple `Array`,
|
341
|
+
* where `nanoseconds` is the remaining part of the real time that can't be represented in second precision.
|
342
|
+
*
|
343
|
+
* `time` is an optional parameter that must be the result of a previous `process.hrtime()` call to diff with the current time.
|
344
|
+
* If the parameter passed in is not a tuple `Array`, a TypeError will be thrown.
|
345
|
+
* Passing in a user-defined array instead of the result of a previous call to `process.hrtime()` will lead to undefined behavior.
|
346
|
+
*
|
347
|
+
* These times are relative to an arbitrary time in the past,
|
348
|
+
* and not related to the time of day and therefore not subject to clock drift.
|
349
|
+
* The primary use is for measuring performance between intervals:
|
350
|
+
* ```js
|
351
|
+
* const { hrtime } = require('node:process');
|
352
|
+
* const NS_PER_SEC = 1e9;
|
353
|
+
* const time = hrtime();
|
354
|
+
* // [ 1800216, 25 ]
|
355
|
+
*
|
356
|
+
* setTimeout(() => {
|
357
|
+
* const diff = hrtime(time);
|
358
|
+
* // [ 1, 552 ]
|
359
|
+
*
|
360
|
+
* console.log(`Benchmark took ${diff[0] * NS_PER_SEC + diff[1]} nanoseconds`);
|
361
|
+
* // Benchmark took 1000000552 nanoseconds
|
362
|
+
* }, 1000);
|
363
|
+
* ```
|
364
|
+
* @since 0.7.6
|
365
|
+
* @legacy Use {@link process.hrtime.bigint()} instead.
|
366
|
+
* @param time The result of a previous call to `process.hrtime()`
|
367
|
+
*/
|
336
368
|
(time?: [number, number]): [number, number];
|
337
369
|
/**
|
338
|
-
* The `bigint` version of the
|
370
|
+
* The `bigint` version of the {@link process.hrtime()} method returning the current high-resolution real time in nanoseconds as a `bigint`.
|
339
371
|
*
|
340
|
-
* Unlike
|
372
|
+
* 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.
|
341
373
|
* ```js
|
342
374
|
* import { hrtime } from 'node:process';
|
343
375
|
*
|
@@ -352,6 +384,7 @@ declare module "process" {
|
|
352
384
|
* // Benchmark took 1154389282 nanoseconds
|
353
385
|
* }, 1000);
|
354
386
|
* ```
|
387
|
+
* @since v10.7.0
|
355
388
|
*/
|
356
389
|
bigint(): bigint;
|
357
390
|
}
|