@types/node 22.15.21 → 22.19.3

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 (80) hide show
  1. node v22.19/README.md +15 -0
  2. node v22.19/assert/strict.d.ts +111 -0
  3. node/assert.d.ts → node v22.19/assert.d.ts +119 -95
  4. node/buffer.buffer.d.ts → node v22.19/buffer.buffer.d.ts +9 -0
  5. node/buffer.d.ts → node v22.19/buffer.d.ts +14 -6
  6. node/child_process.d.ts → node v22.19/child_process.d.ts +89 -162
  7. node/cluster.d.ts → node v22.19/cluster.d.ts +4 -5
  8. node/compatibility/disposable.d.ts → node v22.19/compatibility/disposable.d.ts +0 -2
  9. node/compatibility/indexable.d.ts → node v22.19/compatibility/indexable.d.ts +0 -3
  10. node/compatibility/iterators.d.ts → node v22.19/compatibility/iterators.d.ts +0 -1
  11. node/crypto.d.ts → node v22.19/crypto.d.ts +203 -167
  12. node/dgram.d.ts → node v22.19/dgram.d.ts +9 -8
  13. node/diagnostics_channel.d.ts → node v22.19/diagnostics_channel.d.ts +17 -12
  14. node/dns/promises.d.ts → node v22.19/dns/promises.d.ts +36 -9
  15. node/dns.d.ts → node v22.19/dns.d.ts +79 -21
  16. node/events.d.ts → node v22.19/events.d.ts +80 -35
  17. node/fs/promises.d.ts → node v22.19/fs/promises.d.ts +81 -58
  18. node/fs.d.ts → node v22.19/fs.d.ts +154 -130
  19. node v22.19/globals.d.ts +172 -0
  20. node v22.19/globals.typedarray.d.ts +38 -0
  21. node/http.d.ts → node v22.19/http.d.ts +140 -35
  22. node/http2.d.ts → node v22.19/http2.d.ts +114 -27
  23. node/https.d.ts → node v22.19/https.d.ts +96 -62
  24. node/index.d.ts → node v22.19/index.d.ts +7 -2
  25. node v22.19/inspector.d.ts +253 -0
  26. node/inspector.d.ts → node v22.19/inspector.generated.d.ts +880 -830
  27. node/module.d.ts → node v22.19/module.d.ts +136 -17
  28. node/net.d.ts → node v22.19/net.d.ts +33 -11
  29. node/os.d.ts → node v22.19/os.d.ts +14 -3
  30. node/package.json → node v22.19/package.json +3 -83
  31. node/path.d.ts → node v22.19/path.d.ts +1 -1
  32. node/perf_hooks.d.ts → node v22.19/perf_hooks.d.ts +8 -10
  33. node/process.d.ts → node v22.19/process.d.ts +39 -27
  34. node/readline/promises.d.ts → node v22.19/readline/promises.d.ts +1 -2
  35. node/repl.d.ts → node v22.19/repl.d.ts +3 -5
  36. node/sqlite.d.ts → node v22.19/sqlite.d.ts +219 -6
  37. node/stream/consumers.d.ts → node v22.19/stream/consumers.d.ts +2 -2
  38. node/stream/web.d.ts → node v22.19/stream/web.d.ts +8 -0
  39. node/stream.d.ts → node v22.19/stream.d.ts +34 -32
  40. node/string_decoder.d.ts → node v22.19/string_decoder.d.ts +2 -2
  41. node v22.19/test.d.ts +2162 -0
  42. node/tls.d.ts → node v22.19/tls.d.ts +122 -66
  43. node/ts5.6/buffer.buffer.d.ts → node v22.19/ts5.6/buffer.buffer.d.ts +10 -2
  44. node v22.19/ts5.6/globals.typedarray.d.ts +34 -0
  45. node/ts5.6/index.d.ts → node v22.19/ts5.6/index.d.ts +7 -2
  46. node/url.d.ts → node v22.19/url.d.ts +21 -9
  47. node/util.d.ts → node v22.19/util.d.ts +33 -11
  48. node/v8.d.ts → node v22.19/v8.d.ts +66 -35
  49. node/vm.d.ts → node v22.19/vm.d.ts +65 -56
  50. node/wasi.d.ts → node v22.19/wasi.d.ts +1 -1
  51. node v22.19/web-globals/abortcontroller.d.ts +34 -0
  52. node v22.19/web-globals/domexception.d.ts +68 -0
  53. node v22.19/web-globals/events.d.ts +97 -0
  54. node v22.19/web-globals/fetch.d.ts +46 -0
  55. node v22.19/web-globals/navigator.d.ts +22 -0
  56. node v22.19/web-globals/storage.d.ts +24 -0
  57. node/worker_threads.d.ts → node v22.19/worker_threads.d.ts +112 -74
  58. node/zlib.d.ts → node v22.19/zlib.d.ts +39 -26
  59. node/README.md +0 -15
  60. node/assert/strict.d.ts +0 -8
  61. node/dom-events.d.ts +0 -124
  62. node/globals.d.ts +0 -371
  63. node/globals.typedarray.d.ts +0 -21
  64. node/test.d.ts +0 -2280
  65. node/ts5.6/globals.typedarray.d.ts +0 -19
  66. {node → node v22.19}/LICENSE +0 -0
  67. node/async_hooks.d.ts → node v22.19/async_hooks.d.ts +1 -1
  68. {node → node v22.19}/compatibility/index.d.ts +0 -0
  69. {node → node v22.19}/console.d.ts +0 -0
  70. {node → node v22.19}/constants.d.ts +0 -0
  71. {node → node v22.19}/domain.d.ts +0 -0
  72. {node → node v22.19}/punycode.d.ts +0 -0
  73. {node → node v22.19}/querystring.d.ts +0 -0
  74. {node → node v22.19}/readline.d.ts +0 -0
  75. {node → node v22.19}/sea.d.ts +0 -0
  76. {node → node v22.19}/stream/promises.d.ts +0 -0
  77. {node → node v22.19}/timers/promises.d.ts +0 -0
  78. {node → node v22.19}/timers.d.ts +0 -0
  79. {node → node v22.19}/trace_events.d.ts +0 -0
  80. {node → node v22.19}/tty.d.ts +0 -0
@@ -36,6 +36,12 @@
36
36
 
37
37
  // Definitions for Node.js modules that are not specific to any version of TypeScript:
38
38
  /// <reference path="globals.d.ts" />
39
+ /// <reference path="web-globals/abortcontroller.d.ts" />
40
+ /// <reference path="web-globals/domexception.d.ts" />
41
+ /// <reference path="web-globals/events.d.ts" />
42
+ /// <reference path="web-globals/fetch.d.ts" />
43
+ /// <reference path="web-globals/navigator.d.ts" />
44
+ /// <reference path="web-globals/storage.d.ts" />
39
45
  /// <reference path="assert.d.ts" />
40
46
  /// <reference path="assert/strict.d.ts" />
41
47
  /// <reference path="async_hooks.d.ts" />
@@ -49,9 +55,7 @@
49
55
  /// <reference path="diagnostics_channel.d.ts" />
50
56
  /// <reference path="dns.d.ts" />
51
57
  /// <reference path="dns/promises.d.ts" />
52
- /// <reference path="dns/promises.d.ts" />
53
58
  /// <reference path="domain.d.ts" />
54
- /// <reference path="dom-events.d.ts" />
55
59
  /// <reference path="events.d.ts" />
56
60
  /// <reference path="fs.d.ts" />
57
61
  /// <reference path="fs/promises.d.ts" />
@@ -59,6 +63,7 @@
59
63
  /// <reference path="http2.d.ts" />
60
64
  /// <reference path="https.d.ts" />
61
65
  /// <reference path="inspector.d.ts" />
66
+ /// <reference path="inspector.generated.d.ts" />
62
67
  /// <reference path="module.d.ts" />
63
68
  /// <reference path="net.d.ts" />
64
69
  /// <reference path="os.d.ts" />
@@ -0,0 +1,253 @@
1
+ /**
2
+ * The `node:inspector` module provides an API for interacting with the V8
3
+ * inspector.
4
+ * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/inspector.js)
5
+ */
6
+ declare module "inspector" {
7
+ import EventEmitter = require("node:events");
8
+ /**
9
+ * The `inspector.Session` is used for dispatching messages to the V8 inspector
10
+ * back-end and receiving message responses and notifications.
11
+ */
12
+ class Session extends EventEmitter {
13
+ /**
14
+ * Create a new instance of the inspector.Session class.
15
+ * The inspector session needs to be connected through `session.connect()` before the messages can be dispatched to the inspector backend.
16
+ */
17
+ constructor();
18
+ /**
19
+ * Connects a session to the inspector back-end.
20
+ */
21
+ connect(): void;
22
+ /**
23
+ * Connects a session to the inspector back-end.
24
+ * An exception will be thrown if this API was not called on a Worker thread.
25
+ * @since v12.11.0
26
+ */
27
+ connectToMainThread(): void;
28
+ /**
29
+ * Immediately close the session. All pending message callbacks will be called with an error.
30
+ * `session.connect()` will need to be called to be able to send messages again.
31
+ * Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints.
32
+ */
33
+ disconnect(): void;
34
+ }
35
+ /**
36
+ * Activate inspector on host and port. Equivalent to `node --inspect=[[host:]port]`, but can be done programmatically after node has
37
+ * started.
38
+ *
39
+ * If wait is `true`, will block until a client has connected to the inspect port
40
+ * and flow control has been passed to the debugger client.
41
+ *
42
+ * See the [security warning](https://nodejs.org/docs/latest-v22.x/api/cli.html#warning-binding-inspector-to-a-public-ipport-combination-is-insecure)
43
+ * regarding the `host` parameter usage.
44
+ * @param port Port to listen on for inspector connections. Defaults to what was specified on the CLI.
45
+ * @param host Host to listen on for inspector connections. Defaults to what was specified on the CLI.
46
+ * @param wait Block until a client has connected. Defaults to what was specified on the CLI.
47
+ * @returns Disposable that calls `inspector.close()`.
48
+ */
49
+ function open(port?: number, host?: string, wait?: boolean): Disposable;
50
+ /**
51
+ * Deactivate the inspector. Blocks until there are no active connections.
52
+ */
53
+ function close(): void;
54
+ /**
55
+ * Return the URL of the active inspector, or `undefined` if there is none.
56
+ *
57
+ * ```console
58
+ * $ node --inspect -p 'inspector.url()'
59
+ * Debugger listening on ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34
60
+ * For help, see: https://nodejs.org/en/docs/inspector
61
+ * ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34
62
+ *
63
+ * $ node --inspect=localhost:3000 -p 'inspector.url()'
64
+ * Debugger listening on ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a
65
+ * For help, see: https://nodejs.org/en/docs/inspector
66
+ * ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a
67
+ *
68
+ * $ node -p 'inspector.url()'
69
+ * undefined
70
+ * ```
71
+ */
72
+ function url(): string | undefined;
73
+ /**
74
+ * Blocks until a client (existing or connected later) has sent `Runtime.runIfWaitingForDebugger` command.
75
+ *
76
+ * An exception will be thrown if there is no active inspector.
77
+ * @since v12.7.0
78
+ */
79
+ function waitForDebugger(): void;
80
+ // These methods are exposed by the V8 inspector console API (inspector/v8-console.h).
81
+ // The method signatures differ from those of the Node.js console, and are deliberately
82
+ // typed permissively.
83
+ interface InspectorConsole {
84
+ debug(...data: any[]): void;
85
+ error(...data: any[]): void;
86
+ info(...data: any[]): void;
87
+ log(...data: any[]): void;
88
+ warn(...data: any[]): void;
89
+ dir(...data: any[]): void;
90
+ dirxml(...data: any[]): void;
91
+ table(...data: any[]): void;
92
+ trace(...data: any[]): void;
93
+ group(...data: any[]): void;
94
+ groupCollapsed(...data: any[]): void;
95
+ groupEnd(...data: any[]): void;
96
+ clear(...data: any[]): void;
97
+ count(label?: any): void;
98
+ countReset(label?: any): void;
99
+ assert(value?: any, ...data: any[]): void;
100
+ profile(label?: any): void;
101
+ profileEnd(label?: any): void;
102
+ time(label?: any): void;
103
+ timeLog(label?: any): void;
104
+ timeStamp(label?: any): void;
105
+ }
106
+ /**
107
+ * An object to send messages to the remote inspector console.
108
+ * @since v11.0.0
109
+ */
110
+ const console: InspectorConsole;
111
+ // DevTools protocol event broadcast methods
112
+ namespace Network {
113
+ /**
114
+ * This feature is only available with the `--experimental-network-inspection` flag enabled.
115
+ *
116
+ * Broadcasts the `Network.requestWillBeSent` event to connected frontends. This event indicates that
117
+ * the application is about to send an HTTP request.
118
+ * @since v22.6.0
119
+ */
120
+ function requestWillBeSent(params: RequestWillBeSentEventDataType): void;
121
+ /**
122
+ * This feature is only available with the `--experimental-network-inspection` flag enabled.
123
+ *
124
+ * Broadcasts the `Network.dataReceived` event to connected frontends, or buffers the data if
125
+ * `Network.streamResourceContent` command was not invoked for the given request yet.
126
+ *
127
+ * Also enables `Network.getResponseBody` command to retrieve the response data.
128
+ * @since v22.17.0
129
+ */
130
+ function dataReceived(params: DataReceivedEventDataType): void;
131
+ /**
132
+ * This feature is only available with the `--experimental-network-inspection` flag enabled.
133
+ *
134
+ * Enables `Network.getRequestPostData` command to retrieve the request data.
135
+ * @since v22.18.0
136
+ */
137
+ function dataSent(params: unknown): void;
138
+ /**
139
+ * This feature is only available with the `--experimental-network-inspection` flag enabled.
140
+ *
141
+ * Broadcasts the `Network.responseReceived` event to connected frontends. This event indicates that
142
+ * HTTP response is available.
143
+ * @since v22.6.0
144
+ */
145
+ function responseReceived(params: ResponseReceivedEventDataType): void;
146
+ /**
147
+ * This feature is only available with the `--experimental-network-inspection` flag enabled.
148
+ *
149
+ * Broadcasts the `Network.loadingFinished` event to connected frontends. This event indicates that
150
+ * HTTP request has finished loading.
151
+ * @since v22.6.0
152
+ */
153
+ function loadingFinished(params: LoadingFinishedEventDataType): void;
154
+ /**
155
+ * This feature is only available with the `--experimental-network-inspection` flag enabled.
156
+ *
157
+ * Broadcasts the `Network.loadingFailed` event to connected frontends. This event indicates that
158
+ * HTTP request has failed to load.
159
+ * @since v22.7.0
160
+ */
161
+ function loadingFailed(params: LoadingFailedEventDataType): void;
162
+ }
163
+ namespace NetworkResources {
164
+ /**
165
+ * This feature is only available with the `--experimental-inspector-network-resource` flag enabled.
166
+ *
167
+ * The inspector.NetworkResources.put method is used to provide a response for a loadNetworkResource
168
+ * request issued via the Chrome DevTools Protocol (CDP).
169
+ * This is typically triggered when a source map is specified by URL, and a DevTools frontend—such as
170
+ * Chrome—requests the resource to retrieve the source map.
171
+ *
172
+ * This method allows developers to predefine the resource content to be served in response to such CDP requests.
173
+ *
174
+ * ```js
175
+ * const inspector = require('node:inspector');
176
+ * // By preemptively calling put to register the resource, a source map can be resolved when
177
+ * // a loadNetworkResource request is made from the frontend.
178
+ * async function setNetworkResources() {
179
+ * const mapUrl = 'http://localhost:3000/dist/app.js.map';
180
+ * const tsUrl = 'http://localhost:3000/src/app.ts';
181
+ * const distAppJsMap = await fetch(mapUrl).then((res) => res.text());
182
+ * const srcAppTs = await fetch(tsUrl).then((res) => res.text());
183
+ * inspector.NetworkResources.put(mapUrl, distAppJsMap);
184
+ * inspector.NetworkResources.put(tsUrl, srcAppTs);
185
+ * };
186
+ * setNetworkResources().then(() => {
187
+ * require('./dist/app');
188
+ * });
189
+ * ```
190
+ *
191
+ * For more details, see the official CDP documentation: [Network.loadNetworkResource](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-loadNetworkResource)
192
+ * @since v22.19.0
193
+ * @experimental
194
+ */
195
+ function put(url: string, data: string): void;
196
+ }
197
+ }
198
+
199
+ /**
200
+ * The `node:inspector` module provides an API for interacting with the V8
201
+ * inspector.
202
+ */
203
+ declare module "node:inspector" {
204
+ export * from "inspector";
205
+ }
206
+
207
+ /**
208
+ * The `node:inspector/promises` module provides an API for interacting with the V8
209
+ * inspector.
210
+ * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/inspector/promises.js)
211
+ * @since v19.0.0
212
+ */
213
+ declare module "inspector/promises" {
214
+ import EventEmitter = require("node:events");
215
+ export { close, console, NetworkResources, open, url, waitForDebugger } from "inspector";
216
+ /**
217
+ * The `inspector.Session` is used for dispatching messages to the V8 inspector
218
+ * back-end and receiving message responses and notifications.
219
+ * @since v19.0.0
220
+ */
221
+ export class Session extends EventEmitter {
222
+ /**
223
+ * Create a new instance of the inspector.Session class.
224
+ * The inspector session needs to be connected through `session.connect()` before the messages can be dispatched to the inspector backend.
225
+ */
226
+ constructor();
227
+ /**
228
+ * Connects a session to the inspector back-end.
229
+ */
230
+ connect(): void;
231
+ /**
232
+ * Connects a session to the inspector back-end.
233
+ * An exception will be thrown if this API was not called on a Worker thread.
234
+ * @since v12.11.0
235
+ */
236
+ connectToMainThread(): void;
237
+ /**
238
+ * Immediately close the session. All pending message callbacks will be called with an error.
239
+ * `session.connect()` will need to be called to be able to send messages again.
240
+ * Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints.
241
+ */
242
+ disconnect(): void;
243
+ }
244
+ }
245
+
246
+ /**
247
+ * The `node:inspector/promises` module provides an API for interacting with the V8
248
+ * inspector.
249
+ * @since v19.0.0
250
+ */
251
+ declare module "node:inspector/promises" {
252
+ export * from "inspector/promises";
253
+ }