UNPKG

2.58 kBTypeScriptView Raw
1/// <reference types="rx-lite" />
2
3declare namespace Rx {
4 interface Pattern1<T1> {
5 and<T2>(other: Observable<T2>): Pattern2<T1, T2>;
6 thenDo<TR>(selector: (item1: T1) => TR): Plan<TR>;
7 }
8 interface Pattern2<T1, T2> {
9 and<T3>(other: Observable<T3>): Pattern3<T1, T2, T3>;
10 thenDo<TR>(selector: (item1: T1, item2: T2) => TR): Plan<TR>;
11 }
12 interface Pattern3<T1, T2, T3> {
13 and<T4>(other: Observable<T4>): Pattern4<T1, T2, T3, T4>;
14 thenDo<TR>(selector: (item1: T1, item2: T2, item3: T3) => TR): Plan<TR>;
15 }
16 interface Pattern4<T1, T2, T3, T4> {
17 and<T5>(other: Observable<T5>): Pattern5<T1, T2, T3, T4, T5>;
18 thenDo<TR>(selector: (item1: T1, item2: T2, item3: T3, item4: T4) => TR): Plan<TR>;
19 }
20 interface Pattern5<T1, T2, T3, T4, T5> {
21 and<T6>(other: Observable<T6>): Pattern6<T1, T2, T3, T4, T5, T6>;
22 thenDo<TR>(selector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5) => TR): Plan<TR>;
23 }
24 interface Pattern6<T1, T2, T3, T4, T5, T6> {
25 and<T7>(other: Observable<T7>): Pattern7<T1, T2, T3, T4, T5, T6, T7>;
26 thenDo<TR>(selector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5, item6: T6) => TR): Plan<TR>;
27 }
28 interface Pattern7<T1, T2, T3, T4, T5, T6, T7> {
29 and<T8>(other: Observable<T8>): Pattern8<T1, T2, T3, T4, T5, T6, T7, T8>;
30 thenDo<TR>(
31 selector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5, item6: T6, item7: T7) => TR,
32 ): Plan<TR>;
33 }
34 interface Pattern8<T1, T2, T3, T4, T5, T6, T7, T8> {
35 and<T9>(other: Observable<T9>): Pattern9<T1, T2, T3, T4, T5, T6, T7, T8, T9>;
36 thenDo<TR>(
37 selector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5, item6: T6, item7: T7, item8: T8) => TR,
38 ): Plan<TR>;
39 }
40 interface Pattern9<T1, T2, T3, T4, T5, T6, T7, T8, T9> {
41 thenDo<TR>(
42 selector: (
43 item1: T1,
44 item2: T2,
45 item3: T3,
46 item4: T4,
47 item5: T5,
48 item6: T6,
49 item7: T7,
50 item8: T8,
51 item9: T9,
52 ) => TR,
53 ): Plan<TR>;
54 }
55
56 interface Plan<T> {}
57
58 interface Observable<T> {
59 and<T2>(other: Observable<T2>): Pattern2<T, T2>;
60 thenDo<TR>(selector: (item1: T) => TR): Plan<TR>;
61 }
62
63 interface ObservableStatic {
64 when<TR>(plan: Plan<TR>): Observable<TR>;
65 }
66}
67
68declare module "rx-lite-joinpatterns" {
69 export = Rx;
70}
71
\No newline at end of file