@types/node 24.12.0 → 25.5.0
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 v24.12/README.md → node/README.md +2 -2
- node v24.12/assert/strict.d.ts → node/assert/strict.d.ts +5 -11
- node v24.12/assert.d.ts → node/assert.d.ts +11 -171
- node v24.12/async_hooks.d.ts → node/async_hooks.d.ts +8 -8
- node v24.12/buffer.buffer.d.ts → node/buffer.buffer.d.ts +1 -7
- node v24.12/buffer.d.ts → node/buffer.d.ts +44 -168
- node v24.12/child_process.d.ts → node/child_process.d.ts +21 -64
- node/cluster.d.ts +486 -0
- node/console.d.ts +151 -0
- node v24.12/constants.d.ts → node/constants.d.ts +3 -4
- node v24.12/crypto.d.ts → node/crypto.d.ts +287 -1639
- node v24.12/dgram.d.ts → node/dgram.d.ts +15 -51
- node v24.12/diagnostics_channel.d.ts → node/diagnostics_channel.d.ts +4 -4
- node v24.12/dns/promises.d.ts → node/dns/promises.d.ts +3 -3
- node v24.12/dns.d.ts → node/dns.d.ts +131 -132
- node v24.12/domain.d.ts → node/domain.d.ts +13 -17
- node v24.12/events.d.ts → node/events.d.ts +866 -795
- node v24.12/fs/promises.d.ts → node/fs/promises.d.ts +7 -8
- node v24.12/fs.d.ts → node/fs.d.ts +419 -455
- node v24.12/globals.d.ts → node/globals.d.ts +6 -26
- node/globals.typedarray.d.ts +101 -0
- node v24.12/http.d.ts → node/http.d.ts +310 -276
- node v24.12/http2.d.ts → node/http2.d.ts +528 -804
- node v24.12/https.d.ts → node/https.d.ts +63 -243
- node v24.12/index.d.ts → node/index.d.ts +15 -1
- node/inspector/promises.d.ts +41 -0
- node v24.12/inspector.d.ts → node/inspector.d.ts +42 -50
- node v24.12/inspector.generated.d.ts → node/inspector.generated.d.ts +572 -417
- node v24.12/module.d.ts → node/module.d.ts +47 -195
- node v24.12/net.d.ts → node/net.d.ts +68 -189
- node v24.12/os.d.ts → node/os.d.ts +6 -6
- node v24.12/package.json → node/package.json +3 -3
- node/path/posix.d.ts +8 -0
- node/path/win32.d.ts +8 -0
- node/path.d.ts +187 -0
- node/perf_hooks.d.ts +643 -0
- node v24.12/process.d.ts → node/process.d.ts +219 -127
- node v24.12/punycode.d.ts → node/punycode.d.ts +5 -5
- node v24.12/querystring.d.ts → node/querystring.d.ts +4 -4
- node/quic.d.ts +910 -0
- node v24.12/readline/promises.d.ts → node/readline/promises.d.ts +3 -3
- node v24.12/readline.d.ts → node/readline.d.ts +68 -120
- node v24.12/repl.d.ts → node/repl.d.ts +75 -98
- node v24.12/sea.d.ts → node/sea.d.ts +1 -1
- node v24.12/sqlite.d.ts → node/sqlite.d.ts +137 -30
- node v24.12/stream/consumers.d.ts → node/stream/consumers.d.ts +10 -10
- node/stream/promises.d.ts +211 -0
- node/stream/web.d.ts +296 -0
- node v24.12/stream.d.ts → node/stream.d.ts +565 -478
- node v24.12/string_decoder.d.ts → node/string_decoder.d.ts +4 -4
- node/test/reporters.d.ts +96 -0
- node v24.12/test.d.ts → node/test.d.ts +134 -199
- node v24.12/timers/promises.d.ts → node/timers/promises.d.ts +4 -4
- node v24.12/timers.d.ts → node/timers.d.ts +4 -130
- node v24.12/tls.d.ts → node/tls.d.ts +109 -179
- node v24.12/trace_events.d.ts → node/trace_events.d.ts +9 -9
- node v24.12/ts5.6/buffer.buffer.d.ts → node/ts5.6/buffer.buffer.d.ts +1 -7
- node v24.12/ts5.6/index.d.ts → node/ts5.6/index.d.ts +15 -1
- node v24.12/ts5.7/index.d.ts → node/ts5.7/index.d.ts +15 -1
- node v24.12/tty.d.ts → node/tty.d.ts +58 -16
- node/url.d.ts +541 -0
- node/util/types.d.ts +558 -0
- node v24.12/util.d.ts → node/util.d.ts +150 -796
- node v24.12/v8.d.ts → node/v8.d.ts +31 -21
- node v24.12/vm.d.ts → node/vm.d.ts +43 -30
- node v24.12/wasi.d.ts → node/wasi.d.ts +4 -4
- node v24.12/web-globals/abortcontroller.d.ts → node/web-globals/abortcontroller.d.ts +27 -2
- node/web-globals/blob.d.ts +23 -0
- node/web-globals/console.d.ts +9 -0
- node v24.12/web-globals/crypto.d.ts → node/web-globals/crypto.d.ts +7 -0
- node/web-globals/encoding.d.ts +11 -0
- node v24.12/web-globals/events.d.ts → node/web-globals/events.d.ts +9 -0
- node v24.12/web-globals/fetch.d.ts → node/web-globals/fetch.d.ts +7 -0
- node/web-globals/importmeta.d.ts +13 -0
- node/web-globals/messaging.d.ts +23 -0
- node/web-globals/performance.d.ts +45 -0
- node/web-globals/streams.d.ts +115 -0
- node/web-globals/timers.d.ts +44 -0
- node/web-globals/url.d.ts +24 -0
- node v24.12/worker_threads.d.ts → node/worker_threads.d.ts +186 -363
- node v24.12/zlib.d.ts → node/zlib.d.ts +8 -71
- node v24.12/cluster.d.ts +0 -578
- node v24.12/console.d.ts +0 -453
- node v24.12/globals.typedarray.d.ts +0 -41
- node v24.12/path.d.ts +0 -200
- node v24.12/perf_hooks.d.ts +0 -1042
- node v24.12/stream/promises.d.ts +0 -90
- node v24.12/stream/web.d.ts +0 -573
- node v24.12/url.d.ts +0 -1057
- node v24.12/web-globals/streams.d.ts +0 -22
- {node v24.12 → node}/LICENSE +0 -0
- {node v24.12 → node}/compatibility/iterators.d.ts +0 -0
- {node v24.12 → node}/ts5.6/compatibility/float16array.d.ts +0 -0
- {node v24.12 → node}/ts5.6/globals.typedarray.d.ts +0 -0
- {node v24.12 → node}/ts5.7/compatibility/float16array.d.ts +0 -0
- {node v24.12 → node}/web-globals/domexception.d.ts +0 -0
- {node v24.12 → node}/web-globals/navigator.d.ts +0 -0
- {node v24.12 → node}/web-globals/storage.d.ts +0 -0
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* The timer functions within Node.js implement a similar API as the timers API
|
|
7
7
|
* provided by Web Browsers but use a different internal implementation that is
|
|
8
8
|
* built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout).
|
|
9
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/timers.js)
|
|
10
10
|
*/
|
|
11
|
-
declare module "timers" {
|
|
11
|
+
declare module "node:timers" {
|
|
12
12
|
import { Abortable } from "node:events";
|
|
13
13
|
import * as promises from "node:timers/promises";
|
|
14
14
|
export interface TimerOptions extends Abortable {
|
|
@@ -145,132 +145,6 @@ declare module "timers" {
|
|
|
145
145
|
_onTimeout(...args: any[]): void;
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
/**
|
|
149
|
-
* Schedules the "immediate" execution of the `callback` after I/O events'
|
|
150
|
-
* callbacks.
|
|
151
|
-
*
|
|
152
|
-
* When multiple calls to `setImmediate()` are made, the `callback` functions are
|
|
153
|
-
* queued for execution in the order in which they are created. The entire callback
|
|
154
|
-
* queue is processed every event loop iteration. If an immediate timer is queued
|
|
155
|
-
* from inside an executing callback, that timer will not be triggered until the
|
|
156
|
-
* next event loop iteration.
|
|
157
|
-
*
|
|
158
|
-
* If `callback` is not a function, a `TypeError` will be thrown.
|
|
159
|
-
*
|
|
160
|
-
* This method has a custom variant for promises that is available using
|
|
161
|
-
* `timersPromises.setImmediate()`.
|
|
162
|
-
* @since v0.9.1
|
|
163
|
-
* @param callback The function to call at the end of this turn of
|
|
164
|
-
* the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout)
|
|
165
|
-
* @param args Optional arguments to pass when the `callback` is called.
|
|
166
|
-
* @returns for use with `clearImmediate()`
|
|
167
|
-
*/
|
|
168
|
-
function setImmediate<TArgs extends any[]>(
|
|
169
|
-
callback: (...args: TArgs) => void,
|
|
170
|
-
...args: TArgs
|
|
171
|
-
): NodeJS.Immediate;
|
|
172
|
-
// Allow a single void-accepting argument to be optional in arguments lists.
|
|
173
|
-
// Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
|
|
174
|
-
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
175
|
-
function setImmediate(callback: (_: void) => void): NodeJS.Immediate;
|
|
176
|
-
namespace setImmediate {
|
|
177
|
-
import __promisify__ = promises.setImmediate;
|
|
178
|
-
export { __promisify__ };
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Schedules repeated execution of `callback` every `delay` milliseconds.
|
|
182
|
-
*
|
|
183
|
-
* When `delay` is larger than `2147483647` or less than `1` or `NaN`, the `delay`
|
|
184
|
-
* will be set to `1`. Non-integer delays are truncated to an integer.
|
|
185
|
-
*
|
|
186
|
-
* If `callback` is not a function, a `TypeError` will be thrown.
|
|
187
|
-
*
|
|
188
|
-
* This method has a custom variant for promises that is available using
|
|
189
|
-
* `timersPromises.setInterval()`.
|
|
190
|
-
* @since v0.0.1
|
|
191
|
-
* @param callback The function to call when the timer elapses.
|
|
192
|
-
* @param delay The number of milliseconds to wait before calling the
|
|
193
|
-
* `callback`. **Default:** `1`.
|
|
194
|
-
* @param args Optional arguments to pass when the `callback` is called.
|
|
195
|
-
* @returns for use with `clearInterval()`
|
|
196
|
-
*/
|
|
197
|
-
function setInterval<TArgs extends any[]>(
|
|
198
|
-
callback: (...args: TArgs) => void,
|
|
199
|
-
delay?: number,
|
|
200
|
-
...args: TArgs
|
|
201
|
-
): NodeJS.Timeout;
|
|
202
|
-
// Allow a single void-accepting argument to be optional in arguments lists.
|
|
203
|
-
// Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
|
|
204
|
-
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
205
|
-
function setInterval(callback: (_: void) => void, delay?: number): NodeJS.Timeout;
|
|
206
|
-
/**
|
|
207
|
-
* Schedules execution of a one-time `callback` after `delay` milliseconds.
|
|
208
|
-
*
|
|
209
|
-
* The `callback` will likely not be invoked in precisely `delay` milliseconds.
|
|
210
|
-
* Node.js makes no guarantees about the exact timing of when callbacks will fire,
|
|
211
|
-
* nor of their ordering. The callback will be called as close as possible to the
|
|
212
|
-
* time specified.
|
|
213
|
-
*
|
|
214
|
-
* When `delay` is larger than `2147483647` or less than `1` or `NaN`, the `delay`
|
|
215
|
-
* will be set to `1`. Non-integer delays are truncated to an integer.
|
|
216
|
-
*
|
|
217
|
-
* If `callback` is not a function, a `TypeError` will be thrown.
|
|
218
|
-
*
|
|
219
|
-
* This method has a custom variant for promises that is available using
|
|
220
|
-
* `timersPromises.setTimeout()`.
|
|
221
|
-
* @since v0.0.1
|
|
222
|
-
* @param callback The function to call when the timer elapses.
|
|
223
|
-
* @param delay The number of milliseconds to wait before calling the
|
|
224
|
-
* `callback`. **Default:** `1`.
|
|
225
|
-
* @param args Optional arguments to pass when the `callback` is called.
|
|
226
|
-
* @returns for use with `clearTimeout()`
|
|
227
|
-
*/
|
|
228
|
-
function setTimeout<TArgs extends any[]>(
|
|
229
|
-
callback: (...args: TArgs) => void,
|
|
230
|
-
delay?: number,
|
|
231
|
-
...args: TArgs
|
|
232
|
-
): NodeJS.Timeout;
|
|
233
|
-
// Allow a single void-accepting argument to be optional in arguments lists.
|
|
234
|
-
// Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
|
|
235
|
-
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
236
|
-
function setTimeout(callback: (_: void) => void, delay?: number): NodeJS.Timeout;
|
|
237
|
-
namespace setTimeout {
|
|
238
|
-
import __promisify__ = promises.setTimeout;
|
|
239
|
-
export { __promisify__ };
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Cancels an `Immediate` object created by `setImmediate()`.
|
|
243
|
-
* @since v0.9.1
|
|
244
|
-
* @param immediate An `Immediate` object as returned by `setImmediate()`.
|
|
245
|
-
*/
|
|
246
|
-
function clearImmediate(immediate: NodeJS.Immediate | undefined): void;
|
|
247
|
-
/**
|
|
248
|
-
* Cancels a `Timeout` object created by `setInterval()`.
|
|
249
|
-
* @since v0.0.1
|
|
250
|
-
* @param timeout A `Timeout` object as returned by `setInterval()`
|
|
251
|
-
* or the primitive of the `Timeout` object as a string or a number.
|
|
252
|
-
*/
|
|
253
|
-
function clearInterval(timeout: NodeJS.Timeout | string | number | undefined): void;
|
|
254
|
-
/**
|
|
255
|
-
* Cancels a `Timeout` object created by `setTimeout()`.
|
|
256
|
-
* @since v0.0.1
|
|
257
|
-
* @param timeout A `Timeout` object as returned by `setTimeout()`
|
|
258
|
-
* or the primitive of the `Timeout` object as a string or a number.
|
|
259
|
-
*/
|
|
260
|
-
function clearTimeout(timeout: NodeJS.Timeout | string | number | undefined): void;
|
|
261
|
-
/**
|
|
262
|
-
* The `queueMicrotask()` method queues a microtask to invoke `callback`. If
|
|
263
|
-
* `callback` throws an exception, the `process` object `'uncaughtException'`
|
|
264
|
-
* event will be emitted.
|
|
265
|
-
*
|
|
266
|
-
* The microtask queue is managed by V8 and may be used in a similar manner to
|
|
267
|
-
* the `process.nextTick()` queue, which is managed by Node.js. The
|
|
268
|
-
* `process.nextTick()` queue is always processed before the microtask queue
|
|
269
|
-
* within each turn of the Node.js event loop.
|
|
270
|
-
* @since v11.0.0
|
|
271
|
-
* @param callback Function to be queued.
|
|
272
|
-
*/
|
|
273
|
-
function queueMicrotask(callback: () => void): void;
|
|
274
148
|
}
|
|
275
149
|
import clearImmediate = globalThis.clearImmediate;
|
|
276
150
|
import clearInterval = globalThis.clearInterval;
|
|
@@ -280,6 +154,6 @@ declare module "timers" {
|
|
|
280
154
|
import setTimeout = globalThis.setTimeout;
|
|
281
155
|
export { clearImmediate, clearInterval, clearTimeout, promises, setImmediate, setInterval, setTimeout };
|
|
282
156
|
}
|
|
283
|
-
declare module "
|
|
284
|
-
export * from "timers";
|
|
157
|
+
declare module "timers" {
|
|
158
|
+
export * from "node:timers";
|
|
285
159
|
}
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* ```js
|
|
7
7
|
* import tls from 'node:tls';
|
|
8
8
|
* ```
|
|
9
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/tls.js)
|
|
10
10
|
*/
|
|
11
|
-
declare module "tls" {
|
|
11
|
+
declare module "node:tls" {
|
|
12
12
|
import { NonSharedBuffer } from "node:buffer";
|
|
13
13
|
import { X509Certificate } from "node:crypto";
|
|
14
14
|
import * as net from "node:net";
|
|
@@ -207,6 +207,13 @@ declare module "tls" {
|
|
|
207
207
|
*/
|
|
208
208
|
requestOCSP?: boolean | undefined;
|
|
209
209
|
}
|
|
210
|
+
interface TLSSocketEventMap extends net.SocketEventMap {
|
|
211
|
+
"keylog": [line: NonSharedBuffer];
|
|
212
|
+
"OCSPResponse": [response: NonSharedBuffer];
|
|
213
|
+
"secure": [];
|
|
214
|
+
"secureConnect": [];
|
|
215
|
+
"session": [session: NonSharedBuffer];
|
|
216
|
+
}
|
|
210
217
|
/**
|
|
211
218
|
* Performs transparent encryption of written data and all required TLS
|
|
212
219
|
* negotiation.
|
|
@@ -484,36 +491,48 @@ declare module "tls" {
|
|
|
484
491
|
* @return requested bytes of the keying material
|
|
485
492
|
*/
|
|
486
493
|
exportKeyingMaterial(length: number, label: string, context: Buffer): NonSharedBuffer;
|
|
487
|
-
|
|
488
|
-
addListener
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
emit(
|
|
494
|
-
emit(
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
once(
|
|
507
|
-
|
|
508
|
-
prependListener
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
prependOnceListener
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
494
|
+
// #region InternalEventEmitter
|
|
495
|
+
addListener<E extends keyof TLSSocketEventMap>(
|
|
496
|
+
eventName: E,
|
|
497
|
+
listener: (...args: TLSSocketEventMap[E]) => void,
|
|
498
|
+
): this;
|
|
499
|
+
addListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
500
|
+
emit<E extends keyof TLSSocketEventMap>(eventName: E, ...args: TLSSocketEventMap[E]): boolean;
|
|
501
|
+
emit(eventName: string | symbol, ...args: any[]): boolean;
|
|
502
|
+
listenerCount<E extends keyof TLSSocketEventMap>(
|
|
503
|
+
eventName: E,
|
|
504
|
+
listener?: (...args: TLSSocketEventMap[E]) => void,
|
|
505
|
+
): number;
|
|
506
|
+
listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number;
|
|
507
|
+
listeners<E extends keyof TLSSocketEventMap>(eventName: E): ((...args: TLSSocketEventMap[E]) => void)[];
|
|
508
|
+
listeners(eventName: string | symbol): ((...args: any[]) => void)[];
|
|
509
|
+
off<E extends keyof TLSSocketEventMap>(eventName: E, listener: (...args: TLSSocketEventMap[E]) => void): this;
|
|
510
|
+
off(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
511
|
+
on<E extends keyof TLSSocketEventMap>(eventName: E, listener: (...args: TLSSocketEventMap[E]) => void): this;
|
|
512
|
+
on(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
513
|
+
once<E extends keyof TLSSocketEventMap>(eventName: E, listener: (...args: TLSSocketEventMap[E]) => void): this;
|
|
514
|
+
once(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
515
|
+
prependListener<E extends keyof TLSSocketEventMap>(
|
|
516
|
+
eventName: E,
|
|
517
|
+
listener: (...args: TLSSocketEventMap[E]) => void,
|
|
518
|
+
): this;
|
|
519
|
+
prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
520
|
+
prependOnceListener<E extends keyof TLSSocketEventMap>(
|
|
521
|
+
eventName: E,
|
|
522
|
+
listener: (...args: TLSSocketEventMap[E]) => void,
|
|
523
|
+
): this;
|
|
524
|
+
prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
525
|
+
rawListeners<E extends keyof TLSSocketEventMap>(eventName: E): ((...args: TLSSocketEventMap[E]) => void)[];
|
|
526
|
+
rawListeners(eventName: string | symbol): ((...args: any[]) => void)[];
|
|
527
|
+
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
528
|
+
removeAllListeners<E extends keyof TLSSocketEventMap>(eventName?: E): this;
|
|
529
|
+
removeAllListeners(eventName?: string | symbol): this;
|
|
530
|
+
removeListener<E extends keyof TLSSocketEventMap>(
|
|
531
|
+
eventName: E,
|
|
532
|
+
listener: (...args: TLSSocketEventMap[E]) => void,
|
|
533
|
+
): this;
|
|
534
|
+
removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
535
|
+
// #endregion
|
|
517
536
|
}
|
|
518
537
|
interface CommonConnectionOptions {
|
|
519
538
|
/**
|
|
@@ -533,8 +552,12 @@ declare module "tls" {
|
|
|
533
552
|
*/
|
|
534
553
|
requestCert?: boolean | undefined;
|
|
535
554
|
/**
|
|
536
|
-
* An array of strings or a Buffer
|
|
537
|
-
*
|
|
555
|
+
* An array of strings, or a single `Buffer`, `TypedArray`, or `DataView` containing the supported
|
|
556
|
+
* ALPN protocols. Buffers should have the format `[len][name][len][name]...`
|
|
557
|
+
* e.g. `'\x08http/1.1\x08http/1.0'`, where the `len` byte is the length of the
|
|
558
|
+
* next protocol name. Passing an array is usually much simpler, e.g.
|
|
559
|
+
* `['http/1.1', 'http/1.0']`. Protocols earlier in the list have higher
|
|
560
|
+
* preference than those later.
|
|
538
561
|
*/
|
|
539
562
|
ALPNProtocols?: readonly string[] | NodeJS.ArrayBufferView | undefined;
|
|
540
563
|
/**
|
|
@@ -634,6 +657,19 @@ declare module "tls" {
|
|
|
634
657
|
*/
|
|
635
658
|
pskCallback?: ((hint: string | null) => PSKCallbackNegotation | null) | undefined;
|
|
636
659
|
}
|
|
660
|
+
interface ServerEventMap extends net.ServerEventMap {
|
|
661
|
+
"connection": [socket: net.Socket];
|
|
662
|
+
"keylog": [line: NonSharedBuffer, tlsSocket: TLSSocket];
|
|
663
|
+
"newSession": [sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void];
|
|
664
|
+
"OCSPRequest": [
|
|
665
|
+
certificate: NonSharedBuffer,
|
|
666
|
+
issuer: NonSharedBuffer,
|
|
667
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
668
|
+
];
|
|
669
|
+
"resumeSession": [sessionId: Buffer, callback: (err: Error | null, sessionData?: Buffer) => void];
|
|
670
|
+
"secureConnection": [tlsSocket: TLSSocket];
|
|
671
|
+
"tlsClientError": [exception: Error, tlsSocket: TLSSocket];
|
|
672
|
+
}
|
|
637
673
|
/**
|
|
638
674
|
* Accepts encrypted connections using TLS or SSL.
|
|
639
675
|
* @since v0.3.2
|
|
@@ -679,151 +715,45 @@ declare module "tls" {
|
|
|
679
715
|
* @param keys A 48-byte buffer containing the session ticket keys.
|
|
680
716
|
*/
|
|
681
717
|
setTicketKeys(keys: Buffer): void;
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
718
|
+
// #region InternalEventEmitter
|
|
719
|
+
addListener<E extends keyof ServerEventMap>(eventName: E, listener: (...args: ServerEventMap[E]) => void): this;
|
|
720
|
+
addListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
721
|
+
emit<E extends keyof ServerEventMap>(eventName: E, ...args: ServerEventMap[E]): boolean;
|
|
722
|
+
emit(eventName: string | symbol, ...args: any[]): boolean;
|
|
723
|
+
listenerCount<E extends keyof ServerEventMap>(
|
|
724
|
+
eventName: E,
|
|
725
|
+
listener?: (...args: ServerEventMap[E]) => void,
|
|
726
|
+
): number;
|
|
727
|
+
listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number;
|
|
728
|
+
listeners<E extends keyof ServerEventMap>(eventName: E): ((...args: ServerEventMap[E]) => void)[];
|
|
729
|
+
listeners(eventName: string | symbol): ((...args: any[]) => void)[];
|
|
730
|
+
off<E extends keyof ServerEventMap>(eventName: E, listener: (...args: ServerEventMap[E]) => void): this;
|
|
731
|
+
off(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
732
|
+
on<E extends keyof ServerEventMap>(eventName: E, listener: (...args: ServerEventMap[E]) => void): this;
|
|
733
|
+
on(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
734
|
+
once<E extends keyof ServerEventMap>(eventName: E, listener: (...args: ServerEventMap[E]) => void): this;
|
|
735
|
+
once(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
736
|
+
prependListener<E extends keyof ServerEventMap>(
|
|
737
|
+
eventName: E,
|
|
738
|
+
listener: (...args: ServerEventMap[E]) => void,
|
|
696
739
|
): this;
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
issuer: NonSharedBuffer,
|
|
702
|
-
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
703
|
-
) => void,
|
|
740
|
+
prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
741
|
+
prependOnceListener<E extends keyof ServerEventMap>(
|
|
742
|
+
eventName: E,
|
|
743
|
+
listener: (...args: ServerEventMap[E]) => void,
|
|
704
744
|
): this;
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
745
|
+
prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
746
|
+
rawListeners<E extends keyof ServerEventMap>(eventName: E): ((...args: ServerEventMap[E]) => void)[];
|
|
747
|
+
rawListeners(eventName: string | symbol): ((...args: any[]) => void)[];
|
|
748
|
+
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
749
|
+
removeAllListeners<E extends keyof ServerEventMap>(eventName?: E): this;
|
|
750
|
+
removeAllListeners(eventName?: string | symbol): this;
|
|
751
|
+
removeListener<E extends keyof ServerEventMap>(
|
|
752
|
+
eventName: E,
|
|
753
|
+
listener: (...args: ServerEventMap[E]) => void,
|
|
711
754
|
): this;
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
emit(event: string | symbol, ...args: any[]): boolean;
|
|
715
|
-
emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean;
|
|
716
|
-
emit(
|
|
717
|
-
event: "newSession",
|
|
718
|
-
sessionId: NonSharedBuffer,
|
|
719
|
-
sessionData: NonSharedBuffer,
|
|
720
|
-
callback: () => void,
|
|
721
|
-
): boolean;
|
|
722
|
-
emit(
|
|
723
|
-
event: "OCSPRequest",
|
|
724
|
-
certificate: NonSharedBuffer,
|
|
725
|
-
issuer: NonSharedBuffer,
|
|
726
|
-
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
727
|
-
): boolean;
|
|
728
|
-
emit(
|
|
729
|
-
event: "resumeSession",
|
|
730
|
-
sessionId: NonSharedBuffer,
|
|
731
|
-
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
732
|
-
): boolean;
|
|
733
|
-
emit(event: "secureConnection", tlsSocket: TLSSocket): boolean;
|
|
734
|
-
emit(event: "keylog", line: NonSharedBuffer, tlsSocket: TLSSocket): boolean;
|
|
735
|
-
on(event: string, listener: (...args: any[]) => void): this;
|
|
736
|
-
on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
|
737
|
-
on(
|
|
738
|
-
event: "newSession",
|
|
739
|
-
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
|
740
|
-
): this;
|
|
741
|
-
on(
|
|
742
|
-
event: "OCSPRequest",
|
|
743
|
-
listener: (
|
|
744
|
-
certificate: NonSharedBuffer,
|
|
745
|
-
issuer: NonSharedBuffer,
|
|
746
|
-
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
747
|
-
) => void,
|
|
748
|
-
): this;
|
|
749
|
-
on(
|
|
750
|
-
event: "resumeSession",
|
|
751
|
-
listener: (
|
|
752
|
-
sessionId: NonSharedBuffer,
|
|
753
|
-
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
754
|
-
) => void,
|
|
755
|
-
): this;
|
|
756
|
-
on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
|
757
|
-
on(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
|
|
758
|
-
once(event: string, listener: (...args: any[]) => void): this;
|
|
759
|
-
once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
|
760
|
-
once(
|
|
761
|
-
event: "newSession",
|
|
762
|
-
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
|
763
|
-
): this;
|
|
764
|
-
once(
|
|
765
|
-
event: "OCSPRequest",
|
|
766
|
-
listener: (
|
|
767
|
-
certificate: NonSharedBuffer,
|
|
768
|
-
issuer: NonSharedBuffer,
|
|
769
|
-
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
770
|
-
) => void,
|
|
771
|
-
): this;
|
|
772
|
-
once(
|
|
773
|
-
event: "resumeSession",
|
|
774
|
-
listener: (
|
|
775
|
-
sessionId: NonSharedBuffer,
|
|
776
|
-
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
777
|
-
) => void,
|
|
778
|
-
): this;
|
|
779
|
-
once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
|
780
|
-
once(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
|
|
781
|
-
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
782
|
-
prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
|
783
|
-
prependListener(
|
|
784
|
-
event: "newSession",
|
|
785
|
-
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
|
786
|
-
): this;
|
|
787
|
-
prependListener(
|
|
788
|
-
event: "OCSPRequest",
|
|
789
|
-
listener: (
|
|
790
|
-
certificate: NonSharedBuffer,
|
|
791
|
-
issuer: NonSharedBuffer,
|
|
792
|
-
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
793
|
-
) => void,
|
|
794
|
-
): this;
|
|
795
|
-
prependListener(
|
|
796
|
-
event: "resumeSession",
|
|
797
|
-
listener: (
|
|
798
|
-
sessionId: NonSharedBuffer,
|
|
799
|
-
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
800
|
-
) => void,
|
|
801
|
-
): this;
|
|
802
|
-
prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
|
803
|
-
prependListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
|
|
804
|
-
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
805
|
-
prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
|
806
|
-
prependOnceListener(
|
|
807
|
-
event: "newSession",
|
|
808
|
-
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
|
809
|
-
): this;
|
|
810
|
-
prependOnceListener(
|
|
811
|
-
event: "OCSPRequest",
|
|
812
|
-
listener: (
|
|
813
|
-
certificate: NonSharedBuffer,
|
|
814
|
-
issuer: NonSharedBuffer,
|
|
815
|
-
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
816
|
-
) => void,
|
|
817
|
-
): this;
|
|
818
|
-
prependOnceListener(
|
|
819
|
-
event: "resumeSession",
|
|
820
|
-
listener: (
|
|
821
|
-
sessionId: NonSharedBuffer,
|
|
822
|
-
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
823
|
-
) => void,
|
|
824
|
-
): this;
|
|
825
|
-
prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
|
826
|
-
prependOnceListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
|
|
755
|
+
removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
756
|
+
// #endregion
|
|
827
757
|
}
|
|
828
758
|
type SecureVersion = "TLSv1.3" | "TLSv1.2" | "TLSv1.1" | "TLSv1";
|
|
829
759
|
interface SecureContextOptions {
|
|
@@ -1179,7 +1109,7 @@ declare module "tls" {
|
|
|
1179
1109
|
* the `ciphers` option of `{@link createSecureContext}`.
|
|
1180
1110
|
*
|
|
1181
1111
|
* Not all supported ciphers are enabled by default. See
|
|
1182
|
-
* [Modifying the default TLS cipher suite](https://nodejs.org/docs/latest-
|
|
1112
|
+
* [Modifying the default TLS cipher suite](https://nodejs.org/docs/latest-v25.x/api/tls.html#modifying-the-default-tls-cipher-suite).
|
|
1183
1113
|
*
|
|
1184
1114
|
* Cipher names that start with `'tls_'` are for TLSv1.3, all the others are for
|
|
1185
1115
|
* TLSv1.2 and below.
|
|
@@ -1268,6 +1198,6 @@ declare module "tls" {
|
|
|
1268
1198
|
*/
|
|
1269
1199
|
const rootCertificates: readonly string[];
|
|
1270
1200
|
}
|
|
1271
|
-
declare module "
|
|
1272
|
-
export * from "tls";
|
|
1201
|
+
declare module "tls" {
|
|
1202
|
+
export * from "node:tls";
|
|
1273
1203
|
}
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* The available categories are:
|
|
10
10
|
*
|
|
11
11
|
* * `node`: An empty placeholder.
|
|
12
|
-
* * `node.async_hooks`: Enables capture of detailed [`async_hooks`](https://nodejs.org/docs/latest-
|
|
13
|
-
* The [`async_hooks`](https://nodejs.org/docs/latest-
|
|
12
|
+
* * `node.async_hooks`: Enables capture of detailed [`async_hooks`](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html) trace data.
|
|
13
|
+
* The [`async_hooks`](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html) events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property.
|
|
14
14
|
* * `node.bootstrap`: Enables capture of Node.js bootstrap milestones.
|
|
15
15
|
* * `node.console`: Enables capture of `console.time()` and `console.count()` output.
|
|
16
16
|
* * `node.threadpoolwork.sync`: Enables capture of trace data for threadpool synchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`.
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* * `node.fs_dir.sync`: Enables capture of trace data for file system sync directory methods.
|
|
23
23
|
* * `node.fs.async`: Enables capture of trace data for file system async methods.
|
|
24
24
|
* * `node.fs_dir.async`: Enables capture of trace data for file system async directory methods.
|
|
25
|
-
* * `node.perf`: Enables capture of [Performance API](https://nodejs.org/docs/latest-
|
|
25
|
+
* * `node.perf`: Enables capture of [Performance API](https://nodejs.org/docs/latest-v25.x/api/perf_hooks.html) measurements.
|
|
26
26
|
* * `node.perf.usertiming`: Enables capture of only Performance API User Timing
|
|
27
27
|
* measures and marks.
|
|
28
28
|
* * `node.perf.timerify`: Enables capture of only Performance API timerify
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
* * `node.promises.rejections`: Enables capture of trace data tracking the number
|
|
31
31
|
* of unhandled Promise rejections and handled-after-rejections.
|
|
32
32
|
* * `node.vm.script`: Enables capture of trace data for the `node:vm` module's `runInNewContext()`, `runInContext()`, and `runInThisContext()` methods.
|
|
33
|
-
* * `v8`: The [V8](https://nodejs.org/docs/latest-
|
|
33
|
+
* * `v8`: The [V8](https://nodejs.org/docs/latest-v25.x/api/v8.html) events are GC, compiling, and execution related.
|
|
34
34
|
* * `node.http`: Enables capture of trace data for http request / response.
|
|
35
35
|
*
|
|
36
36
|
* By default the `node`, `node.async_hooks`, and `v8` categories are enabled.
|
|
@@ -88,11 +88,11 @@
|
|
|
88
88
|
* However the trace-event timestamps are expressed in microseconds,
|
|
89
89
|
* unlike `process.hrtime()` which returns nanoseconds.
|
|
90
90
|
*
|
|
91
|
-
* The features from this module are not available in [`Worker`](https://nodejs.org/docs/latest-
|
|
91
|
+
* The features from this module are not available in [`Worker`](https://nodejs.org/docs/latest-v25.x/api/worker_threads.html#class-worker) threads.
|
|
92
92
|
* @experimental
|
|
93
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
93
|
+
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/trace_events.js)
|
|
94
94
|
*/
|
|
95
|
-
declare module "trace_events" {
|
|
95
|
+
declare module "node:trace_events" {
|
|
96
96
|
/**
|
|
97
97
|
* The `Tracing` object is used to enable or disable tracing for sets of
|
|
98
98
|
* categories. Instances are created using the
|
|
@@ -192,6 +192,6 @@ declare module "trace_events" {
|
|
|
192
192
|
*/
|
|
193
193
|
function getEnabledCategories(): string | undefined;
|
|
194
194
|
}
|
|
195
|
-
declare module "
|
|
196
|
-
export * from "trace_events";
|
|
195
|
+
declare module "trace_events" {
|
|
196
|
+
export * from "node:trace_events";
|
|
197
197
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare module "buffer" {
|
|
1
|
+
declare module "node:buffer" {
|
|
2
2
|
global {
|
|
3
3
|
interface BufferConstructor {
|
|
4
4
|
// see ../buffer.d.ts for implementation shared with all TypeScript versions
|
|
@@ -459,10 +459,4 @@ declare module "buffer" {
|
|
|
459
459
|
*/
|
|
460
460
|
type AllowSharedBuffer = Buffer;
|
|
461
461
|
}
|
|
462
|
-
/** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */
|
|
463
|
-
var SlowBuffer: {
|
|
464
|
-
/** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */
|
|
465
|
-
new(size: number): Buffer;
|
|
466
|
-
prototype: Buffer;
|
|
467
|
-
};
|
|
468
462
|
}
|
|
@@ -41,13 +41,21 @@
|
|
|
41
41
|
// Definitions for Node.js modules that are not specific to any version of TypeScript:
|
|
42
42
|
/// <reference path="../globals.d.ts" />
|
|
43
43
|
/// <reference path="../web-globals/abortcontroller.d.ts" />
|
|
44
|
+
/// <reference path="../web-globals/blob.d.ts" />
|
|
45
|
+
/// <reference path="../web-globals/console.d.ts" />
|
|
44
46
|
/// <reference path="../web-globals/crypto.d.ts" />
|
|
45
47
|
/// <reference path="../web-globals/domexception.d.ts" />
|
|
48
|
+
/// <reference path="../web-globals/encoding.d.ts" />
|
|
46
49
|
/// <reference path="../web-globals/events.d.ts" />
|
|
47
50
|
/// <reference path="../web-globals/fetch.d.ts" />
|
|
51
|
+
/// <reference path="../web-globals/importmeta.d.ts" />
|
|
52
|
+
/// <reference path="../web-globals/messaging.d.ts" />
|
|
48
53
|
/// <reference path="../web-globals/navigator.d.ts" />
|
|
54
|
+
/// <reference path="../web-globals/performance.d.ts" />
|
|
49
55
|
/// <reference path="../web-globals/storage.d.ts" />
|
|
50
56
|
/// <reference path="../web-globals/streams.d.ts" />
|
|
57
|
+
/// <reference path="../web-globals/timers.d.ts" />
|
|
58
|
+
/// <reference path="../web-globals/url.d.ts" />
|
|
51
59
|
/// <reference path="../assert.d.ts" />
|
|
52
60
|
/// <reference path="../assert/strict.d.ts" />
|
|
53
61
|
/// <reference path="../async_hooks.d.ts" />
|
|
@@ -70,25 +78,30 @@
|
|
|
70
78
|
/// <reference path="../https.d.ts" />
|
|
71
79
|
/// <reference path="../inspector.d.ts" />
|
|
72
80
|
/// <reference path="../inspector.generated.d.ts" />
|
|
81
|
+
/// <reference path="../inspector/promises.d.ts" />
|
|
73
82
|
/// <reference path="../module.d.ts" />
|
|
74
83
|
/// <reference path="../net.d.ts" />
|
|
75
84
|
/// <reference path="../os.d.ts" />
|
|
76
85
|
/// <reference path="../path.d.ts" />
|
|
86
|
+
/// <reference path="../path/posix.d.ts" />
|
|
87
|
+
/// <reference path="../path/win32.d.ts" />
|
|
77
88
|
/// <reference path="../perf_hooks.d.ts" />
|
|
78
89
|
/// <reference path="../process.d.ts" />
|
|
79
90
|
/// <reference path="../punycode.d.ts" />
|
|
80
91
|
/// <reference path="../querystring.d.ts" />
|
|
92
|
+
/// <reference path="../quic.d.ts" />
|
|
81
93
|
/// <reference path="../readline.d.ts" />
|
|
82
94
|
/// <reference path="../readline/promises.d.ts" />
|
|
83
95
|
/// <reference path="../repl.d.ts" />
|
|
84
96
|
/// <reference path="../sea.d.ts" />
|
|
85
97
|
/// <reference path="../sqlite.d.ts" />
|
|
86
98
|
/// <reference path="../stream.d.ts" />
|
|
87
|
-
/// <reference path="../stream/promises.d.ts" />
|
|
88
99
|
/// <reference path="../stream/consumers.d.ts" />
|
|
100
|
+
/// <reference path="../stream/promises.d.ts" />
|
|
89
101
|
/// <reference path="../stream/web.d.ts" />
|
|
90
102
|
/// <reference path="../string_decoder.d.ts" />
|
|
91
103
|
/// <reference path="../test.d.ts" />
|
|
104
|
+
/// <reference path="../test/reporters.d.ts" />
|
|
92
105
|
/// <reference path="../timers.d.ts" />
|
|
93
106
|
/// <reference path="../timers/promises.d.ts" />
|
|
94
107
|
/// <reference path="../tls.d.ts" />
|
|
@@ -96,6 +109,7 @@
|
|
|
96
109
|
/// <reference path="../tty.d.ts" />
|
|
97
110
|
/// <reference path="../url.d.ts" />
|
|
98
111
|
/// <reference path="../util.d.ts" />
|
|
112
|
+
/// <reference path="../util/types.d.ts" />
|
|
99
113
|
/// <reference path="../v8.d.ts" />
|
|
100
114
|
/// <reference path="../vm.d.ts" />
|
|
101
115
|
/// <reference path="../wasi.d.ts" />
|