@types/node 22.15.21 → 24.10.4
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.
- node v24.10/README.md +15 -0
- node v24.10/assert/strict.d.ts +111 -0
- node/assert.d.ts → node v24.10/assert.d.ts +162 -101
- node/async_hooks.d.ts → node v24.10/async_hooks.d.ts +26 -6
- node/buffer.buffer.d.ts → node v24.10/buffer.buffer.d.ts +9 -0
- node/buffer.d.ts → node v24.10/buffer.d.ts +15 -7
- node/child_process.d.ts → node v24.10/child_process.d.ts +91 -164
- node/cluster.d.ts → node v24.10/cluster.d.ts +19 -20
- node/console.d.ts → node v24.10/console.d.ts +19 -18
- node/crypto.d.ts → node v24.10/crypto.d.ts +1264 -356
- node/dgram.d.ts → node v24.10/dgram.d.ts +10 -9
- node/diagnostics_channel.d.ts → node v24.10/diagnostics_channel.d.ts +18 -15
- node/dns/promises.d.ts → node v24.10/dns/promises.d.ts +36 -9
- node/dns.d.ts → node v24.10/dns.d.ts +95 -37
- node/domain.d.ts → node v24.10/domain.d.ts +1 -1
- node/events.d.ts → node v24.10/events.d.ts +81 -36
- node/fs/promises.d.ts → node v24.10/fs/promises.d.ts +104 -59
- node/fs.d.ts → node v24.10/fs.d.ts +414 -137
- node v24.10/globals.d.ts +170 -0
- node v24.10/globals.typedarray.d.ts +41 -0
- node/http.d.ts → node v24.10/http.d.ts +187 -37
- node/http2.d.ts → node v24.10/http2.d.ts +266 -67
- node/https.d.ts → node v24.10/https.d.ts +97 -63
- node/index.d.ts → node v24.10/index.d.ts +16 -7
- node v24.10/inspector.d.ts +277 -0
- node/inspector.d.ts → node v24.10/inspector.generated.d.ts +1059 -828
- node/module.d.ts → node v24.10/module.d.ts +153 -31
- node/net.d.ts → node v24.10/net.d.ts +35 -16
- node/os.d.ts → node v24.10/os.d.ts +22 -10
- node/package.json → node v24.10/package.json +14 -84
- node/path.d.ts → node v24.10/path.d.ts +2 -2
- node/perf_hooks.d.ts → node v24.10/perf_hooks.d.ts +30 -18
- node/process.d.ts → node v24.10/process.d.ts +45 -34
- node/punycode.d.ts → node v24.10/punycode.d.ts +1 -1
- node/querystring.d.ts → node v24.10/querystring.d.ts +1 -1
- node/readline/promises.d.ts → node v24.10/readline/promises.d.ts +1 -2
- node/readline.d.ts → node v24.10/readline.d.ts +13 -13
- node/repl.d.ts → node v24.10/repl.d.ts +25 -17
- node/sea.d.ts → node v24.10/sea.d.ts +10 -1
- node/sqlite.d.ts → node v24.10/sqlite.d.ts +438 -9
- node/stream/consumers.d.ts → node v24.10/stream/consumers.d.ts +2 -2
- node/stream/web.d.ts → node v24.10/stream/web.d.ts +13 -54
- node/stream.d.ts → node v24.10/stream.d.ts +68 -47
- node/string_decoder.d.ts → node v24.10/string_decoder.d.ts +3 -3
- node v24.10/test.d.ts +2339 -0
- node/timers/promises.d.ts → node v24.10/timers/promises.d.ts +1 -1
- node/timers.d.ts → node v24.10/timers.d.ts +1 -3
- node/tls.d.ts → node v24.10/tls.d.ts +124 -114
- node/trace_events.d.ts → node v24.10/trace_events.d.ts +6 -6
- node/ts5.6/buffer.buffer.d.ts → node v24.10/ts5.6/buffer.buffer.d.ts +10 -2
- node v24.10/ts5.6/compatibility/float16array.d.ts +71 -0
- node v24.10/ts5.6/globals.typedarray.d.ts +36 -0
- node/ts5.6/index.d.ts → node v24.10/ts5.6/index.d.ts +18 -7
- node v24.10/ts5.7/compatibility/float16array.d.ts +72 -0
- node v24.10/ts5.7/index.d.ts +103 -0
- node/tty.d.ts → node v24.10/tty.d.ts +1 -1
- node/url.d.ts → node v24.10/url.d.ts +119 -34
- node/util.d.ts → node v24.10/util.d.ts +46 -305
- node/v8.d.ts → node v24.10/v8.d.ts +100 -37
- node/vm.d.ts → node v24.10/vm.d.ts +299 -110
- node/wasi.d.ts → node v24.10/wasi.d.ts +23 -2
- node v24.10/web-globals/abortcontroller.d.ts +34 -0
- node v24.10/web-globals/crypto.d.ts +32 -0
- node v24.10/web-globals/domexception.d.ts +68 -0
- node v24.10/web-globals/events.d.ts +97 -0
- node v24.10/web-globals/fetch.d.ts +50 -0
- node v24.10/web-globals/navigator.d.ts +25 -0
- node v24.10/web-globals/storage.d.ts +24 -0
- node v24.10/web-globals/streams.d.ts +22 -0
- node/worker_threads.d.ts → node v24.10/worker_threads.d.ts +225 -75
- node/zlib.d.ts → node v24.10/zlib.d.ts +44 -33
- node/README.md +0 -15
- node/assert/strict.d.ts +0 -8
- node/compatibility/disposable.d.ts +0 -16
- node/compatibility/index.d.ts +0 -9
- node/compatibility/indexable.d.ts +0 -23
- node/dom-events.d.ts +0 -124
- node/globals.d.ts +0 -371
- node/globals.typedarray.d.ts +0 -21
- node/test.d.ts +0 -2280
- node/ts5.6/globals.typedarray.d.ts +0 -19
- {node → node v24.10}/LICENSE +0 -0
- {node → node v24.10}/compatibility/iterators.d.ts +0 -0
- {node → node v24.10}/constants.d.ts +0 -0
- {node → node v24.10}/stream/promises.d.ts +0 -0
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a
|
|
3
3
|
* separate module.
|
|
4
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
4
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/https.js)
|
|
5
5
|
*/
|
|
6
6
|
declare module "https" {
|
|
7
|
+
import { NonSharedBuffer } from "node:buffer";
|
|
7
8
|
import { Duplex } from "node:stream";
|
|
8
9
|
import * as tls from "node:tls";
|
|
9
10
|
import * as http from "node:http";
|
|
10
11
|
import { URL } from "node:url";
|
|
11
|
-
|
|
12
|
+
interface ServerOptions<
|
|
12
13
|
Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
|
|
13
14
|
Response extends typeof http.ServerResponse<InstanceType<Request>> = typeof http.ServerResponse,
|
|
14
|
-
>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
rejectUnauthorized?: boolean | undefined; // Defaults to true
|
|
23
|
-
servername?: string | undefined; // SNI TLS Extension
|
|
24
|
-
};
|
|
15
|
+
> extends http.ServerOptions<Request, Response>, tls.TlsOptions {}
|
|
16
|
+
interface RequestOptions extends http.RequestOptions, tls.SecureContextOptions {
|
|
17
|
+
checkServerIdentity?:
|
|
18
|
+
| ((hostname: string, cert: tls.DetailedPeerCertificate) => Error | undefined)
|
|
19
|
+
| undefined;
|
|
20
|
+
rejectUnauthorized?: boolean | undefined; // Defaults to true
|
|
21
|
+
servername?: string | undefined; // SNI TLS Extension
|
|
22
|
+
}
|
|
25
23
|
interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions {
|
|
26
24
|
maxCachedSessions?: number | undefined;
|
|
27
25
|
}
|
|
@@ -32,6 +30,11 @@ declare module "https" {
|
|
|
32
30
|
class Agent extends http.Agent {
|
|
33
31
|
constructor(options?: AgentOptions);
|
|
34
32
|
options: AgentOptions;
|
|
33
|
+
createConnection(
|
|
34
|
+
options: RequestOptions,
|
|
35
|
+
callback?: (err: Error | null, stream: Duplex) => void,
|
|
36
|
+
): Duplex | null | undefined;
|
|
37
|
+
getName(options?: RequestOptions): string;
|
|
35
38
|
}
|
|
36
39
|
interface Server<
|
|
37
40
|
Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
|
|
@@ -61,22 +64,25 @@ declare module "https" {
|
|
|
61
64
|
*/
|
|
62
65
|
closeIdleConnections(): void;
|
|
63
66
|
addListener(event: string, listener: (...args: any[]) => void): this;
|
|
64
|
-
addListener(event: "keylog", listener: (line:
|
|
67
|
+
addListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this;
|
|
65
68
|
addListener(
|
|
66
69
|
event: "newSession",
|
|
67
|
-
listener: (sessionId:
|
|
70
|
+
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
|
68
71
|
): this;
|
|
69
72
|
addListener(
|
|
70
73
|
event: "OCSPRequest",
|
|
71
74
|
listener: (
|
|
72
|
-
certificate:
|
|
73
|
-
issuer:
|
|
74
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
75
|
+
certificate: NonSharedBuffer,
|
|
76
|
+
issuer: NonSharedBuffer,
|
|
77
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
75
78
|
) => void,
|
|
76
79
|
): this;
|
|
77
80
|
addListener(
|
|
78
81
|
event: "resumeSession",
|
|
79
|
-
listener: (
|
|
82
|
+
listener: (
|
|
83
|
+
sessionId: NonSharedBuffer,
|
|
84
|
+
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
85
|
+
) => void,
|
|
80
86
|
): this;
|
|
81
87
|
addListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
|
|
82
88
|
addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
|
@@ -89,28 +95,32 @@ declare module "https" {
|
|
|
89
95
|
addListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
|
|
90
96
|
addListener(
|
|
91
97
|
event: "connect",
|
|
92
|
-
listener: (req: InstanceType<Request>, socket: Duplex, head:
|
|
98
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
93
99
|
): this;
|
|
94
100
|
addListener(event: "request", listener: http.RequestListener<Request, Response>): this;
|
|
95
101
|
addListener(
|
|
96
102
|
event: "upgrade",
|
|
97
|
-
listener: (req: InstanceType<Request>, socket: Duplex, head:
|
|
103
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
98
104
|
): this;
|
|
99
105
|
emit(event: string, ...args: any[]): boolean;
|
|
100
|
-
emit(event: "keylog", line:
|
|
106
|
+
emit(event: "keylog", line: NonSharedBuffer, tlsSocket: tls.TLSSocket): boolean;
|
|
101
107
|
emit(
|
|
102
108
|
event: "newSession",
|
|
103
|
-
sessionId:
|
|
104
|
-
sessionData:
|
|
105
|
-
callback: (
|
|
109
|
+
sessionId: NonSharedBuffer,
|
|
110
|
+
sessionData: NonSharedBuffer,
|
|
111
|
+
callback: () => void,
|
|
106
112
|
): boolean;
|
|
107
113
|
emit(
|
|
108
114
|
event: "OCSPRequest",
|
|
109
|
-
certificate:
|
|
110
|
-
issuer:
|
|
111
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
115
|
+
certificate: NonSharedBuffer,
|
|
116
|
+
issuer: NonSharedBuffer,
|
|
117
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
118
|
+
): boolean;
|
|
119
|
+
emit(
|
|
120
|
+
event: "resumeSession",
|
|
121
|
+
sessionId: NonSharedBuffer,
|
|
122
|
+
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
112
123
|
): boolean;
|
|
113
|
-
emit(event: "resumeSession", sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean;
|
|
114
124
|
emit(event: "secureConnection", tlsSocket: tls.TLSSocket): boolean;
|
|
115
125
|
emit(event: "tlsClientError", err: Error, tlsSocket: tls.TLSSocket): boolean;
|
|
116
126
|
emit(event: "close"): boolean;
|
|
@@ -128,30 +138,33 @@ declare module "https" {
|
|
|
128
138
|
res: InstanceType<Response>,
|
|
129
139
|
): boolean;
|
|
130
140
|
emit(event: "clientError", err: Error, socket: Duplex): boolean;
|
|
131
|
-
emit(event: "connect", req: InstanceType<Request>, socket: Duplex, head:
|
|
141
|
+
emit(event: "connect", req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer): boolean;
|
|
132
142
|
emit(
|
|
133
143
|
event: "request",
|
|
134
144
|
req: InstanceType<Request>,
|
|
135
145
|
res: InstanceType<Response>,
|
|
136
146
|
): boolean;
|
|
137
|
-
emit(event: "upgrade", req: InstanceType<Request>, socket: Duplex, head:
|
|
147
|
+
emit(event: "upgrade", req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer): boolean;
|
|
138
148
|
on(event: string, listener: (...args: any[]) => void): this;
|
|
139
|
-
on(event: "keylog", listener: (line:
|
|
149
|
+
on(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this;
|
|
140
150
|
on(
|
|
141
151
|
event: "newSession",
|
|
142
|
-
listener: (sessionId:
|
|
152
|
+
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
|
143
153
|
): this;
|
|
144
154
|
on(
|
|
145
155
|
event: "OCSPRequest",
|
|
146
156
|
listener: (
|
|
147
|
-
certificate:
|
|
148
|
-
issuer:
|
|
149
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
157
|
+
certificate: NonSharedBuffer,
|
|
158
|
+
issuer: NonSharedBuffer,
|
|
159
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
150
160
|
) => void,
|
|
151
161
|
): this;
|
|
152
162
|
on(
|
|
153
163
|
event: "resumeSession",
|
|
154
|
-
listener: (
|
|
164
|
+
listener: (
|
|
165
|
+
sessionId: NonSharedBuffer,
|
|
166
|
+
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
167
|
+
) => void,
|
|
155
168
|
): this;
|
|
156
169
|
on(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
|
|
157
170
|
on(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
|
@@ -162,26 +175,35 @@ declare module "https" {
|
|
|
162
175
|
on(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
|
|
163
176
|
on(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
|
|
164
177
|
on(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
|
|
165
|
-
on(
|
|
178
|
+
on(
|
|
179
|
+
event: "connect",
|
|
180
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
181
|
+
): this;
|
|
166
182
|
on(event: "request", listener: http.RequestListener<Request, Response>): this;
|
|
167
|
-
on(
|
|
183
|
+
on(
|
|
184
|
+
event: "upgrade",
|
|
185
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
186
|
+
): this;
|
|
168
187
|
once(event: string, listener: (...args: any[]) => void): this;
|
|
169
|
-
once(event: "keylog", listener: (line:
|
|
188
|
+
once(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this;
|
|
170
189
|
once(
|
|
171
190
|
event: "newSession",
|
|
172
|
-
listener: (sessionId:
|
|
191
|
+
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
|
173
192
|
): this;
|
|
174
193
|
once(
|
|
175
194
|
event: "OCSPRequest",
|
|
176
195
|
listener: (
|
|
177
|
-
certificate:
|
|
178
|
-
issuer:
|
|
179
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
196
|
+
certificate: NonSharedBuffer,
|
|
197
|
+
issuer: NonSharedBuffer,
|
|
198
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
180
199
|
) => void,
|
|
181
200
|
): this;
|
|
182
201
|
once(
|
|
183
202
|
event: "resumeSession",
|
|
184
|
-
listener: (
|
|
203
|
+
listener: (
|
|
204
|
+
sessionId: NonSharedBuffer,
|
|
205
|
+
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
206
|
+
) => void,
|
|
185
207
|
): this;
|
|
186
208
|
once(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
|
|
187
209
|
once(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
|
@@ -192,26 +214,35 @@ declare module "https" {
|
|
|
192
214
|
once(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
|
|
193
215
|
once(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
|
|
194
216
|
once(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
|
|
195
|
-
once(
|
|
217
|
+
once(
|
|
218
|
+
event: "connect",
|
|
219
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
220
|
+
): this;
|
|
196
221
|
once(event: "request", listener: http.RequestListener<Request, Response>): this;
|
|
197
|
-
once(
|
|
222
|
+
once(
|
|
223
|
+
event: "upgrade",
|
|
224
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
225
|
+
): this;
|
|
198
226
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
199
|
-
prependListener(event: "keylog", listener: (line:
|
|
227
|
+
prependListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this;
|
|
200
228
|
prependListener(
|
|
201
229
|
event: "newSession",
|
|
202
|
-
listener: (sessionId:
|
|
230
|
+
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
|
203
231
|
): this;
|
|
204
232
|
prependListener(
|
|
205
233
|
event: "OCSPRequest",
|
|
206
234
|
listener: (
|
|
207
|
-
certificate:
|
|
208
|
-
issuer:
|
|
209
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
235
|
+
certificate: NonSharedBuffer,
|
|
236
|
+
issuer: NonSharedBuffer,
|
|
237
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
210
238
|
) => void,
|
|
211
239
|
): this;
|
|
212
240
|
prependListener(
|
|
213
241
|
event: "resumeSession",
|
|
214
|
-
listener: (
|
|
242
|
+
listener: (
|
|
243
|
+
sessionId: NonSharedBuffer,
|
|
244
|
+
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
245
|
+
) => void,
|
|
215
246
|
): this;
|
|
216
247
|
prependListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
|
|
217
248
|
prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
|
@@ -224,30 +255,33 @@ declare module "https" {
|
|
|
224
255
|
prependListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
|
|
225
256
|
prependListener(
|
|
226
257
|
event: "connect",
|
|
227
|
-
listener: (req: InstanceType<Request>, socket: Duplex, head:
|
|
258
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
228
259
|
): this;
|
|
229
260
|
prependListener(event: "request", listener: http.RequestListener<Request, Response>): this;
|
|
230
261
|
prependListener(
|
|
231
262
|
event: "upgrade",
|
|
232
|
-
listener: (req: InstanceType<Request>, socket: Duplex, head:
|
|
263
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
233
264
|
): this;
|
|
234
265
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
235
|
-
prependOnceListener(event: "keylog", listener: (line:
|
|
266
|
+
prependOnceListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this;
|
|
236
267
|
prependOnceListener(
|
|
237
268
|
event: "newSession",
|
|
238
|
-
listener: (sessionId:
|
|
269
|
+
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
|
239
270
|
): this;
|
|
240
271
|
prependOnceListener(
|
|
241
272
|
event: "OCSPRequest",
|
|
242
273
|
listener: (
|
|
243
|
-
certificate:
|
|
244
|
-
issuer:
|
|
245
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
274
|
+
certificate: NonSharedBuffer,
|
|
275
|
+
issuer: NonSharedBuffer,
|
|
276
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
246
277
|
) => void,
|
|
247
278
|
): this;
|
|
248
279
|
prependOnceListener(
|
|
249
280
|
event: "resumeSession",
|
|
250
|
-
listener: (
|
|
281
|
+
listener: (
|
|
282
|
+
sessionId: NonSharedBuffer,
|
|
283
|
+
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
284
|
+
) => void,
|
|
251
285
|
): this;
|
|
252
286
|
prependOnceListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
|
|
253
287
|
prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
|
@@ -260,12 +294,12 @@ declare module "https" {
|
|
|
260
294
|
prependOnceListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
|
|
261
295
|
prependOnceListener(
|
|
262
296
|
event: "connect",
|
|
263
|
-
listener: (req: InstanceType<Request>, socket: Duplex, head:
|
|
297
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
264
298
|
): this;
|
|
265
299
|
prependOnceListener(event: "request", listener: http.RequestListener<Request, Response>): this;
|
|
266
300
|
prependOnceListener(
|
|
267
301
|
event: "upgrade",
|
|
268
|
-
listener: (req: InstanceType<Request>, socket: Duplex, head:
|
|
302
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
269
303
|
): this;
|
|
270
304
|
}
|
|
271
305
|
/**
|
|
@@ -22,20 +22,30 @@
|
|
|
22
22
|
* IN THE SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
// NOTE: These definitions support Node.js and TypeScript 5.
|
|
25
|
+
// NOTE: These definitions support Node.js and TypeScript 5.8+.
|
|
26
26
|
|
|
27
|
-
// Reference required TypeScript
|
|
27
|
+
// Reference required TypeScript libraries:
|
|
28
28
|
/// <reference lib="es2020" />
|
|
29
|
+
/// <reference lib="esnext.disposable" />
|
|
30
|
+
/// <reference lib="esnext.float16" />
|
|
29
31
|
|
|
30
|
-
//
|
|
31
|
-
/// <reference path="compatibility/
|
|
32
|
+
// Iterator definitions required for compatibility with TypeScript <5.6:
|
|
33
|
+
/// <reference path="compatibility/iterators.d.ts" />
|
|
32
34
|
|
|
33
|
-
// Definitions specific to TypeScript 5.7+:
|
|
35
|
+
// Definitions for Node.js modules specific to TypeScript 5.7+:
|
|
34
36
|
/// <reference path="globals.typedarray.d.ts" />
|
|
35
37
|
/// <reference path="buffer.buffer.d.ts" />
|
|
36
38
|
|
|
37
39
|
// Definitions for Node.js modules that are not specific to any version of TypeScript:
|
|
38
40
|
/// <reference path="globals.d.ts" />
|
|
41
|
+
/// <reference path="web-globals/abortcontroller.d.ts" />
|
|
42
|
+
/// <reference path="web-globals/crypto.d.ts" />
|
|
43
|
+
/// <reference path="web-globals/domexception.d.ts" />
|
|
44
|
+
/// <reference path="web-globals/events.d.ts" />
|
|
45
|
+
/// <reference path="web-globals/fetch.d.ts" />
|
|
46
|
+
/// <reference path="web-globals/navigator.d.ts" />
|
|
47
|
+
/// <reference path="web-globals/storage.d.ts" />
|
|
48
|
+
/// <reference path="web-globals/streams.d.ts" />
|
|
39
49
|
/// <reference path="assert.d.ts" />
|
|
40
50
|
/// <reference path="assert/strict.d.ts" />
|
|
41
51
|
/// <reference path="async_hooks.d.ts" />
|
|
@@ -49,9 +59,7 @@
|
|
|
49
59
|
/// <reference path="diagnostics_channel.d.ts" />
|
|
50
60
|
/// <reference path="dns.d.ts" />
|
|
51
61
|
/// <reference path="dns/promises.d.ts" />
|
|
52
|
-
/// <reference path="dns/promises.d.ts" />
|
|
53
62
|
/// <reference path="domain.d.ts" />
|
|
54
|
-
/// <reference path="dom-events.d.ts" />
|
|
55
63
|
/// <reference path="events.d.ts" />
|
|
56
64
|
/// <reference path="fs.d.ts" />
|
|
57
65
|
/// <reference path="fs/promises.d.ts" />
|
|
@@ -59,6 +67,7 @@
|
|
|
59
67
|
/// <reference path="http2.d.ts" />
|
|
60
68
|
/// <reference path="https.d.ts" />
|
|
61
69
|
/// <reference path="inspector.d.ts" />
|
|
70
|
+
/// <reference path="inspector.generated.d.ts" />
|
|
62
71
|
/// <reference path="module.d.ts" />
|
|
63
72
|
/// <reference path="net.d.ts" />
|
|
64
73
|
/// <reference path="os.d.ts" />
|
|
@@ -0,0 +1,277 @@
|
|
|
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/v24.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-v24.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 v24.2.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 v24.3.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
|
+
* This feature is only available with the `--experimental-network-inspection` flag enabled.
|
|
164
|
+
*
|
|
165
|
+
* Broadcasts the `Network.webSocketCreated` event to connected frontends. This event indicates that
|
|
166
|
+
* a WebSocket connection has been initiated.
|
|
167
|
+
* @since v24.7.0
|
|
168
|
+
*/
|
|
169
|
+
function webSocketCreated(params: WebSocketCreatedEventDataType): void;
|
|
170
|
+
/**
|
|
171
|
+
* This feature is only available with the `--experimental-network-inspection` flag enabled.
|
|
172
|
+
*
|
|
173
|
+
* Broadcasts the `Network.webSocketHandshakeResponseReceived` event to connected frontends.
|
|
174
|
+
* This event indicates that the WebSocket handshake response has been received.
|
|
175
|
+
* @since v24.7.0
|
|
176
|
+
*/
|
|
177
|
+
function webSocketHandshakeResponseReceived(params: WebSocketHandshakeResponseReceivedEventDataType): void;
|
|
178
|
+
/**
|
|
179
|
+
* This feature is only available with the `--experimental-network-inspection` flag enabled.
|
|
180
|
+
*
|
|
181
|
+
* Broadcasts the `Network.webSocketClosed` event to connected frontends.
|
|
182
|
+
* This event indicates that a WebSocket connection has been closed.
|
|
183
|
+
* @since v24.7.0
|
|
184
|
+
*/
|
|
185
|
+
function webSocketClosed(params: WebSocketClosedEventDataType): void;
|
|
186
|
+
}
|
|
187
|
+
namespace NetworkResources {
|
|
188
|
+
/**
|
|
189
|
+
* This feature is only available with the `--experimental-inspector-network-resource` flag enabled.
|
|
190
|
+
*
|
|
191
|
+
* The inspector.NetworkResources.put method is used to provide a response for a loadNetworkResource
|
|
192
|
+
* request issued via the Chrome DevTools Protocol (CDP).
|
|
193
|
+
* This is typically triggered when a source map is specified by URL, and a DevTools frontend—such as
|
|
194
|
+
* Chrome—requests the resource to retrieve the source map.
|
|
195
|
+
*
|
|
196
|
+
* This method allows developers to predefine the resource content to be served in response to such CDP requests.
|
|
197
|
+
*
|
|
198
|
+
* ```js
|
|
199
|
+
* const inspector = require('node:inspector');
|
|
200
|
+
* // By preemptively calling put to register the resource, a source map can be resolved when
|
|
201
|
+
* // a loadNetworkResource request is made from the frontend.
|
|
202
|
+
* async function setNetworkResources() {
|
|
203
|
+
* const mapUrl = 'http://localhost:3000/dist/app.js.map';
|
|
204
|
+
* const tsUrl = 'http://localhost:3000/src/app.ts';
|
|
205
|
+
* const distAppJsMap = await fetch(mapUrl).then((res) => res.text());
|
|
206
|
+
* const srcAppTs = await fetch(tsUrl).then((res) => res.text());
|
|
207
|
+
* inspector.NetworkResources.put(mapUrl, distAppJsMap);
|
|
208
|
+
* inspector.NetworkResources.put(tsUrl, srcAppTs);
|
|
209
|
+
* };
|
|
210
|
+
* setNetworkResources().then(() => {
|
|
211
|
+
* require('./dist/app');
|
|
212
|
+
* });
|
|
213
|
+
* ```
|
|
214
|
+
*
|
|
215
|
+
* For more details, see the official CDP documentation: [Network.loadNetworkResource](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-loadNetworkResource)
|
|
216
|
+
* @since v24.5.0
|
|
217
|
+
* @experimental
|
|
218
|
+
*/
|
|
219
|
+
function put(url: string, data: string): void;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* The `node:inspector` module provides an API for interacting with the V8
|
|
225
|
+
* inspector.
|
|
226
|
+
*/
|
|
227
|
+
declare module "node:inspector" {
|
|
228
|
+
export * from "inspector";
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* The `node:inspector/promises` module provides an API for interacting with the V8
|
|
233
|
+
* inspector.
|
|
234
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/inspector/promises.js)
|
|
235
|
+
* @since v19.0.0
|
|
236
|
+
*/
|
|
237
|
+
declare module "inspector/promises" {
|
|
238
|
+
import EventEmitter = require("node:events");
|
|
239
|
+
export { close, console, NetworkResources, open, url, waitForDebugger } from "inspector";
|
|
240
|
+
/**
|
|
241
|
+
* The `inspector.Session` is used for dispatching messages to the V8 inspector
|
|
242
|
+
* back-end and receiving message responses and notifications.
|
|
243
|
+
* @since v19.0.0
|
|
244
|
+
*/
|
|
245
|
+
export class Session extends EventEmitter {
|
|
246
|
+
/**
|
|
247
|
+
* Create a new instance of the inspector.Session class.
|
|
248
|
+
* The inspector session needs to be connected through `session.connect()` before the messages can be dispatched to the inspector backend.
|
|
249
|
+
*/
|
|
250
|
+
constructor();
|
|
251
|
+
/**
|
|
252
|
+
* Connects a session to the inspector back-end.
|
|
253
|
+
*/
|
|
254
|
+
connect(): void;
|
|
255
|
+
/**
|
|
256
|
+
* Connects a session to the inspector back-end.
|
|
257
|
+
* An exception will be thrown if this API was not called on a Worker thread.
|
|
258
|
+
* @since v12.11.0
|
|
259
|
+
*/
|
|
260
|
+
connectToMainThread(): void;
|
|
261
|
+
/**
|
|
262
|
+
* Immediately close the session. All pending message callbacks will be called with an error.
|
|
263
|
+
* `session.connect()` will need to be called to be able to send messages again.
|
|
264
|
+
* Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints.
|
|
265
|
+
*/
|
|
266
|
+
disconnect(): void;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* The `node:inspector/promises` module provides an API for interacting with the V8
|
|
272
|
+
* inspector.
|
|
273
|
+
* @since v19.0.0
|
|
274
|
+
*/
|
|
275
|
+
declare module "node:inspector/promises" {
|
|
276
|
+
export * from "inspector/promises";
|
|
277
|
+
}
|