1 | import { Observable, ObservableLike, SubscriptionObserver } from "observable-fns";
|
2 | declare type Initializer<T> = (observer: SubscriptionObserver<T>) => UnsubscribeFn | void;
|
3 | declare type Thenable<T> = {
|
4 | then: (onFulfilled?: (value: T) => any, onRejected?: (error: any) => any) => any;
|
5 | };
|
6 | declare type UnsubscribeFn = () => void;
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | export declare class ObservablePromise<T> extends Observable<T> implements Promise<T> {
|
21 | private initHasRun;
|
22 | private fulfillmentCallbacks;
|
23 | private rejectionCallbacks;
|
24 | private firstValue;
|
25 | private firstValueSet;
|
26 | private rejection;
|
27 | private state;
|
28 | readonly [Symbol.toStringTag]: "[object ObservablePromise]";
|
29 | constructor(init: Initializer<T>);
|
30 | private onNext;
|
31 | private onError;
|
32 | private onCompletion;
|
33 | then<TResult1 = T, TResult2 = never>(onFulfilledRaw?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onRejectedRaw?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
|
34 | catch<Result = never>(onRejected: ((error: Error) => Promise<Result> | Result) | null | undefined): Promise<Result>;
|
35 | finally(onCompleted?: (() => void) | null | undefined): Promise<T>;
|
36 | static from<T>(thing: Observable<T> | ObservableLike<T> | ArrayLike<T> | Thenable<T>): ObservablePromise<T>;
|
37 | }
|
38 | export {};
|