-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.d.ts
25 lines (24 loc) · 1.09 KB
/
index.d.ts
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
type AsyncOrNotIterableOrIterator<T> = Iterable<T> | Iterator<T> | AsyncIterable<T> | AsyncIterator<T>
/** A ReadableStream and AsyncIterable of Responses obtained by fetching the Request or urls in `requests`.
* @param requests Any sort of (async or not) iterable or iterator of urls (as strings) or `Request` objects.
* Use Requests when you need to specify headers and/or the method is not GET.
* @param strategy You should adjust `highWaterMark` based on expected latency and file size,
* but keep in mind that Web browsers generally don't do more than 6 concurrent fetches.
* @example
* with client-zip :
* ```js
* const input = [
* 'file1.png',
* 'file2.png',
* new Request('file3.txt', { headers: { Authorization: "It's me !" } })
* ]
* const zipResponse = downloadZip(new DownloadStream(input))
* ```
*/
export class DownloadStream extends ReadableStream<Response> implements AsyncIterable<Response> {
constructor(
requests: AsyncOrNotIterableOrIterator<RequestInfo>,
strategy?: QueuingStrategy<Response>
)
[Symbol.asyncIterator](): AsyncIterator<Response>
}