UNPKG

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