Thibault Malbranche 6 年之前
父節點
當前提交
508b44ecb0
共有 9 個文件被更改,包括 550 次插入10 次删除
  1. 0
    6
      index.js
  2. 9
    0
      index.ts
  3. 3
    3
      package.json
  4. 1
    1
      tsconfig.json
  5. 5
    0
      types/index.d.ts
  6. 54
    0
      types/src/WebView.android.d.ts
  7. 114
    0
      types/src/WebView.ios.d.ts
  8. 6
    0
      types/src/WebViewShared.d.ts
  9. 358
    0
      types/src/types/WebViewTypes.d.ts

+ 0
- 6
index.js 查看文件

@@ -1,6 +0,0 @@
1
-import WebView from './src/WebView';
2
-
3
-// We keep this for compatibility reasons.
4
-export { WebView };
5
-
6
-export default WebView;

+ 9
- 0
index.ts 查看文件

@@ -0,0 +1,9 @@
1
+import { Platform } from 'react-native';
2
+import WebViewIOS from './src/WebView.ios';
3
+import WebViewAndroid from './src/WebView.android';
4
+
5
+// We keep this for compatibility reasons.
6
+const WebView = Platform.OS === 'android' ? WebViewAndroid : WebViewIOS;
7
+export { WebView };
8
+
9
+export default WebView;

+ 3
- 3
package.json 查看文件

@@ -1,8 +1,8 @@
1 1
 {
2 2
   "name": "react-native-webview",
3 3
   "description": "React Native WebView component for iOS, Android, and Windows 10 (coming soon)",
4
-  "main": "lib/index.js",
5
-  "types": "lib/index.d.ts",
4
+  "main": "index.ts",
5
+  "types": "types/index.d.ts",
6 6
   "author": "Jamon Holmgren <jamon@infinite.red>",
7 7
   "contributors": [
8 8
     "Thibault Malbranche <malbranche.thibault@gmail.com>"
@@ -51,4 +51,4 @@
51 51
     "type": "git",
52 52
     "url": "https://github.com/react-native-community/react-native-webview.git"
53 53
   }
54
-}
54
+}

+ 1
- 1
tsconfig.json 查看文件

@@ -17,6 +17,6 @@
17 17
     "skipLibCheck": true,
18 18
     "strict": true
19 19
   },
20
-  "include": ["src", "index.js"],
20
+  "include": ["src", "index.ts"],
21 21
   "exclude": ["node_modules", "index.flow.js", "types"]
22 22
 }

+ 5
- 0
types/index.d.ts 查看文件

@@ -0,0 +1,5 @@
1
+import WebViewIOS from './src/WebView.ios';
2
+import WebViewAndroid from './src/WebView.android';
3
+declare const WebView: typeof WebViewAndroid | typeof WebViewIOS;
4
+export { WebView };
5
+export default WebView;

+ 54
- 0
types/src/WebView.android.d.ts 查看文件

@@ -0,0 +1,54 @@
1
+import React from 'react';
2
+import { NativeSyntheticEvent } from 'react-native';
3
+import { WebViewError, WebViewSharedProps, WebViewProgressEvent } from './types/WebViewTypes';
4
+declare enum WebViewState {
5
+    IDLE = "IDLE",
6
+    LOADING = "LOADING",
7
+    ERROR = "ERROR"
8
+}
9
+declare type State = {
10
+    viewState: WebViewState;
11
+    lastErrorEvent: WebViewError | null;
12
+};
13
+/**
14
+ * Renders a native WebView.
15
+ */
16
+export default class WebView extends React.Component<WebViewSharedProps, State> {
17
+    static defaultProps: {
18
+        overScrollMode: string;
19
+        javaScriptEnabled: boolean;
20
+        thirdPartyCookiesEnabled: boolean;
21
+        scalesPageToFit: boolean;
22
+        allowFileAccess: boolean;
23
+        saveFormDataDisabled: boolean;
24
+        originWhitelist: string[];
25
+    };
26
+    static isFileUploadSupported: () => Promise<boolean>;
27
+    state: State;
28
+    webViewRef: React.RefObject<React.ComponentClass<{}, any>>;
29
+    goForward: () => void;
30
+    goBack: () => void;
31
+    reload: () => void;
32
+    stopLoading: () => void;
33
+    postMessage: (data: string) => void;
34
+    /**
35
+     * Injects a javascript string into the referenced WebView. Deliberately does not
36
+     * return a response because using eval() to return a response breaks this method
37
+     * on pages with a Content Security Policy that disallows eval(). If you need that
38
+     * functionality, look into postMessage/onMessage.
39
+     */
40
+    injectJavaScript: (data: string) => void;
41
+    /**
42
+     * We return an event with a bunch of fields including:
43
+     *  url, title, loading, canGoBack, canGoForward
44
+     */
45
+    updateNavigationState: (event: NativeSyntheticEvent<import("./types/WebViewTypes").WebViewNavigation>) => void;
46
+    getWebViewHandle: () => number | null;
47
+    onLoadingStart: (event: NativeSyntheticEvent<import("./types/WebViewTypes").WebViewNavigation>) => void;
48
+    onLoadingError: (event: NativeSyntheticEvent<WebViewError>) => void;
49
+    onLoadingFinish: (event: NativeSyntheticEvent<import("./types/WebViewTypes").WebViewNavigation>) => void;
50
+    onMessage: (event: NativeSyntheticEvent<import("./types/WebViewTypes").WebViewMessage>) => void;
51
+    onLoadingProgress: (event: NativeSyntheticEvent<WebViewProgressEvent>) => void;
52
+    render(): React.ReactNode;
53
+}
54
+export {};

+ 114
- 0
types/src/WebView.ios.d.ts 查看文件

@@ -0,0 +1,114 @@
1
+import React from 'react';
2
+import { NativeSyntheticEvent } from 'react-native';
3
+import { WebViewError, WebViewSharedProps, WebViewProgressEvent } from './types/WebViewTypes';
4
+declare enum WebViewState {
5
+    IDLE = "IDLE",
6
+    LOADING = "LOADING",
7
+    ERROR = "ERROR"
8
+}
9
+declare enum NavigationType {
10
+    click = "click",
11
+    formsubmit = "formsubmit",
12
+    backforward = "backforward",
13
+    reload = "reload",
14
+    formresubmit = "formresubmit",
15
+    other = "other"
16
+}
17
+declare type State = {
18
+    viewState: WebViewState;
19
+    lastErrorEvent: WebViewError | null;
20
+};
21
+/**
22
+ * `WebView` renders web content in a native view.
23
+ *
24
+ *```
25
+ * import React, { Component } from 'react';
26
+ * import { WebView } from 'react-native';
27
+ *
28
+ * class MyWeb extends Component {
29
+ *   render() {
30
+ *     return (
31
+ *       <WebView
32
+ *         source={{uri: 'https://github.com/facebook/react-native'}}
33
+ *         style={{marginTop: 20}}
34
+ *       />
35
+ *     );
36
+ *   }
37
+ * }
38
+ *```
39
+ *
40
+ * You can use this component to navigate back and forth in the web view's
41
+ * history and configure various properties for the web content.
42
+ */
43
+export default class WebView extends React.Component<WebViewSharedProps, State> {
44
+    static JSNavigationScheme: string;
45
+    static NavigationType: typeof NavigationType;
46
+    static defaultProps: {
47
+        useWebKit: boolean;
48
+        originWhitelist: string[];
49
+    };
50
+    static isFileUploadSupported: () => Promise<boolean>;
51
+    state: State;
52
+    webViewRef: React.RefObject<React.ComponentClass<{}, any>>;
53
+    UNSAFE_componentWillMount(): void;
54
+    _getCommands(): {
55
+        goForward: () => void;
56
+        goBack: () => void;
57
+        reload: () => void;
58
+        stopLoading: () => void;
59
+        postMessage: () => void;
60
+        injectJavaScript: () => void;
61
+    };
62
+    /**
63
+     * Go forward one page in the web view's history.
64
+     */
65
+    goForward: () => void;
66
+    /**
67
+     * Go back one page in the web view's history.
68
+     */
69
+    goBack: () => void;
70
+    /**
71
+     * Reloads the current page.
72
+     */
73
+    reload: () => void;
74
+    /**
75
+     * Stop loading the current page.
76
+     */
77
+    stopLoading: () => void;
78
+    /**
79
+     * Posts a message to the web view, which will emit a `message` event.
80
+     * Accepts one argument, `data`, which must be a string.
81
+     *
82
+     * In your webview, you'll need to something like the following.
83
+     *
84
+     * ```js
85
+     * document.addEventListener('message', e => { document.title = e.data; });
86
+     * ```
87
+     */
88
+    postMessage: (data: string) => void;
89
+    /**
90
+     * Injects a javascript string into the referenced WebView. Deliberately does not
91
+     * return a response because using eval() to return a response breaks this method
92
+     * on pages with a Content Security Policy that disallows eval(). If you need that
93
+     * functionality, look into postMessage/onMessage.
94
+     */
95
+    injectJavaScript: (data: string) => void;
96
+    /**
97
+     * We return an event with a bunch of fields including:
98
+     *  url, title, loading, canGoBack, canGoForward
99
+     */
100
+    _updateNavigationState: (event: NativeSyntheticEvent<import("./types/WebViewTypes").WebViewNavigation>) => void;
101
+    /**
102
+     * Returns the native `WebView` node.
103
+     */
104
+    getWebViewHandle: () => number | null;
105
+    _onLoadingStart: (event: NativeSyntheticEvent<import("./types/WebViewTypes").WebViewNavigation>) => void;
106
+    _onLoadingError: (event: NativeSyntheticEvent<WebViewError>) => void;
107
+    _onLoadingFinish: (event: NativeSyntheticEvent<import("./types/WebViewTypes").WebViewNavigation>) => void;
108
+    _onMessage: (event: NativeSyntheticEvent<import("./types/WebViewTypes").WebViewMessage>) => void;
109
+    _onLoadingProgress: (event: NativeSyntheticEvent<WebViewProgressEvent>) => void;
110
+    componentDidUpdate(prevProps: WebViewSharedProps): void;
111
+    _showRedboxOnPropChanges(prevProps: WebViewSharedProps, propName: 'allowsInlineMediaPlayback' | 'mediaPlaybackRequiresUserAction' | 'dataDetectorTypes'): void;
112
+    render(): React.ReactNode;
113
+}
114
+export {};

+ 6
- 0
types/src/WebViewShared.d.ts 查看文件

@@ -0,0 +1,6 @@
1
+declare const WebViewShared: {
2
+    defaultOriginWhitelist: string[];
3
+    extractOrigin: (url: string) => string;
4
+    originWhitelistToRegex: (originWhitelist: string) => string;
5
+};
6
+export default WebViewShared;

+ 358
- 0
types/src/types/WebViewTypes.d.ts 查看文件

@@ -0,0 +1,358 @@
1
+import { ComponentType, ReactElement, ReactNode } from 'react';
2
+import { Insets, NativeSyntheticEvent, StyleProp, ViewProps, ViewStyle } from 'react-native';
3
+declare module 'react-native' {
4
+    interface UIManagerStatic {
5
+        dispatchViewManagerCommand(node: any, callback: any, x: any): void;
6
+        RNCUIWebView: any;
7
+        RNCWKWebView: any;
8
+        RNCWebView: any;
9
+    }
10
+}
11
+export interface WebViewNativeEvent {
12
+    readonly url: string;
13
+    readonly loading: boolean;
14
+    readonly title: string;
15
+    readonly canGoBack: boolean;
16
+    readonly canGoForward: boolean;
17
+}
18
+export interface WebViewIOSLoadRequestEvent extends WebViewNativeEvent {
19
+    target: number;
20
+    lockIdentifier: number;
21
+    navigationType: 'click' | 'formsubmit' | 'backforward' | 'reload' | 'formresubmit' | 'other';
22
+}
23
+export interface WebViewProgressEvent extends WebViewNativeEvent {
24
+    readonly progress: number;
25
+}
26
+export interface WebViewNavigation extends WebViewNativeEvent {
27
+    readonly navigationType: 'click' | 'formsubmit' | 'backforward' | 'reload' | 'formresubmit' | 'other';
28
+}
29
+export interface WebViewMessage extends WebViewNativeEvent {
30
+    readonly data: string;
31
+}
32
+export interface WebViewError extends WebViewNativeEvent {
33
+    readonly domain?: string;
34
+    readonly code: number;
35
+    readonly description: string;
36
+}
37
+export declare type WebViewEvent = NativeSyntheticEvent<WebViewNativeEvent>;
38
+export declare type WebViewNavigationEvent = NativeSyntheticEvent<WebViewNavigation>;
39
+export declare type WebViewMessageEvent = NativeSyntheticEvent<WebViewMessage>;
40
+export declare type WebViewErrorEvent = NativeSyntheticEvent<WebViewError>;
41
+export declare type DataDetectorTypes = 'phoneNumber' | 'link' | 'address' | 'calendarEvent' | 'trackingNumber' | 'flightNumber' | 'lookupSuggestion' | 'none' | 'all';
42
+export declare type OverScrollModeType = 'always' | 'content' | 'never';
43
+export interface WebViewSourceUri {
44
+    /**
45
+     * The URI to load in the `WebView`. Can be a local or remote file.
46
+     */
47
+    uri?: string;
48
+    /**
49
+     * The HTTP Method to use. Defaults to GET if not specified.
50
+     * NOTE: On Android, only GET and POST are supported.
51
+     */
52
+    method?: string;
53
+    /**
54
+     * Additional HTTP headers to send with the request.
55
+     * NOTE: On Android, this can only be used with GET requests.
56
+     */
57
+    headers?: {
58
+        [key: string]: string;
59
+    };
60
+    /**
61
+     * The HTTP body to send with the request. This must be a valid
62
+     * UTF-8 string, and will be sent exactly as specified, with no
63
+     * additional encoding (e.g. URL-escaping or base64) applied.
64
+     * NOTE: On Android, this can only be used with POST requests.
65
+     */
66
+    body?: string;
67
+}
68
+export interface WebViewSourceHtml {
69
+    /**
70
+     * A static HTML page to display in the WebView.
71
+     */
72
+    html?: string;
73
+    /**
74
+     * The base URL to be used for any relative links in the HTML.
75
+     */
76
+    baseUrl?: string;
77
+}
78
+export declare type WebViewSource = WebViewSourceUri | WebViewSourceHtml;
79
+export interface WebViewNativeConfig {
80
+    component?: ComponentType<WebViewSharedProps>;
81
+    props?: any;
82
+    viewManager?: any;
83
+}
84
+export interface IOSWebViewProps {
85
+    /**
86
+     * If true, use WKWebView instead of UIWebView.
87
+     * @platform ios
88
+     */
89
+    useWebKit?: boolean;
90
+    /**
91
+     * Boolean value that determines whether the web view bounces
92
+     * when it reaches the edge of the content. The default value is `true`.
93
+     * @platform ios
94
+     */
95
+    bounces?: boolean;
96
+    /**
97
+     * A floating-point number that determines how quickly the scroll view
98
+     * decelerates after the user lifts their finger. You may also use the
99
+     * string shortcuts `"normal"` and `"fast"` which match the underlying iOS
100
+     * settings for `UIScrollViewDecelerationRateNormal` and
101
+     * `UIScrollViewDecelerationRateFast` respectively:
102
+     *
103
+     *   - normal: 0.998
104
+     *   - fast: 0.99 (the default for iOS web view)
105
+     * @platform ios
106
+     */
107
+    decelerationRate?: 'fast' | 'normal' | number;
108
+    /**
109
+     * Boolean value that determines whether scrolling is enabled in the
110
+     * `WebView`. The default value is `true`.
111
+     * @platform ios
112
+     */
113
+    scrollEnabled?: boolean;
114
+    /**
115
+     * If the value of this property is true, the scroll view stops on multiples
116
+     * of the scroll view’s bounds when the user scrolls.
117
+     * The default value is false.
118
+     * @platform ios
119
+     */
120
+    pagingEnabled?: boolean;
121
+    /**
122
+     * The amount by which the web view content is inset from the edges of
123
+     * the scroll view. Defaults to {top: 0, left: 0, bottom: 0, right: 0}.
124
+     * @platform ios
125
+     */
126
+    contentInset?: Insets;
127
+    /**
128
+     * Determines the types of data converted to clickable URLs in the web view's content.
129
+     * By default only phone numbers are detected.
130
+     *
131
+     * You can provide one type or an array of many types.
132
+     *
133
+     * Possible values for `dataDetectorTypes` are:
134
+     *
135
+     * - `'phoneNumber'`
136
+     * - `'link'`
137
+     * - `'address'`
138
+     * - `'calendarEvent'`
139
+     * - `'none'`
140
+     * - `'all'`
141
+     *
142
+     * With the new WebKit implementation, we have three new values:
143
+     * - `'trackingNumber'`,
144
+     * - `'flightNumber'`,
145
+     * - `'lookupSuggestion'`,
146
+     *
147
+     * @platform ios
148
+     */
149
+    dataDetectorTypes?: DataDetectorTypes | DataDetectorTypes[];
150
+    /**
151
+     * Function that allows custom handling of any web view requests. Return
152
+     * `true` from the function to continue loading the request and `false`
153
+     * to stop loading.
154
+     * @platform ios
155
+     */
156
+    onShouldStartLoadWithRequest?: (event: WebViewIOSLoadRequestEvent) => any;
157
+    /**
158
+     * Boolean that determines whether HTML5 videos play inline or use the
159
+     * native full-screen controller. The default value is `false`.
160
+     *
161
+     * **NOTE** : In order for video to play inline, not only does this
162
+     * property need to be set to `true`, but the video element in the HTML
163
+     * document must also include the `webkit-playsinline` attribute.
164
+     * @platform ios
165
+     */
166
+    allowsInlineMediaPlayback?: boolean;
167
+    /**
168
+     * Hide the accessory view when the keyboard is open. Default is false to be
169
+     * backward compatible.
170
+     */
171
+    hideKeyboardAccessoryView?: boolean;
172
+    /**
173
+     * If true, this will be able horizontal swipe gestures when using the WKWebView. The default value is `false`.
174
+     */
175
+    allowsBackForwardNavigationGestures?: boolean;
176
+    /**
177
+     * A Boolean value that determines whether pressing on a link
178
+     * displays a preview of the destination for the link.
179
+     *
180
+     * This property is available on devices that support 3D Touch.
181
+     * In iOS 10 and later, the default value is `true`; before that, the default value is `false`.
182
+     * @platform ios
183
+     */
184
+    allowsLinkPreview?: boolean;
185
+}
186
+export interface AndroidWebViewProps {
187
+    onNavigationStateChange?: (event: WebViewNavigation) => any;
188
+    onContentSizeChange?: (event: WebViewEvent) => any;
189
+    /**
190
+     * https://developer.android.com/reference/android/view/View#OVER_SCROLL_NEVER
191
+     * Sets the overScrollMode. Possible values are:
192
+     *
193
+     * - `'always'` (default)
194
+     * - `'content'`
195
+     * - `'never'`
196
+     *
197
+     * @platform android
198
+     */
199
+    overScrollMode?: OverScrollModeType;
200
+    /**
201
+     * Sets whether Geolocation is enabled. The default is false.
202
+     * @platform android
203
+     */
204
+    geolocationEnabled?: boolean;
205
+    /**
206
+     * Boolean that sets whether JavaScript running in the context of a file
207
+     * scheme URL should be allowed to access content from any origin.
208
+     * Including accessing content from other file scheme URLs
209
+     * @platform android
210
+     */
211
+    allowUniversalAccessFromFileURLs?: boolean;
212
+    /**
213
+     * Sets whether the webview allow access to file system.
214
+     * @platform android
215
+     */
216
+    allowFileAccess?: boolean;
217
+    /**
218
+     * Used on Android only, controls whether form autocomplete data should be saved
219
+     * @platform android
220
+     */
221
+    saveFormDataDisabled?: boolean;
222
+    urlPrefixesForDefaultIntent?: string[];
223
+    /**
224
+     * Boolean value to enable JavaScript in the `WebView`. Used on Android only
225
+     * as JavaScript is enabled by default on iOS. The default value is `true`.
226
+     * @platform android
227
+     */
228
+    javaScriptEnabled?: boolean;
229
+    /**
230
+     * Boolean value to enable third party cookies in the `WebView`. Used on
231
+     * Android Lollipop and above only as third party cookies are enabled by
232
+     * default on Android Kitkat and below and on iOS. The default value is `true`.
233
+     * @platform android
234
+     */
235
+    thirdPartyCookiesEnabled?: boolean;
236
+    /**
237
+     * Boolean value to control whether DOM Storage is enabled. Used only in
238
+     * Android.
239
+     * @platform android
240
+     */
241
+    domStorageEnabled?: boolean;
242
+    /**
243
+     * Sets the user-agent for the `WebView`.
244
+     * @platform android
245
+     */
246
+    userAgent?: string;
247
+    /**
248
+     * Specifies the mixed content mode. i.e WebView will allow a secure origin to load content from any other origin.
249
+     *
250
+     * Possible values for `mixedContentMode` are:
251
+     *
252
+     * - `'never'` (default) - WebView will not allow a secure origin to load content from an insecure origin.
253
+     * - `'always'` - WebView will allow a secure origin to load content from any other origin, even if that origin is insecure.
254
+     * - `'compatibility'` -  WebView will attempt to be compatible with the approach of a modern web browser with regard to mixed content.
255
+     * @platform android
256
+     */
257
+    mixedContentMode?: 'never' | 'always' | 'compatibility';
258
+}
259
+export interface WebViewSharedProps extends ViewProps, IOSWebViewProps, AndroidWebViewProps {
260
+    /**
261
+     * @Deprecated. Use `source` instead.
262
+     */
263
+    url?: string;
264
+    /**
265
+     * @Deprecated. Use `source` instead.
266
+     */
267
+    html?: string;
268
+    /**
269
+     * Loads static html or a uri (with optional headers) in the WebView.
270
+     */
271
+    source?: WebViewSource;
272
+    /**
273
+     * Function that returns a view to show if there's an error.
274
+     */
275
+    renderError?: (errorDomain: string | undefined, errorCode: number, errorDesc: string) => ReactElement<any>;
276
+    /**
277
+     * Function that returns a loading indicator.
278
+     */
279
+    renderLoading?: () => ReactElement<any>;
280
+    /**
281
+     * Function that is invoked when the `WebView` has finished loading.
282
+     */
283
+    onLoad?: (event: WebViewNavigationEvent) => any;
284
+    /**
285
+     * Function that is invoked when the `WebView` load succeeds or fails.
286
+     */
287
+    onLoadEnd?: (event: WebViewNavigationEvent | WebViewErrorEvent) => any;
288
+    /**
289
+     * Function that is invoked when the `WebView` starts loading.
290
+     */
291
+    onLoadStart?: (event: WebViewNavigationEvent) => any;
292
+    /**
293
+     * Function that is invoked when the `WebView` load fails.
294
+     */
295
+    onError?: (event: WebViewErrorEvent) => any;
296
+    /**
297
+     * Controls whether to adjust the content inset for web views that are
298
+     * placed behind a navigation bar, tab bar, or toolbar. The default value
299
+     * is `true`.
300
+     */
301
+    automaticallyAdjustContentInsets?: boolean;
302
+    /**
303
+     * Function that is invoked when the `WebView` loading starts or ends.
304
+     */
305
+    onNavigationStateChange?: (event: WebViewNavigation) => any;
306
+    /**
307
+     * A function that is invoked when the webview calls `window.postMessage`.
308
+     * Setting this property will inject a `postMessage` global into your
309
+     * webview, but will still call pre-existing values of `postMessage`.
310
+     *
311
+     * `window.postMessage` accepts one argument, `data`, which will be
312
+     * available on the event object, `event.nativeEvent.data`. `data`
313
+     * must be a string.
314
+     */
315
+    onMessage?: (event: WebViewMessageEvent) => any;
316
+    /**
317
+     * Function that is invoked when the `WebView` is loading.
318
+     */
319
+    onLoadProgress?: (event: NativeSyntheticEvent<WebViewProgressEvent>) => any;
320
+    /**
321
+     * Boolean value that forces the `WebView` to show the loading view
322
+     * on the first load.
323
+     */
324
+    startInLoadingState?: boolean;
325
+    /**
326
+     * Set this to provide JavaScript that will be injected into the web page
327
+     * when the view loads.
328
+     */
329
+    injectedJavaScript?: string;
330
+    /**
331
+     * Boolean that controls whether the web content is scaled to fit
332
+     * the view and enables the user to change the scale. The default value
333
+     * is `true`.
334
+     *
335
+     * On iOS, when `useWebKit=true`, this prop will not work.
336
+     */
337
+    scalesPageToFit?: boolean;
338
+    /**
339
+     * Boolean that determines whether HTML5 audio and video requires the user
340
+     * to tap them before they start playing. The default value is `true`.
341
+     */
342
+    mediaPlaybackRequiresUserAction?: boolean;
343
+    /**
344
+     * List of origin strings to allow being navigated to. The strings allow
345
+     * wildcards and get matched against *just* the origin (not the full URL).
346
+     * If the user taps to navigate to a new page but the new page is not in
347
+     * this whitelist, we will open the URL in Safari.
348
+     * The default whitelisted origins are "http://*" and "https://*".
349
+     */
350
+    originWhitelist?: string[];
351
+    /**
352
+     * Override the native component used to render the WebView. Enables a custom native
353
+     * WebView which uses the same JavaScript as the original WebView.
354
+     */
355
+    nativeConfig?: WebViewNativeConfig;
356
+    style?: StyleProp<ViewStyle>;
357
+    children?: ReactNode;
358
+}