// Type definitions for RxJS-Aggregates v2.2.28
// Project: http://rx.codeplex.com/
// Definitions by: Carl de Billy , Igor Oleinikov
// Definitions: https://github.com/borisyankov/DefinitelyTyped
///
declare module Rx {
export interface Observable {
finalValue(): Observable;
aggregate(accumulator: (acc: T, value: T) => T): Observable;
aggregate(seed: TAcc, accumulator: (acc: TAcc, value: T) => TAcc): Observable;
reduce(accumulator: (acc: T, value: T) => T): Observable;
reduce(accumulator: (acc: TAcc, value: T) => TAcc, seed: TAcc): Observable; // TS0.9.5: won't work https://typescript.codeplex.com/discussions/471751
any(predicate?: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable;
some(predicate?: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; // alias for any
isEmpty(): Observable;
all(predicate?: (value: T) => boolean, thisArg?: any): Observable;
every(predicate?: (value: T) => boolean, thisArg?: any): Observable; // alias for all
contains(value: T): Observable;
contains(value: TOther, comparer: (value1: T, value2: TOther) => boolean): Observable;
count(predicate?: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable;
sum(keySelector?: (value: T, index: number, source: Observable) => number, thisArg?: any): Observable;
minBy(keySelector: (item: T) => TKey, comparer: (value1: TKey, value2: TKey) => number): Observable;
minBy(keySelector: (item: T) => number): Observable;
min(comparer?: (value1: T, value2: T) => number): Observable;
maxBy(keySelector: (item: T) => TKey, comparer: (value1: TKey, value2: TKey) => number): Observable;
maxBy(keySelector: (item: T) => number): Observable;
max(comparer?: (value1: T, value2: T) => number): Observable;
average(keySelector?: (value: T, index: number, source: Observable) => number, thisArg?: any): Observable;
sequenceEqual(second: Observable, comparer: (value1: T, value2: TOther) => number): Observable;
sequenceEqual(second: IPromise, comparer: (value1: T, value2: TOther) => number): Observable;
sequenceEqual(second: Observable): Observable;
sequenceEqual(second: IPromise): Observable;
sequenceEqual(second: TOther[], comparer: (value1: T, value2: TOther) => number): Observable;
sequenceEqual(second: T[]): Observable;
elementAt(index: number): Observable;
elementAtOrDefault(index: number, defaultValue?: T): Observable;
single(predicate?: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable;
singleOrDefault(predicate?: (value: T, index: number, source: Observable) => boolean, defaultValue?: T, thisArg?: any): Observable;
first(predicate?: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable;
firstOrDefault(predicate?: (value: T, index: number, source: Observable) => boolean, defaultValue?: T, thisArg?: any): Observable;
last(predicate?: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable;
lastOrDefault(predicate?: (value: T, index: number, source: Observable) => boolean, defaultValue?: T, thisArg?: any): Observable;
find(predicate: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable;
findIndex(predicate: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable;
}
}
declare module "rx.aggregates" {
export = Rx;
}