diff --git a/app/src/moreProms.ts b/app/src/moreProms.ts index e8dc962..4214904 100644 --- a/app/src/moreProms.ts +++ b/app/src/moreProms.ts @@ -310,7 +310,10 @@ export type ResablePromise = SettledPromProps & ResablePromProps catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): ResablePromise; finally(onfinally?: (() => void) | undefined | null): ResablePromise; } & Promise -export const CancelAblePromise = _CancelAblePromise as any as PromiseConstructor & { new(executor?: (resolve: (value: T | PromiseLike) => void, reject: (reason?: any) => void) => void, cancel?: (reason: C) => void): CancelAblePromise } + +export type CancelFunc = (reason: C) => CT + +export const CancelAblePromise = _CancelAblePromise as any as PromiseConstructor & { new(executor?: (resolve: (value: T | PromiseLike) => void, reject: (reason?: any) => void) => (CancelFunc | void), cancel?: (reason: C) => void): CancelAblePromise } export type CancelAblePromise = SettledPromProps & ResablePromProps & CancelAblePromProps & { then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null, onCancelForward?: true): CancelAblePromise; then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null, onCancel?: (reason: newC) => newCT): CancelAblePromise;