@types/node 16.4.1 → 16.4.5
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 +2 -2
- node/assert/strict.d.ts +0 -1
- node/assert.d.ts +1352 -40
- node/async_hooks.d.ts +359 -90
- node/buffer.d.ts +1503 -78
- node/child_process.d.ts +1054 -233
- node/cluster.d.ts +320 -100
- node/console.d.ts +305 -32
- node/crypto.d.ts +3115 -739
- node/dgram.d.ts +446 -55
- node/diagnostics_channel.d.ts +85 -12
- node/dns/promises.d.ts +292 -36
- node/dns.d.ts +410 -97
- node/domain.d.ts +154 -10
- node/events.d.ts +377 -31
- node/fs/promises.d.ts +697 -273
- node/fs.d.ts +2257 -858
- node/http.d.ts +889 -81
- node/http2.d.ts +1520 -459
- node/https.d.ts +261 -11
- node/index.d.ts +25 -0
- node/inspector.d.ts +354 -661
- node/module.d.ts +49 -11
- node/net.d.ts +548 -140
- node/os.d.ts +236 -26
- node/package.json +7 -2
- node/path.d.ts +9 -5
- node/perf_hooks.d.ts +288 -90
- node/process.d.ts +1092 -153
- node/punycode.d.ts +65 -26
- node/querystring.d.ts +107 -8
- node/readline.d.ts +425 -79
- node/repl.d.ts +135 -110
- node/stream/promises.d.ts +15 -44
- node/stream.d.ts +927 -225
- node/string_decoder.d.ts +57 -1
- node/timers/promises.d.ts +97 -9
- node/timers.d.ts +29 -10
- node/tls.d.ts +444 -221
- node/trace_events.d.ts +107 -11
- node/tty.d.ts +163 -23
- node/url.d.ts +739 -29
- node/util.d.ts +1361 -73
- node/v8.d.ts +254 -78
- node/vm.d.ts +381 -33
- node/wasi.d.ts +107 -24
- node/worker_threads.d.ts +494 -131
- node/zlib.d.ts +215 -63
node/repl.d.ts
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `repl` module provides a Read-Eval-Print-Loop (REPL) implementation that
|
|
3
|
+
* is available both as a standalone program or includible in other applications.
|
|
4
|
+
* It can be accessed using:
|
|
5
|
+
*
|
|
6
|
+
* ```js
|
|
7
|
+
* const repl = require('repl');
|
|
8
|
+
* ```
|
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/repl.js)
|
|
10
|
+
*/
|
|
1
11
|
declare module 'repl' {
|
|
2
12
|
import { Interface, Completer, AsyncCompleter } from 'node:readline';
|
|
3
13
|
import { Context } from 'node:vm';
|
|
4
14
|
import { InspectOptions } from 'node:util';
|
|
5
|
-
|
|
6
15
|
interface ReplOptions {
|
|
7
16
|
/**
|
|
8
17
|
* The input prompt to display.
|
|
@@ -90,18 +99,16 @@ declare module 'repl' {
|
|
|
90
99
|
*/
|
|
91
100
|
breakEvalOnSigint?: boolean | undefined;
|
|
92
101
|
}
|
|
93
|
-
|
|
94
102
|
type REPLEval = (this: REPLServer, evalCmd: string, context: Context, file: string, cb: (err: Error | null, result: any) => void) => void;
|
|
95
103
|
type REPLWriter = (this: REPLServer, obj: any) => string;
|
|
96
|
-
|
|
97
104
|
/**
|
|
98
105
|
* This is the default "writer" value, if none is passed in the REPL options,
|
|
99
106
|
* and it can be overridden by custom print functions.
|
|
100
107
|
*/
|
|
101
|
-
const writer: REPLWriter & {
|
|
102
|
-
|
|
108
|
+
const writer: REPLWriter & {
|
|
109
|
+
options: InspectOptions;
|
|
110
|
+
};
|
|
103
111
|
type REPLCommandAction = (this: REPLServer, text: string) => void;
|
|
104
|
-
|
|
105
112
|
interface REPLCommand {
|
|
106
113
|
/**
|
|
107
114
|
* Help text to be displayed when `.help` is entered.
|
|
@@ -112,22 +119,19 @@ declare module 'repl' {
|
|
|
112
119
|
*/
|
|
113
120
|
action: REPLCommandAction;
|
|
114
121
|
}
|
|
115
|
-
|
|
116
122
|
/**
|
|
117
|
-
*
|
|
123
|
+
* Instances of `repl.REPLServer` are created using the {@link start} method
|
|
124
|
+
* or directly using the JavaScript `new` keyword.
|
|
118
125
|
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
* may be from `stdin` and `stdout`, respectively, or may be connected to any Node.js `stream`.
|
|
126
|
+
* ```js
|
|
127
|
+
* const repl = require('repl');
|
|
122
128
|
*
|
|
123
|
-
*
|
|
124
|
-
* line editing, multi-line inputs, ANSI-styled output, saving and restoring current REPL session
|
|
125
|
-
* state, error recovery, and customizable evaluation functions.
|
|
129
|
+
* const options = { useColors: true };
|
|
126
130
|
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
* @
|
|
131
|
+
* const firstInstance = repl.start(options);
|
|
132
|
+
* const secondInstance = new repl.REPLServer(options);
|
|
133
|
+
* ```
|
|
134
|
+
* @since v0.1.91
|
|
131
135
|
*/
|
|
132
136
|
class REPLServer extends Interface {
|
|
133
137
|
/**
|
|
@@ -228,7 +232,6 @@ declare module 'repl' {
|
|
|
228
232
|
* prefacing every repl statement with `'use strict'`.
|
|
229
233
|
*/
|
|
230
234
|
readonly replMode: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT;
|
|
231
|
-
|
|
232
235
|
/**
|
|
233
236
|
* NOTE: According to the documentation:
|
|
234
237
|
*
|
|
@@ -240,49 +243,76 @@ declare module 'repl' {
|
|
|
240
243
|
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_class_replserver
|
|
241
244
|
*/
|
|
242
245
|
private constructor();
|
|
243
|
-
|
|
244
246
|
/**
|
|
245
|
-
*
|
|
246
|
-
* by typing a `.` followed by the
|
|
247
|
+
* The `replServer.defineCommand()` method is used to add new `.`\-prefixed commands
|
|
248
|
+
* to the REPL instance. Such commands are invoked by typing a `.` followed by the`keyword`. The `cmd` is either a `Function` or an `Object` with the following
|
|
249
|
+
* properties:
|
|
247
250
|
*
|
|
248
|
-
*
|
|
249
|
-
*
|
|
251
|
+
* The following example shows two new commands added to the REPL instance:
|
|
252
|
+
*
|
|
253
|
+
* ```js
|
|
254
|
+
* const repl = require('repl');
|
|
255
|
+
*
|
|
256
|
+
* const replServer = repl.start({ prompt: '> ' });
|
|
257
|
+
* replServer.defineCommand('sayhello', {
|
|
258
|
+
* help: 'Say hello',
|
|
259
|
+
* action(name) {
|
|
260
|
+
* this.clearBufferedCommand();
|
|
261
|
+
* console.log(`Hello, ${name}!`);
|
|
262
|
+
* this.displayPrompt();
|
|
263
|
+
* }
|
|
264
|
+
* });
|
|
265
|
+
* replServer.defineCommand('saybye', function saybye() {
|
|
266
|
+
* console.log('Goodbye!');
|
|
267
|
+
* this.close();
|
|
268
|
+
* });
|
|
269
|
+
* ```
|
|
270
|
+
*
|
|
271
|
+
* The new commands can then be used from within the REPL instance:
|
|
250
272
|
*
|
|
251
|
-
*
|
|
273
|
+
* ```console
|
|
274
|
+
* > .sayhello Node.js User
|
|
275
|
+
* Hello, Node.js User!
|
|
276
|
+
* > .saybye
|
|
277
|
+
* Goodbye!
|
|
278
|
+
* ```
|
|
279
|
+
* @since v0.3.0
|
|
280
|
+
* @param keyword The command keyword (*without* a leading `.` character).
|
|
281
|
+
* @param cmd The function to invoke when the command is processed.
|
|
252
282
|
*/
|
|
253
283
|
defineCommand(keyword: string, cmd: REPLCommandAction | REPLCommand): void;
|
|
254
284
|
/**
|
|
255
|
-
*
|
|
256
|
-
* new line in the `output`
|
|
285
|
+
* The `replServer.displayPrompt()` method readies the REPL instance for input
|
|
286
|
+
* from the user, printing the configured `prompt` to a new line in the `output`and resuming the `input` to accept new input.
|
|
257
287
|
*
|
|
258
|
-
* When multi-line input is being entered, an ellipsis is printed rather than the
|
|
288
|
+
* When multi-line input is being entered, an ellipsis is printed rather than the
|
|
289
|
+
* 'prompt'.
|
|
259
290
|
*
|
|
260
|
-
*
|
|
261
|
-
* commands registered using the `replServer.defineCommand()` method.
|
|
291
|
+
* When `preserveCursor` is `true`, the cursor placement will not be reset to `0`.
|
|
262
292
|
*
|
|
263
|
-
*
|
|
293
|
+
* The `replServer.displayPrompt` method is primarily intended to be called from
|
|
294
|
+
* within the action function for commands registered using the`replServer.defineCommand()` method.
|
|
295
|
+
* @since v0.1.91
|
|
264
296
|
*/
|
|
265
297
|
displayPrompt(preserveCursor?: boolean): void;
|
|
266
298
|
/**
|
|
267
|
-
*
|
|
268
|
-
*
|
|
269
|
-
*
|
|
270
|
-
* commands registered using the `replServer.defineCommand()` method.
|
|
271
|
-
*
|
|
299
|
+
* The `replServer.clearBufferedCommand()` method clears any command that has been
|
|
300
|
+
* buffered but not yet executed. This method is primarily intended to be
|
|
301
|
+
* called from within the action function for commands registered using the`replServer.defineCommand()` method.
|
|
272
302
|
* @since v9.0.0
|
|
273
303
|
*/
|
|
274
304
|
clearBufferedCommand(): void;
|
|
275
|
-
|
|
276
305
|
/**
|
|
277
306
|
* Initializes a history log file for the REPL instance. When executing the
|
|
278
|
-
* Node.js binary and using the command
|
|
307
|
+
* Node.js binary and using the command-line REPL, a history file is initialized
|
|
279
308
|
* by default. However, this is not the case when creating a REPL
|
|
280
309
|
* programmatically. Use this method to initialize a history log file when working
|
|
281
310
|
* with REPL instances programmatically.
|
|
282
|
-
* @
|
|
311
|
+
* @since v11.10.0
|
|
312
|
+
* @param historyPath the path to the history file
|
|
313
|
+
* @param callback called when history writes are ready or upon error
|
|
283
314
|
*/
|
|
284
|
-
setupHistory(path: string,
|
|
285
|
-
|
|
315
|
+
setupHistory(path: string, callback: (err: Error | null, repl: this) => void): void;
|
|
286
316
|
/**
|
|
287
317
|
* events.EventEmitter
|
|
288
318
|
* 1. close - inherited from `readline.Interface`
|
|
@@ -295,93 +325,90 @@ declare module 'repl' {
|
|
|
295
325
|
* 8. exit
|
|
296
326
|
* 9. reset
|
|
297
327
|
*/
|
|
298
|
-
|
|
299
328
|
addListener(event: string, listener: (...args: any[]) => void): this;
|
|
300
|
-
addListener(event:
|
|
301
|
-
addListener(event:
|
|
302
|
-
addListener(event:
|
|
303
|
-
addListener(event:
|
|
304
|
-
addListener(event:
|
|
305
|
-
addListener(event:
|
|
306
|
-
addListener(event:
|
|
307
|
-
addListener(event:
|
|
308
|
-
addListener(event:
|
|
309
|
-
|
|
329
|
+
addListener(event: 'close', listener: () => void): this;
|
|
330
|
+
addListener(event: 'line', listener: (input: string) => void): this;
|
|
331
|
+
addListener(event: 'pause', listener: () => void): this;
|
|
332
|
+
addListener(event: 'resume', listener: () => void): this;
|
|
333
|
+
addListener(event: 'SIGCONT', listener: () => void): this;
|
|
334
|
+
addListener(event: 'SIGINT', listener: () => void): this;
|
|
335
|
+
addListener(event: 'SIGTSTP', listener: () => void): this;
|
|
336
|
+
addListener(event: 'exit', listener: () => void): this;
|
|
337
|
+
addListener(event: 'reset', listener: (context: Context) => void): this;
|
|
310
338
|
emit(event: string | symbol, ...args: any[]): boolean;
|
|
311
|
-
emit(event:
|
|
312
|
-
emit(event:
|
|
313
|
-
emit(event:
|
|
314
|
-
emit(event:
|
|
315
|
-
emit(event:
|
|
316
|
-
emit(event:
|
|
317
|
-
emit(event:
|
|
318
|
-
emit(event:
|
|
319
|
-
emit(event:
|
|
320
|
-
|
|
339
|
+
emit(event: 'close'): boolean;
|
|
340
|
+
emit(event: 'line', input: string): boolean;
|
|
341
|
+
emit(event: 'pause'): boolean;
|
|
342
|
+
emit(event: 'resume'): boolean;
|
|
343
|
+
emit(event: 'SIGCONT'): boolean;
|
|
344
|
+
emit(event: 'SIGINT'): boolean;
|
|
345
|
+
emit(event: 'SIGTSTP'): boolean;
|
|
346
|
+
emit(event: 'exit'): boolean;
|
|
347
|
+
emit(event: 'reset', context: Context): boolean;
|
|
321
348
|
on(event: string, listener: (...args: any[]) => void): this;
|
|
322
|
-
on(event:
|
|
323
|
-
on(event:
|
|
324
|
-
on(event:
|
|
325
|
-
on(event:
|
|
326
|
-
on(event:
|
|
327
|
-
on(event:
|
|
328
|
-
on(event:
|
|
329
|
-
on(event:
|
|
330
|
-
on(event:
|
|
331
|
-
|
|
349
|
+
on(event: 'close', listener: () => void): this;
|
|
350
|
+
on(event: 'line', listener: (input: string) => void): this;
|
|
351
|
+
on(event: 'pause', listener: () => void): this;
|
|
352
|
+
on(event: 'resume', listener: () => void): this;
|
|
353
|
+
on(event: 'SIGCONT', listener: () => void): this;
|
|
354
|
+
on(event: 'SIGINT', listener: () => void): this;
|
|
355
|
+
on(event: 'SIGTSTP', listener: () => void): this;
|
|
356
|
+
on(event: 'exit', listener: () => void): this;
|
|
357
|
+
on(event: 'reset', listener: (context: Context) => void): this;
|
|
332
358
|
once(event: string, listener: (...args: any[]) => void): this;
|
|
333
|
-
once(event:
|
|
334
|
-
once(event:
|
|
335
|
-
once(event:
|
|
336
|
-
once(event:
|
|
337
|
-
once(event:
|
|
338
|
-
once(event:
|
|
339
|
-
once(event:
|
|
340
|
-
once(event:
|
|
341
|
-
once(event:
|
|
342
|
-
|
|
359
|
+
once(event: 'close', listener: () => void): this;
|
|
360
|
+
once(event: 'line', listener: (input: string) => void): this;
|
|
361
|
+
once(event: 'pause', listener: () => void): this;
|
|
362
|
+
once(event: 'resume', listener: () => void): this;
|
|
363
|
+
once(event: 'SIGCONT', listener: () => void): this;
|
|
364
|
+
once(event: 'SIGINT', listener: () => void): this;
|
|
365
|
+
once(event: 'SIGTSTP', listener: () => void): this;
|
|
366
|
+
once(event: 'exit', listener: () => void): this;
|
|
367
|
+
once(event: 'reset', listener: (context: Context) => void): this;
|
|
343
368
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
344
|
-
prependListener(event:
|
|
345
|
-
prependListener(event:
|
|
346
|
-
prependListener(event:
|
|
347
|
-
prependListener(event:
|
|
348
|
-
prependListener(event:
|
|
349
|
-
prependListener(event:
|
|
350
|
-
prependListener(event:
|
|
351
|
-
prependListener(event:
|
|
352
|
-
prependListener(event:
|
|
353
|
-
|
|
369
|
+
prependListener(event: 'close', listener: () => void): this;
|
|
370
|
+
prependListener(event: 'line', listener: (input: string) => void): this;
|
|
371
|
+
prependListener(event: 'pause', listener: () => void): this;
|
|
372
|
+
prependListener(event: 'resume', listener: () => void): this;
|
|
373
|
+
prependListener(event: 'SIGCONT', listener: () => void): this;
|
|
374
|
+
prependListener(event: 'SIGINT', listener: () => void): this;
|
|
375
|
+
prependListener(event: 'SIGTSTP', listener: () => void): this;
|
|
376
|
+
prependListener(event: 'exit', listener: () => void): this;
|
|
377
|
+
prependListener(event: 'reset', listener: (context: Context) => void): this;
|
|
354
378
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
355
|
-
prependOnceListener(event:
|
|
356
|
-
prependOnceListener(event:
|
|
357
|
-
prependOnceListener(event:
|
|
358
|
-
prependOnceListener(event:
|
|
359
|
-
prependOnceListener(event:
|
|
360
|
-
prependOnceListener(event:
|
|
361
|
-
prependOnceListener(event:
|
|
362
|
-
prependOnceListener(event:
|
|
363
|
-
prependOnceListener(event:
|
|
379
|
+
prependOnceListener(event: 'close', listener: () => void): this;
|
|
380
|
+
prependOnceListener(event: 'line', listener: (input: string) => void): this;
|
|
381
|
+
prependOnceListener(event: 'pause', listener: () => void): this;
|
|
382
|
+
prependOnceListener(event: 'resume', listener: () => void): this;
|
|
383
|
+
prependOnceListener(event: 'SIGCONT', listener: () => void): this;
|
|
384
|
+
prependOnceListener(event: 'SIGINT', listener: () => void): this;
|
|
385
|
+
prependOnceListener(event: 'SIGTSTP', listener: () => void): this;
|
|
386
|
+
prependOnceListener(event: 'exit', listener: () => void): this;
|
|
387
|
+
prependOnceListener(event: 'reset', listener: (context: Context) => void): this;
|
|
364
388
|
}
|
|
365
|
-
|
|
366
389
|
/**
|
|
367
390
|
* A flag passed in the REPL options. Evaluates expressions in sloppy mode.
|
|
368
391
|
*/
|
|
369
392
|
const REPL_MODE_SLOPPY: unique symbol;
|
|
370
|
-
|
|
371
393
|
/**
|
|
372
394
|
* A flag passed in the REPL options. Evaluates expressions in strict mode.
|
|
373
395
|
* This is equivalent to prefacing every repl statement with `'use strict'`.
|
|
374
396
|
*/
|
|
375
397
|
const REPL_MODE_STRICT: unique symbol;
|
|
376
|
-
|
|
377
398
|
/**
|
|
378
|
-
*
|
|
399
|
+
* The `repl.start()` method creates and starts a {@link REPLServer} instance.
|
|
400
|
+
*
|
|
401
|
+
* If `options` is a string, then it specifies the input prompt:
|
|
402
|
+
*
|
|
403
|
+
* ```js
|
|
404
|
+
* const repl = require('repl');
|
|
379
405
|
*
|
|
380
|
-
*
|
|
381
|
-
*
|
|
406
|
+
* // a Unix style prompt
|
|
407
|
+
* repl.start('$ ');
|
|
408
|
+
* ```
|
|
409
|
+
* @since v0.1.91
|
|
382
410
|
*/
|
|
383
411
|
function start(options?: string | ReplOptions): REPLServer;
|
|
384
|
-
|
|
385
412
|
/**
|
|
386
413
|
* Indicates a recoverable error that a `REPLServer` can use to support multi-line input.
|
|
387
414
|
*
|
|
@@ -389,11 +416,9 @@ declare module 'repl' {
|
|
|
389
416
|
*/
|
|
390
417
|
class Recoverable extends SyntaxError {
|
|
391
418
|
err: Error;
|
|
392
|
-
|
|
393
419
|
constructor(err: Error);
|
|
394
420
|
}
|
|
395
421
|
}
|
|
396
|
-
|
|
397
422
|
declare module 'node:repl' {
|
|
398
423
|
export * from 'repl';
|
|
399
424
|
}
|
node/stream/promises.d.ts
CHANGED
|
@@ -1,71 +1,42 @@
|
|
|
1
|
-
declare module
|
|
2
|
-
import { FinishedOptions, PipelineSource, PipelineTransform,
|
|
3
|
-
PipelineDestination, PipelinePromise, PipelineOptions } from "node:stream";
|
|
4
|
-
|
|
1
|
+
declare module 'stream/promises' {
|
|
2
|
+
import { FinishedOptions, PipelineSource, PipelineTransform, PipelineDestination, PipelinePromise, PipelineOptions } from 'node:stream';
|
|
5
3
|
function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise<void>;
|
|
6
|
-
|
|
7
|
-
function pipeline<A extends PipelineSource<any>,
|
|
8
|
-
B extends PipelineDestination<A, any>>(
|
|
9
|
-
source: A,
|
|
10
|
-
destination: B,
|
|
11
|
-
options?: PipelineOptions
|
|
12
|
-
): PipelinePromise<B>;
|
|
13
|
-
function pipeline<A extends PipelineSource<any>,
|
|
14
|
-
T1 extends PipelineTransform<A, any>,
|
|
15
|
-
B extends PipelineDestination<T1, any>>(
|
|
4
|
+
function pipeline<A extends PipelineSource<any>, B extends PipelineDestination<A, any>>(source: A, destination: B, options?: PipelineOptions): PipelinePromise<B>;
|
|
5
|
+
function pipeline<A extends PipelineSource<any>, T1 extends PipelineTransform<A, any>, B extends PipelineDestination<T1, any>>(
|
|
16
6
|
source: A,
|
|
17
7
|
transform1: T1,
|
|
18
8
|
destination: B,
|
|
19
9
|
options?: PipelineOptions
|
|
20
10
|
): PipelinePromise<B>;
|
|
21
|
-
function pipeline<A extends PipelineSource<any>,
|
|
22
|
-
T1 extends PipelineTransform<A, any>,
|
|
23
|
-
T2 extends PipelineTransform<T1, any>,
|
|
24
|
-
B extends PipelineDestination<T2, any>>(
|
|
11
|
+
function pipeline<A extends PipelineSource<any>, T1 extends PipelineTransform<A, any>, T2 extends PipelineTransform<T1, any>, B extends PipelineDestination<T2, any>>(
|
|
25
12
|
source: A,
|
|
26
13
|
transform1: T1,
|
|
27
14
|
transform2: T2,
|
|
28
15
|
destination: B,
|
|
29
16
|
options?: PipelineOptions
|
|
30
17
|
): PipelinePromise<B>;
|
|
31
|
-
function pipeline<
|
|
18
|
+
function pipeline<
|
|
19
|
+
A extends PipelineSource<any>,
|
|
32
20
|
T1 extends PipelineTransform<A, any>,
|
|
33
21
|
T2 extends PipelineTransform<T1, any>,
|
|
34
22
|
T3 extends PipelineTransform<T2, any>,
|
|
35
|
-
B extends PipelineDestination<T3, any
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
transform3: T3,
|
|
40
|
-
destination: B,
|
|
41
|
-
options?: PipelineOptions
|
|
42
|
-
): PipelinePromise<B>;
|
|
43
|
-
function pipeline<A extends PipelineSource<any>,
|
|
23
|
+
B extends PipelineDestination<T3, any>
|
|
24
|
+
>(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, options?: PipelineOptions): PipelinePromise<B>;
|
|
25
|
+
function pipeline<
|
|
26
|
+
A extends PipelineSource<any>,
|
|
44
27
|
T1 extends PipelineTransform<A, any>,
|
|
45
28
|
T2 extends PipelineTransform<T1, any>,
|
|
46
29
|
T3 extends PipelineTransform<T2, any>,
|
|
47
30
|
T4 extends PipelineTransform<T3, any>,
|
|
48
|
-
B extends PipelineDestination<T4, any
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
transform2: T2,
|
|
52
|
-
transform3: T3,
|
|
53
|
-
transform4: T4,
|
|
54
|
-
destination: B,
|
|
55
|
-
options?: PipelineOptions
|
|
56
|
-
): PipelinePromise<B>;
|
|
57
|
-
|
|
58
|
-
function pipeline(
|
|
59
|
-
streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>,
|
|
60
|
-
options?: PipelineOptions
|
|
61
|
-
): Promise<void>;
|
|
31
|
+
B extends PipelineDestination<T4, any>
|
|
32
|
+
>(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, options?: PipelineOptions): PipelinePromise<B>;
|
|
33
|
+
function pipeline(streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>, options?: PipelineOptions): Promise<void>;
|
|
62
34
|
function pipeline(
|
|
63
35
|
stream1: NodeJS.ReadableStream,
|
|
64
36
|
stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream,
|
|
65
|
-
...streams: Array<NodeJS.ReadWriteStream | NodeJS.WritableStream | PipelineOptions
|
|
37
|
+
...streams: Array<NodeJS.ReadWriteStream | NodeJS.WritableStream | PipelineOptions>
|
|
66
38
|
): Promise<void>;
|
|
67
39
|
}
|
|
68
|
-
|
|
69
40
|
declare module 'node:stream/promises' {
|
|
70
41
|
export * from 'stream/promises';
|
|
71
42
|
}
|