import { Observable } from '../Observable'; import { Operator } from '../Operator'; import { Subscriber } from '../Subscriber'; import { TeardownLogic } from '../types'; import { OuterSubscriber } from '../OuterSubscriber'; import { InnerSubscriber } from '../InnerSubscriber'; /** * Returns an Observable that mirrors the first source Observable to emit an item. * * ## Example * ### Subscribes to the observable that was the first to start emitting. * * ```javascript * const obs1 = interval(1000).pipe(mapTo('fast one')); * const obs2 = interval(3000).pipe(mapTo('medium one')); * const obs3 = interval(5000).pipe(mapTo('slow one')); * * race(obs3, obs1, obs2) * .subscribe( * winner => console.log(winner) * ); * * // result: * // a series of 'fast one' * ``` * * @param {...Observables} ...observables sources used to race for which Observable emits first. * @return {Observable} an Observable that mirrors the output of the first Observable to emit an item. * @static true * @name race * @owner Observable */ export declare function race(observables: Array>): Observable; export declare function race(observables: Array>): Observable; export declare function race(...observables: Array | Array>>): Observable; export declare class RaceOperator implements Operator { call(subscriber: Subscriber, source: any): TeardownLogic; } /** * We need this JSDoc comment for affecting ESDoc. * @ignore * @extends {Ignored} */ export declare class RaceSubscriber extends OuterSubscriber { private hasFirst; private observables; private subscriptions; constructor(destination: Subscriber); protected _next(observable: any): void; protected _complete(): void; notifyNext(outerValue: T, innerValue: T, outerIndex: number, innerIndex: number, innerSub: InnerSubscriber): void; }