Fix building?

merge-requests/4/head
Bsian 2020-03-14 01:02:32 +00:00
parent d91d44e95d
commit 755a176d13
No known key found for this signature in database
GPG Key ID: 097FB9A291026091
2 changed files with 32 additions and 0 deletions

View File

@ -35,6 +35,7 @@
"@types/ioredis": "^4.0.18",
"@types/moment-precise-range-plugin": "^0.2.0",
"@types/mongoose": "^5.5.20",
"@types/node": "^13.9.1",
"@types/nodemailer": "^6.2.1",
"@types/signale": "^1.2.1",
"@types/uuid": "^3.4.5",

31
types/global.d.ts vendored Normal file
View File

@ -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>[]>;
}