import Reject from './interfaces/promise/reject.interface'; import Cancel from './interfaces/promise/cancel.interface'; import Resolve from './interfaces/promise/resolve.interface'; export default class CancelablePromise { private cancelHandler; private isPending; private promise; isCanceled: boolean; constructor(callback: { (resolve: Resolve, reject: Reject, onCancel: Cancel): void; (arg0: (value: any) => void, arg1: (error: any) => void, arg2: (handler: any) => void): void; }); then(onFulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onRejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise; catch(onRejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; cancel(reason?: any): void; }