export declare class CancelError extends Error { constructor(message: string); get isCancelled(): boolean; } export interface OnCancel { readonly isResolved: boolean; readonly isRejected: boolean; readonly isCancelled: boolean; (cancelHandler: () => void): void; } export declare class CancelablePromise implements Promise { #private; constructor(executor: (resolve: (value: T | PromiseLike) => void, reject: (reason?: any) => void, onCancel: OnCancel) => void); get [Symbol.toStringTag](): string; then(onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, onRejected?: ((reason: any) => TResult2 | PromiseLike) | null): Promise; catch(onRejected?: ((reason: any) => TResult | PromiseLike) | null): Promise; finally(onFinally?: (() => void) | null): Promise; cancel(): void; get isCancelled(): boolean; }