@types/node 24.10.2 → 25.0.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 (81) hide show
  1. node/README.md +1 -1
  2. node/assert/strict.d.ts +5 -11
  3. node/assert.d.ts +9 -169
  4. node/async_hooks.d.ts +8 -8
  5. node/buffer.buffer.d.ts +1 -7
  6. node/buffer.d.ts +44 -168
  7. node/child_process.d.ts +16 -64
  8. node/cluster.d.ts +240 -332
  9. node/console.d.ts +49 -351
  10. node/constants.d.ts +3 -4
  11. node/crypto.d.ts +279 -1631
  12. node/dgram.d.ts +15 -51
  13. node/diagnostics_channel.d.ts +4 -4
  14. node/dns/promises.d.ts +3 -3
  15. node/dns.d.ts +131 -132
  16. node/domain.d.ts +13 -17
  17. node/events.d.ts +719 -649
  18. node/fs/promises.d.ts +7 -8
  19. node/fs.d.ts +417 -455
  20. node/globals.d.ts +6 -26
  21. node/globals.typedarray.d.ts +60 -0
  22. node/http.d.ts +263 -254
  23. node/http2.d.ts +528 -804
  24. node/https.d.ts +59 -239
  25. node/index.d.ts +15 -1
  26. node/inspector/promises.d.ts +41 -0
  27. node/inspector.d.ts +6 -59
  28. node/inspector.generated.d.ts +3 -10
  29. node/module.d.ts +47 -122
  30. node/net.d.ts +63 -184
  31. node/os.d.ts +6 -6
  32. node/package.json +2 -2
  33. node/path/posix.d.ts +8 -0
  34. node/path/win32.d.ts +8 -0
  35. node/path.d.ts +120 -133
  36. node/perf_hooks.d.ts +282 -643
  37. node/process.d.ts +151 -128
  38. node/punycode.d.ts +5 -5
  39. node/querystring.d.ts +4 -4
  40. node/quic.d.ts +910 -0
  41. node/readline/promises.d.ts +3 -3
  42. node/readline.d.ts +67 -120
  43. node/repl.d.ts +75 -98
  44. node/sea.d.ts +1 -1
  45. node/sqlite.d.ts +2 -2
  46. node/stream/consumers.d.ts +10 -10
  47. node/stream/promises.d.ts +136 -15
  48. node/stream/web.d.ts +176 -453
  49. node/stream.d.ts +555 -478
  50. node/string_decoder.d.ts +4 -4
  51. node/test/reporters.d.ts +96 -0
  52. node/test.d.ts +80 -180
  53. node/timers/promises.d.ts +4 -4
  54. node/timers.d.ts +4 -130
  55. node/tls.d.ts +102 -177
  56. node/trace_events.d.ts +9 -9
  57. node/ts5.6/buffer.buffer.d.ts +1 -7
  58. node/ts5.6/index.d.ts +15 -1
  59. node/ts5.7/index.d.ts +15 -1
  60. node/tty.d.ts +58 -16
  61. node/url.d.ts +54 -592
  62. node/util/types.d.ts +558 -0
  63. node/util.d.ts +117 -792
  64. node/v8.d.ts +32 -5
  65. node/vm.d.ts +13 -13
  66. node/wasi.d.ts +4 -4
  67. node/web-globals/abortcontroller.d.ts +27 -2
  68. node/web-globals/blob.d.ts +23 -0
  69. node/web-globals/console.d.ts +9 -0
  70. node/web-globals/crypto.d.ts +7 -0
  71. node/web-globals/encoding.d.ts +11 -0
  72. node/web-globals/events.d.ts +9 -0
  73. node/web-globals/fetch.d.ts +4 -0
  74. node/web-globals/importmeta.d.ts +13 -0
  75. node/web-globals/messaging.d.ts +23 -0
  76. node/web-globals/performance.d.ts +45 -0
  77. node/web-globals/streams.d.ts +93 -0
  78. node/web-globals/timers.d.ts +44 -0
  79. node/web-globals/url.d.ts +24 -0
  80. node/worker_threads.d.ts +176 -358
  81. node/zlib.d.ts +8 -71
node/dgram.d.ts CHANGED
@@ -23,13 +23,13 @@
23
23
  * server.bind(41234);
24
24
  * // Prints: server listening 0.0.0.0:41234
25
25
  * ```
26
- * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/dgram.js)
26
+ * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/dgram.js)
27
27
  */
28
- declare module "dgram" {
28
+ declare module "node:dgram" {
29
29
  import { NonSharedBuffer } from "node:buffer";
30
- import { AddressInfo, BlockList } from "node:net";
31
30
  import * as dns from "node:dns";
32
- import { Abortable, EventEmitter } from "node:events";
31
+ import { Abortable, EventEmitter, InternalEventEmitter } from "node:events";
32
+ import { AddressInfo, BlockList } from "node:net";
33
33
  interface RemoteInfo {
34
34
  address: string;
35
35
  family: "IPv4" | "IPv6";
@@ -88,6 +88,13 @@ declare module "dgram" {
88
88
  */
89
89
  function createSocket(type: SocketType, callback?: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): Socket;
90
90
  function createSocket(options: SocketOptions, callback?: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): Socket;
91
+ interface SocketEventMap {
92
+ "close": [];
93
+ "connect": [];
94
+ "error": [err: Error];
95
+ "listening": [];
96
+ "message": [msg: NonSharedBuffer, rinfo: RemoteInfo];
97
+ }
91
98
  /**
92
99
  * Encapsulates the datagram functionality.
93
100
  *
@@ -95,7 +102,7 @@ declare module "dgram" {
95
102
  * The `new` keyword is not to be used to create `dgram.Socket` instances.
96
103
  * @since v0.1.99
97
104
  */
98
- class Socket extends EventEmitter {
105
+ class Socket implements EventEmitter {
99
106
  /**
100
107
  * Tells the kernel to join a multicast group at the given `multicastAddress` and `multicastInterface` using the `IP_ADD_MEMBERSHIP` socket option. If the `multicastInterface` argument is not
101
108
  * specified, the operating system will choose
@@ -544,57 +551,14 @@ declare module "dgram" {
544
551
  * @since v13.1.0, v12.16.0
545
552
  */
546
553
  dropSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void;
547
- /**
548
- * events.EventEmitter
549
- * 1. close
550
- * 2. connect
551
- * 3. error
552
- * 4. listening
553
- * 5. message
554
- */
555
- addListener(event: string, listener: (...args: any[]) => void): this;
556
- addListener(event: "close", listener: () => void): this;
557
- addListener(event: "connect", listener: () => void): this;
558
- addListener(event: "error", listener: (err: Error) => void): this;
559
- addListener(event: "listening", listener: () => void): this;
560
- addListener(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this;
561
- emit(event: string | symbol, ...args: any[]): boolean;
562
- emit(event: "close"): boolean;
563
- emit(event: "connect"): boolean;
564
- emit(event: "error", err: Error): boolean;
565
- emit(event: "listening"): boolean;
566
- emit(event: "message", msg: NonSharedBuffer, rinfo: RemoteInfo): boolean;
567
- on(event: string, listener: (...args: any[]) => void): this;
568
- on(event: "close", listener: () => void): this;
569
- on(event: "connect", listener: () => void): this;
570
- on(event: "error", listener: (err: Error) => void): this;
571
- on(event: "listening", listener: () => void): this;
572
- on(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this;
573
- once(event: string, listener: (...args: any[]) => void): this;
574
- once(event: "close", listener: () => void): this;
575
- once(event: "connect", listener: () => void): this;
576
- once(event: "error", listener: (err: Error) => void): this;
577
- once(event: "listening", listener: () => void): this;
578
- once(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this;
579
- prependListener(event: string, listener: (...args: any[]) => void): this;
580
- prependListener(event: "close", listener: () => void): this;
581
- prependListener(event: "connect", listener: () => void): this;
582
- prependListener(event: "error", listener: (err: Error) => void): this;
583
- prependListener(event: "listening", listener: () => void): this;
584
- prependListener(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this;
585
- prependOnceListener(event: string, listener: (...args: any[]) => void): this;
586
- prependOnceListener(event: "close", listener: () => void): this;
587
- prependOnceListener(event: "connect", listener: () => void): this;
588
- prependOnceListener(event: "error", listener: (err: Error) => void): this;
589
- prependOnceListener(event: "listening", listener: () => void): this;
590
- prependOnceListener(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this;
591
554
  /**
592
555
  * Calls `socket.close()` and returns a promise that fulfills when the socket has closed.
593
556
  * @since v20.5.0
594
557
  */
595
558
  [Symbol.asyncDispose](): Promise<void>;
596
559
  }
560
+ interface Socket extends InternalEventEmitter<SocketEventMap> {}
597
561
  }
598
- declare module "node:dgram" {
599
- export * from "dgram";
562
+ declare module "dgram" {
563
+ export * from "node:dgram";
600
564
  }
@@ -20,9 +20,9 @@
20
20
  * should generally include the module name to avoid collisions with data from
21
21
  * other modules.
22
22
  * @since v15.1.0, v14.17.0
23
- * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/diagnostics_channel.js)
23
+ * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/diagnostics_channel.js)
24
24
  */
25
- declare module "diagnostics_channel" {
25
+ declare module "node:diagnostics_channel" {
26
26
  import { AsyncLocalStorage } from "node:async_hooks";
27
27
  /**
28
28
  * Check if there are active subscribers to the named channel. This is helpful if
@@ -571,6 +571,6 @@ declare module "diagnostics_channel" {
571
571
  readonly hasSubscribers: boolean;
572
572
  }
573
573
  }
574
- declare module "node:diagnostics_channel" {
575
- export * from "diagnostics_channel";
574
+ declare module "diagnostics_channel" {
575
+ export * from "node:diagnostics_channel";
576
576
  }
node/dns/promises.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * via `import { promises as dnsPromises } from 'node:dns'` or `import dnsPromises from 'node:dns/promises'`.
5
5
  * @since v10.6.0
6
6
  */
7
- declare module "dns/promises" {
7
+ declare module "node:dns/promises" {
8
8
  import {
9
9
  AnyRecord,
10
10
  CaaRecord,
@@ -498,6 +498,6 @@ declare module "dns/promises" {
498
498
  setServers: typeof setServers;
499
499
  }
500
500
  }
501
- declare module "node:dns/promises" {
502
- export * from "dns/promises";
501
+ declare module "dns/promises" {
502
+ export * from "node:dns/promises";
503
503
  }