@types/node 18.19.69 → 18.19.71
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 v18.19/README.md +1 -1
- node v18.19/package.json +2 -2
- node v18.19/process.d.ts +52 -0
- node v18.19/timers.d.ts +4 -4
node v18.19/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/v18.
|
|
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 v18.19/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "18.19.
|
|
3
|
+
"version": "18.19.71",
|
|
4
4
|
"description": "TypeScript definitions for node",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -220,6 +220,6 @@
|
|
|
220
220
|
"undici-types": "~5.26.4"
|
|
221
221
|
},
|
|
222
222
|
"peerDependencies": {},
|
|
223
|
-
"typesPublisherContentHash": "
|
|
223
|
+
"typesPublisherContentHash": "b647172e49cef8d6c6c37fad400211ae4f94725bc1385df959712f4a1a699b16",
|
|
224
224
|
"typeScriptVersion": "5.0"
|
|
225
225
|
}
|
node v18.19/process.d.ts
CHANGED
|
@@ -141,7 +141,59 @@ declare module "process" {
|
|
|
141
141
|
TZ?: string;
|
|
142
142
|
}
|
|
143
143
|
interface HRTime {
|
|
144
|
+
/**
|
|
145
|
+
* This is the legacy version of {@link process.hrtime.bigint()}
|
|
146
|
+
* before bigint was introduced in JavaScript.
|
|
147
|
+
*
|
|
148
|
+
* The `process.hrtime()` method returns the current high-resolution real time in a `[seconds, nanoseconds]` tuple `Array`,
|
|
149
|
+
* where `nanoseconds` is the remaining part of the real time that can't be represented in second precision.
|
|
150
|
+
*
|
|
151
|
+
* `time` is an optional parameter that must be the result of a previous `process.hrtime()` call to diff with the current time.
|
|
152
|
+
* If the parameter passed in is not a tuple `Array`, a TypeError will be thrown.
|
|
153
|
+
* Passing in a user-defined array instead of the result of a previous call to `process.hrtime()` will lead to undefined behavior.
|
|
154
|
+
*
|
|
155
|
+
* These times are relative to an arbitrary time in the past,
|
|
156
|
+
* and not related to the time of day and therefore not subject to clock drift.
|
|
157
|
+
* The primary use is for measuring performance between intervals:
|
|
158
|
+
* ```js
|
|
159
|
+
* const { hrtime } = require('node:process');
|
|
160
|
+
* const NS_PER_SEC = 1e9;
|
|
161
|
+
* const time = hrtime();
|
|
162
|
+
* // [ 1800216, 25 ]
|
|
163
|
+
*
|
|
164
|
+
* setTimeout(() => {
|
|
165
|
+
* const diff = hrtime(time);
|
|
166
|
+
* // [ 1, 552 ]
|
|
167
|
+
*
|
|
168
|
+
* console.log(`Benchmark took ${diff[0] * NS_PER_SEC + diff[1]} nanoseconds`);
|
|
169
|
+
* // Benchmark took 1000000552 nanoseconds
|
|
170
|
+
* }, 1000);
|
|
171
|
+
* ```
|
|
172
|
+
* @since 0.7.6
|
|
173
|
+
* @legacy Use {@link process.hrtime.bigint()} instead.
|
|
174
|
+
* @param time The result of a previous call to `process.hrtime()`
|
|
175
|
+
*/
|
|
144
176
|
(time?: [number, number]): [number, number];
|
|
177
|
+
/**
|
|
178
|
+
* The `bigint` version of the {@link process.hrtime()} method returning the current high-resolution real time in nanoseconds as a `bigint`.
|
|
179
|
+
*
|
|
180
|
+
* 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.
|
|
181
|
+
* ```js
|
|
182
|
+
* import { hrtime } from 'node:process';
|
|
183
|
+
*
|
|
184
|
+
* const start = hrtime.bigint();
|
|
185
|
+
* // 191051479007711n
|
|
186
|
+
*
|
|
187
|
+
* setTimeout(() => {
|
|
188
|
+
* const end = hrtime.bigint();
|
|
189
|
+
* // 191052633396993n
|
|
190
|
+
*
|
|
191
|
+
* console.log(`Benchmark took ${end - start} nanoseconds`);
|
|
192
|
+
* // Benchmark took 1154389282 nanoseconds
|
|
193
|
+
* }, 1000);
|
|
194
|
+
* ```
|
|
195
|
+
* @since v10.7.0
|
|
196
|
+
*/
|
|
145
197
|
bigint(): bigint;
|
|
146
198
|
}
|
|
147
199
|
interface ProcessReport {
|
node v18.19/timers.d.ts
CHANGED
|
@@ -85,24 +85,24 @@ declare module "timers" {
|
|
|
85
85
|
*/
|
|
86
86
|
function setTimeout<TArgs extends any[]>(
|
|
87
87
|
callback: (...args: TArgs) => void,
|
|
88
|
-
|
|
88
|
+
delay?: number,
|
|
89
89
|
...args: TArgs
|
|
90
90
|
): NodeJS.Timeout;
|
|
91
91
|
// util.promisify no rest args compability
|
|
92
92
|
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
93
|
-
function setTimeout(callback: (args: void) => void,
|
|
93
|
+
function setTimeout(callback: (args: void) => void, delay?: number): NodeJS.Timeout;
|
|
94
94
|
namespace setTimeout {
|
|
95
95
|
const __promisify__: typeof setTimeoutPromise;
|
|
96
96
|
}
|
|
97
97
|
function clearTimeout(timeoutId: NodeJS.Timeout | string | number | undefined): void;
|
|
98
98
|
function setInterval<TArgs extends any[]>(
|
|
99
99
|
callback: (...args: TArgs) => void,
|
|
100
|
-
|
|
100
|
+
delay?: number,
|
|
101
101
|
...args: TArgs
|
|
102
102
|
): NodeJS.Timeout;
|
|
103
103
|
// util.promisify no rest args compability
|
|
104
104
|
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
105
|
-
function setInterval(callback: (args: void) => void,
|
|
105
|
+
function setInterval(callback: (args: void) => void, delay?: number): NodeJS.Timeout;
|
|
106
106
|
namespace setInterval {
|
|
107
107
|
const __promisify__: typeof setIntervalPromise;
|
|
108
108
|
}
|