omegon 0.8.3 → 0.9.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.
Files changed (140) hide show
  1. package/extensions/cleave/dispatcher.ts +213 -20
  2. package/extensions/cleave/index.ts +24 -8
  3. package/extensions/cleave/rpc-child.ts +269 -0
  4. package/extensions/cleave/types.ts +52 -0
  5. package/extensions/openspec/spec.ts +3 -0
  6. package/node_modules/@types/node/README.md +3 -3
  7. package/node_modules/@types/node/assert/strict.d.ts +11 -5
  8. package/node_modules/@types/node/assert.d.ts +173 -50
  9. package/node_modules/@types/node/async_hooks.d.ts +8 -28
  10. package/node_modules/@types/node/buffer.buffer.d.ts +7 -1
  11. package/node_modules/@types/node/buffer.d.ts +168 -44
  12. package/node_modules/@types/node/child_process.d.ts +70 -27
  13. package/node_modules/@types/node/cluster.d.ts +332 -240
  14. package/node_modules/@types/node/compatibility/disposable.d.ts +14 -0
  15. package/node_modules/@types/node/compatibility/index.d.ts +9 -0
  16. package/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
  17. package/node_modules/@types/node/compatibility/iterators.d.ts +0 -1
  18. package/node_modules/@types/node/console.d.ts +350 -49
  19. package/node_modules/@types/node/constants.d.ts +4 -3
  20. package/node_modules/@types/node/crypto.d.ts +1110 -630
  21. package/node_modules/@types/node/dgram.d.ts +51 -15
  22. package/node_modules/@types/node/diagnostics_channel.d.ts +6 -4
  23. package/node_modules/@types/node/dns/promises.d.ts +4 -4
  24. package/node_modules/@types/node/dns.d.ts +133 -132
  25. package/node_modules/@types/node/domain.d.ts +17 -13
  26. package/node_modules/@types/node/events.d.ts +663 -734
  27. package/node_modules/@types/node/fs/promises.d.ts +9 -43
  28. package/node_modules/@types/node/fs.d.ts +411 -628
  29. package/node_modules/@types/node/globals.d.ts +30 -8
  30. package/node_modules/@types/node/globals.typedarray.d.ts +0 -63
  31. package/node_modules/@types/node/http.d.ts +265 -364
  32. package/node_modules/@types/node/http2.d.ts +715 -551
  33. package/node_modules/@types/node/https.d.ts +239 -65
  34. package/node_modules/@types/node/index.d.ts +6 -24
  35. package/node_modules/@types/node/inspector.d.ts +53 -69
  36. package/node_modules/@types/node/inspector.generated.d.ts +410 -759
  37. package/node_modules/@types/node/module.d.ts +186 -52
  38. package/node_modules/@types/node/net.d.ts +194 -70
  39. package/node_modules/@types/node/os.d.ts +11 -12
  40. package/node_modules/@types/node/package.json +3 -13
  41. package/node_modules/@types/node/path.d.ts +133 -120
  42. package/node_modules/@types/node/perf_hooks.d.ts +643 -318
  43. package/node_modules/@types/node/process.d.ts +132 -223
  44. package/node_modules/@types/node/punycode.d.ts +5 -5
  45. package/node_modules/@types/node/querystring.d.ts +4 -4
  46. package/node_modules/@types/node/readline/promises.d.ts +3 -3
  47. package/node_modules/@types/node/readline.d.ts +120 -68
  48. package/node_modules/@types/node/repl.d.ts +100 -87
  49. package/node_modules/@types/node/sea.d.ts +1 -10
  50. package/node_modules/@types/node/sqlite.d.ts +19 -363
  51. package/node_modules/@types/node/stream/consumers.d.ts +10 -10
  52. package/node_modules/@types/node/stream/promises.d.ts +15 -136
  53. package/node_modules/@types/node/stream/web.d.ts +502 -176
  54. package/node_modules/@types/node/stream.d.ts +475 -581
  55. package/node_modules/@types/node/string_decoder.d.ts +4 -4
  56. package/node_modules/@types/node/test.d.ts +196 -308
  57. package/node_modules/@types/node/timers/promises.d.ts +4 -4
  58. package/node_modules/@types/node/timers.d.ts +132 -4
  59. package/node_modules/@types/node/tls.d.ts +226 -110
  60. package/node_modules/@types/node/trace_events.d.ts +9 -9
  61. package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +7 -1
  62. package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -2
  63. package/node_modules/@types/node/ts5.6/index.d.ts +6 -26
  64. package/node_modules/@types/node/tty.d.ts +16 -58
  65. package/node_modules/@types/node/url.d.ts +573 -130
  66. package/node_modules/@types/node/util.d.ts +1100 -181
  67. package/node_modules/@types/node/v8.d.ts +8 -76
  68. package/node_modules/@types/node/vm.d.ts +72 -280
  69. package/node_modules/@types/node/wasi.d.ts +4 -25
  70. package/node_modules/@types/node/web-globals/abortcontroller.d.ts +2 -27
  71. package/node_modules/@types/node/web-globals/events.d.ts +0 -9
  72. package/node_modules/@types/node/web-globals/fetch.d.ts +0 -14
  73. package/node_modules/@types/node/web-globals/navigator.d.ts +0 -3
  74. package/node_modules/@types/node/worker_threads.d.ts +335 -268
  75. package/node_modules/@types/node/zlib.d.ts +74 -9
  76. package/node_modules/undici-types/agent.d.ts +12 -13
  77. package/node_modules/undici-types/api.d.ts +26 -26
  78. package/node_modules/undici-types/balanced-pool.d.ts +12 -13
  79. package/node_modules/undici-types/client.d.ts +19 -19
  80. package/node_modules/undici-types/connector.d.ts +2 -2
  81. package/node_modules/undici-types/cookies.d.ts +0 -2
  82. package/node_modules/undici-types/diagnostics-channel.d.ts +10 -18
  83. package/node_modules/undici-types/dispatcher.d.ts +103 -123
  84. package/node_modules/undici-types/env-http-proxy-agent.d.ts +3 -4
  85. package/node_modules/undici-types/errors.d.ts +54 -66
  86. package/node_modules/undici-types/eventsource.d.ts +4 -9
  87. package/node_modules/undici-types/fetch.d.ts +20 -22
  88. package/node_modules/undici-types/file.d.ts +39 -0
  89. package/node_modules/undici-types/filereader.d.ts +54 -0
  90. package/node_modules/undici-types/formdata.d.ts +7 -7
  91. package/node_modules/undici-types/global-dispatcher.d.ts +4 -4
  92. package/node_modules/undici-types/global-origin.d.ts +5 -5
  93. package/node_modules/undici-types/handlers.d.ts +8 -8
  94. package/node_modules/undici-types/header.d.ts +1 -157
  95. package/node_modules/undici-types/index.d.ts +47 -64
  96. package/node_modules/undici-types/interceptors.d.ts +8 -64
  97. package/node_modules/undici-types/mock-agent.d.ts +18 -36
  98. package/node_modules/undici-types/mock-client.d.ts +4 -6
  99. package/node_modules/undici-types/mock-errors.d.ts +3 -3
  100. package/node_modules/undici-types/mock-interceptor.d.ts +20 -21
  101. package/node_modules/undici-types/mock-pool.d.ts +4 -6
  102. package/node_modules/undici-types/package.json +1 -1
  103. package/node_modules/undici-types/patch.d.ts +4 -0
  104. package/node_modules/undici-types/pool-stats.d.ts +8 -8
  105. package/node_modules/undici-types/pool.d.ts +13 -15
  106. package/node_modules/undici-types/proxy-agent.d.ts +4 -5
  107. package/node_modules/undici-types/readable.d.ts +16 -19
  108. package/node_modules/undici-types/retry-agent.d.ts +1 -1
  109. package/node_modules/undici-types/retry-handler.d.ts +10 -19
  110. package/node_modules/undici-types/util.d.ts +3 -3
  111. package/node_modules/undici-types/webidl.d.ts +29 -142
  112. package/node_modules/undici-types/websocket.d.ts +10 -46
  113. package/package.json +2 -1
  114. package/skills/cleave/SKILL.md +62 -2
  115. package/node_modules/@types/node/inspector/promises.d.ts +0 -41
  116. package/node_modules/@types/node/path/posix.d.ts +0 -8
  117. package/node_modules/@types/node/path/win32.d.ts +0 -8
  118. package/node_modules/@types/node/quic.d.ts +0 -910
  119. package/node_modules/@types/node/test/reporters.d.ts +0 -96
  120. package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +0 -71
  121. package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +0 -72
  122. package/node_modules/@types/node/ts5.7/index.d.ts +0 -117
  123. package/node_modules/@types/node/util/types.d.ts +0 -558
  124. package/node_modules/@types/node/web-globals/blob.d.ts +0 -23
  125. package/node_modules/@types/node/web-globals/console.d.ts +0 -9
  126. package/node_modules/@types/node/web-globals/crypto.d.ts +0 -39
  127. package/node_modules/@types/node/web-globals/encoding.d.ts +0 -11
  128. package/node_modules/@types/node/web-globals/importmeta.d.ts +0 -13
  129. package/node_modules/@types/node/web-globals/messaging.d.ts +0 -23
  130. package/node_modules/@types/node/web-globals/performance.d.ts +0 -45
  131. package/node_modules/@types/node/web-globals/streams.d.ts +0 -115
  132. package/node_modules/@types/node/web-globals/timers.d.ts +0 -44
  133. package/node_modules/@types/node/web-globals/url.d.ts +0 -24
  134. package/node_modules/undici-types/cache-interceptor.d.ts +0 -173
  135. package/node_modules/undici-types/client-stats.d.ts +0 -15
  136. package/node_modules/undici-types/h2c-client.d.ts +0 -73
  137. package/node_modules/undici-types/mock-call-history.d.ts +0 -111
  138. package/node_modules/undici-types/round-robin-pool.d.ts +0 -41
  139. package/node_modules/undici-types/snapshot-agent.d.ts +0 -109
  140. package/node_modules/undici-types/utility.d.ts +0 -7
@@ -11,9 +11,9 @@
11
11
  * } from 'node:timers/promises';
12
12
  * ```
13
13
  * @since v15.0.0
14
- * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/timers/promises.js)
14
+ * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/timers/promises.js)
15
15
  */
16
- declare module "node:timers/promises" {
16
+ declare module "timers/promises" {
17
17
  import { TimerOptions } from "node:timers";
18
18
  /**
19
19
  * ```js
@@ -103,6 +103,6 @@ declare module "node:timers/promises" {
103
103
  }
104
104
  const scheduler: Scheduler;
105
105
  }
106
- declare module "timers/promises" {
107
- export * from "node:timers/promises";
106
+ declare module "node:timers/promises" {
107
+ export * from "timers/promises";
108
108
  }
@@ -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/v25.x/lib/timers.js)
9
+ * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/timers.js)
10
10
  */
11
- declare module "node:timers" {
11
+ declare module "timers" {
12
12
  import { Abortable } from "node:events";
13
13
  import * as promises from "node:timers/promises";
14
14
  export interface TimerOptions extends Abortable {
@@ -60,6 +60,7 @@ declare module "node:timers" {
60
60
  /**
61
61
  * Cancels the immediate. This is similar to calling `clearImmediate()`.
62
62
  * @since v20.5.0, v18.18.0
63
+ * @experimental
63
64
  */
64
65
  [Symbol.dispose](): void;
65
66
  _onImmediate(...args: any[]): void;
@@ -140,11 +141,138 @@ declare module "node:timers" {
140
141
  /**
141
142
  * Cancels the timeout.
142
143
  * @since v20.5.0, v18.18.0
144
+ * @experimental
143
145
  */
144
146
  [Symbol.dispose](): void;
145
147
  _onTimeout(...args: any[]): void;
146
148
  }
147
149
  }
150
+ /**
151
+ * Schedules the "immediate" execution of the `callback` after I/O events'
152
+ * callbacks.
153
+ *
154
+ * When multiple calls to `setImmediate()` are made, the `callback` functions are
155
+ * queued for execution in the order in which they are created. The entire callback
156
+ * queue is processed every event loop iteration. If an immediate timer is queued
157
+ * from inside an executing callback, that timer will not be triggered until the
158
+ * next event loop iteration.
159
+ *
160
+ * If `callback` is not a function, a `TypeError` will be thrown.
161
+ *
162
+ * This method has a custom variant for promises that is available using
163
+ * `timersPromises.setImmediate()`.
164
+ * @since v0.9.1
165
+ * @param callback The function to call at the end of this turn of
166
+ * the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout)
167
+ * @param args Optional arguments to pass when the `callback` is called.
168
+ * @returns for use with `clearImmediate()`
169
+ */
170
+ function setImmediate<TArgs extends any[]>(
171
+ callback: (...args: TArgs) => void,
172
+ ...args: TArgs
173
+ ): NodeJS.Immediate;
174
+ // Allow a single void-accepting argument to be optional in arguments lists.
175
+ // Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
176
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
177
+ function setImmediate(callback: (_: void) => void): NodeJS.Immediate;
178
+ namespace setImmediate {
179
+ import __promisify__ = promises.setImmediate;
180
+ export { __promisify__ };
181
+ }
182
+ /**
183
+ * Schedules repeated execution of `callback` every `delay` milliseconds.
184
+ *
185
+ * When `delay` is larger than `2147483647` or less than `1` or `NaN`, the `delay`
186
+ * will be set to `1`. Non-integer delays are truncated to an integer.
187
+ *
188
+ * If `callback` is not a function, a `TypeError` will be thrown.
189
+ *
190
+ * This method has a custom variant for promises that is available using
191
+ * `timersPromises.setInterval()`.
192
+ * @since v0.0.1
193
+ * @param callback The function to call when the timer elapses.
194
+ * @param delay The number of milliseconds to wait before calling the
195
+ * `callback`. **Default:** `1`.
196
+ * @param args Optional arguments to pass when the `callback` is called.
197
+ * @returns for use with `clearInterval()`
198
+ */
199
+ function setInterval<TArgs extends any[]>(
200
+ callback: (...args: TArgs) => void,
201
+ delay?: number,
202
+ ...args: TArgs
203
+ ): NodeJS.Timeout;
204
+ // Allow a single void-accepting argument to be optional in arguments lists.
205
+ // Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
206
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
207
+ function setInterval(callback: (_: void) => void, delay?: number): NodeJS.Timeout;
208
+ /**
209
+ * Schedules execution of a one-time `callback` after `delay` milliseconds.
210
+ *
211
+ * The `callback` will likely not be invoked in precisely `delay` milliseconds.
212
+ * Node.js makes no guarantees about the exact timing of when callbacks will fire,
213
+ * nor of their ordering. The callback will be called as close as possible to the
214
+ * time specified.
215
+ *
216
+ * When `delay` is larger than `2147483647` or less than `1` or `NaN`, the `delay`
217
+ * will be set to `1`. Non-integer delays are truncated to an integer.
218
+ *
219
+ * If `callback` is not a function, a `TypeError` will be thrown.
220
+ *
221
+ * This method has a custom variant for promises that is available using
222
+ * `timersPromises.setTimeout()`.
223
+ * @since v0.0.1
224
+ * @param callback The function to call when the timer elapses.
225
+ * @param delay The number of milliseconds to wait before calling the
226
+ * `callback`. **Default:** `1`.
227
+ * @param args Optional arguments to pass when the `callback` is called.
228
+ * @returns for use with `clearTimeout()`
229
+ */
230
+ function setTimeout<TArgs extends any[]>(
231
+ callback: (...args: TArgs) => void,
232
+ delay?: number,
233
+ ...args: TArgs
234
+ ): NodeJS.Timeout;
235
+ // Allow a single void-accepting argument to be optional in arguments lists.
236
+ // Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
237
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
238
+ function setTimeout(callback: (_: void) => void, delay?: number): NodeJS.Timeout;
239
+ namespace setTimeout {
240
+ import __promisify__ = promises.setTimeout;
241
+ export { __promisify__ };
242
+ }
243
+ /**
244
+ * Cancels an `Immediate` object created by `setImmediate()`.
245
+ * @since v0.9.1
246
+ * @param immediate An `Immediate` object as returned by `setImmediate()`.
247
+ */
248
+ function clearImmediate(immediate: NodeJS.Immediate | undefined): void;
249
+ /**
250
+ * Cancels a `Timeout` object created by `setInterval()`.
251
+ * @since v0.0.1
252
+ * @param timeout A `Timeout` object as returned by `setInterval()`
253
+ * or the primitive of the `Timeout` object as a string or a number.
254
+ */
255
+ function clearInterval(timeout: NodeJS.Timeout | string | number | undefined): void;
256
+ /**
257
+ * Cancels a `Timeout` object created by `setTimeout()`.
258
+ * @since v0.0.1
259
+ * @param timeout A `Timeout` object as returned by `setTimeout()`
260
+ * or the primitive of the `Timeout` object as a string or a number.
261
+ */
262
+ function clearTimeout(timeout: NodeJS.Timeout | string | number | undefined): void;
263
+ /**
264
+ * The `queueMicrotask()` method queues a microtask to invoke `callback`. If
265
+ * `callback` throws an exception, the `process` object `'uncaughtException'`
266
+ * event will be emitted.
267
+ *
268
+ * The microtask queue is managed by V8 and may be used in a similar manner to
269
+ * the `process.nextTick()` queue, which is managed by Node.js. The
270
+ * `process.nextTick()` queue is always processed before the microtask queue
271
+ * within each turn of the Node.js event loop.
272
+ * @since v11.0.0
273
+ * @param callback Function to be queued.
274
+ */
275
+ function queueMicrotask(callback: () => void): void;
148
276
  }
149
277
  import clearImmediate = globalThis.clearImmediate;
150
278
  import clearInterval = globalThis.clearInterval;
@@ -154,6 +282,6 @@ declare module "node:timers" {
154
282
  import setTimeout = globalThis.setTimeout;
155
283
  export { clearImmediate, clearInterval, clearTimeout, promises, setImmediate, setInterval, setTimeout };
156
284
  }
157
- declare module "timers" {
158
- export * from "node:timers";
285
+ declare module "node:timers" {
286
+ export * from "timers";
159
287
  }
@@ -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/v25.x/lib/tls.js)
9
+ * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/tls.js)
10
10
  */
11
- declare module "node:tls" {
11
+ declare module "tls" {
12
12
  import { NonSharedBuffer } from "node:buffer";
13
13
  import { X509Certificate } from "node:crypto";
14
14
  import * as net from "node:net";
@@ -207,13 +207,6 @@ declare module "node: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
- }
217
210
  /**
218
211
  * Performs transparent encryption of written data and all required TLS
219
212
  * negotiation.
@@ -491,48 +484,36 @@ declare module "node:tls" {
491
484
  * @return requested bytes of the keying material
492
485
  */
493
486
  exportKeyingMaterial(length: number, label: string, context: Buffer): NonSharedBuffer;
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
487
+ addListener(event: string, listener: (...args: any[]) => void): this;
488
+ addListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
489
+ addListener(event: "secureConnect", listener: () => void): this;
490
+ addListener(event: "session", listener: (session: NonSharedBuffer) => void): this;
491
+ addListener(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
492
+ emit(event: string | symbol, ...args: any[]): boolean;
493
+ emit(event: "OCSPResponse", response: NonSharedBuffer): boolean;
494
+ emit(event: "secureConnect"): boolean;
495
+ emit(event: "session", session: NonSharedBuffer): boolean;
496
+ emit(event: "keylog", line: NonSharedBuffer): boolean;
497
+ on(event: string, listener: (...args: any[]) => void): this;
498
+ on(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
499
+ on(event: "secureConnect", listener: () => void): this;
500
+ on(event: "session", listener: (session: NonSharedBuffer) => void): this;
501
+ on(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
502
+ once(event: string, listener: (...args: any[]) => void): this;
503
+ once(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
504
+ once(event: "secureConnect", listener: () => void): this;
505
+ once(event: "session", listener: (session: NonSharedBuffer) => void): this;
506
+ once(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
507
+ prependListener(event: string, listener: (...args: any[]) => void): this;
508
+ prependListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
509
+ prependListener(event: "secureConnect", listener: () => void): this;
510
+ prependListener(event: "session", listener: (session: NonSharedBuffer) => void): this;
511
+ prependListener(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
512
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
513
+ prependOnceListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
514
+ prependOnceListener(event: "secureConnect", listener: () => void): this;
515
+ prependOnceListener(event: "session", listener: (session: NonSharedBuffer) => void): this;
516
+ prependOnceListener(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
536
517
  }
537
518
  interface CommonConnectionOptions {
538
519
  /**
@@ -552,12 +533,8 @@ declare module "node:tls" {
552
533
  */
553
534
  requestCert?: boolean | undefined;
554
535
  /**
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.
536
+ * An array of strings or a Buffer naming possible ALPN protocols.
537
+ * (Protocols should be ordered by their priority.)
561
538
  */
562
539
  ALPNProtocols?: readonly string[] | NodeJS.ArrayBufferView | undefined;
563
540
  /**
@@ -657,19 +634,6 @@ declare module "node:tls" {
657
634
  */
658
635
  pskCallback?: ((hint: string | null) => PSKCallbackNegotation | null) | undefined;
659
636
  }
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
- }
673
637
  /**
674
638
  * Accepts encrypted connections using TLS or SSL.
675
639
  * @since v0.3.2
@@ -715,45 +679,158 @@ declare module "node:tls" {
715
679
  * @param keys A 48-byte buffer containing the session ticket keys.
716
680
  */
717
681
  setTicketKeys(keys: Buffer): void;
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,
682
+ /**
683
+ * events.EventEmitter
684
+ * 1. tlsClientError
685
+ * 2. newSession
686
+ * 3. OCSPRequest
687
+ * 4. resumeSession
688
+ * 5. secureConnection
689
+ * 6. keylog
690
+ */
691
+ addListener(event: string, listener: (...args: any[]) => void): this;
692
+ addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
693
+ addListener(
694
+ event: "newSession",
695
+ listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
696
+ ): this;
697
+ addListener(
698
+ event: "OCSPRequest",
699
+ listener: (
700
+ certificate: NonSharedBuffer,
701
+ issuer: NonSharedBuffer,
702
+ callback: (err: Error | null, resp: Buffer | null) => void,
703
+ ) => void,
704
+ ): this;
705
+ addListener(
706
+ event: "resumeSession",
707
+ listener: (
708
+ sessionId: NonSharedBuffer,
709
+ callback: (err: Error | null, sessionData: Buffer | null) => void,
710
+ ) => void,
711
+ ): this;
712
+ addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
713
+ addListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
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,
739
778
  ): this;
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,
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,
744
786
  ): this;
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,
787
+ prependListener(
788
+ event: "OCSPRequest",
789
+ listener: (
790
+ certificate: NonSharedBuffer,
791
+ issuer: NonSharedBuffer,
792
+ callback: (err: Error | null, resp: Buffer | null) => void,
793
+ ) => void,
754
794
  ): this;
755
- removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
756
- // #endregion
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;
827
+ }
828
+ /**
829
+ * @deprecated since v0.11.3 Use `tls.TLSSocket` instead.
830
+ */
831
+ interface SecurePair {
832
+ encrypted: TLSSocket;
833
+ cleartext: TLSSocket;
757
834
  }
758
835
  type SecureVersion = "TLSv1.3" | "TLSv1.2" | "TLSv1.1" | "TLSv1";
759
836
  interface SecureContextOptions {
@@ -1053,6 +1130,45 @@ declare module "node:tls" {
1053
1130
  secureConnectListener?: () => void,
1054
1131
  ): TLSSocket;
1055
1132
  function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
1133
+ /**
1134
+ * Creates a new secure pair object with two streams, one of which reads and writes
1135
+ * the encrypted data and the other of which reads and writes the cleartext data.
1136
+ * Generally, the encrypted stream is piped to/from an incoming encrypted data
1137
+ * stream and the cleartext one is used as a replacement for the initial encrypted
1138
+ * stream.
1139
+ *
1140
+ * `tls.createSecurePair()` returns a `tls.SecurePair` object with `cleartext` and `encrypted` stream properties.
1141
+ *
1142
+ * Using `cleartext` has the same API as {@link TLSSocket}.
1143
+ *
1144
+ * The `tls.createSecurePair()` method is now deprecated in favor of`tls.TLSSocket()`. For example, the code:
1145
+ *
1146
+ * ```js
1147
+ * pair = tls.createSecurePair(// ... );
1148
+ * pair.encrypted.pipe(socket);
1149
+ * socket.pipe(pair.encrypted);
1150
+ * ```
1151
+ *
1152
+ * can be replaced by:
1153
+ *
1154
+ * ```js
1155
+ * secureSocket = tls.TLSSocket(socket, options);
1156
+ * ```
1157
+ *
1158
+ * where `secureSocket` has the same API as `pair.cleartext`.
1159
+ * @since v0.3.2
1160
+ * @deprecated Since v0.11.3 - Use {@link TLSSocket} instead.
1161
+ * @param context A secure context object as returned by `tls.createSecureContext()`
1162
+ * @param isServer `true` to specify that this TLS connection should be opened as a server.
1163
+ * @param requestCert `true` to specify whether a server should request a certificate from a connecting client. Only applies when `isServer` is `true`.
1164
+ * @param rejectUnauthorized If not `false` a server automatically reject clients with invalid certificates. Only applies when `isServer` is `true`.
1165
+ */
1166
+ function createSecurePair(
1167
+ context?: SecureContext,
1168
+ isServer?: boolean,
1169
+ requestCert?: boolean,
1170
+ rejectUnauthorized?: boolean,
1171
+ ): SecurePair;
1056
1172
  /**
1057
1173
  * `{@link createServer}` sets the default value of the `honorCipherOrder` option
1058
1174
  * to `true`, other APIs that create secure contexts leave it unset.
@@ -1109,7 +1225,7 @@ declare module "node:tls" {
1109
1225
  * the `ciphers` option of `{@link createSecureContext}`.
1110
1226
  *
1111
1227
  * Not all supported ciphers are enabled by default. See
1112
- * [Modifying the default TLS cipher suite](https://nodejs.org/docs/latest-v25.x/api/tls.html#modifying-the-default-tls-cipher-suite).
1228
+ * [Modifying the default TLS cipher suite](https://nodejs.org/docs/latest-v22.x/api/tls.html#modifying-the-default-tls-cipher-suite).
1113
1229
  *
1114
1230
  * Cipher names that start with `'tls_'` are for TLSv1.3, all the others are for
1115
1231
  * TLSv1.2 and below.
@@ -1148,7 +1264,7 @@ declare module "node:tls" {
1148
1264
  * const additionalCerts = ['-----BEGIN CERTIFICATE-----\n...'];
1149
1265
  * tls.setDefaultCACertificates([...currentCerts, ...additionalCerts]);
1150
1266
  * ```
1151
- * @since v24.5.0
1267
+ * @since v22.19.0
1152
1268
  * @param certs An array of CA certificates in PEM format.
1153
1269
  */
1154
1270
  function setDefaultCACertificates(certs: ReadonlyArray<string | NodeJS.ArrayBufferView>): void;
@@ -1198,6 +1314,6 @@ declare module "node:tls" {
1198
1314
  */
1199
1315
  const rootCertificates: readonly string[];
1200
1316
  }
1201
- declare module "tls" {
1202
- export * from "node:tls";
1317
+ declare module "node:tls" {
1318
+ export * from "tls";
1203
1319
  }
@@ -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-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.
12
+ * * `node.async_hooks`: Enables capture of detailed [`async_hooks`](https://nodejs.org/docs/latest-v22.x/api/async_hooks.html) trace data.
13
+ * The [`async_hooks`](https://nodejs.org/docs/latest-v22.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-v25.x/api/perf_hooks.html) measurements.
25
+ * * `node.perf`: Enables capture of [Performance API](https://nodejs.org/docs/latest-v22.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-v25.x/api/v8.html) events are GC, compiling, and execution related.
33
+ * * `v8`: The [V8](https://nodejs.org/docs/latest-v22.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-v25.x/api/worker_threads.html#class-worker) threads.
91
+ * The features from this module are not available in [`Worker`](https://nodejs.org/docs/latest-v22.x/api/worker_threads.html#class-worker) threads.
92
92
  * @experimental
93
- * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/trace_events.js)
93
+ * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/trace_events.js)
94
94
  */
95
- declare module "node:trace_events" {
95
+ declare module "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 "node:trace_events" {
192
192
  */
193
193
  function getEnabledCategories(): string | undefined;
194
194
  }
195
- declare module "trace_events" {
196
- export * from "node:trace_events";
195
+ declare module "node:trace_events" {
196
+ export * from "trace_events";
197
197
  }