File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -615,6 +615,14 @@ Specifies function to be invoked when the WebView content process is terminated.
615615/>
616616```
617617
618+ #### ` onFileDownload: WebViewDownloadEvent.t => unit `
619+
620+ _ iOS only_
621+
622+ Specifies function to be invoked when the ` WebView ` is about to download a file.
623+
624+ < https://github.com/react-native-webview/react-native-webview/blob/master/docs/Reference.md#onFileDownload >
625+
618626#### ` onError: WebViewErrorEvent.t => unit `
619627
620628Specifies function to be invoked when the ` WebView ` fails to load.
Original file line number Diff line number Diff line change @@ -8,6 +8,10 @@ var Source = {};
88
99Event$ReactNative . SyntheticEvent ( { } ) ;
1010
11+ var WebViewDownloadEvent = { } ;
12+
13+ Event$ReactNative . SyntheticEvent ( { } ) ;
14+
1115var WebViewErrorEvent = { } ;
1216
1317Event$ReactNative . SyntheticEvent ( { } ) ;
@@ -42,6 +46,7 @@ exports.Source = Source;
4246exports . DataDetectorTypes = DataDetectorTypes ;
4347exports . DecelerationRate = DecelerationRate ;
4448exports . NavigationType = NavigationType ;
49+ exports . WebViewDownloadEvent = WebViewDownloadEvent ;
4550exports . WebViewErrorEvent = WebViewErrorEvent ;
4651exports . WebViewHttpErrorEvent = WebViewHttpErrorEvent ;
4752exports . WebViewMessageEvent = WebViewMessageEvent ;
Original file line number Diff line number Diff line change @@ -87,6 +87,14 @@ class type virtual webViewShouldStartLoadWithRequest = {
8787
8888type webViewNavigationOrError ;
8989
90+ module WebViewDownloadEvent = {
91+ type payload = {downloadUrl: string };
92+
93+ include Event . SyntheticEvent ({
94+ type _payload = payload;
95+ });
96+ };
97+
9098module WebViewErrorEvent = {
9199 type payload = Js . t (webViewError );
92100 include Event . SyntheticEvent ({
@@ -192,6 +200,7 @@ external make:
192200 ~mixedContentMode : [ | ` never | ` always | ` compatibility ] =?,
193201 ~nativeConfig : nativeConfig =?,
194202 ~onContentProcessDidTerminate : WebViewTerminatedEvent . t => unit =?,
203+ ~onFileDownload : WebViewDownloadEvent . t => unit =?,
195204 ~onError : WebViewErrorEvent . t => unit =?,
196205 ~onHttpError : WebViewHttpErrorEvent . t => unit =?,
197206 ~onLoad : WebViewNavigationEvent . t => unit =?,
You can’t perform that action at this time.
0 commit comments