40 lines
2.1 KiB
TypeScript
40 lines
2.1 KiB
TypeScript
|
import { Observable } from '../Observable';
|
||
|
import { Scheduler } from '../Scheduler';
|
||
|
import { Operator } from '../Operator';
|
||
|
import { Subscriber } from '../Subscriber';
|
||
|
import { Subscription } from '../Subscription';
|
||
|
import { OuterSubscriber } from '../OuterSubscriber';
|
||
|
import { InnerSubscriber } from '../InnerSubscriber';
|
||
|
/**
|
||
|
* Returns an Observable where for each item in the source Observable, the supplied function is applied to each item,
|
||
|
* resulting in a new value to then be applied again with the function.
|
||
|
* @param {function} project the function for projecting the next emitted item of the Observable.
|
||
|
* @param {number} [concurrent] the max number of observables that can be created concurrently. defaults to infinity.
|
||
|
* @param {Scheduler} [scheduler] The Scheduler to use for managing the expansions.
|
||
|
* @returns {Observable} an Observable containing the expansions of the source Observable.
|
||
|
*/
|
||
|
export declare function expand<T, R>(project: (value: T, index: number) => Observable<R>, concurrent?: number, scheduler?: Scheduler): Observable<R>;
|
||
|
export declare class ExpandOperator<T, R> implements Operator<T, R> {
|
||
|
private project;
|
||
|
private concurrent;
|
||
|
private scheduler;
|
||
|
constructor(project: (value: T, index: number) => Observable<R>, concurrent: number, scheduler: Scheduler);
|
||
|
call(subscriber: Subscriber<R>): Subscriber<T>;
|
||
|
}
|
||
|
export declare class ExpandSubscriber<T, R> extends OuterSubscriber<T, R> {
|
||
|
private project;
|
||
|
private concurrent;
|
||
|
private scheduler;
|
||
|
private index;
|
||
|
private active;
|
||
|
private hasCompleted;
|
||
|
private buffer;
|
||
|
constructor(destination: Subscriber<R>, project: (value: T, index: number) => Observable<R>, concurrent: number, scheduler: Scheduler);
|
||
|
private static dispatch({subscriber, result, value, index});
|
||
|
protected _next(value: any): void;
|
||
|
private subscribeToProjection(result, value, index);
|
||
|
protected _complete(): void;
|
||
|
notifyNext(outerValue: T, innerValue: R, outerIndex: number, innerIndex: number, innerSub: InnerSubscriber<T, R>): void;
|
||
|
notifyComplete(innerSub: Subscription): void;
|
||
|
}
|