@rio-cloud/cdk-v2-constructs 8.2.0 → 8.2.1-alpha.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 (179) hide show
  1. package/.jsii +2 -2
  2. package/node_modules/@types/node/README.md +3 -3
  3. package/node_modules/@types/node/assert/strict.d.ts +105 -2
  4. package/node_modules/@types/node/assert.d.ts +211 -92
  5. package/node_modules/@types/node/async_hooks.d.ts +103 -19
  6. package/node_modules/@types/node/buffer.buffer.d.ts +472 -0
  7. package/node_modules/@types/node/buffer.d.ts +88 -516
  8. package/node_modules/@types/node/child_process.d.ts +167 -231
  9. package/node_modules/@types/node/cluster.d.ts +172 -26
  10. package/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  11. package/node_modules/@types/node/console.d.ts +66 -28
  12. package/node_modules/@types/node/constants.d.ts +14 -12
  13. package/node_modules/@types/node/crypto.d.ts +1458 -497
  14. package/node_modules/@types/node/dgram.d.ts +44 -30
  15. package/node_modules/@types/node/diagnostics_channel.d.ts +389 -4
  16. package/node_modules/@types/node/dns/promises.d.ts +120 -42
  17. package/node_modules/@types/node/dns.d.ts +209 -95
  18. package/node_modules/@types/node/domain.d.ts +14 -18
  19. package/node_modules/@types/node/events.d.ts +245 -113
  20. package/node_modules/@types/node/fs/promises.d.ts +194 -96
  21. package/node_modules/@types/node/fs.d.ts +695 -270
  22. package/node_modules/@types/node/globals.d.ts +97 -308
  23. package/node_modules/@types/node/globals.typedarray.d.ts +41 -0
  24. package/node_modules/@types/node/http.d.ts +363 -97
  25. package/node_modules/@types/node/http2.d.ts +684 -231
  26. package/node_modules/@types/node/https.d.ts +122 -87
  27. package/node_modules/@types/node/index.d.ts +24 -11
  28. package/node_modules/@types/node/inspector.d.ts +220 -2690
  29. package/node_modules/@types/node/inspector.generated.d.ts +4239 -0
  30. package/node_modules/@types/node/module.d.ts +705 -149
  31. package/node_modules/@types/node/net.d.ts +178 -54
  32. package/node_modules/@types/node/os.d.ts +47 -17
  33. package/node_modules/@types/node/package.json +22 -97
  34. package/node_modules/@types/node/path.d.ts +12 -3
  35. package/node_modules/@types/node/perf_hooks.d.ts +500 -97
  36. package/node_modules/@types/node/process.d.ts +657 -87
  37. package/node_modules/@types/node/punycode.d.ts +5 -5
  38. package/node_modules/@types/node/querystring.d.ts +24 -13
  39. package/node_modules/@types/node/readline/promises.d.ts +25 -14
  40. package/node_modules/@types/node/readline.d.ts +102 -41
  41. package/node_modules/@types/node/repl.d.ts +38 -30
  42. package/node_modules/@types/node/sea.d.ts +162 -0
  43. package/node_modules/@types/node/sqlite.d.ts +1040 -0
  44. package/node_modules/@types/node/stream/consumers.d.ts +33 -7
  45. package/node_modules/@types/node/stream/promises.d.ts +8 -1
  46. package/node_modules/@types/node/stream/web.d.ts +251 -28
  47. package/node_modules/@types/node/stream.d.ts +1060 -1055
  48. package/node_modules/@types/node/string_decoder.d.ts +8 -8
  49. package/node_modules/@types/node/test.d.ts +2133 -1166
  50. package/node_modules/@types/node/timers/promises.d.ts +31 -16
  51. package/node_modules/@types/node/timers.d.ts +159 -114
  52. package/node_modules/@types/node/tls.d.ts +232 -163
  53. package/node_modules/@types/node/trace_events.d.ts +43 -28
  54. package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +468 -0
  55. package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
  56. package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
  57. package/node_modules/@types/node/ts5.6/index.d.ts +103 -0
  58. package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
  59. package/node_modules/@types/node/ts5.7/index.d.ts +103 -0
  60. package/node_modules/@types/node/tty.d.ts +9 -9
  61. package/node_modules/@types/node/url.d.ts +236 -84
  62. package/node_modules/@types/node/util.d.ts +562 -412
  63. package/node_modules/@types/node/v8.d.ts +368 -21
  64. package/node_modules/@types/node/vm.d.ts +443 -149
  65. package/node_modules/@types/node/wasi.d.ts +62 -18
  66. package/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
  67. package/node_modules/@types/node/web-globals/crypto.d.ts +32 -0
  68. package/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
  69. package/node_modules/@types/node/web-globals/events.d.ts +97 -0
  70. package/node_modules/@types/node/web-globals/fetch.d.ts +62 -0
  71. package/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
  72. package/node_modules/@types/node/web-globals/storage.d.ts +24 -0
  73. package/node_modules/@types/node/web-globals/streams.d.ts +22 -0
  74. package/node_modules/@types/node/worker_threads.d.ts +310 -107
  75. package/node_modules/@types/node/zlib.d.ts +301 -73
  76. package/node_modules/undici-types/LICENSE +21 -0
  77. package/node_modules/undici-types/agent.d.ts +13 -12
  78. package/node_modules/undici-types/api.d.ts +26 -26
  79. package/node_modules/undici-types/balanced-pool.d.ts +19 -7
  80. package/node_modules/undici-types/cache-interceptor.d.ts +173 -0
  81. package/node_modules/undici-types/client-stats.d.ts +15 -0
  82. package/node_modules/undici-types/client.d.ts +26 -15
  83. package/node_modules/undici-types/connector.d.ts +2 -2
  84. package/node_modules/undici-types/cookies.d.ts +2 -0
  85. package/node_modules/undici-types/diagnostics-channel.d.ts +19 -12
  86. package/node_modules/undici-types/dispatcher.d.ts +148 -113
  87. package/node_modules/undici-types/env-http-proxy-agent.d.ts +22 -0
  88. package/node_modules/undici-types/errors.d.ts +79 -46
  89. package/node_modules/undici-types/eventsource.d.ts +66 -0
  90. package/node_modules/undici-types/fetch.d.ts +41 -39
  91. package/node_modules/undici-types/formdata.d.ts +8 -8
  92. package/node_modules/undici-types/global-dispatcher.d.ts +4 -4
  93. package/node_modules/undici-types/global-origin.d.ts +5 -5
  94. package/node_modules/undici-types/h2c-client.d.ts +73 -0
  95. package/node_modules/undici-types/handlers.d.ts +11 -5
  96. package/node_modules/undici-types/header.d.ts +157 -1
  97. package/node_modules/undici-types/index.d.ts +68 -43
  98. package/node_modules/undici-types/interceptors.d.ts +71 -3
  99. package/node_modules/undici-types/mock-agent.d.ts +36 -18
  100. package/node_modules/undici-types/mock-call-history.d.ts +111 -0
  101. package/node_modules/undici-types/mock-client.d.ts +6 -4
  102. package/node_modules/undici-types/mock-errors.d.ts +3 -3
  103. package/node_modules/undici-types/mock-interceptor.d.ts +24 -23
  104. package/node_modules/undici-types/mock-pool.d.ts +6 -4
  105. package/node_modules/undici-types/package.json +1 -1
  106. package/node_modules/undici-types/patch.d.ts +0 -42
  107. package/node_modules/undici-types/pool-stats.d.ts +8 -8
  108. package/node_modules/undici-types/pool.d.ts +21 -8
  109. package/node_modules/undici-types/proxy-agent.d.ts +5 -6
  110. package/node_modules/undici-types/readable.d.ts +24 -17
  111. package/node_modules/undici-types/retry-agent.d.ts +8 -0
  112. package/node_modules/undici-types/retry-handler.d.ts +125 -0
  113. package/node_modules/undici-types/round-robin-pool.d.ts +41 -0
  114. package/node_modules/undici-types/snapshot-agent.d.ts +109 -0
  115. package/node_modules/undici-types/util.d.ts +18 -0
  116. package/node_modules/undici-types/utility.d.ts +7 -0
  117. package/node_modules/undici-types/webidl.d.ts +157 -36
  118. package/node_modules/undici-types/websocket.d.ts +67 -12
  119. package/package.json +9 -60
  120. package/version.json +1 -1
  121. package/node_modules/@types/node/dom-events.d.ts +0 -122
  122. package/node_modules/@types/node/globals.global.d.ts +0 -1
  123. package/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
  124. package/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
  125. package/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
  126. package/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
  127. package/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
  128. package/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
  129. package/node_modules/@types/node/ts4.8/console.d.ts +0 -415
  130. package/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
  131. package/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4455
  132. package/node_modules/@types/node/ts4.8/dgram.d.ts +0 -586
  133. package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -191
  134. package/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
  135. package/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
  136. package/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
  137. package/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
  138. package/node_modules/@types/node/ts4.8/events.d.ts +0 -796
  139. package/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1232
  140. package/node_modules/@types/node/ts4.8/fs.d.ts +0 -4289
  141. package/node_modules/@types/node/ts4.8/globals.d.ts +0 -381
  142. package/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
  143. package/node_modules/@types/node/ts4.8/http.d.ts +0 -1888
  144. package/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
  145. package/node_modules/@types/node/ts4.8/https.d.ts +0 -550
  146. package/node_modules/@types/node/ts4.8/index.d.ts +0 -88
  147. package/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
  148. package/node_modules/@types/node/ts4.8/module.d.ts +0 -287
  149. package/node_modules/@types/node/ts4.8/net.d.ts +0 -949
  150. package/node_modules/@types/node/ts4.8/os.d.ts +0 -477
  151. package/node_modules/@types/node/ts4.8/path.d.ts +0 -191
  152. package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -639
  153. package/node_modules/@types/node/ts4.8/process.d.ts +0 -1532
  154. package/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
  155. package/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
  156. package/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
  157. package/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
  158. package/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
  159. package/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
  160. package/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
  161. package/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -350
  162. package/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
  163. package/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
  164. package/node_modules/@types/node/ts4.8/test.d.ts +0 -1382
  165. package/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
  166. package/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
  167. package/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
  168. package/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
  169. package/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
  170. package/node_modules/@types/node/ts4.8/url.d.ts +0 -927
  171. package/node_modules/@types/node/ts4.8/util.d.ts +0 -2186
  172. package/node_modules/@types/node/ts4.8/v8.d.ts +0 -635
  173. package/node_modules/@types/node/ts4.8/vm.d.ts +0 -901
  174. package/node_modules/@types/node/ts4.8/wasi.d.ts +0 -158
  175. package/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
  176. package/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
  177. package/node_modules/argparse/CHANGELOG.md +0 -216
  178. package/node_modules/undici-types/file.d.ts +0 -39
  179. package/node_modules/undici-types/filereader.d.ts +0 -54
@@ -8,18 +8,19 @@
8
8
  * It can be accessed using:
9
9
  *
10
10
  * ```js
11
- * const net = require('node:net');
11
+ * import net from 'node:net';
12
12
  * ```
13
- * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/net.js)
13
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/net.js)
14
14
  */
15
15
  declare module "net" {
16
+ import { NonSharedBuffer } from "node:buffer";
16
17
  import * as stream from "node:stream";
17
18
  import { Abortable, EventEmitter } from "node:events";
18
19
  import * as dns from "node:dns";
19
20
  type LookupFunction = (
20
21
  hostname: string,
21
- options: dns.LookupAllOptions,
22
- callback: (err: NodeJS.ErrnoException | null, addresses: dns.LookupAddress[]) => void,
22
+ options: dns.LookupOptions,
23
+ callback: (err: NodeJS.ErrnoException | null, address: string | dns.LookupAddress[], family?: number) => void,
23
24
  ) => void;
24
25
  interface AddressInfo {
25
26
  address: string;
@@ -29,28 +30,25 @@ declare module "net" {
29
30
  interface SocketConstructorOpts {
30
31
  fd?: number | undefined;
31
32
  allowHalfOpen?: boolean | undefined;
33
+ onread?: OnReadOpts | undefined;
32
34
  readable?: boolean | undefined;
33
35
  writable?: boolean | undefined;
34
- signal?: AbortSignal;
36
+ signal?: AbortSignal | undefined;
37
+ noDelay?: boolean | undefined;
38
+ keepAlive?: boolean | undefined;
39
+ keepAliveInitialDelay?: number | undefined;
40
+ blockList?: BlockList | undefined;
35
41
  }
36
42
  interface OnReadOpts {
37
43
  buffer: Uint8Array | (() => Uint8Array);
38
44
  /**
39
45
  * This function is called for every chunk of incoming data.
40
- * Two arguments are passed to it: the number of bytes written to buffer and a reference to buffer.
41
- * Return false from this function to implicitly pause() the socket.
46
+ * Two arguments are passed to it: the number of bytes written to `buffer` and a reference to `buffer`.
47
+ * Return `false` from this function to implicitly `pause()` the socket.
42
48
  */
43
- callback(bytesWritten: number, buf: Uint8Array): boolean;
49
+ callback(bytesWritten: number, buffer: Uint8Array): boolean;
44
50
  }
45
- interface ConnectOpts {
46
- /**
47
- * If specified, incoming data is stored in a single buffer and passed to the supplied callback when data arrives on the socket.
48
- * Note: this will cause the streaming functionality to not provide any data, however events like 'error', 'end', and 'close' will
49
- * still be emitted as normal and methods like pause() and resume() will also behave as expected.
50
- */
51
- onread?: OnReadOpts | undefined;
52
- }
53
- interface TcpSocketConnectOpts extends ConnectOpts {
51
+ interface TcpSocketConnectOpts {
54
52
  port: number;
55
53
  host?: string | undefined;
56
54
  localAddress?: string | undefined;
@@ -58,9 +56,6 @@ declare module "net" {
58
56
  hints?: number | undefined;
59
57
  family?: number | undefined;
60
58
  lookup?: LookupFunction | undefined;
61
- noDelay?: boolean | undefined;
62
- keepAlive?: boolean | undefined;
63
- keepAliveInitialDelay?: number | undefined;
64
59
  /**
65
60
  * @since v18.13.0
66
61
  */
@@ -70,7 +65,7 @@ declare module "net" {
70
65
  */
71
66
  autoSelectFamilyAttemptTimeout?: number | undefined;
72
67
  }
73
- interface IpcSocketConnectOpts extends ConnectOpts {
68
+ interface IpcSocketConnectOpts {
74
69
  path: string;
75
70
  }
76
71
  type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts;
@@ -110,10 +105,15 @@ declare module "net" {
110
105
  * See `Writable` stream `write()` method for more
111
106
  * information.
112
107
  * @since v0.1.90
108
+ */
109
+ write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
110
+ /**
111
+ * Sends data on the socket, with an explicit encoding for string data.
112
+ * @see {@link Socket.write} for full details.
113
+ * @since v0.1.90
113
114
  * @param [encoding='utf8'] Only used when data is `string`.
114
115
  */
115
- write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean;
116
- write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error) => void): boolean;
116
+ write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;
117
117
  /**
118
118
  * Initiate a connection on a given socket.
119
119
  *
@@ -278,7 +278,7 @@ declare module "net" {
278
278
  */
279
279
  readonly bytesWritten: number;
280
280
  /**
281
- * If `true`,`socket.connect(options[, connectListener])` was
281
+ * If `true`, `socket.connect(options[, connectListener])` was
282
282
  * called and has not yet finished. It will stay `true` until the socket becomes
283
283
  * connected, then it is set to `false` and the `'connect'` event is emitted. Note
284
284
  * that the `socket.connect(options[, connectListener])` callback is a listener for the `'connect'` event.
@@ -327,54 +327,80 @@ declare module "net" {
327
327
  * the socket is destroyed (for example, if the client disconnected).
328
328
  * @since v0.5.10
329
329
  */
330
- readonly remoteAddress?: string | undefined;
330
+ readonly remoteAddress: string | undefined;
331
331
  /**
332
332
  * The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. Value may be `undefined` if
333
333
  * the socket is destroyed (for example, if the client disconnected).
334
334
  * @since v0.11.14
335
335
  */
336
- readonly remoteFamily?: string | undefined;
336
+ readonly remoteFamily: string | undefined;
337
337
  /**
338
338
  * The numeric representation of the remote port. For example, `80` or `21`. Value may be `undefined` if
339
339
  * the socket is destroyed (for example, if the client disconnected).
340
340
  * @since v0.5.10
341
341
  */
342
- readonly remotePort?: number | undefined;
342
+ readonly remotePort: number | undefined;
343
343
  /**
344
344
  * The socket timeout in milliseconds as set by `socket.setTimeout()`.
345
345
  * It is `undefined` if a timeout has not been set.
346
346
  * @since v10.7.0
347
347
  */
348
- readonly timeout?: number | undefined;
348
+ readonly timeout?: number;
349
349
  /**
350
350
  * Half-closes the socket. i.e., it sends a FIN packet. It is possible the
351
351
  * server will still send some data.
352
352
  *
353
353
  * See `writable.end()` for further details.
354
354
  * @since v0.1.90
355
- * @param [encoding='utf8'] Only used when data is `string`.
356
355
  * @param callback Optional callback for when the socket is finished.
357
356
  * @return The socket itself.
358
357
  */
359
358
  end(callback?: () => void): this;
359
+ /**
360
+ * Half-closes the socket, with one final chunk of data.
361
+ * @see {@link Socket.end} for full details.
362
+ * @since v0.1.90
363
+ * @param callback Optional callback for when the socket is finished.
364
+ * @return The socket itself.
365
+ */
360
366
  end(buffer: Uint8Array | string, callback?: () => void): this;
367
+ /**
368
+ * Half-closes the socket, with one final chunk of data.
369
+ * @see {@link Socket.end} for full details.
370
+ * @since v0.1.90
371
+ * @param [encoding='utf8'] Only used when data is `string`.
372
+ * @param callback Optional callback for when the socket is finished.
373
+ * @return The socket itself.
374
+ */
361
375
  end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => void): this;
362
376
  /**
363
377
  * events.EventEmitter
364
378
  * 1. close
365
379
  * 2. connect
366
- * 3. data
367
- * 4. drain
368
- * 5. end
369
- * 6. error
370
- * 7. lookup
371
- * 8. ready
372
- * 9. timeout
380
+ * 3. connectionAttempt
381
+ * 4. connectionAttemptFailed
382
+ * 5. connectionAttemptTimeout
383
+ * 6. data
384
+ * 7. drain
385
+ * 8. end
386
+ * 9. error
387
+ * 10. lookup
388
+ * 11. ready
389
+ * 12. timeout
373
390
  */
374
391
  addListener(event: string, listener: (...args: any[]) => void): this;
375
392
  addListener(event: "close", listener: (hadError: boolean) => void): this;
376
393
  addListener(event: "connect", listener: () => void): this;
377
- addListener(event: "data", listener: (data: Buffer) => void): this;
394
+ addListener(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this;
395
+ addListener(
396
+ event: "connectionAttemptFailed",
397
+ listener: (ip: string, port: number, family: number, error: Error) => void,
398
+ ): this;
399
+ addListener(
400
+ event: "connectionAttemptTimeout",
401
+ listener: (ip: string, port: number, family: number) => void,
402
+ ): this;
403
+ addListener(event: "data", listener: (data: NonSharedBuffer) => void): this;
378
404
  addListener(event: "drain", listener: () => void): this;
379
405
  addListener(event: "end", listener: () => void): this;
380
406
  addListener(event: "error", listener: (err: Error) => void): this;
@@ -387,7 +413,10 @@ declare module "net" {
387
413
  emit(event: string | symbol, ...args: any[]): boolean;
388
414
  emit(event: "close", hadError: boolean): boolean;
389
415
  emit(event: "connect"): boolean;
390
- emit(event: "data", data: Buffer): boolean;
416
+ emit(event: "connectionAttempt", ip: string, port: number, family: number): boolean;
417
+ emit(event: "connectionAttemptFailed", ip: string, port: number, family: number, error: Error): boolean;
418
+ emit(event: "connectionAttemptTimeout", ip: string, port: number, family: number): boolean;
419
+ emit(event: "data", data: NonSharedBuffer): boolean;
391
420
  emit(event: "drain"): boolean;
392
421
  emit(event: "end"): boolean;
393
422
  emit(event: "error", err: Error): boolean;
@@ -397,7 +426,13 @@ declare module "net" {
397
426
  on(event: string, listener: (...args: any[]) => void): this;
398
427
  on(event: "close", listener: (hadError: boolean) => void): this;
399
428
  on(event: "connect", listener: () => void): this;
400
- on(event: "data", listener: (data: Buffer) => void): this;
429
+ on(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this;
430
+ on(
431
+ event: "connectionAttemptFailed",
432
+ listener: (ip: string, port: number, family: number, error: Error) => void,
433
+ ): this;
434
+ on(event: "connectionAttemptTimeout", listener: (ip: string, port: number, family: number) => void): this;
435
+ on(event: "data", listener: (data: NonSharedBuffer) => void): this;
401
436
  on(event: "drain", listener: () => void): this;
402
437
  on(event: "end", listener: () => void): this;
403
438
  on(event: "error", listener: (err: Error) => void): this;
@@ -409,8 +444,14 @@ declare module "net" {
409
444
  on(event: "timeout", listener: () => void): this;
410
445
  once(event: string, listener: (...args: any[]) => void): this;
411
446
  once(event: "close", listener: (hadError: boolean) => void): this;
447
+ once(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this;
448
+ once(
449
+ event: "connectionAttemptFailed",
450
+ listener: (ip: string, port: number, family: number, error: Error) => void,
451
+ ): this;
452
+ once(event: "connectionAttemptTimeout", listener: (ip: string, port: number, family: number) => void): this;
412
453
  once(event: "connect", listener: () => void): this;
413
- once(event: "data", listener: (data: Buffer) => void): this;
454
+ once(event: "data", listener: (data: NonSharedBuffer) => void): this;
414
455
  once(event: "drain", listener: () => void): this;
415
456
  once(event: "end", listener: () => void): this;
416
457
  once(event: "error", listener: (err: Error) => void): this;
@@ -423,7 +464,16 @@ declare module "net" {
423
464
  prependListener(event: string, listener: (...args: any[]) => void): this;
424
465
  prependListener(event: "close", listener: (hadError: boolean) => void): this;
425
466
  prependListener(event: "connect", listener: () => void): this;
426
- prependListener(event: "data", listener: (data: Buffer) => void): this;
467
+ prependListener(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this;
468
+ prependListener(
469
+ event: "connectionAttemptFailed",
470
+ listener: (ip: string, port: number, family: number, error: Error) => void,
471
+ ): this;
472
+ prependListener(
473
+ event: "connectionAttemptTimeout",
474
+ listener: (ip: string, port: number, family: number) => void,
475
+ ): this;
476
+ prependListener(event: "data", listener: (data: NonSharedBuffer) => void): this;
427
477
  prependListener(event: "drain", listener: () => void): this;
428
478
  prependListener(event: "end", listener: () => void): this;
429
479
  prependListener(event: "error", listener: (err: Error) => void): this;
@@ -436,7 +486,19 @@ declare module "net" {
436
486
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
437
487
  prependOnceListener(event: "close", listener: (hadError: boolean) => void): this;
438
488
  prependOnceListener(event: "connect", listener: () => void): this;
439
- prependOnceListener(event: "data", listener: (data: Buffer) => void): this;
489
+ prependOnceListener(
490
+ event: "connectionAttempt",
491
+ listener: (ip: string, port: number, family: number) => void,
492
+ ): this;
493
+ prependOnceListener(
494
+ event: "connectionAttemptFailed",
495
+ listener: (ip: string, port: number, family: number, error: Error) => void,
496
+ ): this;
497
+ prependOnceListener(
498
+ event: "connectionAttemptTimeout",
499
+ listener: (ip: string, port: number, family: number) => void,
500
+ ): this;
501
+ prependOnceListener(event: "data", listener: (data: NonSharedBuffer) => void): this;
440
502
  prependOnceListener(event: "drain", listener: () => void): this;
441
503
  prependOnceListener(event: "end", listener: () => void): this;
442
504
  prependOnceListener(event: "error", listener: (err: Error) => void): this;
@@ -448,17 +510,18 @@ declare module "net" {
448
510
  prependOnceListener(event: "timeout", listener: () => void): this;
449
511
  }
450
512
  interface ListenOptions extends Abortable {
451
- port?: number | undefined;
452
- host?: string | undefined;
453
513
  backlog?: number | undefined;
454
- path?: string | undefined;
455
514
  exclusive?: boolean | undefined;
456
- readableAll?: boolean | undefined;
457
- writableAll?: boolean | undefined;
515
+ host?: string | undefined;
458
516
  /**
459
517
  * @default false
460
518
  */
461
519
  ipv6Only?: boolean | undefined;
520
+ reusePort?: boolean | undefined;
521
+ path?: string | undefined;
522
+ port?: number | undefined;
523
+ readableAll?: boolean | undefined;
524
+ writableAll?: boolean | undefined;
462
525
  }
463
526
  interface ServerOpts {
464
527
  /**
@@ -490,6 +553,21 @@ declare module "net" {
490
553
  * @since v16.5.0
491
554
  */
492
555
  keepAliveInitialDelay?: number | undefined;
556
+ /**
557
+ * Optionally overrides all `net.Socket`s' `readableHighWaterMark` and `writableHighWaterMark`.
558
+ * @default See [stream.getDefaultHighWaterMark()](https://nodejs.org/docs/latest-v24.x/api/stream.html#streamgetdefaulthighwatermarkobjectmode).
559
+ * @since v18.17.0, v20.1.0
560
+ */
561
+ highWaterMark?: number | undefined;
562
+ /**
563
+ * `blockList` can be used for disabling inbound
564
+ * access to specific IP addresses, IP ranges, or IP subnets. This does not
565
+ * work if the server is behind a reverse proxy, NAT, etc. because the address
566
+ * checked against the block list is the address of the proxy, or the one
567
+ * specified by the NAT.
568
+ * @since v22.13.0
569
+ */
570
+ blockList?: BlockList | undefined;
493
571
  }
494
572
  interface DropArgument {
495
573
  localAddress?: string;
@@ -522,7 +600,7 @@ declare module "net" {
522
600
  *
523
601
  * All `listen()` methods can take a `backlog` parameter to specify the maximum
524
602
  * length of the queue of pending connections. The actual length will be determined
525
- * by the OS through sysctl settings such as `tcp_max_syn_backlog` and `somaxconn`on Linux. The default value of this parameter is 511 (not 512).
603
+ * by the OS through sysctl settings such as `tcp_max_syn_backlog` and `somaxconn` on Linux. The default value of this parameter is 511 (not 512).
526
604
  *
527
605
  * All {@link Socket} are set to `SO_REUSEADDR` (see [`socket(7)`](https://man7.org/linux/man-pages/man7/socket.7.html) for
528
606
  * details).
@@ -601,7 +679,7 @@ declare module "net" {
601
679
  * Callback should take two arguments `err` and `count`.
602
680
  * @since v0.9.7
603
681
  */
604
- getConnections(cb: (error: Error | null, count: number) => void): void;
682
+ getConnections(cb: (error: Error | null, count: number) => void): this;
605
683
  /**
606
684
  * Opposite of `unref()`, calling `ref()` on a previously `unref`ed server will _not_ let the program exit if it's the only server left (the default behavior).
607
685
  * If the server is `ref`ed calling `ref()` again will have no effect.
@@ -628,7 +706,7 @@ declare module "net" {
628
706
  * Indicates whether or not the server is listening for connections.
629
707
  * @since v5.7.0
630
708
  */
631
- listening: boolean;
709
+ readonly listening: boolean;
632
710
  /**
633
711
  * events.EventEmitter
634
712
  * 1. close
@@ -736,6 +814,38 @@ declare module "net" {
736
814
  */
737
815
  check(address: SocketAddress): boolean;
738
816
  check(address: string, type?: IPVersion): boolean;
817
+ /**
818
+ * The list of rules added to the blocklist.
819
+ * @since v15.0.0, v14.18.0
820
+ */
821
+ rules: readonly string[];
822
+ /**
823
+ * Returns `true` if the `value` is a `net.BlockList`.
824
+ * @since v22.13.0
825
+ * @param value Any JS value
826
+ */
827
+ static isBlockList(value: unknown): value is BlockList;
828
+ /**
829
+ * ```js
830
+ * const blockList = new net.BlockList();
831
+ * const data = [
832
+ * 'Subnet: IPv4 192.168.1.0/24',
833
+ * 'Address: IPv4 10.0.0.5',
834
+ * 'Range: IPv4 192.168.2.1-192.168.2.10',
835
+ * 'Range: IPv4 10.0.0.1-10.0.0.10',
836
+ * ];
837
+ * blockList.fromJSON(data);
838
+ * blockList.fromJSON(JSON.stringify(data));
839
+ * ```
840
+ * @since v24.5.0
841
+ * @experimental
842
+ */
843
+ fromJSON(data: string | readonly string[]): void;
844
+ /**
845
+ * @since v24.5.0
846
+ * @experimental
847
+ */
848
+ toJSON(): readonly string[];
739
849
  }
740
850
  interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts {
741
851
  timeout?: number | undefined;
@@ -765,7 +875,7 @@ declare module "net" {
765
875
  * on port 8124:
766
876
  *
767
877
  * ```js
768
- * const net = require('node:net');
878
+ * import net from 'node:net';
769
879
  * const server = net.createServer((c) => {
770
880
  * // 'connection' listener.
771
881
  * console.log('client connected');
@@ -847,18 +957,24 @@ declare module "net" {
847
957
  function getDefaultAutoSelectFamily(): boolean;
848
958
  /**
849
959
  * Sets the default value of the `autoSelectFamily` option of `socket.connect(options)`.
960
+ * @param value The new default value.
961
+ * The initial default value is `true`, unless the command line option
962
+ * `--no-network-family-autoselection` is provided.
850
963
  * @since v19.4.0
851
964
  */
852
965
  function setDefaultAutoSelectFamily(value: boolean): void;
853
966
  /**
854
967
  * Gets the current default value of the `autoSelectFamilyAttemptTimeout` option of `socket.connect(options)`.
855
- * The initial default value is `250`.
856
- * @since v19.8.0
968
+ * The initial default value is `250` or the value specified via the command line option `--network-family-autoselection-attempt-timeout`.
969
+ * @returns The current default value of the `autoSelectFamilyAttemptTimeout` option.
970
+ * @since v19.8.0, v18.8.0
857
971
  */
858
972
  function getDefaultAutoSelectFamilyAttemptTimeout(): number;
859
973
  /**
860
974
  * Sets the default value of the `autoSelectFamilyAttemptTimeout` option of `socket.connect(options)`.
861
- * @since v19.8.0
975
+ * @param value The new default value, which must be a positive number. If the number is less than `10`, the value `10` is used instead. The initial default value is `250` or the value specified via the command line
976
+ * option `--network-family-autoselection-attempt-timeout`.
977
+ * @since v19.8.0, v18.8.0
862
978
  */
863
979
  function setDefaultAutoSelectFamilyAttemptTimeout(value: number): void;
864
980
  /**
@@ -942,6 +1058,14 @@ declare module "net" {
942
1058
  * @since v15.14.0, v14.18.0
943
1059
  */
944
1060
  readonly flowlabel: number;
1061
+ /**
1062
+ * @since v22.13.0
1063
+ * @param input An input string containing an IP address and optional port,
1064
+ * e.g. `123.1.2.3:1234` or `[1::1]:1234`.
1065
+ * @returns Returns a `SocketAddress` if parsing was successful.
1066
+ * Otherwise returns `undefined`.
1067
+ */
1068
+ static parse(input: string): SocketAddress | undefined;
945
1069
  }
946
1070
  }
947
1071
  declare module "node:net" {
@@ -3,19 +3,25 @@
3
3
  * properties. It can be accessed using:
4
4
  *
5
5
  * ```js
6
- * const os = require('node:os');
6
+ * import os from 'node:os';
7
7
  * ```
8
- * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/os.js)
8
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/os.js)
9
9
  */
10
10
  declare module "os" {
11
+ import { NonSharedBuffer } from "buffer";
11
12
  interface CpuInfo {
12
13
  model: string;
13
14
  speed: number;
14
15
  times: {
16
+ /** The number of milliseconds the CPU has spent in user mode. */
15
17
  user: number;
18
+ /** The number of milliseconds the CPU has spent in nice mode. */
16
19
  nice: number;
20
+ /** The number of milliseconds the CPU has spent in sys mode. */
17
21
  sys: number;
22
+ /** The number of milliseconds the CPU has spent in idle mode. */
18
23
  idle: number;
24
+ /** The number of milliseconds the CPU has spent in irq mode. */
19
25
  irq: number;
20
26
  };
21
27
  }
@@ -25,10 +31,10 @@ declare module "os" {
25
31
  mac: string;
26
32
  internal: boolean;
27
33
  cidr: string | null;
34
+ scopeid?: number;
28
35
  }
29
36
  interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase {
30
37
  family: "IPv4";
31
- scopeid?: undefined;
32
38
  }
33
39
  interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase {
34
40
  family: "IPv6";
@@ -75,7 +81,7 @@ declare module "os" {
75
81
  function totalmem(): number;
76
82
  /**
77
83
  * Returns an array of objects containing information about each logical CPU core.
78
- * The array will be empty if no CPU information is available, such as if the`/proc` file system is unavailable.
84
+ * The array will be empty if no CPU information is available, such as if the `/proc` file system is unavailable.
79
85
  *
80
86
  * The properties included on each object include:
81
87
  *
@@ -226,21 +232,31 @@ declare module "os" {
226
232
  * @since v2.3.0
227
233
  */
228
234
  function homedir(): string;
235
+ interface UserInfoOptions {
236
+ encoding?: BufferEncoding | "buffer" | undefined;
237
+ }
238
+ interface UserInfoOptionsWithBufferEncoding extends UserInfoOptions {
239
+ encoding: "buffer";
240
+ }
241
+ interface UserInfoOptionsWithStringEncoding extends UserInfoOptions {
242
+ encoding?: BufferEncoding | undefined;
243
+ }
229
244
  /**
230
245
  * Returns information about the currently effective user. On POSIX platforms,
231
246
  * this is typically a subset of the password file. The returned object includes
232
- * the `username`, `uid`, `gid`, `shell`, and `homedir`. On Windows, the `uid` and`gid` fields are `-1`, and `shell` is `null`.
247
+ * the `username`, `uid`, `gid`, `shell`, and `homedir`. On Windows, the `uid` and `gid` fields are `-1`, and `shell` is `null`.
233
248
  *
234
249
  * The value of `homedir` returned by `os.userInfo()` is provided by the operating
235
250
  * system. This differs from the result of `os.homedir()`, which queries
236
251
  * environment variables for the home directory before falling back to the
237
252
  * operating system response.
238
253
  *
239
- * Throws a `SystemError` if a user has no `username` or `homedir`.
254
+ * Throws a [`SystemError`](https://nodejs.org/docs/latest-v24.x/api/errors.html#class-systemerror) if a user has no `username` or `homedir`.
240
255
  * @since v6.0.0
241
256
  */
242
- function userInfo(options: { encoding: "buffer" }): UserInfo<Buffer>;
243
- function userInfo(options?: { encoding: BufferEncoding }): UserInfo<string>;
257
+ function userInfo(options?: UserInfoOptionsWithStringEncoding): UserInfo<string>;
258
+ function userInfo(options: UserInfoOptionsWithBufferEncoding): UserInfo<NonSharedBuffer>;
259
+ function userInfo(options: UserInfoOptions): UserInfo<string | NonSharedBuffer>;
244
260
  type SignalConstants = {
245
261
  [key in NodeJS.Signals]: number;
246
262
  };
@@ -387,6 +403,13 @@ declare module "os" {
387
403
  const WSA_E_CANCELLED: number;
388
404
  const WSAEREFUSED: number;
389
405
  }
406
+ namespace dlopen {
407
+ const RTLD_LAZY: number;
408
+ const RTLD_NOW: number;
409
+ const RTLD_GLOBAL: number;
410
+ const RTLD_LOCAL: number;
411
+ const RTLD_DEEPBIND: number;
412
+ }
390
413
  namespace priority {
391
414
  const PRIORITY_LOW: number;
392
415
  const PRIORITY_BELOW_NORMAL: number;
@@ -397,15 +420,21 @@ declare module "os" {
397
420
  }
398
421
  }
399
422
  const devNull: string;
423
+ /**
424
+ * The operating system-specific end-of-line marker.
425
+ * * `\n` on POSIX
426
+ * * `\r\n` on Windows
427
+ */
400
428
  const EOL: string;
401
429
  /**
402
430
  * Returns the operating system CPU architecture for which the Node.js binary was
403
- * compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`, `'ppc64'`, `'riscv64'`, `'s390'`, `'s390x'`, and `'x64'`.
431
+ * compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'loong64'`,
432
+ * `'mips'`, `'mipsel'`, `'ppc64'`, `'riscv64'`, `'s390x'`, and `'x64'`.
404
433
  *
405
- * The return value is equivalent to `process.arch`.
434
+ * The return value is equivalent to [process.arch](https://nodejs.org/docs/latest-v24.x/api/process.html#processarch).
406
435
  * @since v0.5.0
407
436
  */
408
- function arch(): string;
437
+ function arch(): NodeJS.Architecture;
409
438
  /**
410
439
  * Returns a string identifying the kernel version.
411
440
  *
@@ -417,7 +446,7 @@ declare module "os" {
417
446
  /**
418
447
  * Returns a string identifying the operating system platform for which
419
448
  * the Node.js binary was compiled. The value is set at compile time.
420
- * Possible values are `'aix'`, `'darwin'`, `'freebsd'`,`'linux'`,`'openbsd'`, `'sunos'`, and `'win32'`.
449
+ * Possible values are `'aix'`, `'darwin'`, `'freebsd'`, `'linux'`, `'openbsd'`, `'sunos'`, and `'win32'`.
421
450
  *
422
451
  * The return value is equivalent to `process.platform`.
423
452
  *
@@ -427,7 +456,8 @@ declare module "os" {
427
456
  */
428
457
  function platform(): NodeJS.Platform;
429
458
  /**
430
- * Returns the machine type as a string, such as `arm`, `arm64`, `aarch64`,`mips`, `mips64`, `ppc64`, `ppc64le`, `s390`, `s390x`, `i386`, `i686`, `x86_64`.
459
+ * Returns the machine type as a string, such as `arm`, `arm64`, `aarch64`,
460
+ * `mips`, `mips64`, `ppc64`, `ppc64le`, `s390x`, `i386`, `i686`, `x86_64`.
431
461
  *
432
462
  * On POSIX systems, the machine type is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not
433
463
  * available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information.
@@ -456,15 +486,15 @@ declare module "os" {
456
486
  */
457
487
  function getPriority(pid?: number): number;
458
488
  /**
459
- * Attempts to set the scheduling priority for the process specified by `pid`. If`pid` is not provided or is `0`, the process ID of the current process is used.
489
+ * Attempts to set the scheduling priority for the process specified by `pid`. If `pid` is not provided or is `0`, the process ID of the current process is used.
460
490
  *
461
- * The `priority` input must be an integer between `-20` (high priority) and `19`(low priority). Due to differences between Unix priority levels and Windows
462
- * priority classes, `priority` is mapped to one of six priority constants in`os.constants.priority`. When retrieving a process priority level, this range
491
+ * The `priority` input must be an integer between `-20` (high priority) and `19` (low priority). Due to differences between Unix priority levels and Windows
492
+ * priority classes, `priority` is mapped to one of six priority constants in `os.constants.priority`. When retrieving a process priority level, this range
463
493
  * mapping may cause the return value to be slightly different on Windows. To avoid
464
494
  * confusion, set `priority` to one of the priority constants.
465
495
  *
466
496
  * On Windows, setting priority to `PRIORITY_HIGHEST` requires elevated user
467
- * privileges. Otherwise the set priority will be silently reduced to`PRIORITY_HIGH`.
497
+ * privileges. Otherwise the set priority will be silently reduced to `PRIORITY_HIGH`.
468
498
  * @since v10.10.0
469
499
  * @param [pid=0] The process ID to set scheduling priority for.
470
500
  * @param priority The scheduling priority to assign to the process.