Created
February 20, 2020 11:00
-
-
Save tsujp/50e1ed586f69ad2ec40e75086f0762f8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface TypedResponse<T = any> extends Response { | |
/** | |
* this will override `json` method from `Body` that is extended by `Response` | |
* interface Body { | |
* json(): Promise<any>; | |
* } | |
*/ | |
json<P = T>(): Promise<P> | |
} | |
declare function fetch<T>(...args: any): Promise<TypedResponse<T>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment