UNPKG

1.6 kBTypeScriptView Raw
1import { Component } from 'react';
2// eslint-disable-next-line
3import { IOSWebViewProps, AndroidWebViewProps, WindowsWebViewProps } from './lib/WebViewTypes';
4
5export { FileDownload, WebViewMessageEvent, WebViewNavigation } from "./lib/WebViewTypes";
6
7export type WebViewProps = IOSWebViewProps & AndroidWebViewProps & WindowsWebViewProps;
8
9declare class WebView<P = {}> extends Component<WebViewProps & P> {
10 /**
11 * Go back one page in the webview's history.
12 */
13 goBack: () => void;
14
15 /**
16 * Go forward one page in the webview's history.
17 */
18 goForward: () => void;
19
20 /**
21 * Reloads the current page.
22 */
23 reload: () => void;
24
25 /**
26 * Stop loading the current page.
27 */
28 stopLoading(): void;
29
30 /**
31 * Executes the JavaScript string.
32 */
33 injectJavaScript: (script: string) => void;
34
35 /**
36 * Focuses on WebView redered page.
37 */
38 requestFocus: () => void;
39
40 /**
41 * Posts a message to WebView.
42 */
43 postMessage: (message: string) => void;
44
45 /**
46 * (Android only)
47 * Removes the autocomplete popup from the currently focused form field, if present.
48 */
49 clearFormData?: () => void;
50
51 /**
52 * (Android only)
53 * Clears the resource cache. Note that the cache is per-application, so this will clear the cache for all WebViews used.
54 */
55 clearCache?: (clear: boolean) => void;
56
57 /**
58 * (Android only)
59 * Tells this WebView to clear its internal back/forward list.
60 */
61 clearHistory?: () => void;
62}
63
64export {WebView};
65export default WebView;