@types/node 24.8.1 → 24.9.1
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/README.md +1 -1
- node/assert.d.ts +36 -1
- node/buffer.buffer.d.ts +9 -0
- node/buffer.d.ts +8 -4
- node/child_process.d.ts +50 -33
- node/crypto.d.ts +198 -164
- node/dgram.d.ts +9 -8
- node/fs/promises.d.ts +39 -21
- node/fs.d.ts +89 -76
- node/globals.typedarray.d.ts +19 -0
- node/http.d.ts +52 -22
- node/http2.d.ts +29 -22
- node/https.d.ts +82 -50
- node/net.d.ts +7 -6
- node/os.d.ts +3 -2
- node/package.json +3 -3
- node/process.d.ts +2 -1
- node/sqlite.d.ts +114 -7
- node/stream/consumers.d.ts +2 -2
- node/string_decoder.d.ts +2 -2
- node/tls.d.ts +88 -64
- node/ts5.6/buffer.buffer.d.ts +10 -2
- node/ts5.6/globals.typedarray.d.ts +16 -0
- node/url.d.ts +2 -2
- node/util.d.ts +11 -2
- node/v8.d.ts +20 -3
- node/vm.d.ts +24 -3
- node/worker_threads.d.ts +40 -3
- node/zlib.d.ts +25 -24
node/https.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
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";
|
|
@@ -63,22 +64,25 @@ declare module "https" {
|
|
|
63
64
|
*/
|
|
64
65
|
closeIdleConnections(): void;
|
|
65
66
|
addListener(event: string, listener: (...args: any[]) => void): this;
|
|
66
|
-
addListener(event: "keylog", listener: (line:
|
|
67
|
+
addListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this;
|
|
67
68
|
addListener(
|
|
68
69
|
event: "newSession",
|
|
69
|
-
listener: (sessionId:
|
|
70
|
+
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
|
70
71
|
): this;
|
|
71
72
|
addListener(
|
|
72
73
|
event: "OCSPRequest",
|
|
73
74
|
listener: (
|
|
74
|
-
certificate:
|
|
75
|
-
issuer:
|
|
76
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
75
|
+
certificate: NonSharedBuffer,
|
|
76
|
+
issuer: NonSharedBuffer,
|
|
77
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
77
78
|
) => void,
|
|
78
79
|
): this;
|
|
79
80
|
addListener(
|
|
80
81
|
event: "resumeSession",
|
|
81
|
-
listener: (
|
|
82
|
+
listener: (
|
|
83
|
+
sessionId: NonSharedBuffer,
|
|
84
|
+
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
85
|
+
) => void,
|
|
82
86
|
): this;
|
|
83
87
|
addListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
|
|
84
88
|
addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
|
@@ -91,28 +95,32 @@ declare module "https" {
|
|
|
91
95
|
addListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
|
|
92
96
|
addListener(
|
|
93
97
|
event: "connect",
|
|
94
|
-
listener: (req: InstanceType<Request>, socket: Duplex, head:
|
|
98
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
95
99
|
): this;
|
|
96
100
|
addListener(event: "request", listener: http.RequestListener<Request, Response>): this;
|
|
97
101
|
addListener(
|
|
98
102
|
event: "upgrade",
|
|
99
|
-
listener: (req: InstanceType<Request>, socket: Duplex, head:
|
|
103
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
100
104
|
): this;
|
|
101
105
|
emit(event: string, ...args: any[]): boolean;
|
|
102
|
-
emit(event: "keylog", line:
|
|
106
|
+
emit(event: "keylog", line: NonSharedBuffer, tlsSocket: tls.TLSSocket): boolean;
|
|
103
107
|
emit(
|
|
104
108
|
event: "newSession",
|
|
105
|
-
sessionId:
|
|
106
|
-
sessionData:
|
|
107
|
-
callback: (
|
|
109
|
+
sessionId: NonSharedBuffer,
|
|
110
|
+
sessionData: NonSharedBuffer,
|
|
111
|
+
callback: () => void,
|
|
108
112
|
): boolean;
|
|
109
113
|
emit(
|
|
110
114
|
event: "OCSPRequest",
|
|
111
|
-
certificate:
|
|
112
|
-
issuer:
|
|
113
|
-
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,
|
|
114
123
|
): boolean;
|
|
115
|
-
emit(event: "resumeSession", sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean;
|
|
116
124
|
emit(event: "secureConnection", tlsSocket: tls.TLSSocket): boolean;
|
|
117
125
|
emit(event: "tlsClientError", err: Error, tlsSocket: tls.TLSSocket): boolean;
|
|
118
126
|
emit(event: "close"): boolean;
|
|
@@ -130,30 +138,33 @@ declare module "https" {
|
|
|
130
138
|
res: InstanceType<Response>,
|
|
131
139
|
): boolean;
|
|
132
140
|
emit(event: "clientError", err: Error, socket: Duplex): boolean;
|
|
133
|
-
emit(event: "connect", req: InstanceType<Request>, socket: Duplex, head:
|
|
141
|
+
emit(event: "connect", req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer): boolean;
|
|
134
142
|
emit(
|
|
135
143
|
event: "request",
|
|
136
144
|
req: InstanceType<Request>,
|
|
137
145
|
res: InstanceType<Response>,
|
|
138
146
|
): boolean;
|
|
139
|
-
emit(event: "upgrade", req: InstanceType<Request>, socket: Duplex, head:
|
|
147
|
+
emit(event: "upgrade", req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer): boolean;
|
|
140
148
|
on(event: string, listener: (...args: any[]) => void): this;
|
|
141
|
-
on(event: "keylog", listener: (line:
|
|
149
|
+
on(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this;
|
|
142
150
|
on(
|
|
143
151
|
event: "newSession",
|
|
144
|
-
listener: (sessionId:
|
|
152
|
+
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
|
145
153
|
): this;
|
|
146
154
|
on(
|
|
147
155
|
event: "OCSPRequest",
|
|
148
156
|
listener: (
|
|
149
|
-
certificate:
|
|
150
|
-
issuer:
|
|
151
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
157
|
+
certificate: NonSharedBuffer,
|
|
158
|
+
issuer: NonSharedBuffer,
|
|
159
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
152
160
|
) => void,
|
|
153
161
|
): this;
|
|
154
162
|
on(
|
|
155
163
|
event: "resumeSession",
|
|
156
|
-
listener: (
|
|
164
|
+
listener: (
|
|
165
|
+
sessionId: NonSharedBuffer,
|
|
166
|
+
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
167
|
+
) => void,
|
|
157
168
|
): this;
|
|
158
169
|
on(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
|
|
159
170
|
on(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
|
@@ -164,26 +175,35 @@ declare module "https" {
|
|
|
164
175
|
on(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
|
|
165
176
|
on(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
|
|
166
177
|
on(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
|
|
167
|
-
on(
|
|
178
|
+
on(
|
|
179
|
+
event: "connect",
|
|
180
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
181
|
+
): this;
|
|
168
182
|
on(event: "request", listener: http.RequestListener<Request, Response>): this;
|
|
169
|
-
on(
|
|
183
|
+
on(
|
|
184
|
+
event: "upgrade",
|
|
185
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
186
|
+
): this;
|
|
170
187
|
once(event: string, listener: (...args: any[]) => void): this;
|
|
171
|
-
once(event: "keylog", listener: (line:
|
|
188
|
+
once(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this;
|
|
172
189
|
once(
|
|
173
190
|
event: "newSession",
|
|
174
|
-
listener: (sessionId:
|
|
191
|
+
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
|
175
192
|
): this;
|
|
176
193
|
once(
|
|
177
194
|
event: "OCSPRequest",
|
|
178
195
|
listener: (
|
|
179
|
-
certificate:
|
|
180
|
-
issuer:
|
|
181
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
196
|
+
certificate: NonSharedBuffer,
|
|
197
|
+
issuer: NonSharedBuffer,
|
|
198
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
182
199
|
) => void,
|
|
183
200
|
): this;
|
|
184
201
|
once(
|
|
185
202
|
event: "resumeSession",
|
|
186
|
-
listener: (
|
|
203
|
+
listener: (
|
|
204
|
+
sessionId: NonSharedBuffer,
|
|
205
|
+
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
206
|
+
) => void,
|
|
187
207
|
): this;
|
|
188
208
|
once(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
|
|
189
209
|
once(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
|
@@ -194,26 +214,35 @@ declare module "https" {
|
|
|
194
214
|
once(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
|
|
195
215
|
once(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
|
|
196
216
|
once(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
|
|
197
|
-
once(
|
|
217
|
+
once(
|
|
218
|
+
event: "connect",
|
|
219
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
220
|
+
): this;
|
|
198
221
|
once(event: "request", listener: http.RequestListener<Request, Response>): this;
|
|
199
|
-
once(
|
|
222
|
+
once(
|
|
223
|
+
event: "upgrade",
|
|
224
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
225
|
+
): this;
|
|
200
226
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
201
|
-
prependListener(event: "keylog", listener: (line:
|
|
227
|
+
prependListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this;
|
|
202
228
|
prependListener(
|
|
203
229
|
event: "newSession",
|
|
204
|
-
listener: (sessionId:
|
|
230
|
+
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
|
205
231
|
): this;
|
|
206
232
|
prependListener(
|
|
207
233
|
event: "OCSPRequest",
|
|
208
234
|
listener: (
|
|
209
|
-
certificate:
|
|
210
|
-
issuer:
|
|
211
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
235
|
+
certificate: NonSharedBuffer,
|
|
236
|
+
issuer: NonSharedBuffer,
|
|
237
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
212
238
|
) => void,
|
|
213
239
|
): this;
|
|
214
240
|
prependListener(
|
|
215
241
|
event: "resumeSession",
|
|
216
|
-
listener: (
|
|
242
|
+
listener: (
|
|
243
|
+
sessionId: NonSharedBuffer,
|
|
244
|
+
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
245
|
+
) => void,
|
|
217
246
|
): this;
|
|
218
247
|
prependListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
|
|
219
248
|
prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
|
@@ -226,30 +255,33 @@ declare module "https" {
|
|
|
226
255
|
prependListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
|
|
227
256
|
prependListener(
|
|
228
257
|
event: "connect",
|
|
229
|
-
listener: (req: InstanceType<Request>, socket: Duplex, head:
|
|
258
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
230
259
|
): this;
|
|
231
260
|
prependListener(event: "request", listener: http.RequestListener<Request, Response>): this;
|
|
232
261
|
prependListener(
|
|
233
262
|
event: "upgrade",
|
|
234
|
-
listener: (req: InstanceType<Request>, socket: Duplex, head:
|
|
263
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
235
264
|
): this;
|
|
236
265
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
237
|
-
prependOnceListener(event: "keylog", listener: (line:
|
|
266
|
+
prependOnceListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this;
|
|
238
267
|
prependOnceListener(
|
|
239
268
|
event: "newSession",
|
|
240
|
-
listener: (sessionId:
|
|
269
|
+
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
|
241
270
|
): this;
|
|
242
271
|
prependOnceListener(
|
|
243
272
|
event: "OCSPRequest",
|
|
244
273
|
listener: (
|
|
245
|
-
certificate:
|
|
246
|
-
issuer:
|
|
247
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
274
|
+
certificate: NonSharedBuffer,
|
|
275
|
+
issuer: NonSharedBuffer,
|
|
276
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
248
277
|
) => void,
|
|
249
278
|
): this;
|
|
250
279
|
prependOnceListener(
|
|
251
280
|
event: "resumeSession",
|
|
252
|
-
listener: (
|
|
281
|
+
listener: (
|
|
282
|
+
sessionId: NonSharedBuffer,
|
|
283
|
+
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
284
|
+
) => void,
|
|
253
285
|
): this;
|
|
254
286
|
prependOnceListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
|
|
255
287
|
prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
|
@@ -262,12 +294,12 @@ declare module "https" {
|
|
|
262
294
|
prependOnceListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
|
|
263
295
|
prependOnceListener(
|
|
264
296
|
event: "connect",
|
|
265
|
-
listener: (req: InstanceType<Request>, socket: Duplex, head:
|
|
297
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
266
298
|
): this;
|
|
267
299
|
prependOnceListener(event: "request", listener: http.RequestListener<Request, Response>): this;
|
|
268
300
|
prependOnceListener(
|
|
269
301
|
event: "upgrade",
|
|
270
|
-
listener: (req: InstanceType<Request>, socket: Duplex, head:
|
|
302
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
271
303
|
): this;
|
|
272
304
|
}
|
|
273
305
|
/**
|
node/net.d.ts
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
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";
|
|
@@ -380,7 +381,7 @@ declare module "net" {
|
|
|
380
381
|
event: "connectionAttemptTimeout",
|
|
381
382
|
listener: (ip: string, port: number, family: number) => void,
|
|
382
383
|
): this;
|
|
383
|
-
addListener(event: "data", listener: (data:
|
|
384
|
+
addListener(event: "data", listener: (data: NonSharedBuffer) => void): this;
|
|
384
385
|
addListener(event: "drain", listener: () => void): this;
|
|
385
386
|
addListener(event: "end", listener: () => void): this;
|
|
386
387
|
addListener(event: "error", listener: (err: Error) => void): this;
|
|
@@ -396,7 +397,7 @@ declare module "net" {
|
|
|
396
397
|
emit(event: "connectionAttempt", ip: string, port: number, family: number): boolean;
|
|
397
398
|
emit(event: "connectionAttemptFailed", ip: string, port: number, family: number, error: Error): boolean;
|
|
398
399
|
emit(event: "connectionAttemptTimeout", ip: string, port: number, family: number): boolean;
|
|
399
|
-
emit(event: "data", data:
|
|
400
|
+
emit(event: "data", data: NonSharedBuffer): boolean;
|
|
400
401
|
emit(event: "drain"): boolean;
|
|
401
402
|
emit(event: "end"): boolean;
|
|
402
403
|
emit(event: "error", err: Error): boolean;
|
|
@@ -412,7 +413,7 @@ declare module "net" {
|
|
|
412
413
|
listener: (ip: string, port: number, family: number, error: Error) => void,
|
|
413
414
|
): this;
|
|
414
415
|
on(event: "connectionAttemptTimeout", listener: (ip: string, port: number, family: number) => void): this;
|
|
415
|
-
on(event: "data", listener: (data:
|
|
416
|
+
on(event: "data", listener: (data: NonSharedBuffer) => void): this;
|
|
416
417
|
on(event: "drain", listener: () => void): this;
|
|
417
418
|
on(event: "end", listener: () => void): this;
|
|
418
419
|
on(event: "error", listener: (err: Error) => void): this;
|
|
@@ -431,7 +432,7 @@ declare module "net" {
|
|
|
431
432
|
): this;
|
|
432
433
|
once(event: "connectionAttemptTimeout", listener: (ip: string, port: number, family: number) => void): this;
|
|
433
434
|
once(event: "connect", listener: () => void): this;
|
|
434
|
-
once(event: "data", listener: (data:
|
|
435
|
+
once(event: "data", listener: (data: NonSharedBuffer) => void): this;
|
|
435
436
|
once(event: "drain", listener: () => void): this;
|
|
436
437
|
once(event: "end", listener: () => void): this;
|
|
437
438
|
once(event: "error", listener: (err: Error) => void): this;
|
|
@@ -453,7 +454,7 @@ declare module "net" {
|
|
|
453
454
|
event: "connectionAttemptTimeout",
|
|
454
455
|
listener: (ip: string, port: number, family: number) => void,
|
|
455
456
|
): this;
|
|
456
|
-
prependListener(event: "data", listener: (data:
|
|
457
|
+
prependListener(event: "data", listener: (data: NonSharedBuffer) => void): this;
|
|
457
458
|
prependListener(event: "drain", listener: () => void): this;
|
|
458
459
|
prependListener(event: "end", listener: () => void): this;
|
|
459
460
|
prependListener(event: "error", listener: (err: Error) => void): this;
|
|
@@ -478,7 +479,7 @@ declare module "net" {
|
|
|
478
479
|
event: "connectionAttemptTimeout",
|
|
479
480
|
listener: (ip: string, port: number, family: number) => void,
|
|
480
481
|
): this;
|
|
481
|
-
prependOnceListener(event: "data", listener: (data:
|
|
482
|
+
prependOnceListener(event: "data", listener: (data: NonSharedBuffer) => void): this;
|
|
482
483
|
prependOnceListener(event: "drain", listener: () => void): this;
|
|
483
484
|
prependOnceListener(event: "end", listener: () => void): this;
|
|
484
485
|
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
node/os.d.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
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;
|
|
@@ -253,9 +254,9 @@ declare module "os" {
|
|
|
253
254
|
* Throws a [`SystemError`](https://nodejs.org/docs/latest-v24.x/api/errors.html#class-systemerror) if a user has no `username` or `homedir`.
|
|
254
255
|
* @since v6.0.0
|
|
255
256
|
*/
|
|
256
|
-
function userInfo(options: UserInfoOptionsWithBufferEncoding): UserInfo<Buffer>;
|
|
257
257
|
function userInfo(options?: UserInfoOptionsWithStringEncoding): UserInfo<string>;
|
|
258
|
-
function userInfo(options:
|
|
258
|
+
function userInfo(options: UserInfoOptionsWithBufferEncoding): UserInfo<NonSharedBuffer>;
|
|
259
|
+
function userInfo(options: UserInfoOptions): UserInfo<string | NonSharedBuffer>;
|
|
259
260
|
type SignalConstants = {
|
|
260
261
|
[key in NodeJS.Signals]: number;
|
|
261
262
|
};
|
node/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.9.1",
|
|
4
4
|
"description": "TypeScript definitions for node",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -147,9 +147,9 @@
|
|
|
147
147
|
},
|
|
148
148
|
"scripts": {},
|
|
149
149
|
"dependencies": {
|
|
150
|
-
"undici-types": "~7.
|
|
150
|
+
"undici-types": "~7.16.0"
|
|
151
151
|
},
|
|
152
152
|
"peerDependencies": {},
|
|
153
|
-
"typesPublisherContentHash": "
|
|
153
|
+
"typesPublisherContentHash": "1410dcf2b880c650896be220e8be57672e66a772bb4d7d1b2604ce690f70f9ef",
|
|
154
154
|
"typeScriptVersion": "5.2"
|
|
155
155
|
}
|
node/process.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
declare module "process" {
|
|
2
2
|
import { Control, MessageOptions } from "node:child_process";
|
|
3
|
+
import { PathLike } from "node:fs";
|
|
3
4
|
import * as tty from "node:tty";
|
|
4
5
|
import { Worker } from "node:worker_threads";
|
|
5
6
|
|
|
@@ -1466,7 +1467,7 @@ declare module "process" {
|
|
|
1466
1467
|
* @since v20.12.0
|
|
1467
1468
|
* @param path The path to the .env file
|
|
1468
1469
|
*/
|
|
1469
|
-
loadEnvFile(path?:
|
|
1470
|
+
loadEnvFile(path?: PathLike): void;
|
|
1470
1471
|
/**
|
|
1471
1472
|
* The `process.pid` property returns the PID of the process.
|
|
1472
1473
|
*
|
node/sqlite.d.ts
CHANGED
|
@@ -43,10 +43,9 @@
|
|
|
43
43
|
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/sqlite.js)
|
|
44
44
|
*/
|
|
45
45
|
declare module "node:sqlite" {
|
|
46
|
+
import { PathLike } from "node:fs";
|
|
46
47
|
type SQLInputValue = null | number | bigint | string | NodeJS.ArrayBufferView;
|
|
47
|
-
type SQLOutputValue = null | number | bigint | string |
|
|
48
|
-
/** @deprecated Use `SQLInputValue` or `SQLOutputValue` instead. */
|
|
49
|
-
type SupportedValueType = SQLOutputValue;
|
|
48
|
+
type SQLOutputValue = null | number | bigint | string | NodeJS.NonSharedUint8Array;
|
|
50
49
|
interface DatabaseSyncOptions {
|
|
51
50
|
/**
|
|
52
51
|
* If `true`, the database is opened by the constructor. When
|
|
@@ -240,7 +239,7 @@ declare module "node:sqlite" {
|
|
|
240
239
|
* To use an in-memory database, the path should be the special name `':memory:'`.
|
|
241
240
|
* @param options Configuration options for the database connection.
|
|
242
241
|
*/
|
|
243
|
-
constructor(path:
|
|
242
|
+
constructor(path: PathLike, options?: DatabaseSyncOptions);
|
|
244
243
|
/**
|
|
245
244
|
* Registers a new aggregate function with the SQLite database. This method is a wrapper around
|
|
246
245
|
* [`sqlite3_create_window_function()`](https://www.sqlite.org/c3ref/create_function.html).
|
|
@@ -355,6 +354,47 @@ declare module "node:sqlite" {
|
|
|
355
354
|
* @return The prepared statement.
|
|
356
355
|
*/
|
|
357
356
|
prepare(sql: string): StatementSync;
|
|
357
|
+
/**
|
|
358
|
+
* Creates a new `SQLTagStore`, which is an LRU (Least Recently Used) cache for
|
|
359
|
+
* storing prepared statements. This allows for the efficient reuse of prepared
|
|
360
|
+
* statements by tagging them with a unique identifier.
|
|
361
|
+
*
|
|
362
|
+
* When a tagged SQL literal is executed, the `SQLTagStore` checks if a prepared
|
|
363
|
+
* statement for that specific SQL string already exists in the cache. If it does,
|
|
364
|
+
* the cached statement is used. If not, a new prepared statement is created,
|
|
365
|
+
* executed, and then stored in the cache for future use. This mechanism helps to
|
|
366
|
+
* avoid the overhead of repeatedly parsing and preparing the same SQL statements.
|
|
367
|
+
*
|
|
368
|
+
* ```js
|
|
369
|
+
* import { DatabaseSync } from 'node:sqlite';
|
|
370
|
+
*
|
|
371
|
+
* const db = new DatabaseSync(':memory:');
|
|
372
|
+
* const sql = db.createSQLTagStore();
|
|
373
|
+
*
|
|
374
|
+
* db.exec('CREATE TABLE users (id INT, name TEXT)');
|
|
375
|
+
*
|
|
376
|
+
* // Using the 'run' method to insert data.
|
|
377
|
+
* // The tagged literal is used to identify the prepared statement.
|
|
378
|
+
* sql.run`INSERT INTO users VALUES (1, 'Alice')`;
|
|
379
|
+
* sql.run`INSERT INTO users VALUES (2, 'Bob')`;
|
|
380
|
+
*
|
|
381
|
+
* // Using the 'get' method to retrieve a single row.
|
|
382
|
+
* const id = 1;
|
|
383
|
+
* const user = sql.get`SELECT * FROM users WHERE id = ${id}`;
|
|
384
|
+
* console.log(user); // { id: 1, name: 'Alice' }
|
|
385
|
+
*
|
|
386
|
+
* // Using the 'all' method to retrieve all rows.
|
|
387
|
+
* const allUsers = sql.all`SELECT * FROM users ORDER BY id`;
|
|
388
|
+
* console.log(allUsers);
|
|
389
|
+
* // [
|
|
390
|
+
* // { id: 1, name: 'Alice' },
|
|
391
|
+
* // { id: 2, name: 'Bob' }
|
|
392
|
+
* // ]
|
|
393
|
+
* ```
|
|
394
|
+
* @since v24.9.0
|
|
395
|
+
* @returns A new SQL tag store for caching prepared statements.
|
|
396
|
+
*/
|
|
397
|
+
createTagStore(maxSize?: number): SQLTagStore;
|
|
358
398
|
/**
|
|
359
399
|
* Creates and attaches a session to the database. This method is a wrapper around
|
|
360
400
|
* [`sqlite3session_create()`](https://www.sqlite.org/session/sqlite3session_create.html) and
|
|
@@ -410,7 +450,7 @@ declare module "node:sqlite" {
|
|
|
410
450
|
* @returns Binary changeset that can be applied to other databases.
|
|
411
451
|
* @since v22.12.0
|
|
412
452
|
*/
|
|
413
|
-
changeset():
|
|
453
|
+
changeset(): NodeJS.NonSharedUint8Array;
|
|
414
454
|
/**
|
|
415
455
|
* Similar to the method above, but generates a more compact patchset. See
|
|
416
456
|
* [Changesets and Patchsets](https://www.sqlite.org/sessionintro.html#changesets_and_patchsets)
|
|
@@ -420,7 +460,7 @@ declare module "node:sqlite" {
|
|
|
420
460
|
* @returns Binary patchset that can be applied to other databases.
|
|
421
461
|
* @since v22.12.0
|
|
422
462
|
*/
|
|
423
|
-
patchset():
|
|
463
|
+
patchset(): NodeJS.NonSharedUint8Array;
|
|
424
464
|
/**
|
|
425
465
|
* Closes the session. An exception is thrown if the database or the session is not open. This method is a
|
|
426
466
|
* wrapper around
|
|
@@ -428,6 +468,73 @@ declare module "node:sqlite" {
|
|
|
428
468
|
*/
|
|
429
469
|
close(): void;
|
|
430
470
|
}
|
|
471
|
+
/**
|
|
472
|
+
* This class represents a single LRU (Least Recently Used) cache for storing
|
|
473
|
+
* prepared statements.
|
|
474
|
+
*
|
|
475
|
+
* Instances of this class are created via the database.createSQLTagStore() method,
|
|
476
|
+
* not by using a constructor. The store caches prepared statements based on the
|
|
477
|
+
* provided SQL query string. When the same query is seen again, the store
|
|
478
|
+
* retrieves the cached statement and safely applies the new values through
|
|
479
|
+
* parameter binding, thereby preventing attacks like SQL injection.
|
|
480
|
+
*
|
|
481
|
+
* The cache has a maxSize that defaults to 1000 statements, but a custom size can
|
|
482
|
+
* be provided (e.g., database.createSQLTagStore(100)). All APIs exposed by this
|
|
483
|
+
* class execute synchronously.
|
|
484
|
+
* @since v24.9.0
|
|
485
|
+
*/
|
|
486
|
+
interface SQLTagStore {
|
|
487
|
+
/**
|
|
488
|
+
* Executes the given SQL query and returns all resulting rows as an array of objects.
|
|
489
|
+
* @since v24.9.0
|
|
490
|
+
*/
|
|
491
|
+
all(
|
|
492
|
+
stringElements: TemplateStringsArray,
|
|
493
|
+
...boundParameters: SQLInputValue[]
|
|
494
|
+
): Record<string, SQLOutputValue>[];
|
|
495
|
+
/**
|
|
496
|
+
* Executes the given SQL query and returns the first resulting row as an object.
|
|
497
|
+
* @since v24.9.0
|
|
498
|
+
*/
|
|
499
|
+
get(
|
|
500
|
+
stringElements: TemplateStringsArray,
|
|
501
|
+
...boundParameters: SQLInputValue[]
|
|
502
|
+
): Record<string, SQLOutputValue> | undefined;
|
|
503
|
+
/**
|
|
504
|
+
* Executes the given SQL query and returns an iterator over the resulting rows.
|
|
505
|
+
* @since v24.9.0
|
|
506
|
+
*/
|
|
507
|
+
iterate(
|
|
508
|
+
stringElements: TemplateStringsArray,
|
|
509
|
+
...boundParameters: SQLInputValue[]
|
|
510
|
+
): NodeJS.Iterator<Record<string, SQLOutputValue>>;
|
|
511
|
+
/**
|
|
512
|
+
* Executes the given SQL query, which is expected to not return any rows (e.g., INSERT, UPDATE, DELETE).
|
|
513
|
+
* @since v24.9.0
|
|
514
|
+
*/
|
|
515
|
+
run(stringElements: TemplateStringsArray, ...boundParameters: SQLInputValue[]): StatementResultingChanges;
|
|
516
|
+
/**
|
|
517
|
+
* A read-only property that returns the number of prepared statements currently in the cache.
|
|
518
|
+
* @since v24.9.0
|
|
519
|
+
* @returns The maximum number of prepared statements the cache can hold.
|
|
520
|
+
*/
|
|
521
|
+
size(): number;
|
|
522
|
+
/**
|
|
523
|
+
* A read-only property that returns the maximum number of prepared statements the cache can hold.
|
|
524
|
+
* @since v24.9.0
|
|
525
|
+
*/
|
|
526
|
+
readonly capacity: number;
|
|
527
|
+
/**
|
|
528
|
+
* A read-only property that returns the `DatabaseSync` object associated with this `SQLTagStore`.
|
|
529
|
+
* @since v24.9.0
|
|
530
|
+
*/
|
|
531
|
+
readonly db: DatabaseSync;
|
|
532
|
+
/**
|
|
533
|
+
* Resets the LRU cache, clearing all stored prepared statements.
|
|
534
|
+
* @since v24.9.0
|
|
535
|
+
*/
|
|
536
|
+
clear(): void;
|
|
537
|
+
}
|
|
431
538
|
interface StatementColumnMetadata {
|
|
432
539
|
/**
|
|
433
540
|
* The unaliased name of the column in the origin
|
|
@@ -679,7 +786,7 @@ declare module "node:sqlite" {
|
|
|
679
786
|
* @returns A promise that fulfills with the total number of backed-up pages upon completion, or rejects if an
|
|
680
787
|
* error occurs.
|
|
681
788
|
*/
|
|
682
|
-
function backup(sourceDb: DatabaseSync, path:
|
|
789
|
+
function backup(sourceDb: DatabaseSync, path: PathLike, options?: BackupOptions): Promise<number>;
|
|
683
790
|
/**
|
|
684
791
|
* @since v22.13.0
|
|
685
792
|
*/
|
node/stream/consumers.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @since v16.7.0
|
|
5
5
|
*/
|
|
6
6
|
declare module "stream/consumers" {
|
|
7
|
-
import { Blob as NodeBlob } from "node:buffer";
|
|
7
|
+
import { Blob as NodeBlob, NonSharedBuffer } from "node:buffer";
|
|
8
8
|
import { ReadableStream as WebReadableStream } from "node:stream/web";
|
|
9
9
|
/**
|
|
10
10
|
* @since v16.7.0
|
|
@@ -20,7 +20,7 @@ declare module "stream/consumers" {
|
|
|
20
20
|
* @since v16.7.0
|
|
21
21
|
* @returns Fulfills with a `Buffer` containing the full contents of the stream.
|
|
22
22
|
*/
|
|
23
|
-
function buffer(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<
|
|
23
|
+
function buffer(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<NonSharedBuffer>;
|
|
24
24
|
/**
|
|
25
25
|
* @since v16.7.0
|
|
26
26
|
* @returns Fulfills with the contents of the stream parsed as a
|
node/string_decoder.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ declare module "string_decoder" {
|
|
|
48
48
|
* @since v0.1.99
|
|
49
49
|
* @param buffer The bytes to decode.
|
|
50
50
|
*/
|
|
51
|
-
write(buffer: string |
|
|
51
|
+
write(buffer: string | NodeJS.ArrayBufferView): string;
|
|
52
52
|
/**
|
|
53
53
|
* Returns any remaining input stored in the internal buffer as a string. Bytes
|
|
54
54
|
* representing incomplete UTF-8 and UTF-16 characters will be replaced with
|
|
@@ -59,7 +59,7 @@ declare module "string_decoder" {
|
|
|
59
59
|
* @since v0.9.3
|
|
60
60
|
* @param buffer The bytes to decode.
|
|
61
61
|
*/
|
|
62
|
-
end(buffer?: string |
|
|
62
|
+
end(buffer?: string | NodeJS.ArrayBufferView): string;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
declare module "node:string_decoder" {
|