-
Notifications
You must be signed in to change notification settings - Fork 0
/
FlowSource.ts
38 lines (36 loc) · 1.06 KB
/
FlowSource.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
26
27
28
29
30
31
32
33
34
35
36
37
38
import { type ReadableLike } from "web-streams-extensions";
// export type FlowSource<T> =
// | Iterable<T>
// | AsyncIterable<T>
// | (() => Iterable<T>)
// | (() => AsyncIterable<T>)
// export type FlowIterableSource<T> =
// | (() => Iterable<T>)
// | (() => AsyncIterable<T>)
export type FlowSource<T> =
| Promise<T>
| Iterable<T>
| AsyncIterable<T>
| (() => Iterable<T>)
| (() => AsyncIterable<T>)
| ReadableLike<T>
| ReadableStream<T>;
// | ((w: WritableStream<T>) => void)
// | sflow<T>;
// | (T extends Uint8Array ? XMLHttpRequestBodyInit : never);
// export interface FlowSource<T> extends Promise<T>
// , Iterable<T>
// , AsyncIterable<T>
// , ArrayLike<T>
// , FlowIterableGeneratorSource<T>
// , ReadableLike<T>
// // , Omit<ReadableStream<T>, Symbol.asyncIterator>
// // | (T extends Uint8Array ? XMLHttpRequestBodyInit : never);
// { }
// export interface IterableFlowSource<T> extends Iterable<T>,
// AsyncIterable<T> {
// }
// export interface FlowIterableGeneratorSource<T> {
// (): Iterable<T>,
// (): AsyncIterable<T>,
// }