/**
 * CancellablePromise extends a promise by adding the ability to flag it as cancelled.
 */
export declare class CancellablePromise<T> {
    static id: number;
    promiseId: number;
    private promise;
    private isCancelled;
    private onCancel;
    private rejectPromise;
    constructor(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void);
    static all<T>(values: Array<CancellablePromise<T> | PromiseLike<T>>): CancellablePromise<T[]>;
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): CancellablePromise<TResult1 | TResult2>;
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): CancellablePromise<T | TResult>;
    finally(onfinally?: (() => void) | undefined | null): CancellablePromise<T>;
    cancel(): void;
    onCancelled(callback: () => void): void;
    get cancelled(): boolean;
}
