blob: 7d7145bd7300fab14f827fc1ae25584c86af187f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
import { Readable } from 'readable-stream';
/**
* Converts a Web-API stream into Node stream.Readable class
* Node stream readable: https://nodejs.org/api/stream.html#stream_readable_streams
* Web API readable-stream: https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream
* Node readable stream: https://nodejs.org/api/stream.html#stream_readable_streams
*/
export declare class ReadableWebToNodeStream extends Readable {
bytesRead: number;
released: boolean;
/**
* Default web API stream reader
* https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader
*/
private reader;
private pendingRead;
/**
*
* @param stream ReadableStream: https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream
*/
constructor(stream: ReadableStream);
/**
* Implementation of readable._read(size).
* When readable._read() is called, if data is available from the resource,
* the implementation should begin pushing that data into the read queue
* https://nodejs.org/api/stream.html#stream_readable_read_size_1
*/
_read(): Promise<void>;
/**
* If there is no unresolved read call to Web-API ReadableStream immediately returns;
* otherwise will wait until the read is resolved.
*/
waitForReadToComplete(): Promise<void>;
/**
* Close wrapper
*/
close(): Promise<void>;
private syncAndRelease;
}
|