@types/node 16.18.123 → 16.18.125

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, 23 Jan 2025 02:01:50 GMT
12
12
  * Dependencies: none
13
13
 
14
14
  # Credits
node v16.18/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 | Uint8Array | readonly any[],
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 | Uint8Array | readonly any[],
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 | Uint8Array | readonly any[],
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 | Uint8Array,
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 | Uint8Array,
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 | Uint8Array,
385
+ msg: string | NodeJS.ArrayBufferView,
386
386
  offset: number,
387
387
  length: number,
388
388
  callback?: (error: Error | null, bytes: number) => void,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "16.18.123",
3
+ "version": "16.18.125",
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": "ef3bd7ace4c5927bc72c6aa89d3e9713f9142b4a1434f0a9dc34cab17b5d53fa",
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 {