mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add WindowOrWorkerGlobalScope.fetch (#36453)
This is compatible with TS3.6 and above.
This commit is contained in:
parent
c51dc8610d
commit
2ceda6e7ea
4
types/react-native/globals.d.ts
vendored
4
types/react-native/globals.d.ts
vendored
@ -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");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user