Add WindowOrWorkerGlobalScope.fetch (#36453)

This is compatible with TS3.6 and above.
This commit is contained in:
Nathan Shively-Sanders 2019-06-25 12:39:47 -07:00 committed by GitHub
parent c51dc8610d
commit 2ceda6e7ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -31,6 +31,10 @@ declare interface GlobalFetch {
declare function fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
declare interface WindowOrWorkerGlobalScope {
fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
}
interface Blob {}
declare class FormData {

View File

@ -1,4 +1,4 @@
const fetchCopy: GlobalFetch["fetch"] = fetch;
const fetchCopy: WindowOrWorkerGlobalScope["fetch"] = fetch;
const myHeaders = new Headers();
myHeaders.append("Content-Type", "image/jpeg");