@types/node 22.15.21 → 22.18.10
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 v22.18/README.md +15 -0
- node/assert.d.ts → node v22.18/assert.d.ts +19 -0
- node/buffer.d.ts → node v22.18/buffer.d.ts +6 -2
- node/child_process.d.ts → node v22.18/child_process.d.ts +41 -131
- node/cluster.d.ts → node v22.18/cluster.d.ts +3 -4
- node/compatibility/disposable.d.ts → node v22.18/compatibility/disposable.d.ts +0 -2
- node/compatibility/indexable.d.ts → node v22.18/compatibility/indexable.d.ts +0 -3
- node/compatibility/iterators.d.ts → node v22.18/compatibility/iterators.d.ts +0 -1
- node/crypto.d.ts → node v22.18/crypto.d.ts +52 -36
- node/diagnostics_channel.d.ts → node v22.18/diagnostics_channel.d.ts +17 -12
- node/dns/promises.d.ts → node v22.18/dns/promises.d.ts +36 -9
- node/dns.d.ts → node v22.18/dns.d.ts +74 -21
- node/events.d.ts → node v22.18/events.d.ts +80 -35
- node/fs/promises.d.ts → node v22.18/fs/promises.d.ts +44 -39
- node/fs.d.ts → node v22.18/fs.d.ts +67 -56
- node v22.18/globals.d.ts +172 -0
- node/http.d.ts → node v22.18/http.d.ts +71 -10
- node/http2.d.ts → node v22.18/http2.d.ts +85 -5
- node/https.d.ts → node v22.18/https.d.ts +14 -12
- node/index.d.ts → node v22.18/index.d.ts +7 -3
- node/inspector.d.ts → node v22.18/inspector.generated.d.ts +219 -10
- node/module.d.ts → node v22.18/module.d.ts +136 -17
- node/net.d.ts → node v22.18/net.d.ts +5 -5
- node/os.d.ts → node v22.18/os.d.ts +13 -3
- node/package.json → node v22.18/package.json +3 -83
- node/perf_hooks.d.ts → node v22.18/perf_hooks.d.ts +8 -10
- node/process.d.ts → node v22.18/process.d.ts +10 -23
- node/readline/promises.d.ts → node v22.18/readline/promises.d.ts +1 -2
- node/repl.d.ts → node v22.18/repl.d.ts +3 -5
- node/sqlite.d.ts → node v22.18/sqlite.d.ts +207 -0
- node/stream/web.d.ts → node v22.18/stream/web.d.ts +8 -0
- node/stream.d.ts → node v22.18/stream.d.ts +34 -32
- node v22.18/test.d.ts +2162 -0
- node/tls.d.ts → node v22.18/tls.d.ts +2 -2
- node/ts5.6/index.d.ts → node v22.18/ts5.6/index.d.ts +7 -3
- node/url.d.ts → node v22.18/url.d.ts +12 -3
- node/util.d.ts → node v22.18/util.d.ts +20 -5
- node/v8.d.ts → node v22.18/v8.d.ts +62 -32
- node/vm.d.ts → node v22.18/vm.d.ts +62 -54
- node v22.18/web-globals/abortcontroller.d.ts +34 -0
- node v22.18/web-globals/domexception.d.ts +68 -0
- node v22.18/web-globals/events.d.ts +97 -0
- node v22.18/web-globals/fetch.d.ts +46 -0
- node v22.18/web-globals/navigator.d.ts +22 -0
- node v22.18/web-globals/storage.d.ts +24 -0
- node/worker_threads.d.ts → node v22.18/worker_threads.d.ts +105 -74
- node/zlib.d.ts → node v22.18/zlib.d.ts +8 -2
- node/README.md +0 -15
- node/dom-events.d.ts +0 -124
- node/globals.d.ts +0 -371
- node/test.d.ts +0 -2280
- {node → node v22.18}/LICENSE +0 -0
- {node → node v22.18}/assert/strict.d.ts +0 -0
- node/async_hooks.d.ts → node v22.18/async_hooks.d.ts +1 -1
- {node → node v22.18}/buffer.buffer.d.ts +0 -0
- {node → node v22.18}/compatibility/index.d.ts +0 -0
- {node → node v22.18}/console.d.ts +0 -0
- {node → node v22.18}/constants.d.ts +0 -0
- {node → node v22.18}/dgram.d.ts +0 -0
- {node → node v22.18}/domain.d.ts +0 -0
- {node → node v22.18}/globals.typedarray.d.ts +0 -0
- {node → node v22.18}/path.d.ts +0 -0
- {node → node v22.18}/punycode.d.ts +0 -0
- {node → node v22.18}/querystring.d.ts +0 -0
- {node → node v22.18}/readline.d.ts +0 -0
- {node → node v22.18}/sea.d.ts +0 -0
- {node → node v22.18}/stream/consumers.d.ts +0 -0
- {node → node v22.18}/stream/promises.d.ts +0 -0
- {node → node v22.18}/string_decoder.d.ts +0 -0
- {node → node v22.18}/timers/promises.d.ts +0 -0
- {node → node v22.18}/timers.d.ts +0 -0
- {node → node v22.18}/trace_events.d.ts +0 -0
- {node → node v22.18}/ts5.6/buffer.buffer.d.ts +0 -0
- {node → node v22.18}/ts5.6/globals.typedarray.d.ts +0 -0
- {node → node v22.18}/tty.d.ts +0 -0
- {node → node v22.18}/wasi.d.ts +0 -0
|
@@ -89,6 +89,41 @@ declare module "node:sqlite" {
|
|
|
89
89
|
* @default false
|
|
90
90
|
*/
|
|
91
91
|
allowExtension?: boolean | undefined;
|
|
92
|
+
/**
|
|
93
|
+
* The [busy timeout](https://sqlite.org/c3ref/busy_timeout.html) in milliseconds. This is the maximum amount of
|
|
94
|
+
* time that SQLite will wait for a database lock to be released before
|
|
95
|
+
* returning an error.
|
|
96
|
+
* @since v22.16.0
|
|
97
|
+
* @default 0
|
|
98
|
+
*/
|
|
99
|
+
timeout?: number | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* If `true`, integer fields are read as JavaScript `BigInt` values. If `false`,
|
|
102
|
+
* integer fields are read as JavaScript numbers.
|
|
103
|
+
* @since v22.18.0
|
|
104
|
+
* @default false
|
|
105
|
+
*/
|
|
106
|
+
readBigInts?: boolean | undefined;
|
|
107
|
+
/**
|
|
108
|
+
* If `true`, query results are returned as arrays instead of objects.
|
|
109
|
+
* @since v22.18.0
|
|
110
|
+
* @default false
|
|
111
|
+
*/
|
|
112
|
+
returnArrays?: boolean | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* If `true`, allows binding named parameters without the prefix
|
|
115
|
+
* character (e.g., `foo` instead of `:foo`).
|
|
116
|
+
* @since v22.18.0
|
|
117
|
+
* @default true
|
|
118
|
+
*/
|
|
119
|
+
allowBareNamedParameters?: boolean | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* If `true`, unknown named parameters are ignored when binding.
|
|
122
|
+
* If `false`, an exception is thrown for unknown named parameters.
|
|
123
|
+
* @since v22.18.0
|
|
124
|
+
* @default false
|
|
125
|
+
*/
|
|
126
|
+
allowUnknownNamedParameters?: boolean | undefined;
|
|
92
127
|
}
|
|
93
128
|
interface CreateSessionOptions {
|
|
94
129
|
/**
|
|
@@ -166,6 +201,31 @@ declare module "node:sqlite" {
|
|
|
166
201
|
*/
|
|
167
202
|
varargs?: boolean | undefined;
|
|
168
203
|
}
|
|
204
|
+
interface AggregateOptions<T extends SQLInputValue = SQLInputValue> extends FunctionOptions {
|
|
205
|
+
/**
|
|
206
|
+
* The identity value for the aggregation function. This value is used when the aggregation
|
|
207
|
+
* function is initialized. When a `Function` is passed the identity will be its return value.
|
|
208
|
+
*/
|
|
209
|
+
start: T | (() => T);
|
|
210
|
+
/**
|
|
211
|
+
* The function to call for each row in the aggregation. The
|
|
212
|
+
* function receives the current state and the row value. The return value of
|
|
213
|
+
* this function should be the new state.
|
|
214
|
+
*/
|
|
215
|
+
step: (accumulator: T, ...args: SQLOutputValue[]) => T;
|
|
216
|
+
/**
|
|
217
|
+
* The function to call to get the result of the
|
|
218
|
+
* aggregation. The function receives the final state and should return the
|
|
219
|
+
* result of the aggregation.
|
|
220
|
+
*/
|
|
221
|
+
result?: ((accumulator: T) => SQLInputValue) | undefined;
|
|
222
|
+
/**
|
|
223
|
+
* When this function is provided, the `aggregate` method will work as a window function.
|
|
224
|
+
* The function receives the current state and the dropped row value. The return value of this function should be the
|
|
225
|
+
* new state.
|
|
226
|
+
*/
|
|
227
|
+
inverse?: ((accumulator: T, ...args: SQLOutputValue[]) => T) | undefined;
|
|
228
|
+
}
|
|
169
229
|
/**
|
|
170
230
|
* This class represents a single [connection](https://www.sqlite.org/c3ref/sqlite3.html) to a SQLite database. All APIs
|
|
171
231
|
* exposed by this class execute synchronously.
|
|
@@ -181,6 +241,38 @@ declare module "node:sqlite" {
|
|
|
181
241
|
* @param options Configuration options for the database connection.
|
|
182
242
|
*/
|
|
183
243
|
constructor(path: string | Buffer | URL, options?: DatabaseSyncOptions);
|
|
244
|
+
/**
|
|
245
|
+
* Registers a new aggregate function with the SQLite database. This method is a wrapper around
|
|
246
|
+
* [`sqlite3_create_window_function()`](https://www.sqlite.org/c3ref/create_function.html).
|
|
247
|
+
*
|
|
248
|
+
* When used as a window function, the `result` function will be called multiple times.
|
|
249
|
+
*
|
|
250
|
+
* ```js
|
|
251
|
+
* import { DatabaseSync } from 'node:sqlite';
|
|
252
|
+
*
|
|
253
|
+
* const db = new DatabaseSync(':memory:');
|
|
254
|
+
* db.exec(`
|
|
255
|
+
* CREATE TABLE t3(x, y);
|
|
256
|
+
* INSERT INTO t3 VALUES ('a', 4),
|
|
257
|
+
* ('b', 5),
|
|
258
|
+
* ('c', 3),
|
|
259
|
+
* ('d', 8),
|
|
260
|
+
* ('e', 1);
|
|
261
|
+
* `);
|
|
262
|
+
*
|
|
263
|
+
* db.aggregate('sumint', {
|
|
264
|
+
* start: 0,
|
|
265
|
+
* step: (acc, value) => acc + value,
|
|
266
|
+
* });
|
|
267
|
+
*
|
|
268
|
+
* db.prepare('SELECT sumint(y) as total FROM t3').get(); // { total: 21 }
|
|
269
|
+
* ```
|
|
270
|
+
* @since v22.16.0
|
|
271
|
+
* @param name The name of the SQLite function to create.
|
|
272
|
+
* @param options Function configuration settings.
|
|
273
|
+
*/
|
|
274
|
+
aggregate(name: string, options: AggregateOptions): void;
|
|
275
|
+
aggregate<T extends SQLInputValue>(name: string, options: AggregateOptions<T>): void;
|
|
184
276
|
/**
|
|
185
277
|
* Closes the database connection. An exception is thrown if the database is not
|
|
186
278
|
* open. This method is a wrapper around [`sqlite3_close_v2()`](https://www.sqlite.org/c3ref/close.html).
|
|
@@ -203,6 +295,15 @@ declare module "node:sqlite" {
|
|
|
203
295
|
* @param allow Whether to allow loading extensions.
|
|
204
296
|
*/
|
|
205
297
|
enableLoadExtension(allow: boolean): void;
|
|
298
|
+
/**
|
|
299
|
+
* This method is a wrapper around [`sqlite3_db_filename()`](https://sqlite.org/c3ref/db_filename.html)
|
|
300
|
+
* @since v22.16.0
|
|
301
|
+
* @param dbName Name of the database. This can be `'main'` (the default primary database) or any other
|
|
302
|
+
* database that has been added with [`ATTACH DATABASE`](https://www.sqlite.org/lang_attach.html) **Default:** `'main'`.
|
|
303
|
+
* @returns The location of the database file. When using an in-memory database,
|
|
304
|
+
* this method returns null.
|
|
305
|
+
*/
|
|
306
|
+
location(dbName?: string): string | null;
|
|
206
307
|
/**
|
|
207
308
|
* This method allows one or more SQL statements to be executed without returning
|
|
208
309
|
* any results. This method is useful when executing SQL statements read from a
|
|
@@ -234,6 +335,12 @@ declare module "node:sqlite" {
|
|
|
234
335
|
* @since v22.15.0
|
|
235
336
|
*/
|
|
236
337
|
readonly isOpen: boolean;
|
|
338
|
+
/**
|
|
339
|
+
* Whether the database is currently within a transaction. This method
|
|
340
|
+
* is a wrapper around [`sqlite3_get_autocommit()`](https://sqlite.org/c3ref/get_autocommit.html).
|
|
341
|
+
* @since v22.16.0
|
|
342
|
+
*/
|
|
343
|
+
readonly isTransaction: boolean;
|
|
237
344
|
/**
|
|
238
345
|
* 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
|
|
239
346
|
* the constructor. An exception is thrown if the database is already open.
|
|
@@ -322,6 +429,38 @@ declare module "node:sqlite" {
|
|
|
322
429
|
*/
|
|
323
430
|
close(): void;
|
|
324
431
|
}
|
|
432
|
+
interface StatementColumnMetadata {
|
|
433
|
+
/**
|
|
434
|
+
* The unaliased name of the column in the origin
|
|
435
|
+
* table, or `null` if the column is the result of an expression or subquery.
|
|
436
|
+
* This property is the result of [`sqlite3_column_origin_name()`](https://www.sqlite.org/c3ref/column_database_name.html).
|
|
437
|
+
*/
|
|
438
|
+
column: string | null;
|
|
439
|
+
/**
|
|
440
|
+
* The unaliased name of the origin database, or
|
|
441
|
+
* `null` if the column is the result of an expression or subquery. This
|
|
442
|
+
* property is the result of [`sqlite3_column_database_name()`](https://www.sqlite.org/c3ref/column_database_name.html).
|
|
443
|
+
*/
|
|
444
|
+
database: string | null;
|
|
445
|
+
/**
|
|
446
|
+
* The name assigned to the column in the result set of a
|
|
447
|
+
* `SELECT` statement. This property is the result of
|
|
448
|
+
* [`sqlite3_column_name()`](https://www.sqlite.org/c3ref/column_name.html).
|
|
449
|
+
*/
|
|
450
|
+
name: string;
|
|
451
|
+
/**
|
|
452
|
+
* The unaliased name of the origin table, or `null` if
|
|
453
|
+
* the column is the result of an expression or subquery. This property is the
|
|
454
|
+
* result of [`sqlite3_column_table_name()`](https://www.sqlite.org/c3ref/column_database_name.html).
|
|
455
|
+
*/
|
|
456
|
+
table: string | null;
|
|
457
|
+
/**
|
|
458
|
+
* The declared data type of the column, or `null` if the
|
|
459
|
+
* column is the result of an expression or subquery. This property is the
|
|
460
|
+
* result of [`sqlite3_column_decltype()`](https://www.sqlite.org/c3ref/column_decltype.html).
|
|
461
|
+
*/
|
|
462
|
+
type: string | null;
|
|
463
|
+
}
|
|
325
464
|
interface StatementResultingChanges {
|
|
326
465
|
/**
|
|
327
466
|
* The number of rows modified, inserted, or deleted by the most recently completed `INSERT`, `UPDATE`, or `DELETE` statement.
|
|
@@ -366,6 +505,14 @@ declare module "node:sqlite" {
|
|
|
366
505
|
namedParameters: Record<string, SQLInputValue>,
|
|
367
506
|
...anonymousParameters: SQLInputValue[]
|
|
368
507
|
): Record<string, SQLOutputValue>[];
|
|
508
|
+
/**
|
|
509
|
+
* This method is used to retrieve information about the columns returned by the
|
|
510
|
+
* prepared statement.
|
|
511
|
+
* @since v22.16.0
|
|
512
|
+
* @returns An array of objects. Each object corresponds to a column
|
|
513
|
+
* in the prepared statement, and contains the following properties:
|
|
514
|
+
*/
|
|
515
|
+
columns(): StatementColumnMetadata[];
|
|
369
516
|
/**
|
|
370
517
|
* The source SQL text of the prepared statement with parameter
|
|
371
518
|
* placeholders replaced by the values that were used during the most recent
|
|
@@ -465,6 +612,66 @@ declare module "node:sqlite" {
|
|
|
465
612
|
*/
|
|
466
613
|
readonly sourceSQL: string;
|
|
467
614
|
}
|
|
615
|
+
interface BackupOptions {
|
|
616
|
+
/**
|
|
617
|
+
* Name of the source database. This can be `'main'` (the default primary database) or any other
|
|
618
|
+
* database that have been added with [`ATTACH DATABASE`](https://www.sqlite.org/lang_attach.html)
|
|
619
|
+
* @default 'main'
|
|
620
|
+
*/
|
|
621
|
+
source?: string | undefined;
|
|
622
|
+
/**
|
|
623
|
+
* Name of the target database. This can be `'main'` (the default primary database) or any other
|
|
624
|
+
* database that have been added with [`ATTACH DATABASE`](https://www.sqlite.org/lang_attach.html)
|
|
625
|
+
* @default 'main'
|
|
626
|
+
*/
|
|
627
|
+
target?: string | undefined;
|
|
628
|
+
/**
|
|
629
|
+
* Number of pages to be transmitted in each batch of the backup.
|
|
630
|
+
* @default 100
|
|
631
|
+
*/
|
|
632
|
+
rate?: number | undefined;
|
|
633
|
+
/**
|
|
634
|
+
* Callback function that will be called with the number of pages copied and the total number of
|
|
635
|
+
* pages.
|
|
636
|
+
*/
|
|
637
|
+
progress?: ((progressInfo: BackupProgressInfo) => void) | undefined;
|
|
638
|
+
}
|
|
639
|
+
interface BackupProgressInfo {
|
|
640
|
+
totalPages: number;
|
|
641
|
+
remainingPages: number;
|
|
642
|
+
}
|
|
643
|
+
/**
|
|
644
|
+
* This method makes a database backup. This method abstracts the
|
|
645
|
+
* [`sqlite3_backup_init()`](https://www.sqlite.org/c3ref/backup_finish.html#sqlite3backupinit),
|
|
646
|
+
* [`sqlite3_backup_step()`](https://www.sqlite.org/c3ref/backup_finish.html#sqlite3backupstep)
|
|
647
|
+
* and [`sqlite3_backup_finish()`](https://www.sqlite.org/c3ref/backup_finish.html#sqlite3backupfinish) functions.
|
|
648
|
+
*
|
|
649
|
+
* The backed-up database can be used normally during the backup process. Mutations coming from the same connection - same
|
|
650
|
+
* `DatabaseSync` - object will be reflected in the backup right away. However, mutations from other connections will cause
|
|
651
|
+
* the backup process to restart.
|
|
652
|
+
*
|
|
653
|
+
* ```js
|
|
654
|
+
* import { backup, DatabaseSync } from 'node:sqlite';
|
|
655
|
+
*
|
|
656
|
+
* const sourceDb = new DatabaseSync('source.db');
|
|
657
|
+
* const totalPagesTransferred = await backup(sourceDb, 'backup.db', {
|
|
658
|
+
* rate: 1, // Copy one page at a time.
|
|
659
|
+
* progress: ({ totalPages, remainingPages }) => {
|
|
660
|
+
* console.log('Backup in progress', { totalPages, remainingPages });
|
|
661
|
+
* },
|
|
662
|
+
* });
|
|
663
|
+
*
|
|
664
|
+
* console.log('Backup completed', totalPagesTransferred);
|
|
665
|
+
* ```
|
|
666
|
+
* @since v22.16.0
|
|
667
|
+
* @param sourceDb The database to backup. The source database must be open.
|
|
668
|
+
* @param path The path where the backup will be created. If the file already exists,
|
|
669
|
+
* the contents will be overwritten.
|
|
670
|
+
* @param options Optional configuration for the backup. The
|
|
671
|
+
* following properties are supported:
|
|
672
|
+
* @returns A promise that resolves when the backup is completed and rejects if an error occurs.
|
|
673
|
+
*/
|
|
674
|
+
function backup(sourceDb: DatabaseSync, path: string | Buffer | URL, options?: BackupOptions): Promise<void>;
|
|
468
675
|
/**
|
|
469
676
|
* @since v22.13.0
|
|
470
677
|
*/
|
|
@@ -6,6 +6,8 @@ type _CountQueuingStrategy = typeof globalThis extends { onmessage: any } ? {}
|
|
|
6
6
|
: import("stream/web").CountQueuingStrategy;
|
|
7
7
|
type _DecompressionStream = typeof globalThis extends { onmessage: any; ReportingObserver: any } ? {}
|
|
8
8
|
: import("stream/web").DecompressionStream;
|
|
9
|
+
type _QueuingStrategy<T = any> = typeof globalThis extends { onmessage: any } ? {}
|
|
10
|
+
: import("stream/web").QueuingStrategy<T>;
|
|
9
11
|
type _ReadableByteStreamController = typeof globalThis extends { onmessage: any } ? {}
|
|
10
12
|
: import("stream/web").ReadableByteStreamController;
|
|
11
13
|
type _ReadableStream<R = any> = typeof globalThis extends { onmessage: any } ? {}
|
|
@@ -143,6 +145,9 @@ declare module "stream/web" {
|
|
|
143
145
|
interface TransformerTransformCallback<I, O> {
|
|
144
146
|
(chunk: I, controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;
|
|
145
147
|
}
|
|
148
|
+
interface TransformerCancelCallback {
|
|
149
|
+
(reason: any): void | PromiseLike<void>;
|
|
150
|
+
}
|
|
146
151
|
interface UnderlyingByteSource {
|
|
147
152
|
autoAllocateChunkSize?: number;
|
|
148
153
|
cancel?: ReadableStreamErrorCallback;
|
|
@@ -261,6 +266,7 @@ declare module "stream/web" {
|
|
|
261
266
|
readableType?: undefined;
|
|
262
267
|
start?: TransformerStartCallback<O>;
|
|
263
268
|
transform?: TransformerTransformCallback<I, O>;
|
|
269
|
+
cancel?: TransformerCancelCallback;
|
|
264
270
|
writableType?: undefined;
|
|
265
271
|
}
|
|
266
272
|
interface TransformStream<I = any, O = any> {
|
|
@@ -483,6 +489,8 @@ declare module "stream/web" {
|
|
|
483
489
|
}
|
|
484
490
|
: typeof import("stream/web").DecompressionStream;
|
|
485
491
|
|
|
492
|
+
interface QueuingStrategy<T = any> extends _QueuingStrategy<T> {}
|
|
493
|
+
|
|
486
494
|
interface ReadableByteStreamController extends _ReadableByteStreamController {}
|
|
487
495
|
/**
|
|
488
496
|
* `ReadableByteStreamController` class is a global reference for `import { ReadableByteStreamController } from 'node:stream/web'`.
|
|
@@ -45,22 +45,22 @@ declare module "stream" {
|
|
|
45
45
|
emitClose?: boolean | undefined;
|
|
46
46
|
highWaterMark?: number | undefined;
|
|
47
47
|
objectMode?: boolean | undefined;
|
|
48
|
-
construct
|
|
49
|
-
destroy
|
|
48
|
+
construct?: ((this: T, callback: (error?: Error | null) => void) => void) | undefined;
|
|
49
|
+
destroy?: ((this: T, error: Error | null, callback: (error?: Error | null) => void) => void) | undefined;
|
|
50
50
|
autoDestroy?: boolean | undefined;
|
|
51
51
|
}
|
|
52
52
|
interface ReadableOptions<T extends Readable = Readable> extends StreamOptions<T> {
|
|
53
53
|
encoding?: BufferEncoding | undefined;
|
|
54
|
-
read
|
|
54
|
+
read?: ((this: T, size: number) => void) | undefined;
|
|
55
55
|
}
|
|
56
56
|
interface ArrayOptions {
|
|
57
57
|
/**
|
|
58
58
|
* The maximum concurrent invocations of `fn` to call on the stream at once.
|
|
59
59
|
* @default 1
|
|
60
60
|
*/
|
|
61
|
-
concurrency?: number;
|
|
61
|
+
concurrency?: number | undefined;
|
|
62
62
|
/** Allows destroying the stream if the signal is aborted. */
|
|
63
|
-
signal?: AbortSignal;
|
|
63
|
+
signal?: AbortSignal | undefined;
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
66
|
* @since v0.9.4
|
|
@@ -76,7 +76,6 @@ declare module "stream" {
|
|
|
76
76
|
/**
|
|
77
77
|
* A utility method for creating a `Readable` from a web `ReadableStream`.
|
|
78
78
|
* @since v17.0.0
|
|
79
|
-
* @experimental
|
|
80
79
|
*/
|
|
81
80
|
static fromWeb(
|
|
82
81
|
readableStream: streamWeb.ReadableStream,
|
|
@@ -85,7 +84,6 @@ declare module "stream" {
|
|
|
85
84
|
/**
|
|
86
85
|
* A utility method for creating a web `ReadableStream` from a `Readable`.
|
|
87
86
|
* @since v17.0.0
|
|
88
|
-
* @experimental
|
|
89
87
|
*/
|
|
90
88
|
static toWeb(
|
|
91
89
|
streamReadable: Readable,
|
|
@@ -101,7 +99,6 @@ declare module "stream" {
|
|
|
101
99
|
/**
|
|
102
100
|
* Returns whether the stream was destroyed or errored before emitting `'end'`.
|
|
103
101
|
* @since v16.8.0
|
|
104
|
-
* @experimental
|
|
105
102
|
*/
|
|
106
103
|
readonly readableAborted: boolean;
|
|
107
104
|
/**
|
|
@@ -113,7 +110,6 @@ declare module "stream" {
|
|
|
113
110
|
/**
|
|
114
111
|
* Returns whether `'data'` has been emitted.
|
|
115
112
|
* @since v16.7.0, v14.18.0
|
|
116
|
-
* @experimental
|
|
117
113
|
*/
|
|
118
114
|
readonly readableDidRead: boolean;
|
|
119
115
|
/**
|
|
@@ -696,21 +692,25 @@ declare module "stream" {
|
|
|
696
692
|
interface WritableOptions<T extends Writable = Writable> extends StreamOptions<T> {
|
|
697
693
|
decodeStrings?: boolean | undefined;
|
|
698
694
|
defaultEncoding?: BufferEncoding | undefined;
|
|
699
|
-
write
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
695
|
+
write?:
|
|
696
|
+
| ((
|
|
697
|
+
this: T,
|
|
698
|
+
chunk: any,
|
|
699
|
+
encoding: BufferEncoding,
|
|
700
|
+
callback: (error?: Error | null) => void,
|
|
701
|
+
) => void)
|
|
702
|
+
| undefined;
|
|
703
|
+
writev?:
|
|
704
|
+
| ((
|
|
705
|
+
this: T,
|
|
706
|
+
chunks: Array<{
|
|
707
|
+
chunk: any;
|
|
708
|
+
encoding: BufferEncoding;
|
|
709
|
+
}>,
|
|
710
|
+
callback: (error?: Error | null) => void,
|
|
711
|
+
) => void)
|
|
712
|
+
| undefined;
|
|
713
|
+
final?: ((this: T, callback: (error?: Error | null) => void) => void) | undefined;
|
|
714
714
|
}
|
|
715
715
|
/**
|
|
716
716
|
* @since v0.9.4
|
|
@@ -719,7 +719,6 @@ declare module "stream" {
|
|
|
719
719
|
/**
|
|
720
720
|
* A utility method for creating a `Writable` from a web `WritableStream`.
|
|
721
721
|
* @since v17.0.0
|
|
722
|
-
* @experimental
|
|
723
722
|
*/
|
|
724
723
|
static fromWeb(
|
|
725
724
|
writableStream: streamWeb.WritableStream,
|
|
@@ -728,7 +727,6 @@ declare module "stream" {
|
|
|
728
727
|
/**
|
|
729
728
|
* A utility method for creating a web `WritableStream` from a `Writable`.
|
|
730
729
|
* @since v17.0.0
|
|
731
|
-
* @experimental
|
|
732
730
|
*/
|
|
733
731
|
static toWeb(streamWritable: Writable): streamWeb.WritableStream;
|
|
734
732
|
/**
|
|
@@ -737,6 +735,11 @@ declare module "stream" {
|
|
|
737
735
|
* @since v11.4.0
|
|
738
736
|
*/
|
|
739
737
|
readonly writable: boolean;
|
|
738
|
+
/**
|
|
739
|
+
* Returns whether the stream was destroyed or errored before emitting `'finish'`.
|
|
740
|
+
* @since v18.0.0, v16.17.0
|
|
741
|
+
*/
|
|
742
|
+
readonly writableAborted: boolean;
|
|
740
743
|
/**
|
|
741
744
|
* Is `true` after `writable.end()` has been called. This property
|
|
742
745
|
* does not indicate whether the data has been flushed, for this use `writable.writableFinished` instead.
|
|
@@ -1084,7 +1087,6 @@ declare module "stream" {
|
|
|
1084
1087
|
/**
|
|
1085
1088
|
* A utility method for creating a web `ReadableStream` and `WritableStream` from a `Duplex`.
|
|
1086
1089
|
* @since v17.0.0
|
|
1087
|
-
* @experimental
|
|
1088
1090
|
*/
|
|
1089
1091
|
static toWeb(streamDuplex: Duplex): {
|
|
1090
1092
|
readable: streamWeb.ReadableStream;
|
|
@@ -1093,7 +1095,6 @@ declare module "stream" {
|
|
|
1093
1095
|
/**
|
|
1094
1096
|
* A utility method for creating a `Duplex` from a web `ReadableStream` and `WritableStream`.
|
|
1095
1097
|
* @since v17.0.0
|
|
1096
|
-
* @experimental
|
|
1097
1098
|
*/
|
|
1098
1099
|
static fromWeb(
|
|
1099
1100
|
duplexStream: {
|
|
@@ -1227,8 +1228,10 @@ declare module "stream" {
|
|
|
1227
1228
|
function duplexPair(options?: DuplexOptions): [Duplex, Duplex];
|
|
1228
1229
|
type TransformCallback = (error?: Error | null, data?: any) => void;
|
|
1229
1230
|
interface TransformOptions<T extends Transform = Transform> extends DuplexOptions<T> {
|
|
1230
|
-
transform
|
|
1231
|
-
|
|
1231
|
+
transform?:
|
|
1232
|
+
| ((this: T, chunk: any, encoding: BufferEncoding, callback: TransformCallback) => void)
|
|
1233
|
+
| undefined;
|
|
1234
|
+
flush?: ((this: T, callback: TransformCallback) => void) | undefined;
|
|
1232
1235
|
}
|
|
1233
1236
|
/**
|
|
1234
1237
|
* Transform streams are `Duplex` streams where the output is in some way
|
|
@@ -1635,6 +1638,7 @@ declare module "stream" {
|
|
|
1635
1638
|
...streams: Array<NodeJS.ReadWriteStream | NodeJS.WritableStream | PipelineOptions>
|
|
1636
1639
|
): Promise<void>;
|
|
1637
1640
|
}
|
|
1641
|
+
// TODO: this interface never existed; remove in next major
|
|
1638
1642
|
interface Pipe {
|
|
1639
1643
|
close(): void;
|
|
1640
1644
|
hasRef(): boolean;
|
|
@@ -1644,13 +1648,11 @@ declare module "stream" {
|
|
|
1644
1648
|
/**
|
|
1645
1649
|
* Returns whether the stream has encountered an error.
|
|
1646
1650
|
* @since v17.3.0, v16.14.0
|
|
1647
|
-
* @experimental
|
|
1648
1651
|
*/
|
|
1649
1652
|
function isErrored(stream: Readable | Writable | NodeJS.ReadableStream | NodeJS.WritableStream): boolean;
|
|
1650
1653
|
/**
|
|
1651
1654
|
* Returns whether the stream is readable.
|
|
1652
1655
|
* @since v17.4.0, v16.14.0
|
|
1653
|
-
* @experimental
|
|
1654
1656
|
*/
|
|
1655
1657
|
function isReadable(stream: Readable | NodeJS.ReadableStream): boolean;
|
|
1656
1658
|
}
|