1 | import type { Duplex, Transform, Sink } from 'it-stream-types';
|
2 | interface SourceFn<A = any> {
|
3 | (): A;
|
4 | }
|
5 | type PipeSource<A = any> = Iterable<A> | AsyncIterable<A> | SourceFn<A> | Duplex<A, any, any>;
|
6 | type PipeTransform<A = any, B = any> = Transform<A, B> | Duplex<B, A>;
|
7 | type PipeSink<A = any, B = any> = Sink<A, B> | Duplex<any, A, B>;
|
8 | type PipeOutput<A> = A extends Sink<any> ? ReturnType<A> : A extends Duplex<any, any, any> ? ReturnType<A['sink']> : never;
|
9 | type SingleItemPipeOutput<A> = A extends Iterable<any> ? A : A extends AsyncIterable<any> ? A : A extends SourceFn ? ReturnType<A> : A extends Duplex<any, any, any> ? A['source'] : PipeOutput<A>;
|
10 | type PipeFnInput<A> = A extends Iterable<any> ? A : A extends AsyncIterable<any> ? A : A extends SourceFn ? ReturnType<A> : A extends Transform<any, any> ? ReturnType<A> : A extends Duplex<any, any, any> ? A['source'] : never;
|
11 | export declare function pipe<A extends PipeSource>(source: A): SingleItemPipeOutput<A>;
|
12 | export declare function pipe<A extends PipeSource, B extends PipeSink<PipeFnInput<A>>>(source: A, sink: B): PipeOutput<B>;
|
13 | export declare function pipe<A extends PipeSource, B extends PipeTransform<PipeFnInput<A>>, C extends PipeSink<PipeFnInput<B>>>(source: A, transform1: B, sink: C): PipeOutput<C>;
|
14 | export declare function pipe<A extends PipeSource, B extends PipeTransform<PipeFnInput<A>>, C extends PipeTransform<PipeFnInput<B>>, D extends PipeSink<PipeFnInput<C>>>(source: A, transform1: B, transform2: C, sink: D): PipeOutput<D>;
|
15 | export declare function pipe<A extends PipeSource, B extends PipeTransform<PipeFnInput<A>>, C extends PipeTransform<PipeFnInput<B>>, D extends PipeTransform<PipeFnInput<C>>, E extends PipeSink<PipeFnInput<D>>>(source: A, transform1: B, transform2: C, transform3: D, sink: E): PipeOutput<E>;
|
16 | export declare function pipe<A extends PipeSource, B extends PipeTransform<PipeFnInput<A>>, C extends PipeTransform<PipeFnInput<B>>, D extends PipeTransform<PipeFnInput<C>>, E extends PipeTransform<PipeFnInput<D>>, F extends PipeSink<PipeFnInput<E>>>(source: A, transform1: B, transform2: C, transform3: D, transform4: E, sink: F): PipeOutput<F>;
|
17 | export declare function pipe<A extends PipeSource, B extends PipeTransform<PipeFnInput<A>>, C extends PipeTransform<PipeFnInput<B>>, D extends PipeTransform<PipeFnInput<C>>, E extends PipeTransform<PipeFnInput<D>>, F extends PipeTransform<PipeFnInput<E>>, G extends PipeSink<PipeFnInput<F>>>(source: A, transform1: B, transform2: C, transform3: D, transform4: E, transform5: F, sink: G): PipeOutput<G>;
|
18 | export declare function pipe<A extends PipeSource, B extends PipeTransform<PipeFnInput<A>>, C extends PipeTransform<PipeFnInput<B>>, D extends PipeTransform<PipeFnInput<C>>, E extends PipeTransform<PipeFnInput<D>>, F extends PipeTransform<PipeFnInput<E>>, G extends PipeTransform<PipeFnInput<F>>, H extends PipeSink<PipeFnInput<G>>>(source: A, transform1: B, transform2: C, transform3: D, transform4: E, transform5: F, transform6: G, sink: H): PipeOutput<H>;
|
19 | export declare function pipe<A extends PipeSource, B extends PipeTransform<PipeFnInput<A>>, C extends PipeTransform<PipeFnInput<B>>, D extends PipeTransform<PipeFnInput<C>>, E extends PipeTransform<PipeFnInput<D>>, F extends PipeTransform<PipeFnInput<E>>, G extends PipeTransform<PipeFnInput<F>>, H extends PipeTransform<PipeFnInput<G>>, I extends PipeSink<PipeFnInput<H>>>(source: A, transform1: B, transform2: C, transform3: D, transform4: E, transform5: F, transform6: G, transform7: H, sink: I): PipeOutput<I>;
|
20 | export declare function pipe<A extends PipeSource, B extends PipeTransform<PipeFnInput<A>>, C extends PipeTransform<PipeFnInput<B>>, D extends PipeTransform<PipeFnInput<C>>, E extends PipeTransform<PipeFnInput<D>>, F extends PipeTransform<PipeFnInput<E>>, G extends PipeTransform<PipeFnInput<F>>, H extends PipeTransform<PipeFnInput<G>>, I extends PipeTransform<PipeFnInput<H>>, J extends PipeSink<PipeFnInput<I>>>(source: A, transform1: B, transform2: C, transform3: D, transform4: E, transform5: F, transform6: G, transform7: H, transform8: I, sink: J): PipeOutput<J>;
|
21 | export declare function pipe<A extends PipeSource, B extends PipeTransform<PipeFnInput<A>>, C extends PipeTransform<PipeFnInput<B>>, D extends PipeTransform<PipeFnInput<C>>, E extends PipeTransform<PipeFnInput<D>>, F extends PipeTransform<PipeFnInput<E>>, G extends PipeTransform<PipeFnInput<F>>, H extends PipeTransform<PipeFnInput<G>>, I extends PipeTransform<PipeFnInput<H>>, J extends PipeTransform<PipeFnInput<I>>, K extends PipeSink<PipeFnInput<J>>>(source: A, transform1: B, transform2: C, transform3: D, transform4: E, transform5: F, transform6: G, transform7: H, transform8: I, transform9: J, sink: K): PipeOutput<K>;
|
22 | export declare function pipe<A extends PipeSource, B extends PipeTransform<PipeFnInput<A>>, C extends PipeTransform<PipeFnInput<B>>, D extends PipeTransform<PipeFnInput<C>>, E extends PipeTransform<PipeFnInput<D>>, F extends PipeTransform<PipeFnInput<E>>, G extends PipeTransform<PipeFnInput<F>>, H extends PipeTransform<PipeFnInput<G>>, I extends PipeTransform<PipeFnInput<H>>, J extends PipeTransform<PipeFnInput<I>>, K extends PipeTransform<PipeFnInput<J>>, L extends PipeSink<PipeFnInput<K>>>(source: A, transform1: B, transform2: C, transform3: D, transform4: E, transform5: F, transform6: G, transform7: H, transform8: I, transform9: J, transform10: K, sink: L): PipeOutput<L>;
|
23 | export declare const rawPipe: (...fns: any) => any;
|
24 | export {};
|
25 |
|
\ | No newline at end of file |