UNPKG

3.51 kBTypeScriptView Raw
1// Type definitions for rx-lite-coincidence 4.0
2// Project: https://github.com/Reactive-Extensions/RxJS
3// Definitions by: Carl de Billy <http://carl.debilly.net/>, 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 Observable<T> {
10 join<TRight, TDurationLeft, TDurationRight, TResult>(
11 right: Observable<TRight>,
12 leftDurationSelector: (leftItem: T) => Observable<TDurationLeft>,
13 rightDurationSelector: (rightItem: TRight) => Observable<TDurationRight>,
14 resultSelector: (leftItem: T, rightItem: TRight) => TResult): Observable<TResult>;
15
16 groupJoin<TRight, TDurationLeft, TDurationRight, TResult>(
17 right: Observable<TRight>,
18 leftDurationSelector: (leftItem: T) => Observable<TDurationLeft>,
19 rightDurationSelector: (rightItem: TRight) => Observable<TDurationRight>,
20 resultSelector: (leftItem: T, rightItem: Observable<TRight>) => TResult): Observable<TResult>;
21
22 window<TWindowOpening>(windowOpenings: Observable<TWindowOpening>): Observable<Observable<T>>;
23 window<TWindowClosing>(windowClosingSelector: () => Observable<TWindowClosing>): Observable<Observable<T>>;
24 window<TWindowOpening, TWindowClosing>(windowOpenings: Observable<TWindowOpening>, windowClosingSelector: () => Observable<TWindowClosing>): Observable<Observable<T>>;
25
26 buffer<TBufferOpening>(bufferOpenings: Observable<TBufferOpening>): Observable<T[]>;
27 buffer<TBufferClosing>(bufferClosingSelector: () => Observable<TBufferClosing>): Observable<T[]>;
28 buffer<TBufferOpening, TBufferClosing>(bufferOpenings: Observable<TBufferOpening>, bufferClosingSelector: () => Observable<TBufferClosing>): Observable<T[]>;
29
30 /**
31 * Returns a new observable that triggers on the second and subsequent triggerings of the input observable.
32 * The Nth triggering of the input observable passes the arguments from the N-1th and Nth triggering as a pair.
33 * The argument passed to the N-1th triggering is held in hidden internal state until the Nth triggering occurs.
34 * @returns An observable that triggers on successive pairs of observations from the input observable as an array.
35 */
36 pairwise(): Observable<T[]>;
37
38 /**
39 * Returns two observables which partition the observations of the source by the given function.
40 * The first will trigger observations for those values for which the predicate returns true.
41 * The second will trigger observations for those values where the predicate returns false.
42 * The predicate is executed once for each subscribed observer.
43 * Both also propagate all error observations arising from the source and each completes
44 * when the source completes.
45 * @param predicate
46 * The function to determine which output Observable will trigger a particular observation.
47 * @returns
48 * An array of observables. The first triggers when the predicate returns true,
49 * and the second triggers when the predicate returns false.
50 */
51 partition(predicate: (value: T, index: number, source: Observable<T>) => boolean, thisArg?: any): Array<Observable<T>>;
52 }
53}
54
55declare module "rx-lite-coincidence" {
56 export = Rx;
57}
58
\No newline at end of file