mirror of
https://github.com/status-im/react-native-webview.git
synced 2025-02-22 16:58:34 +00:00
`onFileDownload` is called with the URL that you can use to download the file. When RNCWebView detects that the HTTP response should result in a file download, `onFileDownload` is called. The client can then provide code to download the file. RNCWebView determines that a file download should take place if either of the following is true: 1. The HTTP response contains a `Content-Disposition` header that is of type 'attachment' 2. The MIME type of the response cannot be rendered by the iOS WebView
48 lines
1.0 KiB
TypeScript
48 lines
1.0 KiB
TypeScript
import { Component } from 'react';
|
|
// eslint-disable-next-line
|
|
import { IOSWebViewProps, AndroidWebViewProps } from './lib/WebViewTypes';
|
|
|
|
export { FileDownload, WebViewMessageEvent, WebViewNavigation } from "./lib/WebViewTypes";
|
|
|
|
export type WebViewProps = IOSWebViewProps & AndroidWebViewProps;
|
|
|
|
declare class WebView extends Component<WebViewProps> {
|
|
/**
|
|
* Go back one page in the webview's history.
|
|
*/
|
|
goBack: () => void;
|
|
|
|
/**
|
|
* Go forward one page in the webview's history.
|
|
*/
|
|
goForward: () => void;
|
|
|
|
/**
|
|
* Reloads the current page.
|
|
*/
|
|
reload: () => void;
|
|
|
|
/**
|
|
* Stop loading the current page.
|
|
*/
|
|
stopLoading(): void;
|
|
|
|
/**
|
|
* Extra Native Component Config.
|
|
*/
|
|
extraNativeComponentConfig: () => any;
|
|
|
|
/**
|
|
* Executes the JavaScript string.
|
|
*/
|
|
injectJavaScript: (script: string) => void;
|
|
|
|
/**
|
|
* Focuses on WebView redered page.
|
|
*/
|
|
requestFocus: () => void;
|
|
}
|
|
|
|
export {WebView};
|
|
export default WebView;
|