import { IConstructor } from './IConstructor' export type TPromiseExecutor = ( resolve: (value: TValue) => void, reject: (reason: TReason) => void, ) => void export interface IPromise extends Promise { then: ( onSuccess?: (value: TValue) => any, onReject?: (reason: TReason) => any, ) => IPromise catch: (onReject: (reason: TReason) => any) => IPromise // finally: (onFinally: () => any) => IPromise readonly [Symbol.toStringTag]: string } export interface IPromiseConstructor extends IConstructor> { new (executor: TPromiseExecutor): IPromise all: ( values: Iterable>, ) => IPromise race: ( values: Iterable>, ) => IPromise reject: (reason?: TReason) => IPromise resolve: (value?: TValue) => IPromise } // https://stackoverflow.com/questions/45902881/ts1055-when-using-async-await-using-a-type-alias export const IPromise = Promise