forked from engineering/cloudservices
Fix building?
parent
d91d44e95d
commit
755a176d13
|
@ -35,6 +35,7 @@
|
||||||
"@types/ioredis": "^4.0.18",
|
"@types/ioredis": "^4.0.18",
|
||||||
"@types/moment-precise-range-plugin": "^0.2.0",
|
"@types/moment-precise-range-plugin": "^0.2.0",
|
||||||
"@types/mongoose": "^5.5.20",
|
"@types/mongoose": "^5.5.20",
|
||||||
|
"@types/node": "^13.9.1",
|
||||||
"@types/nodemailer": "^6.2.1",
|
"@types/nodemailer": "^6.2.1",
|
||||||
"@types/signale": "^1.2.1",
|
"@types/signale": "^1.2.1",
|
||||||
"@types/uuid": "^3.4.5",
|
"@types/uuid": "^3.4.5",
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
|
||||||
|
interface PromiseFulfilledResult<T> {
|
||||||
|
status: 'fulfilled';
|
||||||
|
value: T;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface PromiseRejectedResult {
|
||||||
|
status: 'rejected';
|
||||||
|
reason: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
type PromiseSettledResult<T> = PromiseFulfilledResult<T> | PromiseRejectedResult;
|
||||||
|
|
||||||
|
interface PromiseConstructor {
|
||||||
|
/**
|
||||||
|
* Creates a Promise that is resolved with an array of results when all
|
||||||
|
* of the provided Promises resolve or reject.
|
||||||
|
* @param values An array of Promises.
|
||||||
|
* @returns A new Promise.
|
||||||
|
*/
|
||||||
|
allSettled<T extends readonly unknown[] | readonly [unknown]>(values: T):
|
||||||
|
Promise<{ -readonly [P in keyof T]: PromiseSettledResult<T[P] extends PromiseLike<infer U> ? U : T[P]> }>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a Promise that is resolved with an array of results when all
|
||||||
|
* of the provided Promises resolve or reject.
|
||||||
|
* @param values An array of Promises.
|
||||||
|
* @returns A new Promise.
|
||||||
|
*/
|
||||||
|
allSettled<T>(values: Iterable<T>): Promise<PromiseSettledResult<T extends PromiseLike<infer U> ? U : T>[]>;
|
||||||
|
}
|
Loading…
Reference in New Issue