import { IScheduler } from '../Scheduler'; import { Observable } from '../Observable'; import { Subscriber } from '../Subscriber'; import { TeardownLogic } from '../Subscription'; /** * We need this JSDoc comment for affecting ESDoc. * @extends {Ignored} * @hide true */ export declare class PromiseObservable extends Observable { private promise; private scheduler; value: T; /** * Converts a Promise to an Observable. * * Returns an Observable that just emits the Promise's * resolved value, then completes. * * Converts an ES2015 Promise or a Promises/A+ spec compliant Promise to an * Observable. If the Promise resolves with a value, the output Observable * emits that resolved value as a `next`, and then completes. If the Promise * is rejected, then the output Observable emits the corresponding Error. * * @example Convert the Promise returned by Fetch to an Observable * var result = Rx.Observable.fromPromise(fetch('http://myserver.com/')); * result.subscribe(x => console.log(x), e => console.error(e)); * * @see {@link bindCallback} * @see {@link from} * * @param {PromiseLike} promise The promise to be converted. * @param {Scheduler} [scheduler] An optional IScheduler to use for scheduling * the delivery of the resolved value (or the rejection). * @return {Observable} An Observable which wraps the Promise. * @static true * @name fromPromise * @owner Observable */ static create(promise: PromiseLike, scheduler?: IScheduler): Observable; constructor(promise: PromiseLike, scheduler?: IScheduler); /** @deprecated internal use only */ _subscribe(subscriber: Subscriber): TeardownLogic; }