mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-09-25 18:40:34 +00:00
Add WindowOrWorkerGlobalScope.fetch (#36453)
This is compatible with TS3.6 and above.
This commit is contained in:
Vendored
+4
@@ -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 {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const fetchCopy: GlobalFetch["fetch"] = fetch;
|
||||
const fetchCopy: WindowOrWorkerGlobalScope["fetch"] = fetch;
|
||||
|
||||
const myHeaders = new Headers();
|
||||
myHeaders.append("Content-Type", "image/jpeg");
|
||||
|
||||
Reference in New Issue
Block a user