Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2020-04-22 13:08:33 +01:00
parent d915e613dc
commit 01abb61e9a
3 changed files with 291 additions and 242 deletions

View file

@ -37,4 +37,17 @@ declare global {
interface StorageEstimate {
usageDetails?: {[key: string]: number};
}
export interface ISettledFulfilled<T> {
status: "fulfilled";
value: T;
}
export interface ISettledRejected {
status: "rejected";
reason: any;
}
interface PromiseConstructor {
allSettled<T>(promises: Promise<T>[]): Promise<Array<ISettledFulfilled<T> | ISettledRejected>>;
}
}

View file

@ -33,7 +33,7 @@ export async function timeout<T>(promise: Promise<T>, timeoutValue: T, ms: numbe
}
export interface IDeferred<T> {
resolve: (T) => void;
resolve: (value: T) => void;
reject: (any) => void;
promise: Promise<T>;
}