// Type definitions for RxJS-Experimental v2.2.28 // Project: https://github.com/Reactive-Extensions/RxJS/ // Definitions by: Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped /// declare module Rx { interface Observable { /** * Returns an observable sequence that is the result of invoking the selector on the source sequence, without sharing subscriptions. * This operator allows for a fluent style of writing queries that use the same sequence multiple times. * * @param selector Selector function which can use the source sequence as many times as needed, without sharing subscriptions to the source sequence. * @returns An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ let(selector: (source: Observable) => Observable): Observable; /** * Returns an observable sequence that is the result of invoking the selector on the source sequence, without sharing subscriptions. * This operator allows for a fluent style of writing queries that use the same sequence multiple times. * * @param selector Selector function which can use the source sequence as many times as needed, without sharing subscriptions to the source sequence. * @returns An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ letBind(selector: (source: Observable) => Observable): Observable; /** * Repeats source as long as condition holds emulating a do while loop. * @param condition The condition which determines if the source will be repeated. * @returns An observable sequence which is repeated as long as the condition holds. */ doWhile(condition: () => boolean): Observable; /** * Expands an observable sequence by recursively invoking selector. * * @param selector Selector function to invoke for each produced element, resulting in another sequence to which the selector will be invoked recursively again. * @param [scheduler] Scheduler on which to perform the expansion. If not provided, this defaults to the current thread scheduler. * @returns An observable sequence containing all the elements produced by the recursive expansion. */ expand(selector: (item: T) => Observable, scheduler?: IScheduler): Observable; /** * Runs two observable sequences in parallel and combines their last elemenets. * * @param second Second observable sequence or promise. * @param resultSelector Result selector function to invoke with the last elements of both sequences. * @returns An observable sequence with the result of calling the selector function with the last elements of both input sequences. */ forkJoin(second: Observable, resultSelector: (left: T, right: TSecond) => TResult): Observable; forkJoin(second: IPromise, resultSelector: (left: T, right: TSecond) => TResult): Observable; /** * Comonadic bind operator. * @param selector A transform function to apply to each element. * @param [scheduler] Scheduler used to execute the operation. If not specified, defaults to the ImmediateScheduler. * @returns An observable sequence which results from the comonadic bind operation. */ manySelect(selector: (item: Observable, index: number, source: Observable) => TResult, scheduler?: IScheduler): Observable; } interface ObservableStatic { /** * Determines whether an observable collection contains values. There is an alias for this method called 'ifThen' for browsers (condition: () => boolean, thenSource: Observable, elseSource: Observable): Observable; if(condition: () => boolean, thenSource: Observable, elseSource: IPromise): Observable; if(condition: () => boolean, thenSource: IPromise, elseSource: Observable): Observable; if(condition: () => boolean, thenSource: IPromise, elseSource: IPromise): Observable; /** * Determines whether an observable collection contains values. There is an alias for this method called 'ifThen' for browsers (condition: () => boolean, thenSource: Observable, scheduler?: IScheduler): Observable; if(condition: () => boolean, thenSource: IPromise, scheduler?: IScheduler): Observable; /** * Determines whether an observable collection contains values. There is an alias for this method called 'ifThen' for browsers (condition: () => boolean, thenSource: Observable, elseSource: Observable): Observable; ifThen(condition: () => boolean, thenSource: Observable, elseSource: IPromise): Observable; ifThen(condition: () => boolean, thenSource: IPromise, elseSource: Observable): Observable; ifThen(condition: () => boolean, thenSource: IPromise, elseSource: IPromise): Observable; /** * Determines whether an observable collection contains values. There is an alias for this method called 'ifThen' for browsers (condition: () => boolean, thenSource: Observable, scheduler?: IScheduler): Observable; ifThen(condition: () => boolean, thenSource: IPromise, scheduler?: IScheduler): Observable; /** * Concatenates the observable sequences obtained by running the specified result selector for each element in source. * There is an alias for this method called 'forIn' for browsers (sources: T[], resultSelector: (item: T) => Observable): Observable; /** * Concatenates the observable sequences obtained by running the specified result selector for each element in source. * There is an alias for this method called 'forIn' for browsers (sources: T[], resultSelector: (item: T) => Observable): Observable; /** * Repeats source as long as condition holds emulating a while loop. * There is an alias for this method called 'whileDo' for browsers (condition: () => boolean, source: Observable): Observable; while(condition: () => boolean, source: IPromise): Observable; /** * Repeats source as long as condition holds emulating a while loop. * There is an alias for this method called 'whileDo' for browsers (condition: () => boolean, source: Observable): Observable; whileDo(condition: () => boolean, source: IPromise): Observable; /** * Uses selector to determine which source in sources to use. * There is an alias 'switchCase' for browsers (selector: () => string, sources: { [key: string]: Observable; }, elseSource: Observable): Observable; case(selector: () => string, sources: { [key: string]: IPromise; }, elseSource: Observable): Observable; case(selector: () => string, sources: { [key: string]: Observable; }, elseSource: IPromise): Observable; case(selector: () => string, sources: { [key: string]: IPromise; }, elseSource: IPromise): Observable; /** * Uses selector to determine which source in sources to use. * There is an alias 'switchCase' for browsers (selector: () => string, sources: { [key: string]: Observable; }, scheduler?: IScheduler): Observable; case(selector: () => string, sources: { [key: string]: IPromise; }, scheduler?: IScheduler): Observable; /** * Uses selector to determine which source in sources to use. * There is an alias 'switchCase' for browsers (selector: () => number, sources: { [key: number]: Observable; }, elseSource: Observable): Observable; case(selector: () => number, sources: { [key: number]: IPromise; }, elseSource: Observable): Observable; case(selector: () => number, sources: { [key: number]: Observable; }, elseSource: IPromise): Observable; case(selector: () => number, sources: { [key: number]: IPromise; }, elseSource: IPromise): Observable; /** * Uses selector to determine which source in sources to use. * There is an alias 'switchCase' for browsers (selector: () => number, sources: { [key: number]: Observable; }, scheduler?: IScheduler): Observable; case(selector: () => number, sources: { [key: number]: IPromise; }, scheduler?: IScheduler): Observable; /** * Uses selector to determine which source in sources to use. * There is an alias 'switchCase' for browsers (selector: () => string, sources: { [key: string]: Observable; }, elseSource: Observable): Observable; switchCase(selector: () => string, sources: { [key: string]: IPromise; }, elseSource: Observable): Observable; switchCase(selector: () => string, sources: { [key: string]: Observable; }, elseSource: IPromise): Observable; switchCase(selector: () => string, sources: { [key: string]: IPromise; }, elseSource: IPromise): Observable; /** * Uses selector to determine which source in sources to use. * There is an alias 'switchCase' for browsers (selector: () => string, sources: { [key: string]: Observable; }, scheduler?: IScheduler): Observable; switchCase(selector: () => string, sources: { [key: string]: IPromise; }, scheduler?: IScheduler): Observable; /** * Uses selector to determine which source in sources to use. * There is an alias 'switchCase' for browsers (selector: () => number, sources: { [key: number]: Observable; }, elseSource: Observable): Observable; switchCase(selector: () => number, sources: { [key: number]: IPromise; }, elseSource: Observable): Observable; switchCase(selector: () => number, sources: { [key: number]: Observable; }, elseSource: IPromise): Observable; switchCase(selector: () => number, sources: { [key: number]: IPromise; }, elseSource: IPromise): Observable; /** * Uses selector to determine which source in sources to use. * There is an alias 'switchCase' for browsers (selector: () => number, sources: { [key: number]: Observable; }, scheduler?: IScheduler): Observable; switchCase(selector: () => number, sources: { [key: number]: IPromise; }, scheduler?: IScheduler): Observable; /** * Runs all observable sequences in parallel and collect their last elements. * * @example * res = Rx.Observable.forkJoin([obs1, obs2]); * @param sources Array of source sequences or promises. * @returns An observable sequence with an array collecting the last elements of all the input sequences. */ forkJoin(sources: Observable[]): Observable; forkJoin(sources: IPromise[]): Observable; /** * Runs all observable sequences in parallel and collect their last elements. * * @example * res = Rx.Observable.forkJoin(obs1, obs2, ...); * @param args Source sequences or promises. * @returns An observable sequence with an array collecting the last elements of all the input sequences. */ forkJoin(...args: Observable[]): Observable; forkJoin(...args: IPromise[]): Observable; } } declare module "rx.experimental" { export = Rx; }