Use the pSettle namespace to export SettledResult

This commit is contained in:
Nate Silva
2017-05-22 14:18:54 -07:00
parent b5ae0602a2
commit d357ad09ab

View File

@@ -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;