export interface CancellablePromise extends Promise { cancel(): void; catch(onrejected?: ((reason: any) => E | PromiseLike) | undefined | null): CancellablePromise; finally(callback?: (() => void) | undefined | null): CancellablePromise; then(onfulfilled?: ((value: T) => V | PromiseLike) | undefined | null, onrejected?: ((reason: any) => E | PromiseLike) | undefined | null): CancellablePromise; } export default class Task implements CancellablePromise { readonly [Symbol.toStringTag]: 'Promise'; static race(iterable: Iterable> | (T | PromiseLike)[]): Task; static reject(reason?: Error): Task; static resolve(): Task; static resolve(value: T | PromiseLike): Task; static all(iterable: DictionaryOfPromises): Task<{ [key: string]: T; }>; static all(iterable: (T | PromiseLike)[]): Task; static all(iterable: T | PromiseLike): Task; static all(iterable: ListOfPromises): Task; private static unwrapPromises; private readonly _promise; private canceler; private readonly children; private _finally; private _state; constructor(executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void, canceler?: () => void); private _cancel; cancel(): void; catch(onRejected?: ((reason: any) => TResult | PromiseLike) | undefined): Task; finally(callback?: (() => void) | undefined | null): Task; then(onFulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onRejected?: ((reason: any) => TResult2 | PromiseLike | undefined) | undefined | null): Task; } export declare function isTask(value: any): value is Task; export declare type DictionaryOfPromises = { [_: string]: T | PromiseLike; }; export declare type ListOfPromises = Iterable>; export declare function isPromiseLike(value: any): value is PromiseLike;