type CancellablePromise<T> = Promise<T> & {
    cancel: () => void;
};
export declare function cancelable<T>(promise: Promise<T>): CancellablePromise<T>;
export declare function timeout(promise: Promise<unknown>, duration: number, error: unknown): Promise<unknown>;
export declare function delay(duration: number): Promise<unknown>;
export interface Deferred<T = unknown> {
    promise: Promise<T>;
    resolve(value?: T | PromiseLike<T>): void;
    reject(reason?: any): void;
}
export declare function defer<T>(): Deferred<T>;
export {};
