@types/node 22.10.6 → 22.10.8
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/dgram.d.ts +6 -6
- 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, 23 Jan 2025 02:01:50 GMT
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
13
13
|
|
14
14
|
# Credits
|
node/dgram.d.ts
CHANGED
@@ -352,22 +352,22 @@ declare module "dgram" {
|
|
352
352
|
* @param callback Called when the message has been sent.
|
353
353
|
*/
|
354
354
|
send(
|
355
|
-
msg: string |
|
355
|
+
msg: string | NodeJS.ArrayBufferView | readonly any[],
|
356
356
|
port?: number,
|
357
357
|
address?: string,
|
358
358
|
callback?: (error: Error | null, bytes: number) => void,
|
359
359
|
): void;
|
360
360
|
send(
|
361
|
-
msg: string |
|
361
|
+
msg: string | NodeJS.ArrayBufferView | readonly any[],
|
362
362
|
port?: number,
|
363
363
|
callback?: (error: Error | null, bytes: number) => void,
|
364
364
|
): void;
|
365
365
|
send(
|
366
|
-
msg: string |
|
366
|
+
msg: string | NodeJS.ArrayBufferView | readonly any[],
|
367
367
|
callback?: (error: Error | null, bytes: number) => void,
|
368
368
|
): void;
|
369
369
|
send(
|
370
|
-
msg: string |
|
370
|
+
msg: string | NodeJS.ArrayBufferView,
|
371
371
|
offset: number,
|
372
372
|
length: number,
|
373
373
|
port?: number,
|
@@ -375,14 +375,14 @@ declare module "dgram" {
|
|
375
375
|
callback?: (error: Error | null, bytes: number) => void,
|
376
376
|
): void;
|
377
377
|
send(
|
378
|
-
msg: string |
|
378
|
+
msg: string | NodeJS.ArrayBufferView,
|
379
379
|
offset: number,
|
380
380
|
length: number,
|
381
381
|
port?: number,
|
382
382
|
callback?: (error: Error | null, bytes: number) => void,
|
383
383
|
): void;
|
384
384
|
send(
|
385
|
-
msg: string |
|
385
|
+
msg: string | NodeJS.ArrayBufferView,
|
386
386
|
offset: number,
|
387
387
|
length: number,
|
388
388
|
callback?: (error: Error | null, bytes: number) => void,
|
node/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/node",
|
3
|
-
"version": "22.10.
|
3
|
+
"version": "22.10.8",
|
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": "6b2ad1d410d97b9dceefb4d048c6a19b899e20c167aaac2d82c719accb54a65f",
|
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
|
}
|