|
@@ -113,6 +113,10 @@ export interface WebViewNavigation extends WebViewNativeEvent {
|
113
|
113
|
mainDocumentURL?: string;
|
114
|
114
|
}
|
115
|
115
|
|
|
116
|
+export interface ShouldStartLoadRequest extends WebViewNavigation {
|
|
117
|
+ isTopFrame: boolean;
|
|
118
|
+}
|
|
119
|
+
|
116
|
120
|
export interface FileDownload {
|
117
|
121
|
downloadUrl: string;
|
118
|
122
|
}
|
|
@@ -149,6 +153,8 @@ export type WebViewProgressEvent = NativeSyntheticEvent<
|
149
|
153
|
|
150
|
154
|
export type WebViewNavigationEvent = NativeSyntheticEvent<WebViewNavigation>;
|
151
|
155
|
|
|
156
|
+export type ShouldStartLoadRequestEvent = NativeSyntheticEvent<ShouldStartLoadRequest>;
|
|
157
|
+
|
152
|
158
|
export type FileDownloadEvent = NativeSyntheticEvent<FileDownload>;
|
153
|
159
|
|
154
|
160
|
export type WebViewMessageEvent = NativeSyntheticEvent<WebViewMessage>;
|
|
@@ -238,7 +244,7 @@ export interface WebViewNativeConfig {
|
238
|
244
|
}
|
239
|
245
|
|
240
|
246
|
export type OnShouldStartLoadWithRequest = (
|
241
|
|
- event: WebViewNavigation,
|
|
247
|
+ event: ShouldStartLoadRequest,
|
242
|
248
|
) => boolean;
|
243
|
249
|
|
244
|
250
|
export interface CommonNativeWebViewProps extends ViewProps {
|
|
@@ -258,7 +264,7 @@ export interface CommonNativeWebViewProps extends ViewProps {
|
258
|
264
|
onLoadingStart: (event: WebViewNavigationEvent) => void;
|
259
|
265
|
onHttpError: (event: WebViewHttpErrorEvent) => void;
|
260
|
266
|
onMessage: (event: WebViewMessageEvent) => void;
|
261
|
|
- onShouldStartLoadWithRequest: (event: WebViewNavigationEvent) => void;
|
|
267
|
+ onShouldStartLoadWithRequest: (event: ShouldStartLoadRequestEvent) => void;
|
262
|
268
|
showsHorizontalScrollIndicator?: boolean;
|
263
|
269
|
showsVerticalScrollIndicator?: boolean;
|
264
|
270
|
// TODO: find a better way to type this.
|
|
@@ -266,7 +272,7 @@ export interface CommonNativeWebViewProps extends ViewProps {
|
266
|
272
|
source: any;
|
267
|
273
|
userAgent?: string;
|
268
|
274
|
/**
|
269
|
|
- * Append to the existing user-agent. Overriden if `userAgent` is set.
|
|
275
|
+ * Append to the existing user-agent. Overridden if `userAgent` is set.
|
270
|
276
|
*/
|
271
|
277
|
applicationNameForUserAgent?: string;
|
272
|
278
|
}
|