-
Notifications
You must be signed in to change notification settings - Fork 1
/
rx.aggregates.d.ts
61 lines (49 loc) · 3.79 KB
/
rx.aggregates.d.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Type definitions for RxJS-Aggregates v2.2.28
// Project: http://rx.codeplex.com/
// Definitions by: Carl de Billy <http://carl.debilly.net/>, Igor Oleinikov <https://github.com/Igorbek>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
///<reference path="rx.d.ts" />
declare module Rx {
export interface Observable<T> {
finalValue(): Observable<T>;
aggregate(accumulator: (acc: T, value: T) => T): Observable<T>;
aggregate<TAcc>(seed: TAcc, accumulator: (acc: TAcc, value: T) => TAcc): Observable<TAcc>;
reduce(accumulator: (acc: T, value: T) => T): Observable<T>;
reduce<TAcc>(accumulator: (acc: TAcc, value: T) => TAcc, seed: TAcc): Observable<TAcc>; // TS0.9.5: won't work https://typescript.codeplex.com/discussions/471751
any(predicate?: (value: T, index: number, source: Observable<T>) => boolean, thisArg?: any): Observable<boolean>;
some(predicate?: (value: T, index: number, source: Observable<T>) => boolean, thisArg?: any): Observable<boolean>; // alias for any
isEmpty(): Observable<boolean>;
all(predicate?: (value: T) => boolean, thisArg?: any): Observable<boolean>;
every(predicate?: (value: T) => boolean, thisArg?: any): Observable<boolean>; // alias for all
contains(value: T): Observable<boolean>;
contains<TOther>(value: TOther, comparer: (value1: T, value2: TOther) => boolean): Observable<boolean>;
count(predicate?: (value: T, index: number, source: Observable<T>) => boolean, thisArg?: any): Observable<number>;
sum(keySelector?: (value: T, index: number, source: Observable<T>) => number, thisArg?: any): Observable<number>;
minBy<TKey>(keySelector: (item: T) => TKey, comparer: (value1: TKey, value2: TKey) => number): Observable<T>;
minBy(keySelector: (item: T) => number): Observable<T>;
min(comparer?: (value1: T, value2: T) => number): Observable<T>;
maxBy<TKey>(keySelector: (item: T) => TKey, comparer: (value1: TKey, value2: TKey) => number): Observable<T>;
maxBy(keySelector: (item: T) => number): Observable<T>;
max(comparer?: (value1: T, value2: T) => number): Observable<number>;
average(keySelector?: (value: T, index: number, source: Observable<T>) => number, thisArg?: any): Observable<number>;
sequenceEqual<TOther>(second: Observable<TOther>, comparer: (value1: T, value2: TOther) => number): Observable<boolean>;
sequenceEqual<TOther>(second: IPromise<TOther>, comparer: (value1: T, value2: TOther) => number): Observable<boolean>;
sequenceEqual(second: Observable<T>): Observable<boolean>;
sequenceEqual(second: IPromise<T>): Observable<boolean>;
sequenceEqual<TOther>(second: TOther[], comparer: (value1: T, value2: TOther) => number): Observable<boolean>;
sequenceEqual(second: T[]): Observable<boolean>;
elementAt(index: number): Observable<T>;
elementAtOrDefault(index: number, defaultValue?: T): Observable<T>;
single(predicate?: (value: T, index: number, source: Observable<T>) => boolean, thisArg?: any): Observable<T>;
singleOrDefault(predicate?: (value: T, index: number, source: Observable<T>) => boolean, defaultValue?: T, thisArg?: any): Observable<T>;
first(predicate?: (value: T, index: number, source: Observable<T>) => boolean, thisArg?: any): Observable<T>;
firstOrDefault(predicate?: (value: T, index: number, source: Observable<T>) => boolean, defaultValue?: T, thisArg?: any): Observable<T>;
last(predicate?: (value: T, index: number, source: Observable<T>) => boolean, thisArg?: any): Observable<T>;
lastOrDefault(predicate?: (value: T, index: number, source: Observable<T>) => boolean, defaultValue?: T, thisArg?: any): Observable<T>;
find(predicate: (value: T, index: number, source: Observable<T>) => boolean, thisArg?: any): Observable<T>;
findIndex(predicate: (value: T, index: number, source: Observable<T>) => boolean, thisArg?: any): Observable<number>;
}
}
declare module "rx.aggregates" {
export = Rx;
}