From 6407fad3ae4109f4098ad52d0c5322898cebc11c Mon Sep 17 00:00:00 2001 From: huhuanming Date: Tue, 19 Sep 2017 01:10:32 +0800 Subject: [PATCH 1/2] Add Fetch and Remove dom in tsconfig --- types/react-native/globals.d.ts | 2 ++ types/react-native/index.d.ts | 5 ----- 2 files changed, 2 insertions(+), 5 deletions(-) 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 f02bd5d45e..38f1be82d6 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -8468,11 +8468,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; } From d55a543b6ed0edb6427117d599ba12be8ad51f0a Mon Sep 17 00:00:00 2001 From: huhuanming Date: Mon, 9 Oct 2017 22:51:02 +0800 Subject: [PATCH 2/2] remove dom --- types/react-native/tsconfig.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/types/react-native/tsconfig.json b/types/react-native/tsconfig.json index 68be3a9834..8fa39e5d29 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,