Improve global fetch type

This commit is contained in:
Martijn Walraven 2018-10-12 11:23:53 +02:00
parent 7720ae835e
commit 2a2e3ffe4f

View file

@ -1,4 +1,12 @@
type fetch = typeof import('./fetch').fetch;
declare function fetch(
input?: RequestInfo,
init?: RequestInit,
): Promise<Response>;
declare interface GlobalFetch {
fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
}
type RequestInfo = import('./fetch').RequestInfo;
type Headers = import('./fetch').Headers;
type HeadersInit = import('./fetch').HeadersInit;