@types/node 22.15.21 → 24.10.9

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 (85) hide show
  1. node v24.10/README.md +15 -0
  2. node v24.10/assert/strict.d.ts +111 -0
  3. node/assert.d.ts → node v24.10/assert.d.ts +162 -101
  4. node/async_hooks.d.ts → node v24.10/async_hooks.d.ts +26 -6
  5. node/buffer.buffer.d.ts → node v24.10/buffer.buffer.d.ts +9 -0
  6. node/buffer.d.ts → node v24.10/buffer.d.ts +15 -7
  7. node/child_process.d.ts → node v24.10/child_process.d.ts +91 -164
  8. node/cluster.d.ts → node v24.10/cluster.d.ts +19 -20
  9. node/console.d.ts → node v24.10/console.d.ts +19 -18
  10. node/crypto.d.ts → node v24.10/crypto.d.ts +1264 -356
  11. node/dgram.d.ts → node v24.10/dgram.d.ts +10 -9
  12. node/diagnostics_channel.d.ts → node v24.10/diagnostics_channel.d.ts +18 -15
  13. node/dns/promises.d.ts → node v24.10/dns/promises.d.ts +36 -9
  14. node/dns.d.ts → node v24.10/dns.d.ts +95 -37
  15. node/domain.d.ts → node v24.10/domain.d.ts +1 -1
  16. node/events.d.ts → node v24.10/events.d.ts +81 -36
  17. node/fs/promises.d.ts → node v24.10/fs/promises.d.ts +117 -59
  18. node/fs.d.ts → node v24.10/fs.d.ts +414 -137
  19. node v24.10/globals.d.ts +170 -0
  20. node v24.10/globals.typedarray.d.ts +41 -0
  21. node/http.d.ts → node v24.10/http.d.ts +187 -37
  22. node/http2.d.ts → node v24.10/http2.d.ts +266 -67
  23. node/https.d.ts → node v24.10/https.d.ts +97 -63
  24. node/index.d.ts → node v24.10/index.d.ts +16 -7
  25. node v24.10/inspector.d.ts +277 -0
  26. node/inspector.d.ts → node v24.10/inspector.generated.d.ts +1059 -828
  27. node/module.d.ts → node v24.10/module.d.ts +153 -31
  28. node/net.d.ts → node v24.10/net.d.ts +35 -16
  29. node/os.d.ts → node v24.10/os.d.ts +22 -10
  30. node/package.json → node v24.10/package.json +14 -84
  31. node/path.d.ts → node v24.10/path.d.ts +2 -2
  32. node/perf_hooks.d.ts → node v24.10/perf_hooks.d.ts +30 -18
  33. node/process.d.ts → node v24.10/process.d.ts +59 -34
  34. node/punycode.d.ts → node v24.10/punycode.d.ts +1 -1
  35. node/querystring.d.ts → node v24.10/querystring.d.ts +1 -1
  36. node/readline/promises.d.ts → node v24.10/readline/promises.d.ts +1 -2
  37. node/readline.d.ts → node v24.10/readline.d.ts +13 -13
  38. node/repl.d.ts → node v24.10/repl.d.ts +25 -17
  39. node/sea.d.ts → node v24.10/sea.d.ts +10 -1
  40. node/sqlite.d.ts → node v24.10/sqlite.d.ts +438 -9
  41. node/stream/consumers.d.ts → node v24.10/stream/consumers.d.ts +2 -2
  42. node/stream/web.d.ts → node v24.10/stream/web.d.ts +13 -54
  43. node/stream.d.ts → node v24.10/stream.d.ts +68 -47
  44. node/string_decoder.d.ts → node v24.10/string_decoder.d.ts +3 -3
  45. node v24.10/test.d.ts +2339 -0
  46. node/timers/promises.d.ts → node v24.10/timers/promises.d.ts +1 -1
  47. node/timers.d.ts → node v24.10/timers.d.ts +1 -3
  48. node/tls.d.ts → node v24.10/tls.d.ts +128 -114
  49. node/trace_events.d.ts → node v24.10/trace_events.d.ts +6 -6
  50. node/ts5.6/buffer.buffer.d.ts → node v24.10/ts5.6/buffer.buffer.d.ts +10 -2
  51. node v24.10/ts5.6/compatibility/float16array.d.ts +71 -0
  52. node v24.10/ts5.6/globals.typedarray.d.ts +36 -0
  53. node/ts5.6/index.d.ts → node v24.10/ts5.6/index.d.ts +18 -7
  54. node v24.10/ts5.7/compatibility/float16array.d.ts +72 -0
  55. node v24.10/ts5.7/index.d.ts +103 -0
  56. node/tty.d.ts → node v24.10/tty.d.ts +1 -1
  57. node/url.d.ts → node v24.10/url.d.ts +119 -34
  58. node/util.d.ts → node v24.10/util.d.ts +46 -305
  59. node/v8.d.ts → node v24.10/v8.d.ts +100 -37
  60. node/vm.d.ts → node v24.10/vm.d.ts +299 -110
  61. node/wasi.d.ts → node v24.10/wasi.d.ts +23 -2
  62. node v24.10/web-globals/abortcontroller.d.ts +34 -0
  63. node v24.10/web-globals/crypto.d.ts +32 -0
  64. node v24.10/web-globals/domexception.d.ts +68 -0
  65. node v24.10/web-globals/events.d.ts +97 -0
  66. node v24.10/web-globals/fetch.d.ts +50 -0
  67. node v24.10/web-globals/navigator.d.ts +25 -0
  68. node v24.10/web-globals/storage.d.ts +24 -0
  69. node v24.10/web-globals/streams.d.ts +22 -0
  70. node/worker_threads.d.ts → node v24.10/worker_threads.d.ts +225 -75
  71. node/zlib.d.ts → node v24.10/zlib.d.ts +44 -33
  72. node/README.md +0 -15
  73. node/assert/strict.d.ts +0 -8
  74. node/compatibility/disposable.d.ts +0 -16
  75. node/compatibility/index.d.ts +0 -9
  76. node/compatibility/indexable.d.ts +0 -23
  77. node/dom-events.d.ts +0 -124
  78. node/globals.d.ts +0 -371
  79. node/globals.typedarray.d.ts +0 -21
  80. node/test.d.ts +0 -2280
  81. node/ts5.6/globals.typedarray.d.ts +0 -19
  82. {node → node v24.10}/LICENSE +0 -0
  83. {node → node v24.10}/compatibility/iterators.d.ts +0 -0
  84. {node → node v24.10}/constants.d.ts +0 -0
  85. {node → node v24.10}/stream/promises.d.ts +0 -0
@@ -11,7 +11,7 @@
11
11
  * } from 'node:timers/promises';
12
12
  * ```
13
13
  * @since v15.0.0
14
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/timers/promises.js)
14
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/timers/promises.js)
15
15
  */
16
16
  declare module "timers/promises" {
17
17
  import { TimerOptions } from "node:timers";
@@ -6,7 +6,7 @@
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/v22.x/lib/timers.js)
9
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/timers.js)
10
10
  */
11
11
  declare module "timers" {
12
12
  import { Abortable } from "node:events";
@@ -60,7 +60,6 @@ declare module "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
64
63
  */
65
64
  [Symbol.dispose](): void;
66
65
  _onImmediate(...args: any[]): void;
@@ -141,7 +140,6 @@ declare module "timers" {
141
140
  /**
142
141
  * Cancels the timeout.
143
142
  * @since v20.5.0, v18.18.0
144
- * @experimental
145
143
  */
146
144
  [Symbol.dispose](): void;
147
145
  _onTimeout(...args: any[]): void;
@@ -6,9 +6,10 @@
6
6
  * ```js
7
7
  * import tls from 'node:tls';
8
8
  * ```
9
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/tls.js)
9
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/tls.js)
10
10
  */
11
11
  declare module "tls" {
12
+ import { NonSharedBuffer } from "node:buffer";
12
13
  import { X509Certificate } from "node:crypto";
13
14
  import * as net from "node:net";
14
15
  import * as stream from "stream";
@@ -49,7 +50,7 @@ declare module "tls" {
49
50
  /**
50
51
  * The DER encoded X.509 certificate data.
51
52
  */
52
- raw: Buffer;
53
+ raw: NonSharedBuffer;
53
54
  /**
54
55
  * The certificate subject.
55
56
  */
@@ -115,7 +116,7 @@ declare module "tls" {
115
116
  /**
116
117
  * The public key.
117
118
  */
118
- pubkey?: Buffer;
119
+ pubkey?: NonSharedBuffer;
119
120
  /**
120
121
  * The ASN.1 name of the OID of the elliptic curve.
121
122
  * Well-known curves are identified by an OID.
@@ -244,6 +245,10 @@ declare module "tls" {
244
245
  * When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false.
245
246
  */
246
247
  alpnProtocol: string | false | null;
248
+ /**
249
+ * String containing the server name requested via SNI (Server Name Indication) TLS extension.
250
+ */
251
+ servername: string | false | null;
247
252
  /**
248
253
  * Returns an object representing the local certificate. The returned object has
249
254
  * some properties corresponding to the fields of the certificate.
@@ -295,7 +300,7 @@ declare module "tls" {
295
300
  * @since v9.9.0
296
301
  * @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.
297
302
  */
298
- getFinished(): Buffer | undefined;
303
+ getFinished(): NonSharedBuffer | undefined;
299
304
  /**
300
305
  * Returns an object representing the peer's certificate. If the peer does not
301
306
  * provide a certificate, an empty object will be returned. If the socket has been
@@ -322,7 +327,7 @@ declare module "tls" {
322
327
  * @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
323
328
  * far.
324
329
  */
325
- getPeerFinished(): Buffer | undefined;
330
+ getPeerFinished(): NonSharedBuffer | undefined;
326
331
  /**
327
332
  * Returns a string containing the negotiated SSL/TLS protocol version of the
328
333
  * current connection. The value `'unknown'` will be returned for connected
@@ -352,7 +357,7 @@ declare module "tls" {
352
357
  * must use the `'session'` event (it also works for TLSv1.2 and below).
353
358
  * @since v0.11.4
354
359
  */
355
- getSession(): Buffer | undefined;
360
+ getSession(): NonSharedBuffer | undefined;
356
361
  /**
357
362
  * See [SSL\_get\_shared\_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html) for more information.
358
363
  * @since v12.11.0
@@ -367,7 +372,7 @@ declare module "tls" {
367
372
  * See `Session Resumption` for more information.
368
373
  * @since v0.11.4
369
374
  */
370
- getTLSTicket(): Buffer | undefined;
375
+ getTLSTicket(): NonSharedBuffer | undefined;
371
376
  /**
372
377
  * See `Session Resumption` for more information.
373
378
  * @since v0.5.6
@@ -478,37 +483,37 @@ declare module "tls" {
478
483
  * @param context Optionally provide a context.
479
484
  * @return requested bytes of the keying material
480
485
  */
481
- exportKeyingMaterial(length: number, label: string, context: Buffer): Buffer;
486
+ exportKeyingMaterial(length: number, label: string, context: Buffer): NonSharedBuffer;
482
487
  addListener(event: string, listener: (...args: any[]) => void): this;
483
- addListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
488
+ addListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
484
489
  addListener(event: "secureConnect", listener: () => void): this;
485
- addListener(event: "session", listener: (session: Buffer) => void): this;
486
- addListener(event: "keylog", listener: (line: Buffer) => void): this;
490
+ addListener(event: "session", listener: (session: NonSharedBuffer) => void): this;
491
+ addListener(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
487
492
  emit(event: string | symbol, ...args: any[]): boolean;
488
- emit(event: "OCSPResponse", response: Buffer): boolean;
493
+ emit(event: "OCSPResponse", response: NonSharedBuffer): boolean;
489
494
  emit(event: "secureConnect"): boolean;
490
- emit(event: "session", session: Buffer): boolean;
491
- emit(event: "keylog", line: Buffer): boolean;
495
+ emit(event: "session", session: NonSharedBuffer): boolean;
496
+ emit(event: "keylog", line: NonSharedBuffer): boolean;
492
497
  on(event: string, listener: (...args: any[]) => void): this;
493
- on(event: "OCSPResponse", listener: (response: Buffer) => void): this;
498
+ on(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
494
499
  on(event: "secureConnect", listener: () => void): this;
495
- on(event: "session", listener: (session: Buffer) => void): this;
496
- on(event: "keylog", listener: (line: Buffer) => void): this;
500
+ on(event: "session", listener: (session: NonSharedBuffer) => void): this;
501
+ on(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
497
502
  once(event: string, listener: (...args: any[]) => void): this;
498
- once(event: "OCSPResponse", listener: (response: Buffer) => void): this;
503
+ once(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
499
504
  once(event: "secureConnect", listener: () => void): this;
500
- once(event: "session", listener: (session: Buffer) => void): this;
501
- once(event: "keylog", listener: (line: Buffer) => void): this;
505
+ once(event: "session", listener: (session: NonSharedBuffer) => void): this;
506
+ once(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
502
507
  prependListener(event: string, listener: (...args: any[]) => void): this;
503
- prependListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
508
+ prependListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
504
509
  prependListener(event: "secureConnect", listener: () => void): this;
505
- prependListener(event: "session", listener: (session: Buffer) => void): this;
506
- prependListener(event: "keylog", listener: (line: Buffer) => void): this;
510
+ prependListener(event: "session", listener: (session: NonSharedBuffer) => void): this;
511
+ prependListener(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
507
512
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
508
- prependOnceListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
513
+ prependOnceListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
509
514
  prependOnceListener(event: "secureConnect", listener: () => void): this;
510
- prependOnceListener(event: "session", listener: (session: Buffer) => void): this;
511
- prependOnceListener(event: "keylog", listener: (line: Buffer) => void): this;
515
+ prependOnceListener(event: "session", listener: (session: NonSharedBuffer) => void): this;
516
+ prependOnceListener(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
512
517
  }
513
518
  interface CommonConnectionOptions {
514
519
  /**
@@ -531,7 +536,7 @@ declare module "tls" {
531
536
  * An array of strings or a Buffer naming possible ALPN protocols.
532
537
  * (Protocols should be ordered by their priority.)
533
538
  */
534
- ALPNProtocols?: string[] | Uint8Array[] | Uint8Array | undefined;
539
+ ALPNProtocols?: readonly string[] | NodeJS.ArrayBufferView | undefined;
535
540
  /**
536
541
  * SNICallback(servername, cb) <Function> A function that will be
537
542
  * called if the client supports SNI TLS extension. Two arguments
@@ -586,7 +591,7 @@ declare module "tls" {
586
591
  * requires explicitly specifying a cipher suite with the `ciphers` option.
587
592
  * More information can be found in the RFC 4279.
588
593
  */
589
- pskCallback?(socket: TLSSocket, identity: string): DataView | NodeJS.TypedArray | null;
594
+ pskCallback?: ((socket: TLSSocket, identity: string) => NodeJS.ArrayBufferView | null) | undefined;
590
595
  /**
591
596
  * hint to send to a client to help
592
597
  * with selecting the identity during TLS-PSK negotiation. Will be ignored
@@ -596,7 +601,7 @@ declare module "tls" {
596
601
  pskIdentityHint?: string | undefined;
597
602
  }
598
603
  interface PSKCallbackNegotation {
599
- psk: DataView | NodeJS.TypedArray;
604
+ psk: NodeJS.ArrayBufferView;
600
605
  identity: string;
601
606
  }
602
607
  interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions {
@@ -627,7 +632,7 @@ declare module "tls" {
627
632
  * compatible with the selected cipher's digest.
628
633
  * `identity` must use UTF-8 encoding.
629
634
  */
630
- pskCallback?(hint: string | null): PSKCallbackNegotation | null;
635
+ pskCallback?: ((hint: string | null) => PSKCallbackNegotation | null) | undefined;
631
636
  }
632
637
  /**
633
638
  * Accepts encrypted connections using TLS or SSL.
@@ -655,7 +660,7 @@ declare module "tls" {
655
660
  * @since v3.0.0
656
661
  * @return A 48-byte buffer containing the session ticket keys.
657
662
  */
658
- getTicketKeys(): Buffer;
663
+ getTicketKeys(): NonSharedBuffer;
659
664
  /**
660
665
  * The `server.setSecureContext()` method replaces the secure context of an
661
666
  * existing server. Existing connections to the server are not interrupted.
@@ -687,122 +692,138 @@ declare module "tls" {
687
692
  addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
688
693
  addListener(
689
694
  event: "newSession",
690
- listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
695
+ listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
691
696
  ): this;
692
697
  addListener(
693
698
  event: "OCSPRequest",
694
699
  listener: (
695
- certificate: Buffer,
696
- issuer: Buffer,
697
- callback: (err: Error | null, resp: Buffer) => void,
700
+ certificate: NonSharedBuffer,
701
+ issuer: NonSharedBuffer,
702
+ callback: (err: Error | null, resp: Buffer | null) => void,
698
703
  ) => void,
699
704
  ): this;
700
705
  addListener(
701
706
  event: "resumeSession",
702
- listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
707
+ listener: (
708
+ sessionId: NonSharedBuffer,
709
+ callback: (err: Error | null, sessionData: Buffer | null) => void,
710
+ ) => void,
703
711
  ): this;
704
712
  addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
705
- addListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
713
+ addListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
706
714
  emit(event: string | symbol, ...args: any[]): boolean;
707
715
  emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean;
708
- emit(event: "newSession", sessionId: Buffer, sessionData: Buffer, callback: () => void): boolean;
716
+ emit(
717
+ event: "newSession",
718
+ sessionId: NonSharedBuffer,
719
+ sessionData: NonSharedBuffer,
720
+ callback: () => void,
721
+ ): boolean;
709
722
  emit(
710
723
  event: "OCSPRequest",
711
- certificate: Buffer,
712
- issuer: Buffer,
713
- callback: (err: Error | null, resp: Buffer) => void,
724
+ certificate: NonSharedBuffer,
725
+ issuer: NonSharedBuffer,
726
+ callback: (err: Error | null, resp: Buffer | null) => void,
714
727
  ): boolean;
715
728
  emit(
716
729
  event: "resumeSession",
717
- sessionId: Buffer,
730
+ sessionId: NonSharedBuffer,
718
731
  callback: (err: Error | null, sessionData: Buffer | null) => void,
719
732
  ): boolean;
720
733
  emit(event: "secureConnection", tlsSocket: TLSSocket): boolean;
721
- emit(event: "keylog", line: Buffer, tlsSocket: TLSSocket): boolean;
734
+ emit(event: "keylog", line: NonSharedBuffer, tlsSocket: TLSSocket): boolean;
722
735
  on(event: string, listener: (...args: any[]) => void): this;
723
736
  on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
724
- on(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this;
737
+ on(
738
+ event: "newSession",
739
+ listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
740
+ ): this;
725
741
  on(
726
742
  event: "OCSPRequest",
727
743
  listener: (
728
- certificate: Buffer,
729
- issuer: Buffer,
730
- callback: (err: Error | null, resp: Buffer) => void,
744
+ certificate: NonSharedBuffer,
745
+ issuer: NonSharedBuffer,
746
+ callback: (err: Error | null, resp: Buffer | null) => void,
731
747
  ) => void,
732
748
  ): this;
733
749
  on(
734
750
  event: "resumeSession",
735
- listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
751
+ listener: (
752
+ sessionId: NonSharedBuffer,
753
+ callback: (err: Error | null, sessionData: Buffer | null) => void,
754
+ ) => void,
736
755
  ): this;
737
756
  on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
738
- on(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
757
+ on(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
739
758
  once(event: string, listener: (...args: any[]) => void): this;
740
759
  once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
741
760
  once(
742
761
  event: "newSession",
743
- listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
762
+ listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
744
763
  ): this;
745
764
  once(
746
765
  event: "OCSPRequest",
747
766
  listener: (
748
- certificate: Buffer,
749
- issuer: Buffer,
750
- callback: (err: Error | null, resp: Buffer) => void,
767
+ certificate: NonSharedBuffer,
768
+ issuer: NonSharedBuffer,
769
+ callback: (err: Error | null, resp: Buffer | null) => void,
751
770
  ) => void,
752
771
  ): this;
753
772
  once(
754
773
  event: "resumeSession",
755
- listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
774
+ listener: (
775
+ sessionId: NonSharedBuffer,
776
+ callback: (err: Error | null, sessionData: Buffer | null) => void,
777
+ ) => void,
756
778
  ): this;
757
779
  once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
758
- once(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
780
+ once(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
759
781
  prependListener(event: string, listener: (...args: any[]) => void): this;
760
782
  prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
761
783
  prependListener(
762
784
  event: "newSession",
763
- listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
785
+ listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
764
786
  ): this;
765
787
  prependListener(
766
788
  event: "OCSPRequest",
767
789
  listener: (
768
- certificate: Buffer,
769
- issuer: Buffer,
770
- callback: (err: Error | null, resp: Buffer) => void,
790
+ certificate: NonSharedBuffer,
791
+ issuer: NonSharedBuffer,
792
+ callback: (err: Error | null, resp: Buffer | null) => void,
771
793
  ) => void,
772
794
  ): this;
773
795
  prependListener(
774
796
  event: "resumeSession",
775
- listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
797
+ listener: (
798
+ sessionId: NonSharedBuffer,
799
+ callback: (err: Error | null, sessionData: Buffer | null) => void,
800
+ ) => void,
776
801
  ): this;
777
802
  prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
778
- prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
803
+ prependListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
779
804
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
780
805
  prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
781
806
  prependOnceListener(
782
807
  event: "newSession",
783
- listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
808
+ listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
784
809
  ): this;
785
810
  prependOnceListener(
786
811
  event: "OCSPRequest",
787
812
  listener: (
788
- certificate: Buffer,
789
- issuer: Buffer,
790
- callback: (err: Error | null, resp: Buffer) => void,
813
+ certificate: NonSharedBuffer,
814
+ issuer: NonSharedBuffer,
815
+ callback: (err: Error | null, resp: Buffer | null) => void,
791
816
  ) => void,
792
817
  ): this;
793
818
  prependOnceListener(
794
819
  event: "resumeSession",
795
- listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
820
+ listener: (
821
+ sessionId: NonSharedBuffer,
822
+ callback: (err: Error | null, sessionData: Buffer | null) => void,
823
+ ) => void,
796
824
  ): this;
797
825
  prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
798
- prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
799
- }
800
- /**
801
- * @deprecated since v0.11.3 Use `tls.TLSSocket` instead.
802
- */
803
- interface SecurePair {
804
- encrypted: TLSSocket;
805
- cleartext: TLSSocket;
826
+ prependOnceListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
806
827
  }
807
828
  type SecureVersion = "TLSv1.3" | "TLSv1.2" | "TLSv1.1" | "TLSv1";
808
829
  interface SecureContextOptions {
@@ -1102,45 +1123,6 @@ declare module "tls" {
1102
1123
  secureConnectListener?: () => void,
1103
1124
  ): TLSSocket;
1104
1125
  function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
1105
- /**
1106
- * Creates a new secure pair object with two streams, one of which reads and writes
1107
- * the encrypted data and the other of which reads and writes the cleartext data.
1108
- * Generally, the encrypted stream is piped to/from an incoming encrypted data
1109
- * stream and the cleartext one is used as a replacement for the initial encrypted
1110
- * stream.
1111
- *
1112
- * `tls.createSecurePair()` returns a `tls.SecurePair` object with `cleartext` and `encrypted` stream properties.
1113
- *
1114
- * Using `cleartext` has the same API as {@link TLSSocket}.
1115
- *
1116
- * The `tls.createSecurePair()` method is now deprecated in favor of`tls.TLSSocket()`. For example, the code:
1117
- *
1118
- * ```js
1119
- * pair = tls.createSecurePair(// ... );
1120
- * pair.encrypted.pipe(socket);
1121
- * socket.pipe(pair.encrypted);
1122
- * ```
1123
- *
1124
- * can be replaced by:
1125
- *
1126
- * ```js
1127
- * secureSocket = tls.TLSSocket(socket, options);
1128
- * ```
1129
- *
1130
- * where `secureSocket` has the same API as `pair.cleartext`.
1131
- * @since v0.3.2
1132
- * @deprecated Since v0.11.3 - Use {@link TLSSocket} instead.
1133
- * @param context A secure context object as returned by `tls.createSecureContext()`
1134
- * @param isServer `true` to specify that this TLS connection should be opened as a server.
1135
- * @param requestCert `true` to specify whether a server should request a certificate from a connecting client. Only applies when `isServer` is `true`.
1136
- * @param rejectUnauthorized If not `false` a server automatically reject clients with invalid certificates. Only applies when `isServer` is `true`.
1137
- */
1138
- function createSecurePair(
1139
- context?: SecureContext,
1140
- isServer?: boolean,
1141
- requestCert?: boolean,
1142
- rejectUnauthorized?: boolean,
1143
- ): SecurePair;
1144
1126
  /**
1145
1127
  * `{@link createServer}` sets the default value of the `honorCipherOrder` option
1146
1128
  * to `true`, other APIs that create secure contexts leave it unset.
@@ -1197,7 +1179,7 @@ declare module "tls" {
1197
1179
  * the `ciphers` option of `{@link createSecureContext}`.
1198
1180
  *
1199
1181
  * Not all supported ciphers are enabled by default. See
1200
- * [Modifying the default TLS cipher suite](https://nodejs.org/docs/latest-v22.x/api/tls.html#modifying-the-default-tls-cipher-suite).
1182
+ * [Modifying the default TLS cipher suite](https://nodejs.org/docs/latest-v24.x/api/tls.html#modifying-the-default-tls-cipher-suite).
1201
1183
  *
1202
1184
  * Cipher names that start with `'tls_'` are for TLSv1.3, all the others are for
1203
1185
  * TLSv1.2 and below.
@@ -1208,6 +1190,38 @@ declare module "tls" {
1208
1190
  * @since v0.10.2
1209
1191
  */
1210
1192
  function getCiphers(): string[];
1193
+ /**
1194
+ * Sets the default CA certificates used by Node.js TLS clients. If the provided
1195
+ * certificates are parsed successfully, they will become the default CA
1196
+ * certificate list returned by {@link getCACertificates} and used
1197
+ * by subsequent TLS connections that don't specify their own CA certificates.
1198
+ * The certificates will be deduplicated before being set as the default.
1199
+ *
1200
+ * This function only affects the current Node.js thread. Previous
1201
+ * sessions cached by the HTTPS agent won't be affected by this change, so
1202
+ * this method should be called before any unwanted cachable TLS connections are
1203
+ * made.
1204
+ *
1205
+ * To use system CA certificates as the default:
1206
+ *
1207
+ * ```js
1208
+ * import tls from 'node:tls';
1209
+ * tls.setDefaultCACertificates(tls.getCACertificates('system'));
1210
+ * ```
1211
+ *
1212
+ * This function completely replaces the default CA certificate list. To add additional
1213
+ * certificates to the existing defaults, get the current certificates and append to them:
1214
+ *
1215
+ * ```js
1216
+ * import tls from 'node:tls';
1217
+ * const currentCerts = tls.getCACertificates('default');
1218
+ * const additionalCerts = ['-----BEGIN CERTIFICATE-----\n...'];
1219
+ * tls.setDefaultCACertificates([...currentCerts, ...additionalCerts]);
1220
+ * ```
1221
+ * @since v24.5.0
1222
+ * @param certs An array of CA certificates in PEM format.
1223
+ */
1224
+ function setDefaultCACertificates(certs: ReadonlyArray<string | NodeJS.ArrayBufferView>): void;
1211
1225
  /**
1212
1226
  * The default curve name to use for ECDH key agreement in a tls server.
1213
1227
  * The default value is `'auto'`. See `{@link createSecureContext()}` for further
@@ -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-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.
12
+ * * `node.async_hooks`: Enables capture of detailed [`async_hooks`](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html) trace data.
13
+ * The [`async_hooks`](https://nodejs.org/docs/latest-v24.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-v22.x/api/perf_hooks.html) measurements.
25
+ * * `node.perf`: Enables capture of [Performance API](https://nodejs.org/docs/latest-v24.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-v22.x/api/v8.html) events are GC, compiling, and execution related.
33
+ * * `v8`: The [V8](https://nodejs.org/docs/latest-v24.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,9 +88,9 @@
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-v22.x/api/worker_threads.html#class-worker) threads.
91
+ * The features from this module are not available in [`Worker`](https://nodejs.org/docs/latest-v24.x/api/worker_threads.html#class-worker) threads.
92
92
  * @experimental
93
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/trace_events.js)
93
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/trace_events.js)
94
94
  */
95
95
  declare module "trace_events" {
96
96
  /**
@@ -32,7 +32,7 @@ declare module "buffer" {
32
32
  * @param arrayBuffer The ArrayBuffer with which to share memory.
33
33
  * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead.
34
34
  */
35
- new(arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer;
35
+ new(arrayBuffer: ArrayBufferLike): Buffer;
36
36
  /**
37
37
  * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`.
38
38
  * Array entries outside that range will be truncated to fit into it.
@@ -126,7 +126,7 @@ declare module "buffer" {
126
126
  * `arrayBuffer.byteLength - byteOffset`.
127
127
  */
128
128
  from(
129
- arrayBuffer: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>,
129
+ arrayBuffer: WithImplicitCoercion<ArrayBufferLike>,
130
130
  byteOffset?: number,
131
131
  length?: number,
132
132
  ): Buffer;
@@ -448,7 +448,15 @@ declare module "buffer" {
448
448
  */
449
449
  subarray(start?: number, end?: number): Buffer;
450
450
  }
451
+ /**
452
+ * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
453
+ * TypeScript versions earlier than 5.7.
454
+ */
451
455
  type NonSharedBuffer = Buffer;
456
+ /**
457
+ * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
458
+ * TypeScript versions earlier than 5.7.
459
+ */
452
460
  type AllowSharedBuffer = Buffer;
453
461
  }
454
462
  /** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */
@@ -0,0 +1,71 @@
1
+ // Interface declaration for Float16Array, required in @types/node v24+.
2
+ // These definitions are specific to TS <=5.6.
3
+
4
+ // This needs all of the "common" properties/methods of the TypedArrays,
5
+ // otherwise the type unions `TypedArray` and `ArrayBufferView` will be
6
+ // empty objects.
7
+ interface Float16Array extends Pick<Float32Array, typeof Symbol.iterator | "entries" | "keys" | "values"> {
8
+ readonly BYTES_PER_ELEMENT: number;
9
+ readonly buffer: ArrayBufferLike;
10
+ readonly byteLength: number;
11
+ readonly byteOffset: number;
12
+ readonly length: number;
13
+ readonly [Symbol.toStringTag]: "Float16Array";
14
+ at(index: number): number | undefined;
15
+ copyWithin(target: number, start: number, end?: number): this;
16
+ every(predicate: (value: number, index: number, array: Float16Array) => unknown, thisArg?: any): boolean;
17
+ fill(value: number, start?: number, end?: number): this;
18
+ filter(predicate: (value: number, index: number, array: Float16Array) => any, thisArg?: any): Float16Array;
19
+ find(predicate: (value: number, index: number, obj: Float16Array) => boolean, thisArg?: any): number | undefined;
20
+ findIndex(predicate: (value: number, index: number, obj: Float16Array) => boolean, thisArg?: any): number;
21
+ findLast<S extends number>(
22
+ predicate: (value: number, index: number, array: Float16Array) => value is S,
23
+ thisArg?: any,
24
+ ): S | undefined;
25
+ findLast(
26
+ predicate: (value: number, index: number, array: Float16Array) => unknown,
27
+ thisArg?: any,
28
+ ): number | undefined;
29
+ findLastIndex(predicate: (value: number, index: number, array: Float16Array) => unknown, thisArg?: any): number;
30
+ forEach(callbackfn: (value: number, index: number, array: Float16Array) => void, thisArg?: any): void;
31
+ includes(searchElement: number, fromIndex?: number): boolean;
32
+ indexOf(searchElement: number, fromIndex?: number): number;
33
+ join(separator?: string): string;
34
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
35
+ map(callbackfn: (value: number, index: number, array: Float16Array) => number, thisArg?: any): Float16Array;
36
+ reduce(
37
+ callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float16Array) => number,
38
+ ): number;
39
+ reduce(
40
+ callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float16Array) => number,
41
+ initialValue: number,
42
+ ): number;
43
+ reduce<U>(
44
+ callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float16Array) => U,
45
+ initialValue: U,
46
+ ): U;
47
+ reduceRight(
48
+ callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float16Array) => number,
49
+ ): number;
50
+ reduceRight(
51
+ callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float16Array) => number,
52
+ initialValue: number,
53
+ ): number;
54
+ reduceRight<U>(
55
+ callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float16Array) => U,
56
+ initialValue: U,
57
+ ): U;
58
+ reverse(): Float16Array;
59
+ set(array: ArrayLike<number>, offset?: number): void;
60
+ slice(start?: number, end?: number): Float16Array;
61
+ some(predicate: (value: number, index: number, array: Float16Array) => unknown, thisArg?: any): boolean;
62
+ sort(compareFn?: (a: number, b: number) => number): this;
63
+ subarray(begin?: number, end?: number): Float16Array;
64
+ toLocaleString(locales: string | string[], options?: Intl.NumberFormatOptions): string;
65
+ toReversed(): Float16Array;
66
+ toSorted(compareFn?: (a: number, b: number) => number): Float16Array;
67
+ toString(): string;
68
+ valueOf(): Float16Array;
69
+ with(index: number, value: number): Float16Array;
70
+ [index: number]: number;
71
+ }