/// module Rx { export interface Observable { /** * Merges the specified observable sequences into one observable sequence by using the selector function only when the (first) source observable sequence produces an element. * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ withLatestFrom(second: ObservableOrPromise, resultSelector: (v1: T, v2: T2) => TResult): Observable; /** * Merges the specified observable sequences into one observable sequence by using the selector function only when the (first) source observable sequence produces an element. * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ withLatestFrom(second: ObservableOrPromise, third: ObservableOrPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; /** * Merges the specified observable sequences into one observable sequence by using the selector function only when the (first) source observable sequence produces an element. * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ withLatestFrom(second: ObservableOrPromise, third: ObservableOrPromise, fourth: ObservableOrPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; /** * Merges the specified observable sequences into one observable sequence by using the selector function only when the (first) source observable sequence produces an element. * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ withLatestFrom(second: ObservableOrPromise, third: ObservableOrPromise, fourth: ObservableOrPromise, fifth: ObservableOrPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable; /** * Merges the specified observable sequences into one observable sequence by using the selector function only when the (first) source observable sequence produces an element. * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ withLatestFrom(second: ObservableOrPromise, third: ObservableOrPromise, fourth: ObservableOrPromise, fifth: ObservableOrPromise, sixth: ObservableOrPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6) => TResult): Observable; /** * Merges the specified observable sequences into one observable sequence by using the selector function only when the (first) source observable sequence produces an element. * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ withLatestFrom(second: ObservableOrPromise, third: ObservableOrPromise, fourth: ObservableOrPromise, fifth: ObservableOrPromise, sixth: ObservableOrPromise, seventh: ObservableOrPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6, v7: T7) => TResult): Observable; /** * Merges the specified observable sequences into one observable sequence by using the selector function only when the (first) source observable sequence produces an element. * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ withLatestFrom(second: ObservableOrPromise, third: ObservableOrPromise, fourth: ObservableOrPromise, fifth: ObservableOrPromise, sixth: ObservableOrPromise, seventh: ObservableOrPromise, eighth: ObservableOrPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6, v7: T7, v8: T8) => TResult): Observable; /** * Merges the specified observable sequences into one observable sequence by using the selector function only when the (first) source observable sequence produces an element. * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ withLatestFrom(second: ObservableOrPromise, third: ObservableOrPromise, fourth: ObservableOrPromise, fifth: ObservableOrPromise, sixth: ObservableOrPromise, seventh: ObservableOrPromise, eighth: ObservableOrPromise, ninth: ObservableOrPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6, v7: T7, v8: T8, v9: T9) => TResult): Observable; /** * Merges the specified observable sequences into one observable sequence by using the selector function only when the (first) source observable sequence produces an element. * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ withLatestFrom(souces: ObservableOrPromise[], resultSelector: (firstValue: T, ...otherValues: TOther[]) => TResult): Observable; } } (function() { var o: Rx.Observable; var io: Rx.IObservable; var so: Rx.Subject; var p: Rx.Promise<{ a: string }>; var r: Rx.Observable<{ vo: boolean, vio: string, vp: { a: string }, vso: number }> = o.withLatestFrom(io, p, so, (vo, vio, vp, vso) => ({ vo, vio, vp, vso })); var rr : Rx.Observable = o.withLatestFrom([io, so, p], (v1, items) => 5); });