DefinitelyTyped/types/promise-hash/index.d.ts
Michael Shafir 6061d28041 Add typings for the promise-hash library, v1.3 (#40331)
* Added typings for this promise-hash library

* pull out common type for the promise hash argument

* make recommended simplifications, expand test
2019-11-14 15:31:23 -08:00

17 lines
461 B
TypeScript

// Type definitions for promise-hash 1.3
// Project: https://github.com/mtimofiiv/promise-hash
// Definitions by: Michael Shafir <https://github.com/mshafir>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = hash;
type PromiseHash = <T>(promiseHash: { [P in keyof T]: PromiseLike<T[P]> | T[P] }) => Promise<T>;
declare global {
interface PromiseConstructor {
hash: PromiseHash;
}
}
declare const hash: PromiseHash;