@idlebox/stripe-node-types 24.0.14-patch.0 → 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.
Files changed (134) hide show
  1. package/README.md +1 -1
  2. package/assert/strict.d.ts +113 -1
  3. package/assert.d.ts +162 -248
  4. package/async_hooks.d.ts +20 -5
  5. package/buffer.buffer.d.ts +24 -6
  6. package/buffer.d.ts +63 -168
  7. package/child_process.d.ts +117 -223
  8. package/cluster.d.ts +251 -329
  9. package/compatibility/iterators.d.ts +15 -0
  10. package/console.d.ts +60 -346
  11. package/constants.d.ts +15 -1
  12. package/crypto.d.ts +713 -1149
  13. package/dgram.d.ts +30 -50
  14. package/diagnostics_channel.d.ts +16 -3
  15. package/dns/promises.d.ts +15 -0
  16. package/dns.d.ts +150 -131
  17. package/domain.d.ts +25 -14
  18. package/events.d.ts +858 -719
  19. package/fs/promises.d.ts +117 -53
  20. package/fs.d.ts +729 -484
  21. package/globals.d.ts +142 -344
  22. package/globals.typedarray.d.ts +94 -0
  23. package/http.d.ts +358 -246
  24. package/http2.d.ts +578 -711
  25. package/https.d.ts +85 -216
  26. package/index.d.ts +39 -3
  27. package/inspector/promises.d.ts +54 -0
  28. package/inspector.d.ts +180 -3936
  29. package/inspector.generated.d.ts +4242 -0
  30. package/module.d.ts +60 -95
  31. package/my-shim.d.ts +15 -0
  32. package/net.d.ts +102 -186
  33. package/os.d.ts +32 -6
  34. package/package.json +3 -8
  35. package/path/posix.d.ts +20 -0
  36. package/path/win32.d.ts +20 -0
  37. package/path.d.ts +132 -122
  38. package/perf_hooks.d.ts +310 -644
  39. package/process.d.ts +192 -138
  40. package/punycode.d.ts +17 -2
  41. package/querystring.d.ts +16 -1
  42. package/quic.d.ts +926 -0
  43. package/readline/promises.d.ts +16 -1
  44. package/readline.d.ts +80 -118
  45. package/repl.d.ts +98 -96
  46. package/sea.d.ts +25 -1
  47. package/sqlite.d.ts +277 -13
  48. package/stream/consumers.d.ts +22 -7
  49. package/stream/promises.d.ts +148 -12
  50. package/stream/web.d.ts +187 -494
  51. package/stream.d.ts +608 -490
  52. package/string_decoder.d.ts +18 -3
  53. package/test/reporters.d.ts +112 -0
  54. package/test.d.ts +238 -199
  55. package/timers/promises.d.ts +16 -1
  56. package/timers.d.ts +16 -129
  57. package/tls.d.ts +163 -163
  58. package/trace_events.d.ts +21 -6
  59. package/ts5.6/buffer.buffer.d.ts +25 -8
  60. package/ts5.6/compatibility/float16array.d.ts +15 -0
  61. package/ts5.6/globals.typedarray.d.ts +31 -0
  62. package/ts5.6/index.d.ts +39 -3
  63. package/ts5.7/compatibility/float16array.d.ts +15 -0
  64. package/ts5.7/index.d.ts +39 -3
  65. package/tty.d.ts +70 -13
  66. package/undici-types/agent.d.ts +20 -4
  67. package/undici-types/api.d.ts +15 -0
  68. package/undici-types/balanced-pool.d.ts +15 -0
  69. package/undici-types/cache-interceptor.d.ts +15 -0
  70. package/undici-types/cache.d.ts +15 -0
  71. package/undici-types/client-stats.d.ts +31 -0
  72. package/undici-types/client.d.ts +21 -5
  73. package/undici-types/connector.d.ts +15 -0
  74. package/undici-types/content-type.d.ts +15 -0
  75. package/undici-types/cookies.d.ts +15 -0
  76. package/undici-types/diagnostics-channel.d.ts +24 -1
  77. package/undici-types/dispatcher.d.ts +18 -8
  78. package/undici-types/env-http-proxy-agent.d.ts +17 -1
  79. package/undici-types/errors.d.ts +20 -15
  80. package/undici-types/eventsource.d.ts +24 -4
  81. package/undici-types/fetch.d.ts +16 -0
  82. package/undici-types/formdata.d.ts +15 -0
  83. package/undici-types/global-dispatcher.d.ts +15 -0
  84. package/undici-types/global-origin.d.ts +15 -0
  85. package/undici-types/h2c-client.d.ts +15 -2
  86. package/undici-types/handlers.d.ts +16 -1
  87. package/undici-types/header.d.ts +15 -0
  88. package/undici-types/index.d.ts +21 -1
  89. package/undici-types/interceptors.d.ts +20 -0
  90. package/undici-types/mock-agent.d.ts +18 -0
  91. package/undici-types/mock-call-history.d.ts +15 -0
  92. package/undici-types/mock-client.d.ts +17 -0
  93. package/undici-types/mock-errors.d.ts +15 -0
  94. package/undici-types/mock-interceptor.d.ts +17 -1
  95. package/undici-types/mock-pool.d.ts +17 -0
  96. package/undici-types/package.json +1 -1
  97. package/undici-types/patch.d.ts +15 -0
  98. package/undici-types/pool-stats.d.ts +15 -0
  99. package/undici-types/pool.d.ts +17 -0
  100. package/undici-types/proxy-agent.d.ts +16 -0
  101. package/undici-types/readable.d.ts +15 -0
  102. package/undici-types/retry-agent.d.ts +15 -0
  103. package/undici-types/retry-handler.d.ts +24 -0
  104. package/undici-types/snapshot-agent.d.ts +125 -0
  105. package/undici-types/util.d.ts +15 -0
  106. package/undici-types/utility.d.ts +15 -0
  107. package/undici-types/webidl.d.ts +126 -36
  108. package/undici-types/websocket.d.ts +18 -1
  109. package/url.d.ts +107 -587
  110. package/util/types.d.ts +571 -0
  111. package/util.d.ts +158 -792
  112. package/v8.d.ts +82 -7
  113. package/vm.d.ts +267 -108
  114. package/wasi.d.ts +38 -2
  115. package/web-globals/abortcontroller.d.ts +75 -0
  116. package/web-globals/blob.d.ts +39 -0
  117. package/web-globals/console.d.ts +25 -0
  118. package/web-globals/crypto.d.ts +55 -0
  119. package/web-globals/domexception.d.ts +84 -0
  120. package/web-globals/encoding.d.ts +27 -0
  121. package/{dom-events.d.ts → web-globals/events.d.ts} +72 -50
  122. package/web-globals/fetch.d.ts +70 -0
  123. package/web-globals/importmeta.d.ts +29 -0
  124. package/web-globals/messaging.d.ts +39 -0
  125. package/web-globals/navigator.d.ts +41 -0
  126. package/web-globals/performance.d.ts +61 -0
  127. package/web-globals/storage.d.ts +40 -0
  128. package/web-globals/streams.d.ts +131 -0
  129. package/web-globals/timers.d.ts +60 -0
  130. package/web-globals/url.d.ts +40 -0
  131. package/worker_threads.d.ts +306 -349
  132. package/zlib.d.ts +59 -94
  133. package/ts5.1/compatibility/disposable.d.ts +0 -13
  134. package/ts5.1/index.d.ts +0 -100
package/timers.d.ts CHANGED
@@ -1,3 +1,18 @@
1
+ // biome-ignore-all lint: generated file
2
+ // biome-ignore-all assist: generated file
3
+ /* eslint-disable */
4
+ // @ts-ignore
5
+
6
+ /******************************************************************************
7
+ * GENERATED FILE, DO NOT MODIFY
8
+ * 这是生成的文件,千万不要修改
9
+ *
10
+ * @build-script/codegen - The Simple Code Generater
11
+ * https://github.com/GongT/baobao
12
+ *
13
+ ******************************************************************************/
14
+
15
+
1
16
  /**
2
17
  * The `timer` module exposes a global API for scheduling functions to
3
18
  * be called at some future period of time. Because the timer functions are
@@ -6,7 +21,7 @@
6
21
  * The timer functions within Node.js implement a similar API as the timers API
7
22
  * provided by Web Browsers but use a different internal implementation that is
8
23
  * 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/v24.x/lib/timers.js)
24
+ * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/timers.js)
10
25
  */
11
26
 
12
27
  declare module "node:timers" {
@@ -61,7 +76,6 @@ declare module "node:timers" {
61
76
  /**
62
77
  * Cancels the immediate. This is similar to calling `clearImmediate()`.
63
78
  * @since v20.5.0, v18.18.0
64
- * @experimental
65
79
  */
66
80
  [Symbol.dispose](): void;
67
81
  _onImmediate(...args: any[]): void;
@@ -142,138 +156,11 @@ declare module "node:timers" {
142
156
  /**
143
157
  * Cancels the timeout.
144
158
  * @since v20.5.0, v18.18.0
145
- * @experimental
146
159
  */
147
160
  [Symbol.dispose](): void;
148
161
  _onTimeout(...args: any[]): void;
149
162
  }
150
163
  }
151
- /**
152
- * Schedules the "immediate" execution of the `callback` after I/O events'
153
- * callbacks.
154
- *
155
- * When multiple calls to `setImmediate()` are made, the `callback` functions are
156
- * queued for execution in the order in which they are created. The entire callback
157
- * queue is processed every event loop iteration. If an immediate timer is queued
158
- * from inside an executing callback, that timer will not be triggered until the
159
- * next event loop iteration.
160
- *
161
- * If `callback` is not a function, a `TypeError` will be thrown.
162
- *
163
- * This method has a custom variant for promises that is available using
164
- * `timersPromises.setImmediate()`.
165
- * @since v0.9.1
166
- * @param callback The function to call at the end of this turn of
167
- * the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout)
168
- * @param args Optional arguments to pass when the `callback` is called.
169
- * @returns for use with `clearImmediate()`
170
- */
171
- function setImmediate<TArgs extends any[]>(
172
- callback: (...args: TArgs) => void,
173
- ...args: TArgs
174
- ): NodeJS.Immediate;
175
- // Allow a single void-accepting argument to be optional in arguments lists.
176
- // Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
177
- // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
178
- function setImmediate(callback: (_: void) => void): NodeJS.Immediate;
179
- namespace setImmediate {
180
- import __promisify__ = promises.setImmediate;
181
- export { __promisify__ };
182
- }
183
- /**
184
- * Schedules repeated execution of `callback` every `delay` milliseconds.
185
- *
186
- * When `delay` is larger than `2147483647` or less than `1` or `NaN`, the `delay`
187
- * will be set to `1`. Non-integer delays are truncated to an integer.
188
- *
189
- * If `callback` is not a function, a `TypeError` will be thrown.
190
- *
191
- * This method has a custom variant for promises that is available using
192
- * `timersPromises.setInterval()`.
193
- * @since v0.0.1
194
- * @param callback The function to call when the timer elapses.
195
- * @param delay The number of milliseconds to wait before calling the
196
- * `callback`. **Default:** `1`.
197
- * @param args Optional arguments to pass when the `callback` is called.
198
- * @returns for use with `clearInterval()`
199
- */
200
- function setInterval<TArgs extends any[]>(
201
- callback: (...args: TArgs) => void,
202
- delay?: number,
203
- ...args: TArgs
204
- ): NodeJS.Timeout;
205
- // Allow a single void-accepting argument to be optional in arguments lists.
206
- // Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
207
- // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
208
- function setInterval(callback: (_: void) => void, delay?: number): NodeJS.Timeout;
209
- /**
210
- * Schedules execution of a one-time `callback` after `delay` milliseconds.
211
- *
212
- * The `callback` will likely not be invoked in precisely `delay` milliseconds.
213
- * Node.js makes no guarantees about the exact timing of when callbacks will fire,
214
- * nor of their ordering. The callback will be called as close as possible to the
215
- * time specified.
216
- *
217
- * When `delay` is larger than `2147483647` or less than `1` or `NaN`, the `delay`
218
- * will be set to `1`. Non-integer delays are truncated to an integer.
219
- *
220
- * If `callback` is not a function, a `TypeError` will be thrown.
221
- *
222
- * This method has a custom variant for promises that is available using
223
- * `timersPromises.setTimeout()`.
224
- * @since v0.0.1
225
- * @param callback The function to call when the timer elapses.
226
- * @param delay The number of milliseconds to wait before calling the
227
- * `callback`. **Default:** `1`.
228
- * @param args Optional arguments to pass when the `callback` is called.
229
- * @returns for use with `clearTimeout()`
230
- */
231
- function setTimeout<TArgs extends any[]>(
232
- callback: (...args: TArgs) => void,
233
- delay?: number,
234
- ...args: TArgs
235
- ): NodeJS.Timeout;
236
- // Allow a single void-accepting argument to be optional in arguments lists.
237
- // Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
238
- // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
239
- function setTimeout(callback: (_: void) => void, delay?: number): NodeJS.Timeout;
240
- namespace setTimeout {
241
- import __promisify__ = promises.setTimeout;
242
- export { __promisify__ };
243
- }
244
- /**
245
- * Cancels an `Immediate` object created by `setImmediate()`.
246
- * @since v0.9.1
247
- * @param immediate An `Immediate` object as returned by `setImmediate()`.
248
- */
249
- function clearImmediate(immediate: NodeJS.Immediate | undefined): void;
250
- /**
251
- * Cancels a `Timeout` object created by `setInterval()`.
252
- * @since v0.0.1
253
- * @param timeout A `Timeout` object as returned by `setInterval()`
254
- * or the primitive of the `Timeout` object as a string or a number.
255
- */
256
- function clearInterval(timeout: NodeJS.Timeout | string | number | undefined): void;
257
- /**
258
- * Cancels a `Timeout` object created by `setTimeout()`.
259
- * @since v0.0.1
260
- * @param timeout A `Timeout` object as returned by `setTimeout()`
261
- * or the primitive of the `Timeout` object as a string or a number.
262
- */
263
- function clearTimeout(timeout: NodeJS.Timeout | string | number | undefined): void;
264
- /**
265
- * The `queueMicrotask()` method queues a microtask to invoke `callback`. If
266
- * `callback` throws an exception, the `process` object `'uncaughtException'`
267
- * event will be emitted.
268
- *
269
- * The microtask queue is managed by V8 and may be used in a similar manner to
270
- * the `process.nextTick()` queue, which is managed by Node.js. The
271
- * `process.nextTick()` queue is always processed before the microtask queue
272
- * within each turn of the Node.js event loop.
273
- * @since v11.0.0
274
- * @param callback Function to be queued.
275
- */
276
- function queueMicrotask(callback: () => void): void;
277
164
  }
278
165
  import clearImmediate = globalThis.clearImmediate;
279
166
  import clearInterval = globalThis.clearInterval;
package/tls.d.ts CHANGED
@@ -1,3 +1,18 @@
1
+ // biome-ignore-all lint: generated file
2
+ // biome-ignore-all assist: generated file
3
+ /* eslint-disable */
4
+ // @ts-ignore
5
+
6
+ /******************************************************************************
7
+ * GENERATED FILE, DO NOT MODIFY
8
+ * 这是生成的文件,千万不要修改
9
+ *
10
+ * @build-script/codegen - The Simple Code Generater
11
+ * https://github.com/GongT/baobao
12
+ *
13
+ ******************************************************************************/
14
+
15
+
1
16
  /**
2
17
  * The `node:tls` module provides an implementation of the Transport Layer Security
3
18
  * (TLS) and Secure Socket Layer (SSL) protocols that is built on top of OpenSSL.
@@ -6,10 +21,11 @@
6
21
  * ```js
7
22
  * import tls from 'node:tls';
8
23
  * ```
9
- * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/tls.js)
24
+ * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/tls.js)
10
25
  */
11
26
 
12
27
  declare module "node:tls" {
28
+ import { NonSharedBuffer } from 'node:buffer';
13
29
  import { X509Certificate } from 'node:crypto';
14
30
  import * as net from 'node:net';
15
31
  import * as stream from 'node:stream';
@@ -50,7 +66,7 @@ declare module "node:tls" {
50
66
  /**
51
67
  * The DER encoded X.509 certificate data.
52
68
  */
53
- raw: Buffer;
69
+ raw: NonSharedBuffer;
54
70
  /**
55
71
  * The certificate subject.
56
72
  */
@@ -116,7 +132,7 @@ declare module "node:tls" {
116
132
  /**
117
133
  * The public key.
118
134
  */
119
- pubkey?: Buffer;
135
+ pubkey?: NonSharedBuffer;
120
136
  /**
121
137
  * The ASN.1 name of the OID of the elliptic curve.
122
138
  * Well-known curves are identified by an OID.
@@ -207,6 +223,12 @@ declare module "node:tls" {
207
223
  */
208
224
  requestOCSP?: boolean | undefined;
209
225
  }
226
+ interface TLSSocketEventMap extends net.SocketEventMap {
227
+ "keylog": [line: NonSharedBuffer];
228
+ "OCSPResponse": [response: NonSharedBuffer];
229
+ "secureConnect": [];
230
+ "session": [session: NonSharedBuffer];
231
+ }
210
232
  /**
211
233
  * Performs transparent encryption of written data and all required TLS
212
234
  * negotiation.
@@ -245,6 +267,10 @@ declare module "node:tls" {
245
267
  * When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false.
246
268
  */
247
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;
248
274
  /**
249
275
  * Returns an object representing the local certificate. The returned object has
250
276
  * some properties corresponding to the fields of the certificate.
@@ -296,7 +322,7 @@ declare module "node:tls" {
296
322
  * @since v9.9.0
297
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.
298
324
  */
299
- getFinished(): Buffer | undefined;
325
+ getFinished(): NonSharedBuffer | undefined;
300
326
  /**
301
327
  * Returns an object representing the peer's certificate. If the peer does not
302
328
  * provide a certificate, an empty object will be returned. If the socket has been
@@ -323,7 +349,7 @@ declare module "node:tls" {
323
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
324
350
  * far.
325
351
  */
326
- getPeerFinished(): Buffer | undefined;
352
+ getPeerFinished(): NonSharedBuffer | undefined;
327
353
  /**
328
354
  * Returns a string containing the negotiated SSL/TLS protocol version of the
329
355
  * current connection. The value `'unknown'` will be returned for connected
@@ -353,7 +379,7 @@ declare module "node:tls" {
353
379
  * must use the `'session'` event (it also works for TLSv1.2 and below).
354
380
  * @since v0.11.4
355
381
  */
356
- getSession(): Buffer | undefined;
382
+ getSession(): NonSharedBuffer | undefined;
357
383
  /**
358
384
  * See [SSL\_get\_shared\_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html) for more information.
359
385
  * @since v12.11.0
@@ -368,7 +394,7 @@ declare module "node:tls" {
368
394
  * See `Session Resumption` for more information.
369
395
  * @since v0.11.4
370
396
  */
371
- getTLSTicket(): Buffer | undefined;
397
+ getTLSTicket(): NonSharedBuffer | undefined;
372
398
  /**
373
399
  * See `Session Resumption` for more information.
374
400
  * @since v0.5.6
@@ -479,37 +505,49 @@ declare module "node:tls" {
479
505
  * @param context Optionally provide a context.
480
506
  * @return requested bytes of the keying material
481
507
  */
482
- exportKeyingMaterial(length: number, label: string, context: Buffer): Buffer;
483
- addListener(event: string, listener: (...args: any[]) => void): this;
484
- addListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
485
- addListener(event: "secureConnect", listener: () => void): this;
486
- addListener(event: "session", listener: (session: Buffer) => void): this;
487
- addListener(event: "keylog", listener: (line: Buffer) => void): this;
488
- emit(event: string | symbol, ...args: any[]): boolean;
489
- emit(event: "OCSPResponse", response: Buffer): boolean;
490
- emit(event: "secureConnect"): boolean;
491
- emit(event: "session", session: Buffer): boolean;
492
- emit(event: "keylog", line: Buffer): boolean;
493
- on(event: string, listener: (...args: any[]) => void): this;
494
- on(event: "OCSPResponse", listener: (response: Buffer) => void): this;
495
- on(event: "secureConnect", listener: () => void): this;
496
- on(event: "session", listener: (session: Buffer) => void): this;
497
- on(event: "keylog", listener: (line: Buffer) => void): this;
498
- once(event: string, listener: (...args: any[]) => void): this;
499
- once(event: "OCSPResponse", listener: (response: Buffer) => void): this;
500
- once(event: "secureConnect", listener: () => void): this;
501
- once(event: "session", listener: (session: Buffer) => void): this;
502
- once(event: "keylog", listener: (line: Buffer) => void): this;
503
- prependListener(event: string, listener: (...args: any[]) => void): this;
504
- prependListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
505
- prependListener(event: "secureConnect", listener: () => void): this;
506
- prependListener(event: "session", listener: (session: Buffer) => void): this;
507
- prependListener(event: "keylog", listener: (line: Buffer) => void): this;
508
- prependOnceListener(event: string, listener: (...args: any[]) => void): this;
509
- prependOnceListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
510
- prependOnceListener(event: "secureConnect", listener: () => void): this;
511
- prependOnceListener(event: "session", listener: (session: Buffer) => void): this;
512
- prependOnceListener(event: "keylog", listener: (line: Buffer) => void): this;
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
513
551
  }
514
552
  interface CommonConnectionOptions {
515
553
  /**
@@ -532,7 +570,7 @@ declare module "node:tls" {
532
570
  * An array of strings or a Buffer naming possible ALPN protocols.
533
571
  * (Protocols should be ordered by their priority.)
534
572
  */
535
- ALPNProtocols?: string[] | Uint8Array[] | Uint8Array | undefined;
573
+ ALPNProtocols?: readonly string[] | NodeJS.ArrayBufferView | undefined;
536
574
  /**
537
575
  * SNICallback(servername, cb) <Function> A function that will be
538
576
  * called if the client supports SNI TLS extension. Two arguments
@@ -587,7 +625,7 @@ declare module "node:tls" {
587
625
  * requires explicitly specifying a cipher suite with the `ciphers` option.
588
626
  * More information can be found in the RFC 4279.
589
627
  */
590
- pskCallback?(socket: TLSSocket, identity: string): DataView | NodeJS.TypedArray | null;
628
+ pskCallback?: ((socket: TLSSocket, identity: string) => NodeJS.ArrayBufferView | null) | undefined;
591
629
  /**
592
630
  * hint to send to a client to help
593
631
  * with selecting the identity during TLS-PSK negotiation. Will be ignored
@@ -597,7 +635,7 @@ declare module "node:tls" {
597
635
  pskIdentityHint?: string | undefined;
598
636
  }
599
637
  interface PSKCallbackNegotation {
600
- psk: DataView | NodeJS.TypedArray;
638
+ psk: NodeJS.ArrayBufferView;
601
639
  identity: string;
602
640
  }
603
641
  interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions {
@@ -628,7 +666,20 @@ declare module "node:tls" {
628
666
  * compatible with the selected cipher's digest.
629
667
  * `identity` must use UTF-8 encoding.
630
668
  */
631
- pskCallback?(hint: string | null): PSKCallbackNegotation | null;
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];
632
683
  }
633
684
  /**
634
685
  * Accepts encrypted connections using TLS or SSL.
@@ -656,7 +707,7 @@ declare module "node:tls" {
656
707
  * @since v3.0.0
657
708
  * @return A 48-byte buffer containing the session ticket keys.
658
709
  */
659
- getTicketKeys(): Buffer;
710
+ getTicketKeys(): NonSharedBuffer;
660
711
  /**
661
712
  * The `server.setSecureContext()` method replaces the secure context of an
662
713
  * existing server. Existing connections to the server are not interrupted.
@@ -675,128 +726,45 @@ declare module "node:tls" {
675
726
  * @param keys A 48-byte buffer containing the session ticket keys.
676
727
  */
677
728
  setTicketKeys(keys: Buffer): void;
678
- /**
679
- * events.EventEmitter
680
- * 1. tlsClientError
681
- * 2. newSession
682
- * 3. OCSPRequest
683
- * 4. resumeSession
684
- * 5. secureConnection
685
- * 6. keylog
686
- */
687
- addListener(event: string, listener: (...args: any[]) => void): this;
688
- addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
689
- addListener(
690
- event: "newSession",
691
- listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
692
- ): this;
693
- addListener(
694
- event: "OCSPRequest",
695
- listener: (
696
- certificate: Buffer,
697
- issuer: Buffer,
698
- callback: (err: Error | null, resp: Buffer) => void,
699
- ) => void,
700
- ): this;
701
- addListener(
702
- event: "resumeSession",
703
- listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
704
- ): this;
705
- addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
706
- addListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
707
- emit(event: string | symbol, ...args: any[]): boolean;
708
- emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean;
709
- emit(event: "newSession", sessionId: Buffer, sessionData: Buffer, callback: () => void): boolean;
710
- emit(
711
- event: "OCSPRequest",
712
- certificate: Buffer,
713
- issuer: Buffer,
714
- callback: (err: Error | null, resp: Buffer) => void,
715
- ): boolean;
716
- emit(
717
- event: "resumeSession",
718
- sessionId: Buffer,
719
- callback: (err: Error | null, sessionData: Buffer | null) => void,
720
- ): boolean;
721
- emit(event: "secureConnection", tlsSocket: TLSSocket): boolean;
722
- emit(event: "keylog", line: Buffer, tlsSocket: TLSSocket): boolean;
723
- on(event: string, listener: (...args: any[]) => void): this;
724
- on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
725
- on(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this;
726
- on(
727
- event: "OCSPRequest",
728
- listener: (
729
- certificate: Buffer,
730
- issuer: Buffer,
731
- callback: (err: Error | null, resp: Buffer) => void,
732
- ) => void,
733
- ): this;
734
- on(
735
- event: "resumeSession",
736
- listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
737
- ): this;
738
- on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
739
- on(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
740
- once(event: string, listener: (...args: any[]) => void): this;
741
- once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
742
- once(
743
- event: "newSession",
744
- listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
745
- ): this;
746
- once(
747
- event: "OCSPRequest",
748
- listener: (
749
- certificate: Buffer,
750
- issuer: Buffer,
751
- callback: (err: Error | null, resp: Buffer) => void,
752
- ) => 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,
753
750
  ): this;
754
- once(
755
- event: "resumeSession",
756
- listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => 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,
757
755
  ): this;
758
- once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
759
- once(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
760
- prependListener(event: string, listener: (...args: any[]) => void): this;
761
- prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
762
- prependListener(
763
- event: "newSession",
764
- listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
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,
765
765
  ): this;
766
- prependListener(
767
- event: "OCSPRequest",
768
- listener: (
769
- certificate: Buffer,
770
- issuer: Buffer,
771
- callback: (err: Error | null, resp: Buffer) => void,
772
- ) => void,
773
- ): this;
774
- prependListener(
775
- event: "resumeSession",
776
- listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
777
- ): this;
778
- prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
779
- prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
780
- prependOnceListener(event: string, listener: (...args: any[]) => void): this;
781
- prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
782
- prependOnceListener(
783
- event: "newSession",
784
- listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
785
- ): this;
786
- prependOnceListener(
787
- event: "OCSPRequest",
788
- listener: (
789
- certificate: Buffer,
790
- issuer: Buffer,
791
- callback: (err: Error | null, resp: Buffer) => void,
792
- ) => void,
793
- ): this;
794
- prependOnceListener(
795
- event: "resumeSession",
796
- listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
797
- ): this;
798
- prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
799
- prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
766
+ removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
767
+ // #endregion
800
768
  }
801
769
  type SecureVersion = "TLSv1.3" | "TLSv1.2" | "TLSv1.1" | "TLSv1";
802
770
  interface SecureContextOptions {
@@ -1152,7 +1120,7 @@ declare module "node:tls" {
1152
1120
  * the `ciphers` option of `{@link createSecureContext}`.
1153
1121
  *
1154
1122
  * Not all supported ciphers are enabled by default. See
1155
- * [Modifying the default TLS cipher suite](https://nodejs.org/docs/latest-v24.x/api/tls.html#modifying-the-default-tls-cipher-suite).
1123
+ * [Modifying the default TLS cipher suite](https://nodejs.org/docs/latest-v25.x/api/tls.html#modifying-the-default-tls-cipher-suite).
1156
1124
  *
1157
1125
  * Cipher names that start with `'tls_'` are for TLSv1.3, all the others are for
1158
1126
  * TLSv1.2 and below.
@@ -1163,6 +1131,38 @@ declare module "node:tls" {
1163
1131
  * @since v0.10.2
1164
1132
  */
1165
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;
1166
1166
  /**
1167
1167
  * The default curve name to use for ECDH key agreement in a tls server.
1168
1168
  * The default value is `'auto'`. See `{@link createSecureContext()}` for further