Thibault Malbranche 5 years ago
parent
commit
9dcfb53943
5 changed files with 16 additions and 13 deletions
  1. 0
    10
      index.ts
  2. 6
    0
      src/index.d.ts
  3. 0
    0
      src/index.flow.js
  4. 6
    0
      src/index.js
  5. 4
    3
      tsconfig.json

+ 0
- 10
index.ts View File

@@ -1,10 +0,0 @@
1
-import { Platform } from 'react-native';
2
-import WebViewIOS from './src/WebView.ios';
3
-import WebViewAndroid from './src/WebView.android';
4
-
5
-const WebView = Platform.OS === 'android' ? WebViewAndroid : WebViewIOS;
6
-
7
-// We keep this for compatibility reasons.
8
-export { WebView };
9
-
10
-export default WebView;

+ 6
- 0
src/index.d.ts View File

@@ -0,0 +1,6 @@
1
+import WebViewIOS from './WebView.ios';
2
+import WebViewAndroid from './WebView.android';
3
+
4
+declare const WebView: typeof WebViewAndroid | typeof WebViewIOS;
5
+export { WebView };
6
+export default WebView;

+ 0
- 0
src/index.flow.js View File


+ 6
- 0
src/index.js View File

@@ -0,0 +1,6 @@
1
+import WebView from './WebView';
2
+
3
+// We keep this for compatibility reasons.
4
+export { WebView };
5
+
6
+export default WebView;

+ 4
- 3
tsconfig.json View File

@@ -1,19 +1,20 @@
1 1
 {
2 2
   "compilerOptions": {
3 3
     "allowSyntheticDefaultImports": true,
4
+    "declaration": true,
4 5
     "jsx": "react-native",
5 6
     "lib": ["es6"],
6 7
     "module": "esnext",
7 8
     "moduleResolution": "node",
8
-    "noEmit": true,
9 9
     "noFallthroughCasesInSwitch": true,
10 10
     "noImplicitReturns": true,
11 11
     "noUnusedLocals": true,
12 12
     "noUnusedParameters": true,
13
+    "outDir": "lib",
13 14
     "pretty": true,
14 15
     "skipLibCheck": true,
15 16
     "strict": true
16 17
   },
17
-  "include": ["src", "index.ts"],
18
-  "exclude": ["node_modules", "index.flow.js"]
18
+  "include": ["src"],
19
+  "exclude": ["node_modules", "index.flow.js", "src/index.js", "src/index.d.ts"]
19 20
 }