@types/node 24.13.6 → 24.19.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.
- {node v24.13 → node v24.19}/README.md +1 -1
- {node v24.13 → node v24.19}/async_hooks.d.ts +18 -22
- {node v24.13 → node v24.19}/buffer.buffer.d.ts +10 -5
- {node v24.13 → node v24.19}/buffer.d.ts +7 -0
- {node v24.13 → node v24.19}/child_process.d.ts +5 -1
- {node v24.13 → node v24.19}/crypto.d.ts +114 -47
- {node v24.13 → node v24.19}/dgram.d.ts +119 -4
- {node v24.13 → node v24.19}/dns/promises.d.ts +5 -5
- {node v24.13 → node v24.19}/dns.d.ts +6 -6
- {node v24.13 → node v24.19}/events.d.ts +13 -22
- {node v24.13 → node v24.19}/fs/promises.d.ts +79 -66
- {node v24.13 → node v24.19}/fs.d.ts +153 -90
- {node v24.13 → node v24.19}/http.d.ts +94 -2
- {node v24.13 → node v24.19}/http2.d.ts +65 -18
- {node v24.13 → node v24.19}/inspector.d.ts +47 -1
- {node v24.13 → node v24.19}/inspector.generated.d.ts +167 -0
- {node v24.13 → node v24.19}/module.d.ts +1 -0
- {node v24.13 → node v24.19}/net.d.ts +139 -15
- {node v24.13 → node v24.19}/os.d.ts +30 -30
- {node v24.13 → node v24.19}/package.json +3 -3
- {node v24.13 → node v24.19}/perf_hooks.d.ts +31 -19
- {node v24.13 → node v24.19}/process.d.ts +42 -43
- {node v24.13 → node v24.19}/sqlite.d.ts +153 -11
- {node v24.13 → node v24.19}/stream/consumers.d.ts +7 -0
- {node v24.13 → node v24.19}/stream/web.d.ts +19 -0
- {node v24.13 → node v24.19}/stream.d.ts +2 -1
- {node v24.13 → node v24.19}/test.d.ts +320 -13
- {node v24.13 → node v24.19}/tls.d.ts +50 -15
- {node v24.13 → node v24.19}/ts5.6/buffer.buffer.d.ts +5 -0
- {node v24.13 → node v24.19}/tty.d.ts +4 -3
- {node v24.13 → node v24.19}/url.d.ts +27 -3
- {node v24.13 → node v24.19}/util.d.ts +42 -2
- {node v24.13 → node v24.19}/v8.d.ts +51 -23
- {node v24.13 → node v24.19}/vm.d.ts +52 -87
- {node v24.13 → node v24.19}/zlib.d.ts +17 -0
- {node v24.13 → node v24.19}/LICENSE +0 -0
- {node v24.13 → node v24.19}/assert/strict.d.ts +0 -0
- {node v24.13 → node v24.19}/assert.d.ts +0 -0
- {node v24.13 → node v24.19}/cluster.d.ts +0 -0
- {node v24.13 → node v24.19}/compatibility/iterators.d.ts +0 -0
- {node v24.13 → node v24.19}/console.d.ts +0 -0
- {node v24.13 → node v24.19}/constants.d.ts +0 -0
- {node v24.13 → node v24.19}/diagnostics_channel.d.ts +0 -0
- {node v24.13 → node v24.19}/domain.d.ts +0 -0
- {node v24.13 → node v24.19}/globals.d.ts +0 -0
- {node v24.13 → node v24.19}/globals.typedarray.d.ts +0 -0
- {node v24.13 → node v24.19}/https.d.ts +0 -0
- {node v24.13 → node v24.19}/index.d.ts +0 -0
- {node v24.13 → node v24.19}/path.d.ts +0 -0
- {node v24.13 → node v24.19}/punycode.d.ts +0 -0
- {node v24.13 → node v24.19}/querystring.d.ts +0 -0
- {node v24.13 → node v24.19}/readline/promises.d.ts +0 -0
- {node v24.13 → node v24.19}/readline.d.ts +0 -0
- {node v24.13 → node v24.19}/repl.d.ts +0 -0
- {node v24.13 → node v24.19}/sea.d.ts +0 -0
- {node v24.13 → node v24.19}/stream/promises.d.ts +0 -0
- {node v24.13 → node v24.19}/string_decoder.d.ts +0 -0
- {node v24.13 → node v24.19}/timers/promises.d.ts +0 -0
- {node v24.13 → node v24.19}/timers.d.ts +0 -0
- {node v24.13 → node v24.19}/trace_events.d.ts +0 -0
- {node v24.13 → node v24.19}/ts5.6/compatibility/float16array.d.ts +0 -0
- {node v24.13 → node v24.19}/ts5.6/globals.typedarray.d.ts +0 -0
- {node v24.13 → node v24.19}/ts5.6/index.d.ts +0 -0
- {node v24.13 → node v24.19}/ts5.7/compatibility/float16array.d.ts +0 -0
- {node v24.13 → node v24.19}/ts5.7/index.d.ts +0 -0
- {node v24.13 → node v24.19}/wasi.d.ts +0 -0
- {node v24.13 → node v24.19}/web-globals/abortcontroller.d.ts +0 -0
- {node v24.13 → node v24.19}/web-globals/crypto.d.ts +0 -0
- {node v24.13 → node v24.19}/web-globals/domexception.d.ts +0 -0
- {node v24.13 → node v24.19}/web-globals/events.d.ts +0 -0
- {node v24.13 → node v24.19}/web-globals/fetch.d.ts +0 -0
- {node v24.13 → node v24.19}/web-globals/navigator.d.ts +0 -0
- {node v24.13 → node v24.19}/web-globals/storage.d.ts +0 -0
- {node v24.13 → node v24.19}/web-globals/streams.d.ts +0 -0
- {node v24.13 → node v24.19}/worker_threads.d.ts +0 -0
|
@@ -126,6 +126,29 @@ declare module "node:sqlite" {
|
|
|
126
126
|
* @default true
|
|
127
127
|
*/
|
|
128
128
|
defensive?: boolean | undefined;
|
|
129
|
+
/**
|
|
130
|
+
* Configuration for various SQLite limits. These limits
|
|
131
|
+
* can be used to prevent excessive resource consumption when handling
|
|
132
|
+
* potentially malicious input. See [Run-Time Limits](https://www.sqlite.org/c3ref/c_limit_attached.html) and [Limit Constants](https://www.sqlite.org/c3ref/limit.html)
|
|
133
|
+
* in the SQLite documentation for details. Default values are determined by
|
|
134
|
+
* SQLite's compile-time defaults and may vary depending on how SQLite was
|
|
135
|
+
* built. The following properties are supported:
|
|
136
|
+
* @since v24.15.0
|
|
137
|
+
*/
|
|
138
|
+
limits?: NodeJS.PartialOptions<DatabaseLimits> | undefined;
|
|
139
|
+
}
|
|
140
|
+
interface DatabaseLimits {
|
|
141
|
+
length: number;
|
|
142
|
+
sqlLength: number;
|
|
143
|
+
column: number;
|
|
144
|
+
exprDepth: number;
|
|
145
|
+
compoundSelect: number;
|
|
146
|
+
vdbeOp: number;
|
|
147
|
+
functionArg: number;
|
|
148
|
+
attach: number;
|
|
149
|
+
likePatternLength: number;
|
|
150
|
+
variableNumber: number;
|
|
151
|
+
triggerDepth: number;
|
|
129
152
|
}
|
|
130
153
|
interface CreateSessionOptions {
|
|
131
154
|
/**
|
|
@@ -143,8 +166,12 @@ declare module "node:sqlite" {
|
|
|
143
166
|
}
|
|
144
167
|
interface ApplyChangesetOptions {
|
|
145
168
|
/**
|
|
146
|
-
*
|
|
147
|
-
*
|
|
169
|
+
* for each table affected by at least
|
|
170
|
+
* one change in the changeset, the `filter` callback is invoked with the
|
|
171
|
+
* table name as the first argument. If the return value is falsy, then no
|
|
172
|
+
* attempt is made to apply any changes to the table.
|
|
173
|
+
* Otherwise, if the return value is truthy or no `filter` callback is provided,
|
|
174
|
+
* all changes related to the table are attempted.
|
|
148
175
|
* @since v22.12.0
|
|
149
176
|
*/
|
|
150
177
|
filter?: ((tableName: string) => boolean) | undefined;
|
|
@@ -174,6 +201,13 @@ declare module "node:sqlite" {
|
|
|
174
201
|
*/
|
|
175
202
|
onConflict?: ((conflictType: number) => number) | undefined;
|
|
176
203
|
}
|
|
204
|
+
interface DeserializeOptions {
|
|
205
|
+
/**
|
|
206
|
+
* Name of the database to deserialize into.
|
|
207
|
+
* @default 'main'
|
|
208
|
+
*/
|
|
209
|
+
dbName?: string | undefined;
|
|
210
|
+
}
|
|
177
211
|
interface FunctionOptions {
|
|
178
212
|
/**
|
|
179
213
|
* If `true`, the [`SQLITE_DETERMINISTIC`](https://www.sqlite.org/c3ref/c_deterministic.html) flag is
|
|
@@ -228,6 +262,28 @@ declare module "node:sqlite" {
|
|
|
228
262
|
*/
|
|
229
263
|
inverse?: ((accumulator: T, ...args: SQLOutputValue[]) => T) | undefined;
|
|
230
264
|
}
|
|
265
|
+
interface PrepareOptions {
|
|
266
|
+
/**
|
|
267
|
+
* If `true`, integer fields are read as `BigInt`s.
|
|
268
|
+
* @since v24.14.0
|
|
269
|
+
*/
|
|
270
|
+
readBigInts?: boolean | undefined;
|
|
271
|
+
/**
|
|
272
|
+
* If `true`, results are returned as arrays.
|
|
273
|
+
* @since v24.14.0
|
|
274
|
+
*/
|
|
275
|
+
returnArrays?: boolean | undefined;
|
|
276
|
+
/**
|
|
277
|
+
* If `true`, allows binding named parameters without the prefix character.
|
|
278
|
+
* @since v24.14.0
|
|
279
|
+
*/
|
|
280
|
+
allowBareNamedParameters?: boolean | undefined;
|
|
281
|
+
/**
|
|
282
|
+
* If `true`, unknown named parameters are ignored.
|
|
283
|
+
* @since v24.14.0
|
|
284
|
+
*/
|
|
285
|
+
allowUnknownNamedParameters?: boolean | undefined;
|
|
286
|
+
}
|
|
231
287
|
/**
|
|
232
288
|
* This class represents a single [connection](https://www.sqlite.org/c3ref/sqlite3.html) to a SQLite database. All APIs
|
|
233
289
|
* exposed by this class execute synchronously.
|
|
@@ -285,10 +341,23 @@ declare module "node:sqlite" {
|
|
|
285
341
|
* Loads a shared library into the database connection. This method is a wrapper
|
|
286
342
|
* around [`sqlite3_load_extension()`](https://www.sqlite.org/c3ref/load_extension.html). It is required to enable the
|
|
287
343
|
* `allowExtension` option when constructing the `DatabaseSync` instance.
|
|
344
|
+
*
|
|
345
|
+
* ```js
|
|
346
|
+
* import { DatabaseSync } from 'node:sqlite';
|
|
347
|
+
* const database = new DatabaseSync(':memory:', { allowExtension: true });
|
|
348
|
+
*
|
|
349
|
+
* // Load using the entry point derived from the filename.
|
|
350
|
+
* database.loadExtension('./decimal.dylib');
|
|
351
|
+
*
|
|
352
|
+
* // Override the entry point when the derived name does not match.
|
|
353
|
+
* database.loadExtension('./base64.dylib', 'sqlite3_base64_init');
|
|
288
354
|
* @since v22.13.0
|
|
289
355
|
* @param path The path to the shared library to load.
|
|
356
|
+
* @param entryPoint The name of the extension's entry-point function. When
|
|
357
|
+
* omitted, SQLite derives the entry point from the shared library's filename;
|
|
358
|
+
* pass this argument explicitly when the derived name does not match.
|
|
290
359
|
*/
|
|
291
|
-
loadExtension(path: string): void;
|
|
360
|
+
loadExtension(path: string, entryPoint?: string): void;
|
|
292
361
|
/**
|
|
293
362
|
* Enables or disables the `loadExtension` SQL function, and the `loadExtension()`
|
|
294
363
|
* method. When `allowExtension` is `false` when constructing, you cannot enable
|
|
@@ -330,18 +399,17 @@ declare module "node:sqlite" {
|
|
|
330
399
|
* @since v22.13.0
|
|
331
400
|
* @param name The name of the SQLite function to create.
|
|
332
401
|
* @param options Optional configuration settings for the function.
|
|
333
|
-
* @param
|
|
334
|
-
*
|
|
335
|
-
*
|
|
336
|
-
*
|
|
337
|
-
* The result defaults to `NULL` if the return value is `undefined`.
|
|
402
|
+
* @param fn The JavaScript function to call when the SQLite function is
|
|
403
|
+
* invoked. The return value of this function should be a valid SQLite data type:
|
|
404
|
+
* see [Type conversion between JavaScript and SQLite](https://nodejs.org/docs/latest-v24.x/api/sqlite.html#type-conversion-between-javascript-and-sqlite). The result defaults to
|
|
405
|
+
* `NULL` if the return value is `undefined`.
|
|
338
406
|
*/
|
|
339
407
|
function(
|
|
340
408
|
name: string,
|
|
341
409
|
options: FunctionOptions,
|
|
342
|
-
|
|
410
|
+
fn: (...args: SQLOutputValue[]) => SQLInputValue,
|
|
343
411
|
): void;
|
|
344
|
-
function(name: string,
|
|
412
|
+
function(name: string, fn: (...args: SQLOutputValue[]) => SQLInputValue): void;
|
|
345
413
|
/**
|
|
346
414
|
* Sets an authorizer callback that SQLite will invoke whenever it attempts to
|
|
347
415
|
* access data or modify the database schema through prepared statements.
|
|
@@ -411,20 +479,94 @@ declare module "node:sqlite" {
|
|
|
411
479
|
* @since v24.0.0
|
|
412
480
|
*/
|
|
413
481
|
readonly isTransaction: boolean;
|
|
482
|
+
/**
|
|
483
|
+
* An object for getting and setting SQLite database limits at runtime.
|
|
484
|
+
* Each property corresponds to an SQLite limit and can be read or written.
|
|
485
|
+
*
|
|
486
|
+
* ```js
|
|
487
|
+
* const db = new DatabaseSync(':memory:');
|
|
488
|
+
*
|
|
489
|
+
* // Read current limit
|
|
490
|
+
* console.log(db.limits.length);
|
|
491
|
+
*
|
|
492
|
+
* // Set a new limit
|
|
493
|
+
* db.limits.sqlLength = 100000;
|
|
494
|
+
*
|
|
495
|
+
* // Reset a limit to its compile-time maximum
|
|
496
|
+
* db.limits.sqlLength = Infinity;
|
|
497
|
+
* ```
|
|
498
|
+
*
|
|
499
|
+
* Available properties: `length`, `sqlLength`, `column`, `exprDepth`,
|
|
500
|
+
* `compoundSelect`, `vdbeOp`, `functionArg`, `attach`, `likePatternLength`,
|
|
501
|
+
* `variableNumber`, `triggerDepth`.
|
|
502
|
+
*
|
|
503
|
+
* Setting a property to `Infinity` resets the limit to its compile-time maximum value.
|
|
504
|
+
* @since v24.15.0
|
|
505
|
+
*/
|
|
506
|
+
readonly limits: DatabaseLimits;
|
|
414
507
|
/**
|
|
415
508
|
* Opens the database specified in the `path` argument of the `DatabaseSync`constructor. This method should only be used when the database is not opened via
|
|
416
509
|
* the constructor. An exception is thrown if the database is already open.
|
|
417
510
|
* @since v22.5.0
|
|
418
511
|
*/
|
|
419
512
|
open(): void;
|
|
513
|
+
/**
|
|
514
|
+
* Serializes the database into a binary representation, returned as a
|
|
515
|
+
* `Uint8Array`. This is useful for saving, cloning, or transferring an in-memory
|
|
516
|
+
* database. This method is a wrapper around [`sqlite3_serialize()`](https://sqlite.org/c3ref/serialize.html).
|
|
517
|
+
*
|
|
518
|
+
* ```js
|
|
519
|
+
* import { DatabaseSync } from 'node:sqlite';
|
|
520
|
+
*
|
|
521
|
+
* const db = new DatabaseSync(':memory:');
|
|
522
|
+
* db.exec('CREATE TABLE t(key INTEGER PRIMARY KEY, value TEXT)');
|
|
523
|
+
* db.exec("INSERT INTO t VALUES (1, 'hello')");
|
|
524
|
+
* const buffer = db.serialize();
|
|
525
|
+
* console.log(buffer.length); // Prints the byte length of the database
|
|
526
|
+
* ```
|
|
527
|
+
* @since v24.16.0
|
|
528
|
+
* @param dbName Name of the database to serialize. This can be `'main'`
|
|
529
|
+
* (the default primary database) or any other database that has been added with
|
|
530
|
+
* [`ATTACH DATABASE`](https://www.sqlite.org/lang_attach.html). **Default:** `'main'`.
|
|
531
|
+
* @returns A binary representation of the database.
|
|
532
|
+
*/
|
|
533
|
+
serialize(dbName?: string): NodeJS.NonSharedUint8Array;
|
|
534
|
+
/**
|
|
535
|
+
* Loads a serialized database into this connection, replacing the current
|
|
536
|
+
* database. The deserialized database is writable. Existing prepared statements
|
|
537
|
+
* are finalized before deserialization is attempted, even if the operation
|
|
538
|
+
* subsequently fails. This method is a wrapper around
|
|
539
|
+
* [`sqlite3_deserialize()`](https://sqlite.org/c3ref/deserialize.html).
|
|
540
|
+
*
|
|
541
|
+
* ```js
|
|
542
|
+
* import { DatabaseSync } from 'node:sqlite';
|
|
543
|
+
*
|
|
544
|
+
* const original = new DatabaseSync(':memory:');
|
|
545
|
+
* original.exec('CREATE TABLE t(key INTEGER PRIMARY KEY, value TEXT)');
|
|
546
|
+
* original.exec("INSERT INTO t VALUES (1, 'hello')");
|
|
547
|
+
* const buffer = original.serialize();
|
|
548
|
+
* original.close();
|
|
549
|
+
*
|
|
550
|
+
* const clone = new DatabaseSync(':memory:');
|
|
551
|
+
* clone.deserialize(buffer);
|
|
552
|
+
* console.log(clone.prepare('SELECT value FROM t').get());
|
|
553
|
+
* // Prints: { value: 'hello' }
|
|
554
|
+
* ```
|
|
555
|
+
* @since v24.16.0
|
|
556
|
+
* @param buffer A binary representation of a database, such as the
|
|
557
|
+
* output of `database.serialize()`.
|
|
558
|
+
* @param options Optional configuration for the deserialization.
|
|
559
|
+
*/
|
|
560
|
+
deserialize(buffer: Uint8Array, options?: DeserializeOptions): void;
|
|
420
561
|
/**
|
|
421
562
|
* Compiles a SQL statement into a [prepared statement](https://www.sqlite.org/c3ref/stmt.html). This method is a wrapper
|
|
422
563
|
* around [`sqlite3_prepare_v2()`](https://www.sqlite.org/c3ref/prepare.html).
|
|
423
564
|
* @since v22.5.0
|
|
424
565
|
* @param sql A SQL string to compile to a prepared statement.
|
|
566
|
+
* @param options Optional configuration for the prepared statement.
|
|
425
567
|
* @return The prepared statement.
|
|
426
568
|
*/
|
|
427
|
-
prepare(sql: string): StatementSync;
|
|
569
|
+
prepare(sql: string, options?: PrepareOptions): StatementSync;
|
|
428
570
|
/**
|
|
429
571
|
* Creates a new {@link SQLTagStore}, which is a Least Recently Used (LRU) cache
|
|
430
572
|
* for storing prepared statements. This allows for the efficient reuse of
|
|
@@ -21,6 +21,13 @@ declare module "stream/consumers" {
|
|
|
21
21
|
* @returns Fulfills with a `Buffer` containing the full contents of the stream.
|
|
22
22
|
*/
|
|
23
23
|
function buffer(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<NonSharedBuffer>;
|
|
24
|
+
/**
|
|
25
|
+
* @since v24.14.0
|
|
26
|
+
* @returns Fulfills with a `Uint8Array` containing the full contents of the stream.
|
|
27
|
+
*/
|
|
28
|
+
function bytes(
|
|
29
|
+
stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable<any>,
|
|
30
|
+
): Promise<NodeJS.NonSharedUint8Array>;
|
|
24
31
|
/**
|
|
25
32
|
* @since v16.7.0
|
|
26
33
|
* @returns Fulfills with the contents of the stream parsed as a
|
|
@@ -259,6 +259,25 @@ declare module "stream/web" {
|
|
|
259
259
|
prototype: ReadableStreamDefaultController;
|
|
260
260
|
new(): ReadableStreamDefaultController;
|
|
261
261
|
};
|
|
262
|
+
/**
|
|
263
|
+
* Runs the WHATWG `ReadableStreamTee` abstract operation on `stream`.
|
|
264
|
+
*
|
|
265
|
+
* This differs from `readableStream.tee()` only when `cloneForBranch2` is
|
|
266
|
+
* `true`. The `tee()` method always passes `false`, while other web platform
|
|
267
|
+
* specifications, such as Fetch body cloning, pass `true` so that the second
|
|
268
|
+
* branch receives cloned chunks and consumption of one branch cannot mutate chunks
|
|
269
|
+
* seen by the other.
|
|
270
|
+
* @since v24.19.0
|
|
271
|
+
* @experimental
|
|
272
|
+
* @param cloneForBranch2 When `true`, chunks enqueued into the second
|
|
273
|
+
* branch are cloned from chunks enqueued into the first branch. **Default:**
|
|
274
|
+
* `false`.
|
|
275
|
+
* @returns Two `ReadableStream` branches.
|
|
276
|
+
*/
|
|
277
|
+
function ReadableStreamTee<R>(
|
|
278
|
+
stream: ReadableStream<R>,
|
|
279
|
+
cloneForBranch2?: boolean,
|
|
280
|
+
): [ReadableStream<R>, ReadableStream<R>];
|
|
262
281
|
interface Transformer<I = any, O = any> {
|
|
263
282
|
flush?: TransformerFlushCallback<O>;
|
|
264
283
|
readableType?: undefined;
|
|
@@ -89,6 +89,7 @@ declare module "stream" {
|
|
|
89
89
|
streamReadable: Readable,
|
|
90
90
|
options?: {
|
|
91
91
|
strategy?: streamWeb.QueuingStrategy | undefined;
|
|
92
|
+
type?: "bytes" | undefined;
|
|
92
93
|
},
|
|
93
94
|
): streamWeb.ReadableStream;
|
|
94
95
|
/**
|
|
@@ -1122,7 +1123,7 @@ declare module "stream" {
|
|
|
1122
1123
|
* A utility method for creating a web `ReadableStream` and `WritableStream` from a `Duplex`.
|
|
1123
1124
|
* @since v17.0.0
|
|
1124
1125
|
*/
|
|
1125
|
-
static toWeb(streamDuplex: Duplex): {
|
|
1126
|
+
static toWeb(streamDuplex: Duplex, options?: { readableType?: "bytes" | undefined }): {
|
|
1126
1127
|
readable: streamWeb.ReadableStream;
|
|
1127
1128
|
writable: streamWeb.WritableStream;
|
|
1128
1129
|
};
|