Tero Paananen 4 年之前
父節點
當前提交
3581ef2ad8
共有 2 個文件被更改,包括 25 次插入2 次删除
  1. 24
    1
      index.d.ts
  2. 1
    1
      package.json

+ 24
- 1
index.d.ts 查看文件

@@ -6,7 +6,7 @@ export { FileDownload, WebViewMessageEvent, WebViewNavigation } from "./lib/WebV
6 6
 
7 7
 export type WebViewProps = IOSWebViewProps & AndroidWebViewProps;
8 8
 
9
-declare class WebView extends Component<WebViewProps> {
9
+declare class WebView<P = {}> extends Component<WebViewProps & P> {
10 10
     /**
11 11
      * Go back one page in the webview's history.
12 12
      */
@@ -41,6 +41,29 @@ declare class WebView extends Component<WebViewProps> {
41 41
      * Focuses on WebView redered page.
42 42
      */
43 43
     requestFocus: () => void;
44
+    
45
+     /**
46
+     * Posts a message to WebView.
47
+     */
48
+    postMessage: (message: string) => void;
49
+    
50
+     /**
51
+     * (Android only)
52
+     * Removes the autocomplete popup from the currently focused form field, if present.
53
+     */
54
+    clearFormData: () => void;
55
+
56
+     /**
57
+     * (Android only)
58
+     * Clears the resource cache. Note that the cache is per-application, so this will clear the cache for all WebViews used.
59
+     */
60
+    clearCache: (clear: boolean) => void;
61
+
62
+     /**
63
+     * (Android only)
64
+     * Tells this WebView to clear its internal back/forward list.
65
+     */
66
+    clearHistory: () => void;
44 67
 }
45 68
 
46 69
 export {WebView};

+ 1
- 1
package.json 查看文件

@@ -8,7 +8,7 @@
8 8
     "Thibault Malbranche <malbranche.thibault@gmail.com>"
9 9
   ],
10 10
   "license": "MIT",
11
-  "version": "10.8.2",
11
+  "version": "10.8.3",
12 12
   "homepage": "https://github.com/react-native-community/react-native-webview#readme",
13 13
   "scripts": {
14 14
     "start": "node node_modules/react-native/local-cli/cli.js start",