import { Observable } from "../Observable"; /** * Returns a Promise which will be resolved with the first event (or error) coming from * an Observable. Uses global ES6 promise implementation to construct the promise. * * @param obs Observable whose first event/error will be resolved to the promise * * @see firstToCustomPromise * @see toPromise * @see toCustomPromise * * @example * * F.firstToPromise(F.sequentially(100, [1, 2, 3])).then(console.log) * // => 1 * * @public */ export declare function firstToPromise(obs: Observable): Promise; /** * Works same as `firstToPromise` but offers way to use custom promise * implementation instead. * * @param ctor Constructor to the custom promise implementation * @param obs Observable whose first event/error will be resolved to the promise * * @see firstToPromise * @see toPromise * @see toCustomPromise * * @example * * import * as Promise from "bluebird" * const bluebirdPromise = F.firstToCustomPromise(Promise, F.later(100, "tsers!")) * * @public */ export declare const firstToCustomPromise: CurriedFirstToCustomPromise; interface CurriedFirstToCustomPromise { (ctor: PromiseConstructor, obs: Observable): Promise; (ctor: PromiseConstructor): (obs: Observable) => Promise; } /** * Returns a Promise which will be resolved with the last event (or first error) coming from * an Observable. Uses global ES6 promise implementation to construct the promise. * * @param obs Observable whose last event/error will be resolved to the promise * * @see toCustomPromise * @see firstToPromise * @see firstToCustomPromise * * @example * * F.firstToPromise(F.sequentially(100, [1, 2, 3])).then(console.log) * // => 3 * * @public */ export declare function toPromise(obs: Observable): Promise; /** * Works same as `toPromise` but offers way to use custom promise implementation instead. * * @param ctor Constructor to the custom promise implementation * @param obs Observable whose last event/error will be resolved to the promise * * @see toPromise * @see firstToPromise * @see firstToCustomPromise * * @example * * import * as Promise from "bluebird" * const bluebirdPromise = F.toCustomPromise(Promise, F.later(100, "tsers!")) * * @public */ export declare const toCustomPromise: CurriedToCustomPromise; interface CurriedToCustomPromise { (ctor: PromiseConstructor, obs: Observable): Promise; (ctor: PromiseConstructor): (obs: Observable) => Promise; } export {};