@idlebox/stripe-node-types 24.0.14 → 24.0.15
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.
- package/README.md +1 -1
- package/assert/strict.d.ts +98 -1
- package/assert.d.ts +147 -248
- package/async_hooks.d.ts +5 -5
- package/buffer.buffer.d.ts +9 -6
- package/buffer.d.ts +49 -169
- package/child_process.d.ts +102 -223
- package/cluster.d.ts +236 -329
- package/console.d.ts +45 -346
- package/constants.d.ts +0 -1
- package/crypto.d.ts +698 -1149
- package/dgram.d.ts +15 -50
- package/diagnostics_channel.d.ts +1 -3
- package/dns.d.ts +135 -131
- package/domain.d.ts +10 -14
- package/events.d.ts +846 -722
- package/fs/promises.d.ts +102 -53
- package/fs.d.ts +714 -484
- package/globals.d.ts +130 -347
- package/globals.typedarray.d.ts +79 -0
- package/http.d.ts +343 -246
- package/http2.d.ts +563 -711
- package/https.d.ts +70 -216
- package/index.d.ts +24 -3
- package/inspector/promises.d.ts +54 -0
- package/inspector.d.ts +167 -3938
- package/inspector.generated.d.ts +4242 -0
- package/module.d.ts +45 -95
- package/net.d.ts +87 -186
- package/os.d.ts +17 -6
- package/package.json +3 -8
- package/path/posix.d.ts +20 -0
- package/path/win32.d.ts +20 -0
- package/path.d.ts +117 -122
- package/perf_hooks.d.ts +295 -644
- package/process.d.ts +177 -138
- package/punycode.d.ts +2 -2
- package/querystring.d.ts +1 -1
- package/quic.d.ts +926 -0
- package/readline/promises.d.ts +1 -1
- package/readline.d.ts +65 -118
- package/repl.d.ts +83 -96
- package/sea.d.ts +10 -1
- package/sqlite.d.ts +262 -13
- package/stream/consumers.d.ts +7 -7
- package/stream/promises.d.ts +133 -12
- package/stream/web.d.ts +173 -495
- package/stream.d.ts +593 -490
- package/string_decoder.d.ts +3 -3
- package/test/reporters.d.ts +112 -0
- package/test.d.ts +223 -199
- package/timers/promises.d.ts +1 -1
- package/timers.d.ts +1 -129
- package/tls.d.ts +148 -163
- package/trace_events.d.ts +6 -6
- package/ts5.6/buffer.buffer.d.ts +10 -8
- package/ts5.6/globals.typedarray.d.ts +16 -0
- package/ts5.6/index.d.ts +24 -3
- package/ts5.7/index.d.ts +24 -3
- package/tty.d.ts +55 -13
- package/url.d.ts +92 -587
- package/util/types.d.ts +571 -0
- package/util.d.ts +143 -792
- package/v8.d.ts +67 -7
- package/vm.d.ts +252 -108
- package/wasi.d.ts +23 -2
- package/web-globals/abortcontroller.d.ts +75 -0
- package/web-globals/blob.d.ts +39 -0
- package/{ts5.1/compatibility/disposable.d.ts → web-globals/console.d.ts} +6 -9
- package/web-globals/crypto.d.ts +55 -0
- package/web-globals/domexception.d.ts +84 -0
- package/web-globals/encoding.d.ts +27 -0
- package/{dom-events.d.ts → web-globals/events.d.ts} +57 -50
- package/web-globals/fetch.d.ts +70 -0
- package/web-globals/importmeta.d.ts +29 -0
- package/web-globals/messaging.d.ts +39 -0
- package/web-globals/navigator.d.ts +41 -0
- package/web-globals/performance.d.ts +61 -0
- package/web-globals/storage.d.ts +40 -0
- package/web-globals/streams.d.ts +131 -0
- package/web-globals/timers.d.ts +60 -0
- package/web-globals/url.d.ts +40 -0
- package/worker_threads.d.ts +291 -349
- package/zlib.d.ts +44 -94
- package/ts5.1/index.d.ts +0 -115
package/timers.d.ts
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* The timer functions within Node.js implement a similar API as the timers API
|
|
22
22
|
* provided by Web Browsers but use a different internal implementation that is
|
|
23
23
|
* built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout).
|
|
24
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
24
|
+
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/timers.js)
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
27
|
declare module "node:timers" {
|
|
@@ -76,7 +76,6 @@ declare module "node:timers" {
|
|
|
76
76
|
/**
|
|
77
77
|
* Cancels the immediate. This is similar to calling `clearImmediate()`.
|
|
78
78
|
* @since v20.5.0, v18.18.0
|
|
79
|
-
* @experimental
|
|
80
79
|
*/
|
|
81
80
|
[Symbol.dispose](): void;
|
|
82
81
|
_onImmediate(...args: any[]): void;
|
|
@@ -157,138 +156,11 @@ declare module "node:timers" {
|
|
|
157
156
|
/**
|
|
158
157
|
* Cancels the timeout.
|
|
159
158
|
* @since v20.5.0, v18.18.0
|
|
160
|
-
* @experimental
|
|
161
159
|
*/
|
|
162
160
|
[Symbol.dispose](): void;
|
|
163
161
|
_onTimeout(...args: any[]): void;
|
|
164
162
|
}
|
|
165
163
|
}
|
|
166
|
-
/**
|
|
167
|
-
* Schedules the "immediate" execution of the `callback` after I/O events'
|
|
168
|
-
* callbacks.
|
|
169
|
-
*
|
|
170
|
-
* When multiple calls to `setImmediate()` are made, the `callback` functions are
|
|
171
|
-
* queued for execution in the order in which they are created. The entire callback
|
|
172
|
-
* queue is processed every event loop iteration. If an immediate timer is queued
|
|
173
|
-
* from inside an executing callback, that timer will not be triggered until the
|
|
174
|
-
* next event loop iteration.
|
|
175
|
-
*
|
|
176
|
-
* If `callback` is not a function, a `TypeError` will be thrown.
|
|
177
|
-
*
|
|
178
|
-
* This method has a custom variant for promises that is available using
|
|
179
|
-
* `timersPromises.setImmediate()`.
|
|
180
|
-
* @since v0.9.1
|
|
181
|
-
* @param callback The function to call at the end of this turn of
|
|
182
|
-
* the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout)
|
|
183
|
-
* @param args Optional arguments to pass when the `callback` is called.
|
|
184
|
-
* @returns for use with `clearImmediate()`
|
|
185
|
-
*/
|
|
186
|
-
function setImmediate<TArgs extends any[]>(
|
|
187
|
-
callback: (...args: TArgs) => void,
|
|
188
|
-
...args: TArgs
|
|
189
|
-
): NodeJS.Immediate;
|
|
190
|
-
// Allow a single void-accepting argument to be optional in arguments lists.
|
|
191
|
-
// Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
|
|
192
|
-
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
193
|
-
function setImmediate(callback: (_: void) => void): NodeJS.Immediate;
|
|
194
|
-
namespace setImmediate {
|
|
195
|
-
import __promisify__ = promises.setImmediate;
|
|
196
|
-
export { __promisify__ };
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Schedules repeated execution of `callback` every `delay` milliseconds.
|
|
200
|
-
*
|
|
201
|
-
* When `delay` is larger than `2147483647` or less than `1` or `NaN`, the `delay`
|
|
202
|
-
* will be set to `1`. Non-integer delays are truncated to an integer.
|
|
203
|
-
*
|
|
204
|
-
* If `callback` is not a function, a `TypeError` will be thrown.
|
|
205
|
-
*
|
|
206
|
-
* This method has a custom variant for promises that is available using
|
|
207
|
-
* `timersPromises.setInterval()`.
|
|
208
|
-
* @since v0.0.1
|
|
209
|
-
* @param callback The function to call when the timer elapses.
|
|
210
|
-
* @param delay The number of milliseconds to wait before calling the
|
|
211
|
-
* `callback`. **Default:** `1`.
|
|
212
|
-
* @param args Optional arguments to pass when the `callback` is called.
|
|
213
|
-
* @returns for use with `clearInterval()`
|
|
214
|
-
*/
|
|
215
|
-
function setInterval<TArgs extends any[]>(
|
|
216
|
-
callback: (...args: TArgs) => void,
|
|
217
|
-
delay?: number,
|
|
218
|
-
...args: TArgs
|
|
219
|
-
): NodeJS.Timeout;
|
|
220
|
-
// Allow a single void-accepting argument to be optional in arguments lists.
|
|
221
|
-
// Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
|
|
222
|
-
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
223
|
-
function setInterval(callback: (_: void) => void, delay?: number): NodeJS.Timeout;
|
|
224
|
-
/**
|
|
225
|
-
* Schedules execution of a one-time `callback` after `delay` milliseconds.
|
|
226
|
-
*
|
|
227
|
-
* The `callback` will likely not be invoked in precisely `delay` milliseconds.
|
|
228
|
-
* Node.js makes no guarantees about the exact timing of when callbacks will fire,
|
|
229
|
-
* nor of their ordering. The callback will be called as close as possible to the
|
|
230
|
-
* time specified.
|
|
231
|
-
*
|
|
232
|
-
* When `delay` is larger than `2147483647` or less than `1` or `NaN`, the `delay`
|
|
233
|
-
* will be set to `1`. Non-integer delays are truncated to an integer.
|
|
234
|
-
*
|
|
235
|
-
* If `callback` is not a function, a `TypeError` will be thrown.
|
|
236
|
-
*
|
|
237
|
-
* This method has a custom variant for promises that is available using
|
|
238
|
-
* `timersPromises.setTimeout()`.
|
|
239
|
-
* @since v0.0.1
|
|
240
|
-
* @param callback The function to call when the timer elapses.
|
|
241
|
-
* @param delay The number of milliseconds to wait before calling the
|
|
242
|
-
* `callback`. **Default:** `1`.
|
|
243
|
-
* @param args Optional arguments to pass when the `callback` is called.
|
|
244
|
-
* @returns for use with `clearTimeout()`
|
|
245
|
-
*/
|
|
246
|
-
function setTimeout<TArgs extends any[]>(
|
|
247
|
-
callback: (...args: TArgs) => void,
|
|
248
|
-
delay?: number,
|
|
249
|
-
...args: TArgs
|
|
250
|
-
): NodeJS.Timeout;
|
|
251
|
-
// Allow a single void-accepting argument to be optional in arguments lists.
|
|
252
|
-
// Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
|
|
253
|
-
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
254
|
-
function setTimeout(callback: (_: void) => void, delay?: number): NodeJS.Timeout;
|
|
255
|
-
namespace setTimeout {
|
|
256
|
-
import __promisify__ = promises.setTimeout;
|
|
257
|
-
export { __promisify__ };
|
|
258
|
-
}
|
|
259
|
-
/**
|
|
260
|
-
* Cancels an `Immediate` object created by `setImmediate()`.
|
|
261
|
-
* @since v0.9.1
|
|
262
|
-
* @param immediate An `Immediate` object as returned by `setImmediate()`.
|
|
263
|
-
*/
|
|
264
|
-
function clearImmediate(immediate: NodeJS.Immediate | undefined): void;
|
|
265
|
-
/**
|
|
266
|
-
* Cancels a `Timeout` object created by `setInterval()`.
|
|
267
|
-
* @since v0.0.1
|
|
268
|
-
* @param timeout A `Timeout` object as returned by `setInterval()`
|
|
269
|
-
* or the primitive of the `Timeout` object as a string or a number.
|
|
270
|
-
*/
|
|
271
|
-
function clearInterval(timeout: NodeJS.Timeout | string | number | undefined): void;
|
|
272
|
-
/**
|
|
273
|
-
* Cancels a `Timeout` object created by `setTimeout()`.
|
|
274
|
-
* @since v0.0.1
|
|
275
|
-
* @param timeout A `Timeout` object as returned by `setTimeout()`
|
|
276
|
-
* or the primitive of the `Timeout` object as a string or a number.
|
|
277
|
-
*/
|
|
278
|
-
function clearTimeout(timeout: NodeJS.Timeout | string | number | undefined): void;
|
|
279
|
-
/**
|
|
280
|
-
* The `queueMicrotask()` method queues a microtask to invoke `callback`. If
|
|
281
|
-
* `callback` throws an exception, the `process` object `'uncaughtException'`
|
|
282
|
-
* event will be emitted.
|
|
283
|
-
*
|
|
284
|
-
* The microtask queue is managed by V8 and may be used in a similar manner to
|
|
285
|
-
* the `process.nextTick()` queue, which is managed by Node.js. The
|
|
286
|
-
* `process.nextTick()` queue is always processed before the microtask queue
|
|
287
|
-
* within each turn of the Node.js event loop.
|
|
288
|
-
* @since v11.0.0
|
|
289
|
-
* @param callback Function to be queued.
|
|
290
|
-
*/
|
|
291
|
-
function queueMicrotask(callback: () => void): void;
|
|
292
164
|
}
|
|
293
165
|
import clearImmediate = globalThis.clearImmediate;
|
|
294
166
|
import clearInterval = globalThis.clearInterval;
|
package/tls.d.ts
CHANGED
|
@@ -21,10 +21,11 @@
|
|
|
21
21
|
* ```js
|
|
22
22
|
* import tls from 'node:tls';
|
|
23
23
|
* ```
|
|
24
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
24
|
+
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/tls.js)
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
27
|
declare module "node:tls" {
|
|
28
|
+
import { NonSharedBuffer } from 'node:buffer';
|
|
28
29
|
import { X509Certificate } from 'node:crypto';
|
|
29
30
|
import * as net from 'node:net';
|
|
30
31
|
import * as stream from 'node:stream';
|
|
@@ -65,7 +66,7 @@ declare module "node:tls" {
|
|
|
65
66
|
/**
|
|
66
67
|
* The DER encoded X.509 certificate data.
|
|
67
68
|
*/
|
|
68
|
-
raw:
|
|
69
|
+
raw: NonSharedBuffer;
|
|
69
70
|
/**
|
|
70
71
|
* The certificate subject.
|
|
71
72
|
*/
|
|
@@ -131,7 +132,7 @@ declare module "node:tls" {
|
|
|
131
132
|
/**
|
|
132
133
|
* The public key.
|
|
133
134
|
*/
|
|
134
|
-
pubkey?:
|
|
135
|
+
pubkey?: NonSharedBuffer;
|
|
135
136
|
/**
|
|
136
137
|
* The ASN.1 name of the OID of the elliptic curve.
|
|
137
138
|
* Well-known curves are identified by an OID.
|
|
@@ -222,6 +223,12 @@ declare module "node:tls" {
|
|
|
222
223
|
*/
|
|
223
224
|
requestOCSP?: boolean | undefined;
|
|
224
225
|
}
|
|
226
|
+
interface TLSSocketEventMap extends net.SocketEventMap {
|
|
227
|
+
"keylog": [line: NonSharedBuffer];
|
|
228
|
+
"OCSPResponse": [response: NonSharedBuffer];
|
|
229
|
+
"secureConnect": [];
|
|
230
|
+
"session": [session: NonSharedBuffer];
|
|
231
|
+
}
|
|
225
232
|
/**
|
|
226
233
|
* Performs transparent encryption of written data and all required TLS
|
|
227
234
|
* negotiation.
|
|
@@ -260,6 +267,10 @@ declare module "node:tls" {
|
|
|
260
267
|
* When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false.
|
|
261
268
|
*/
|
|
262
269
|
alpnProtocol: string | false | null;
|
|
270
|
+
/**
|
|
271
|
+
* String containing the server name requested via SNI (Server Name Indication) TLS extension.
|
|
272
|
+
*/
|
|
273
|
+
servername: string | false | null;
|
|
263
274
|
/**
|
|
264
275
|
* Returns an object representing the local certificate. The returned object has
|
|
265
276
|
* some properties corresponding to the fields of the certificate.
|
|
@@ -311,7 +322,7 @@ declare module "node:tls" {
|
|
|
311
322
|
* @since v9.9.0
|
|
312
323
|
* @return The latest `Finished` message that has been sent to the socket as part of a SSL/TLS handshake, or `undefined` if no `Finished` message has been sent yet.
|
|
313
324
|
*/
|
|
314
|
-
getFinished():
|
|
325
|
+
getFinished(): NonSharedBuffer | undefined;
|
|
315
326
|
/**
|
|
316
327
|
* Returns an object representing the peer's certificate. If the peer does not
|
|
317
328
|
* provide a certificate, an empty object will be returned. If the socket has been
|
|
@@ -338,7 +349,7 @@ declare module "node:tls" {
|
|
|
338
349
|
* @return The latest `Finished` message that is expected or has actually been received from the socket as part of a SSL/TLS handshake, or `undefined` if there is no `Finished` message so
|
|
339
350
|
* far.
|
|
340
351
|
*/
|
|
341
|
-
getPeerFinished():
|
|
352
|
+
getPeerFinished(): NonSharedBuffer | undefined;
|
|
342
353
|
/**
|
|
343
354
|
* Returns a string containing the negotiated SSL/TLS protocol version of the
|
|
344
355
|
* current connection. The value `'unknown'` will be returned for connected
|
|
@@ -368,7 +379,7 @@ declare module "node:tls" {
|
|
|
368
379
|
* must use the `'session'` event (it also works for TLSv1.2 and below).
|
|
369
380
|
* @since v0.11.4
|
|
370
381
|
*/
|
|
371
|
-
getSession():
|
|
382
|
+
getSession(): NonSharedBuffer | undefined;
|
|
372
383
|
/**
|
|
373
384
|
* See [SSL\_get\_shared\_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html) for more information.
|
|
374
385
|
* @since v12.11.0
|
|
@@ -383,7 +394,7 @@ declare module "node:tls" {
|
|
|
383
394
|
* See `Session Resumption` for more information.
|
|
384
395
|
* @since v0.11.4
|
|
385
396
|
*/
|
|
386
|
-
getTLSTicket():
|
|
397
|
+
getTLSTicket(): NonSharedBuffer | undefined;
|
|
387
398
|
/**
|
|
388
399
|
* See `Session Resumption` for more information.
|
|
389
400
|
* @since v0.5.6
|
|
@@ -494,37 +505,49 @@ declare module "node:tls" {
|
|
|
494
505
|
* @param context Optionally provide a context.
|
|
495
506
|
* @return requested bytes of the keying material
|
|
496
507
|
*/
|
|
497
|
-
exportKeyingMaterial(length: number, label: string, context: Buffer):
|
|
498
|
-
|
|
499
|
-
addListener
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
emit(
|
|
505
|
-
emit(
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
once(
|
|
518
|
-
|
|
519
|
-
prependListener
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
prependOnceListener
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
508
|
+
exportKeyingMaterial(length: number, label: string, context: Buffer): NonSharedBuffer;
|
|
509
|
+
// #region InternalEventEmitter
|
|
510
|
+
addListener<E extends keyof TLSSocketEventMap>(
|
|
511
|
+
eventName: E,
|
|
512
|
+
listener: (...args: TLSSocketEventMap[E]) => void,
|
|
513
|
+
): this;
|
|
514
|
+
addListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
515
|
+
emit<E extends keyof TLSSocketEventMap>(eventName: E, ...args: TLSSocketEventMap[E]): boolean;
|
|
516
|
+
emit(eventName: string | symbol, ...args: any[]): boolean;
|
|
517
|
+
listenerCount<E extends keyof TLSSocketEventMap>(
|
|
518
|
+
eventName: E,
|
|
519
|
+
listener?: (...args: TLSSocketEventMap[E]) => void,
|
|
520
|
+
): number;
|
|
521
|
+
listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number;
|
|
522
|
+
listeners<E extends keyof TLSSocketEventMap>(eventName: E): ((...args: TLSSocketEventMap[E]) => void)[];
|
|
523
|
+
listeners(eventName: string | symbol): ((...args: any[]) => void)[];
|
|
524
|
+
off<E extends keyof TLSSocketEventMap>(eventName: E, listener: (...args: TLSSocketEventMap[E]) => void): this;
|
|
525
|
+
off(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
526
|
+
on<E extends keyof TLSSocketEventMap>(eventName: E, listener: (...args: TLSSocketEventMap[E]) => void): this;
|
|
527
|
+
on(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
528
|
+
once<E extends keyof TLSSocketEventMap>(eventName: E, listener: (...args: TLSSocketEventMap[E]) => void): this;
|
|
529
|
+
once(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
530
|
+
prependListener<E extends keyof TLSSocketEventMap>(
|
|
531
|
+
eventName: E,
|
|
532
|
+
listener: (...args: TLSSocketEventMap[E]) => void,
|
|
533
|
+
): this;
|
|
534
|
+
prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
535
|
+
prependOnceListener<E extends keyof TLSSocketEventMap>(
|
|
536
|
+
eventName: E,
|
|
537
|
+
listener: (...args: TLSSocketEventMap[E]) => void,
|
|
538
|
+
): this;
|
|
539
|
+
prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
540
|
+
rawListeners<E extends keyof TLSSocketEventMap>(eventName: E): ((...args: TLSSocketEventMap[E]) => void)[];
|
|
541
|
+
rawListeners(eventName: string | symbol): ((...args: any[]) => void)[];
|
|
542
|
+
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
543
|
+
removeAllListeners<E extends keyof TLSSocketEventMap>(eventName?: E): this;
|
|
544
|
+
removeAllListeners(eventName?: string | symbol): this;
|
|
545
|
+
removeListener<E extends keyof TLSSocketEventMap>(
|
|
546
|
+
eventName: E,
|
|
547
|
+
listener: (...args: TLSSocketEventMap[E]) => void,
|
|
548
|
+
): this;
|
|
549
|
+
removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
550
|
+
// #endregion
|
|
528
551
|
}
|
|
529
552
|
interface CommonConnectionOptions {
|
|
530
553
|
/**
|
|
@@ -547,7 +570,7 @@ declare module "node:tls" {
|
|
|
547
570
|
* An array of strings or a Buffer naming possible ALPN protocols.
|
|
548
571
|
* (Protocols should be ordered by their priority.)
|
|
549
572
|
*/
|
|
550
|
-
ALPNProtocols?: string[] |
|
|
573
|
+
ALPNProtocols?: readonly string[] | NodeJS.ArrayBufferView | undefined;
|
|
551
574
|
/**
|
|
552
575
|
* SNICallback(servername, cb) <Function> A function that will be
|
|
553
576
|
* called if the client supports SNI TLS extension. Two arguments
|
|
@@ -602,7 +625,7 @@ declare module "node:tls" {
|
|
|
602
625
|
* requires explicitly specifying a cipher suite with the `ciphers` option.
|
|
603
626
|
* More information can be found in the RFC 4279.
|
|
604
627
|
*/
|
|
605
|
-
pskCallback
|
|
628
|
+
pskCallback?: ((socket: TLSSocket, identity: string) => NodeJS.ArrayBufferView | null) | undefined;
|
|
606
629
|
/**
|
|
607
630
|
* hint to send to a client to help
|
|
608
631
|
* with selecting the identity during TLS-PSK negotiation. Will be ignored
|
|
@@ -612,7 +635,7 @@ declare module "node:tls" {
|
|
|
612
635
|
pskIdentityHint?: string | undefined;
|
|
613
636
|
}
|
|
614
637
|
interface PSKCallbackNegotation {
|
|
615
|
-
psk:
|
|
638
|
+
psk: NodeJS.ArrayBufferView;
|
|
616
639
|
identity: string;
|
|
617
640
|
}
|
|
618
641
|
interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions {
|
|
@@ -643,7 +666,20 @@ declare module "node:tls" {
|
|
|
643
666
|
* compatible with the selected cipher's digest.
|
|
644
667
|
* `identity` must use UTF-8 encoding.
|
|
645
668
|
*/
|
|
646
|
-
pskCallback
|
|
669
|
+
pskCallback?: ((hint: string | null) => PSKCallbackNegotation | null) | undefined;
|
|
670
|
+
}
|
|
671
|
+
interface ServerEventMap extends net.ServerEventMap {
|
|
672
|
+
"connection": [socket: net.Socket];
|
|
673
|
+
"keylog": [line: NonSharedBuffer, tlsSocket: TLSSocket];
|
|
674
|
+
"newSession": [sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void];
|
|
675
|
+
"OCSPRequest": [
|
|
676
|
+
certificate: NonSharedBuffer,
|
|
677
|
+
issuer: NonSharedBuffer,
|
|
678
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
679
|
+
];
|
|
680
|
+
"resumeSession": [sessionId: Buffer, callback: (err: Error | null, sessionData?: Buffer) => void];
|
|
681
|
+
"secureConnection": [tlsSocket: TLSSocket];
|
|
682
|
+
"tlsClientError": [exception: Error, tlsSocket: TLSSocket];
|
|
647
683
|
}
|
|
648
684
|
/**
|
|
649
685
|
* Accepts encrypted connections using TLS or SSL.
|
|
@@ -671,7 +707,7 @@ declare module "node:tls" {
|
|
|
671
707
|
* @since v3.0.0
|
|
672
708
|
* @return A 48-byte buffer containing the session ticket keys.
|
|
673
709
|
*/
|
|
674
|
-
getTicketKeys():
|
|
710
|
+
getTicketKeys(): NonSharedBuffer;
|
|
675
711
|
/**
|
|
676
712
|
* The `server.setSecureContext()` method replaces the secure context of an
|
|
677
713
|
* existing server. Existing connections to the server are not interrupted.
|
|
@@ -690,128 +726,45 @@ declare module "node:tls" {
|
|
|
690
726
|
* @param keys A 48-byte buffer containing the session ticket keys.
|
|
691
727
|
*/
|
|
692
728
|
setTicketKeys(keys: Buffer): void;
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
): this;
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
) => void,
|
|
715
|
-
): this;
|
|
716
|
-
addListener(
|
|
717
|
-
event: "resumeSession",
|
|
718
|
-
listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
|
|
719
|
-
): this;
|
|
720
|
-
addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
|
721
|
-
addListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
|
|
722
|
-
emit(event: string | symbol, ...args: any[]): boolean;
|
|
723
|
-
emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean;
|
|
724
|
-
emit(event: "newSession", sessionId: Buffer, sessionData: Buffer, callback: () => void): boolean;
|
|
725
|
-
emit(
|
|
726
|
-
event: "OCSPRequest",
|
|
727
|
-
certificate: Buffer,
|
|
728
|
-
issuer: Buffer,
|
|
729
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
730
|
-
): boolean;
|
|
731
|
-
emit(
|
|
732
|
-
event: "resumeSession",
|
|
733
|
-
sessionId: Buffer,
|
|
734
|
-
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
735
|
-
): boolean;
|
|
736
|
-
emit(event: "secureConnection", tlsSocket: TLSSocket): boolean;
|
|
737
|
-
emit(event: "keylog", line: Buffer, tlsSocket: TLSSocket): boolean;
|
|
738
|
-
on(event: string, listener: (...args: any[]) => void): this;
|
|
739
|
-
on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
|
740
|
-
on(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this;
|
|
741
|
-
on(
|
|
742
|
-
event: "OCSPRequest",
|
|
743
|
-
listener: (
|
|
744
|
-
certificate: Buffer,
|
|
745
|
-
issuer: Buffer,
|
|
746
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
747
|
-
) => void,
|
|
748
|
-
): this;
|
|
749
|
-
on(
|
|
750
|
-
event: "resumeSession",
|
|
751
|
-
listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
|
|
752
|
-
): this;
|
|
753
|
-
on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
|
754
|
-
on(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
|
|
755
|
-
once(event: string, listener: (...args: any[]) => void): this;
|
|
756
|
-
once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
|
757
|
-
once(
|
|
758
|
-
event: "newSession",
|
|
759
|
-
listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
|
|
760
|
-
): this;
|
|
761
|
-
once(
|
|
762
|
-
event: "OCSPRequest",
|
|
763
|
-
listener: (
|
|
764
|
-
certificate: Buffer,
|
|
765
|
-
issuer: Buffer,
|
|
766
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
767
|
-
) => void,
|
|
768
|
-
): this;
|
|
769
|
-
once(
|
|
770
|
-
event: "resumeSession",
|
|
771
|
-
listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
|
|
772
|
-
): this;
|
|
773
|
-
once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
|
774
|
-
once(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
|
|
775
|
-
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
776
|
-
prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
|
777
|
-
prependListener(
|
|
778
|
-
event: "newSession",
|
|
779
|
-
listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
|
|
729
|
+
// #region InternalEventEmitter
|
|
730
|
+
addListener<E extends keyof ServerEventMap>(eventName: E, listener: (...args: ServerEventMap[E]) => void): this;
|
|
731
|
+
addListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
732
|
+
emit<E extends keyof ServerEventMap>(eventName: E, ...args: ServerEventMap[E]): boolean;
|
|
733
|
+
emit(eventName: string | symbol, ...args: any[]): boolean;
|
|
734
|
+
listenerCount<E extends keyof ServerEventMap>(
|
|
735
|
+
eventName: E,
|
|
736
|
+
listener?: (...args: ServerEventMap[E]) => void,
|
|
737
|
+
): number;
|
|
738
|
+
listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number;
|
|
739
|
+
listeners<E extends keyof ServerEventMap>(eventName: E): ((...args: ServerEventMap[E]) => void)[];
|
|
740
|
+
listeners(eventName: string | symbol): ((...args: any[]) => void)[];
|
|
741
|
+
off<E extends keyof ServerEventMap>(eventName: E, listener: (...args: ServerEventMap[E]) => void): this;
|
|
742
|
+
off(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
743
|
+
on<E extends keyof ServerEventMap>(eventName: E, listener: (...args: ServerEventMap[E]) => void): this;
|
|
744
|
+
on(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
745
|
+
once<E extends keyof ServerEventMap>(eventName: E, listener: (...args: ServerEventMap[E]) => void): this;
|
|
746
|
+
once(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
747
|
+
prependListener<E extends keyof ServerEventMap>(
|
|
748
|
+
eventName: E,
|
|
749
|
+
listener: (...args: ServerEventMap[E]) => void,
|
|
780
750
|
): this;
|
|
781
|
-
prependListener(
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
issuer: Buffer,
|
|
786
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
787
|
-
) => void,
|
|
751
|
+
prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
752
|
+
prependOnceListener<E extends keyof ServerEventMap>(
|
|
753
|
+
eventName: E,
|
|
754
|
+
listener: (...args: ServerEventMap[E]) => void,
|
|
788
755
|
): this;
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
756
|
+
prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
757
|
+
rawListeners<E extends keyof ServerEventMap>(eventName: E): ((...args: ServerEventMap[E]) => void)[];
|
|
758
|
+
rawListeners(eventName: string | symbol): ((...args: any[]) => void)[];
|
|
759
|
+
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
760
|
+
removeAllListeners<E extends keyof ServerEventMap>(eventName?: E): this;
|
|
761
|
+
removeAllListeners(eventName?: string | symbol): this;
|
|
762
|
+
removeListener<E extends keyof ServerEventMap>(
|
|
763
|
+
eventName: E,
|
|
764
|
+
listener: (...args: ServerEventMap[E]) => void,
|
|
792
765
|
): this;
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
796
|
-
prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
|
797
|
-
prependOnceListener(
|
|
798
|
-
event: "newSession",
|
|
799
|
-
listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
|
|
800
|
-
): this;
|
|
801
|
-
prependOnceListener(
|
|
802
|
-
event: "OCSPRequest",
|
|
803
|
-
listener: (
|
|
804
|
-
certificate: Buffer,
|
|
805
|
-
issuer: Buffer,
|
|
806
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
807
|
-
) => void,
|
|
808
|
-
): this;
|
|
809
|
-
prependOnceListener(
|
|
810
|
-
event: "resumeSession",
|
|
811
|
-
listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
|
|
812
|
-
): this;
|
|
813
|
-
prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
|
814
|
-
prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
|
|
766
|
+
removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
767
|
+
// #endregion
|
|
815
768
|
}
|
|
816
769
|
type SecureVersion = "TLSv1.3" | "TLSv1.2" | "TLSv1.1" | "TLSv1";
|
|
817
770
|
interface SecureContextOptions {
|
|
@@ -1167,7 +1120,7 @@ declare module "node:tls" {
|
|
|
1167
1120
|
* the `ciphers` option of `{@link createSecureContext}`.
|
|
1168
1121
|
*
|
|
1169
1122
|
* Not all supported ciphers are enabled by default. See
|
|
1170
|
-
* [Modifying the default TLS cipher suite](https://nodejs.org/docs/latest-
|
|
1123
|
+
* [Modifying the default TLS cipher suite](https://nodejs.org/docs/latest-v25.x/api/tls.html#modifying-the-default-tls-cipher-suite).
|
|
1171
1124
|
*
|
|
1172
1125
|
* Cipher names that start with `'tls_'` are for TLSv1.3, all the others are for
|
|
1173
1126
|
* TLSv1.2 and below.
|
|
@@ -1178,6 +1131,38 @@ declare module "node:tls" {
|
|
|
1178
1131
|
* @since v0.10.2
|
|
1179
1132
|
*/
|
|
1180
1133
|
function getCiphers(): string[];
|
|
1134
|
+
/**
|
|
1135
|
+
* Sets the default CA certificates used by Node.js TLS clients. If the provided
|
|
1136
|
+
* certificates are parsed successfully, they will become the default CA
|
|
1137
|
+
* certificate list returned by {@link getCACertificates} and used
|
|
1138
|
+
* by subsequent TLS connections that don't specify their own CA certificates.
|
|
1139
|
+
* The certificates will be deduplicated before being set as the default.
|
|
1140
|
+
*
|
|
1141
|
+
* This function only affects the current Node.js thread. Previous
|
|
1142
|
+
* sessions cached by the HTTPS agent won't be affected by this change, so
|
|
1143
|
+
* this method should be called before any unwanted cachable TLS connections are
|
|
1144
|
+
* made.
|
|
1145
|
+
*
|
|
1146
|
+
* To use system CA certificates as the default:
|
|
1147
|
+
*
|
|
1148
|
+
* ```js
|
|
1149
|
+
* import tls from 'node:tls';
|
|
1150
|
+
* tls.setDefaultCACertificates(tls.getCACertificates('system'));
|
|
1151
|
+
* ```
|
|
1152
|
+
*
|
|
1153
|
+
* This function completely replaces the default CA certificate list. To add additional
|
|
1154
|
+
* certificates to the existing defaults, get the current certificates and append to them:
|
|
1155
|
+
*
|
|
1156
|
+
* ```js
|
|
1157
|
+
* import tls from 'node:tls';
|
|
1158
|
+
* const currentCerts = tls.getCACertificates('default');
|
|
1159
|
+
* const additionalCerts = ['-----BEGIN CERTIFICATE-----\n...'];
|
|
1160
|
+
* tls.setDefaultCACertificates([...currentCerts, ...additionalCerts]);
|
|
1161
|
+
* ```
|
|
1162
|
+
* @since v24.5.0
|
|
1163
|
+
* @param certs An array of CA certificates in PEM format.
|
|
1164
|
+
*/
|
|
1165
|
+
function setDefaultCACertificates(certs: ReadonlyArray<string | NodeJS.ArrayBufferView>): void;
|
|
1181
1166
|
/**
|
|
1182
1167
|
* The default curve name to use for ECDH key agreement in a tls server.
|
|
1183
1168
|
* The default value is `'auto'`. See `{@link createSecureContext()}` for further
|
package/trace_events.d.ts
CHANGED
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
* The available categories are:
|
|
25
25
|
*
|
|
26
26
|
* * `node`: An empty placeholder.
|
|
27
|
-
* * `node.async_hooks`: Enables capture of detailed [`async_hooks`](https://nodejs.org/docs/latest-
|
|
28
|
-
* The [`async_hooks`](https://nodejs.org/docs/latest-
|
|
27
|
+
* * `node.async_hooks`: Enables capture of detailed [`async_hooks`](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html) trace data.
|
|
28
|
+
* 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.
|
|
29
29
|
* * `node.bootstrap`: Enables capture of Node.js bootstrap milestones.
|
|
30
30
|
* * `node.console`: Enables capture of `console.time()` and `console.count()` output.
|
|
31
31
|
* * `node.threadpoolwork.sync`: Enables capture of trace data for threadpool synchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`.
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
* * `node.fs_dir.sync`: Enables capture of trace data for file system sync directory methods.
|
|
38
38
|
* * `node.fs.async`: Enables capture of trace data for file system async methods.
|
|
39
39
|
* * `node.fs_dir.async`: Enables capture of trace data for file system async directory methods.
|
|
40
|
-
* * `node.perf`: Enables capture of [Performance API](https://nodejs.org/docs/latest-
|
|
40
|
+
* * `node.perf`: Enables capture of [Performance API](https://nodejs.org/docs/latest-v25.x/api/perf_hooks.html) measurements.
|
|
41
41
|
* * `node.perf.usertiming`: Enables capture of only Performance API User Timing
|
|
42
42
|
* measures and marks.
|
|
43
43
|
* * `node.perf.timerify`: Enables capture of only Performance API timerify
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
* * `node.promises.rejections`: Enables capture of trace data tracking the number
|
|
46
46
|
* of unhandled Promise rejections and handled-after-rejections.
|
|
47
47
|
* * `node.vm.script`: Enables capture of trace data for the `node:vm` module's `runInNewContext()`, `runInContext()`, and `runInThisContext()` methods.
|
|
48
|
-
* * `v8`: The [V8](https://nodejs.org/docs/latest-
|
|
48
|
+
* * `v8`: The [V8](https://nodejs.org/docs/latest-v25.x/api/v8.html) events are GC, compiling, and execution related.
|
|
49
49
|
* * `node.http`: Enables capture of trace data for http request / response.
|
|
50
50
|
*
|
|
51
51
|
* By default the `node`, `node.async_hooks`, and `v8` categories are enabled.
|
|
@@ -103,9 +103,9 @@
|
|
|
103
103
|
* However the trace-event timestamps are expressed in microseconds,
|
|
104
104
|
* unlike `process.hrtime()` which returns nanoseconds.
|
|
105
105
|
*
|
|
106
|
-
* The features from this module are not available in [`Worker`](https://nodejs.org/docs/latest-
|
|
106
|
+
* The features from this module are not available in [`Worker`](https://nodejs.org/docs/latest-v25.x/api/worker_threads.html#class-worker) threads.
|
|
107
107
|
* @experimental
|
|
108
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
108
|
+
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/trace_events.js)
|
|
109
109
|
*/
|
|
110
110
|
|
|
111
111
|
declare module "node:trace_events" {
|