mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 04:49:15 +08:00
Use the pSettle namespace to export SettledResult
This commit is contained in:
18
types/p-settle/index.d.ts
vendored
18
types/p-settle/index.d.ts
vendored
@@ -3,13 +3,15 @@
|
||||
// Definitions by: Nate Silva <https://github.com/natesilva>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface SettledResult<T> {
|
||||
isFulfilled: boolean;
|
||||
isRejected: boolean;
|
||||
/** If the promise was fulfilled, the resolved value */
|
||||
value?: T;
|
||||
/** If the promise was rejected, the reason */
|
||||
reason?: any;
|
||||
declare namespace pSettle {
|
||||
interface SettledResult<T> {
|
||||
isFulfilled: boolean;
|
||||
isRejected: boolean;
|
||||
/** If the promise was fulfilled, the resolved value */
|
||||
value?: T;
|
||||
/** If the promise was rejected, the reason */
|
||||
reason?: any;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -23,6 +25,6 @@ interface SettledResult<T> {
|
||||
*
|
||||
* @param input
|
||||
*/
|
||||
declare function pSettle<T>(input: Iterable<PromiseLike<T>>): Promise<Array<SettledResult<T>>>;
|
||||
declare function pSettle<T>(input: Iterable<PromiseLike<T>>): Promise<Array<pSettle.SettledResult<T>>>;
|
||||
|
||||
export = pSettle;
|
||||
|
||||
Reference in New Issue
Block a user