diff --git a/types/react-native/globals.d.ts b/types/react-native/globals.d.ts index baaaa261d7..4753591ff6 100644 --- a/types/react-native/globals.d.ts +++ b/types/react-native/globals.d.ts @@ -18,3 +18,5 @@ declare function setImmediate(handler: (...args: any[]) => void): number; declare function cancelAnimationFrame(handle: number): void; declare function requestAnimationFrame(callback: (time: number) => void): number; + +declare function fetch(input: RequestInfo, init?: RequestInit): Promise; diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index c1b5b99043..3f02a5f6c5 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -8496,11 +8496,6 @@ export interface ImageStoreStatic { ): void } -// Network Polyfill -// TODO: Add proper support for fetch -export type fetch = (url: string, options?: Object) => Promise -export const fetch: fetch; - export interface TabsReducerStatic { JumpToAction(index: number): any; } diff --git a/types/react-native/tsconfig.json b/types/react-native/tsconfig.json index 0d93ac324a..508ac06f1a 100644 --- a/types/react-native/tsconfig.json +++ b/types/react-native/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6", - "dom" + "es6" ], "noImplicitAny": true, "noImplicitThis": true,