react-native-minimal-webview 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +130 -2
  3. package/android/build.gradle +26 -0
  4. package/android/consumer-rules.pro +4 -0
  5. package/android/src/main/AndroidManifest.xml +2 -0
  6. package/android/src/main/java/expo/modules/minimalwebview/Asks.kt +44 -0
  7. package/android/src/main/java/expo/modules/minimalwebview/DocumentEnd.kt +31 -0
  8. package/android/src/main/java/expo/modules/minimalwebview/Hooks.kt +496 -0
  9. package/android/src/main/java/expo/modules/minimalwebview/MinimalWebView.kt +510 -0
  10. package/android/src/main/java/expo/modules/minimalwebview/MinimalWebViewClients.kt +359 -0
  11. package/android/src/main/java/expo/modules/minimalwebview/MinimalWebViewModule.kt +245 -0
  12. package/android/src/main/java/expo/modules/minimalwebview/MinimalWebViewNavigation.kt +199 -0
  13. package/android/src/main/java/expo/modules/minimalwebview/MinimalWebViewScripts.kt +191 -0
  14. package/android/src/main/java/expo/modules/minimalwebview/NavigationRules.kt +113 -0
  15. package/android/src/main/java/expo/modules/minimalwebview/PlatformSettings.kt +306 -0
  16. package/android/src/main/java/expo/modules/minimalwebview/PullToRefresh.kt +76 -0
  17. package/android/src/main/java/expo/modules/minimalwebview/requests/Downloads.kt +258 -0
  18. package/android/src/main/java/expo/modules/minimalwebview/requests/FileUpload.kt +44 -0
  19. package/android/src/main/java/expo/modules/minimalwebview/requests/FullscreenVideo.kt +87 -0
  20. package/android/src/main/java/expo/modules/minimalwebview/requests/Permissions.kt +77 -0
  21. package/build/WebView.d.ts +99 -0
  22. package/build/WebView.d.ts.map +1 -0
  23. package/build/WebView.js +448 -0
  24. package/build/WebView.js.map +1 -0
  25. package/build/bridge/createBridge.d.ts +32 -0
  26. package/build/bridge/createBridge.d.ts.map +1 -0
  27. package/build/bridge/createBridge.js +135 -0
  28. package/build/bridge/createBridge.js.map +1 -0
  29. package/build/bridge/endpoint.d.ts +35 -0
  30. package/build/bridge/endpoint.d.ts.map +1 -0
  31. package/build/bridge/endpoint.js +100 -0
  32. package/build/bridge/endpoint.js.map +1 -0
  33. package/build/bridge/origins.d.ts +25 -0
  34. package/build/bridge/origins.d.ts.map +1 -0
  35. package/build/bridge/origins.js +60 -0
  36. package/build/bridge/origins.js.map +1 -0
  37. package/build/bridge/pageClient.generated.d.ts +3 -0
  38. package/build/bridge/pageClient.generated.d.ts.map +1 -0
  39. package/build/bridge/pageClient.generated.js +4 -0
  40. package/build/bridge/pageClient.generated.js.map +1 -0
  41. package/build/bridge/protocol.d.ts +50 -0
  42. package/build/bridge/protocol.d.ts.map +1 -0
  43. package/build/bridge/protocol.js +52 -0
  44. package/build/bridge/protocol.js.map +1 -0
  45. package/build/defaultNavigationRules.d.ts +16 -0
  46. package/build/defaultNavigationRules.d.ts.map +1 -0
  47. package/build/defaultNavigationRules.js +23 -0
  48. package/build/defaultNavigationRules.js.map +1 -0
  49. package/build/index.d.ts +31 -0
  50. package/build/index.d.ts.map +1 -0
  51. package/build/index.js +30 -0
  52. package/build/index.js.map +1 -0
  53. package/build/platform.generated.d.ts +702 -0
  54. package/build/platform.generated.d.ts.map +1 -0
  55. package/build/platform.generated.js +199 -0
  56. package/build/platform.generated.js.map +1 -0
  57. package/build/reactNativeWebViewDefaults.d.ts +21 -0
  58. package/build/reactNativeWebViewDefaults.d.ts.map +1 -0
  59. package/build/reactNativeWebViewDefaults.js +12 -0
  60. package/build/reactNativeWebViewDefaults.js.map +1 -0
  61. package/build/reactNativeWebViewMessages.d.ts +22 -0
  62. package/build/reactNativeWebViewMessages.d.ts.map +1 -0
  63. package/build/reactNativeWebViewMessages.js +30 -0
  64. package/build/reactNativeWebViewMessages.js.map +1 -0
  65. package/build/refStore.d.ts +31 -0
  66. package/build/refStore.d.ts.map +1 -0
  67. package/build/refStore.js +113 -0
  68. package/build/refStore.js.map +1 -0
  69. package/build/types.d.ts +1127 -0
  70. package/build/types.d.ts.map +1 -0
  71. package/build/types.defaults.d.ts +8 -0
  72. package/build/types.defaults.d.ts.map +1 -0
  73. package/build/types.defaults.js +17 -0
  74. package/build/types.defaults.js.map +1 -0
  75. package/build/types.js +2 -0
  76. package/build/types.js.map +1 -0
  77. package/expo-module.config.json +9 -0
  78. package/ios/Asks.swift +45 -0
  79. package/ios/DelegateProxy.swift +162 -0
  80. package/ios/DocumentEnd.swift +23 -0
  81. package/ios/DownloadName.swift +12 -0
  82. package/ios/Downloads.swift +51 -0
  83. package/ios/Hooks.swift +308 -0
  84. package/ios/Loads.swift +44 -0
  85. package/ios/MRWExceptions.h +9 -0
  86. package/ios/MRWExceptions.m +10 -0
  87. package/ios/MRWInvoke.h +23 -0
  88. package/ios/MRWInvoke.m +187 -0
  89. package/ios/MinimalWebView+Dialogs.swift +99 -0
  90. package/ios/MinimalWebView+Navigation.swift +244 -0
  91. package/ios/MinimalWebView+Scripts.swift +92 -0
  92. package/ios/MinimalWebView.docc/MinimalWebView.md +13 -0
  93. package/ios/MinimalWebView.podspec +32 -0
  94. package/ios/MinimalWebView.swift +512 -0
  95. package/ios/MinimalWebViewModule.swift +110 -0
  96. package/ios/NavigationRules.swift +123 -0
  97. package/ios/OriginRules.swift +35 -0
  98. package/ios/PlatformCompletions.generated.swift +39 -0
  99. package/ios/PlatformSettings.swift +247 -0
  100. package/ios/ReadAccess.swift +19 -0
  101. package/ios/Recovery.swift +25 -0
  102. package/ios/SharedCookies.swift +59 -0
  103. package/package.json +94 -4
  104. package/src/WebView.tsx +623 -0
  105. package/src/bridge/createBridge.ts +176 -0
  106. package/src/bridge/endpoint.ts +119 -0
  107. package/src/bridge/origins.ts +62 -0
  108. package/src/bridge/pageClient.generated.ts +5 -0
  109. package/src/bridge/pageClient.ts +68 -0
  110. package/src/bridge/protocol.ts +78 -0
  111. package/src/defaultNavigationRules.ts +25 -0
  112. package/src/index.ts +37 -0
  113. package/src/platform.generated.ts +694 -0
  114. package/src/reactNativeWebViewDefaults.ts +13 -0
  115. package/src/reactNativeWebViewMessages.ts +32 -0
  116. package/src/refStore.ts +164 -0
  117. package/src/types.defaults.ts +24 -0
  118. package/src/types.ts +1194 -0
@@ -0,0 +1,694 @@
1
+ // Generated by .github/scripts/gen-platform-types.mts from .github/scripts/platform-headers/. Do not edit.
2
+
3
+ /**
4
+ * An iOS struct the settings channel carries as an object.
5
+ * @group Platform settings
6
+ * @ios
7
+ */
8
+ export type UIEdgeInsets = { top: number; left: number; bottom: number; right: number };
9
+
10
+ /**
11
+ * An iOS struct the settings channel carries as an object.
12
+ * @group Platform settings
13
+ * @ios
14
+ */
15
+ export type CGPoint = { x: number; y: number };
16
+
17
+ /**
18
+ * An iOS struct the settings channel carries as an object.
19
+ * @group Platform settings
20
+ * @ios
21
+ */
22
+ export type CGSize = { width: number; height: number };
23
+
24
+ /**
25
+ * An iOS struct the settings channel carries as an object.
26
+ * @group Platform settings
27
+ * @ios
28
+ */
29
+ export type CGRect = { x: number; y: number; width: number; height: number };
30
+
31
+ /**
32
+ * The iOS settings keys by root: the writable WebKit and UIScrollView properties the settings channel can carry, from
33
+ * the SDK headers.
34
+ *
35
+ * A key a newer SDK adds goes under the root's `other`.
36
+ * @group Platform settings
37
+ * @ios
38
+ */
39
+ export type IOSSettingKeys = {
40
+ /** `WKWebViewConfiguration` */
41
+ configuration: {
42
+ /** @since iOS 9.0 */
43
+ websiteDataStore?: 'default' | 'nonPersistent';
44
+ suppressesIncrementalRendering?: boolean;
45
+ /** @since iOS 9.0 */
46
+ applicationNameForUserAgent?: string | null;
47
+ /** @since iOS 9.0 */
48
+ allowsAirPlayForMediaPlayback?: boolean;
49
+ /** @since iOS 26.0 */
50
+ showsSystemScreenTimeBlockingView?: boolean;
51
+ /** @since iOS 14.5 */
52
+ upgradeKnownHostsToHTTPS?: boolean;
53
+ /**
54
+ * A {@link IOSConstants.AudiovisualMediaTypes}.
55
+ * @since iOS 10.0
56
+ */
57
+ mediaTypesRequiringUserActionForPlayback?: number;
58
+ /** @since iOS 14.0 */
59
+ limitsNavigationsToAppBoundDomains?: boolean;
60
+ /** @since iOS 17.0 */
61
+ allowsInlinePredictions?: boolean;
62
+ allowsInlineMediaPlayback?: boolean;
63
+ /**
64
+ * A {@link IOSConstants.SelectionGranularity}.
65
+ * @since iOS 8.0
66
+ * @deprecated This property is ignored; selection granularity is always `character`.
67
+ */
68
+ selectionGranularity?: number;
69
+ /** @since iOS 9.0 */
70
+ allowsPictureInPictureMediaPlayback?: boolean;
71
+ /**
72
+ * A {@link IOSConstants.DataDetectorTypes}.
73
+ * @since iOS 10.0
74
+ */
75
+ dataDetectorTypes?: number;
76
+ /** @since iOS 10.0 */
77
+ ignoresViewportScaleLimits?: boolean;
78
+ /** @since iOS 18.0 */
79
+ supportsAdaptiveImageGlyph?: boolean;
80
+ /** @since iOS 18.0 */
81
+ writingToolsBehavior?: number;
82
+ /**
83
+ * @since iOS 8.0
84
+ * @deprecated use mediaTypesRequiringUserActionForPlayback
85
+ */
86
+ mediaPlaybackRequiresUserAction?: boolean;
87
+ /**
88
+ * @since iOS 8.0
89
+ * @deprecated use allowsAirPlayForMediaPlayback
90
+ */
91
+ mediaPlaybackAllowsAirPlay?: boolean;
92
+ /**
93
+ * @since iOS 9.0
94
+ * @deprecated use mediaTypesRequiringUserActionForPlayback
95
+ */
96
+ requiresUserActionForMediaPlayback?: boolean;
97
+ };
98
+ /** `WKPreferences` */
99
+ preferences: {
100
+ minimumFontSize?: number;
101
+ javaScriptCanOpenWindowsAutomatically?: boolean;
102
+ /** @since iOS 13.0 */
103
+ fraudulentWebsiteWarningEnabled?: boolean;
104
+ /** @since iOS 16.4 */
105
+ shouldPrintBackgrounds?: boolean;
106
+ /** @since iOS 14.5 */
107
+ textInteractionEnabled?: boolean;
108
+ /** @since iOS 15.4 */
109
+ siteSpecificQuirksModeEnabled?: boolean;
110
+ /** @since iOS 15.4 */
111
+ elementFullscreenEnabled?: boolean;
112
+ /**
113
+ * A {@link IOSConstants.InactiveSchedulingPolicy}.
114
+ * @since iOS 17.0
115
+ */
116
+ inactiveSchedulingPolicy?: number;
117
+ /**
118
+ * @since iOS 8.0
119
+ * @deprecated Use WKWebpagePreferences.allowsContentJavaScript to disable content JavaScript on a per-navigation basis
120
+ */
121
+ javaScriptEnabled?: boolean;
122
+ };
123
+ /** `WKWebpagePreferences` */
124
+ webpagePreferences: {
125
+ /**
126
+ * A {@link IOSConstants.ContentMode}.
127
+ * @since iOS 13.0
128
+ */
129
+ preferredContentMode?: number;
130
+ /** @since iOS 14.0 */
131
+ allowsContentJavaScript?: boolean;
132
+ /** @since iOS 16.0 */
133
+ lockdownModeEnabled?: boolean;
134
+ /**
135
+ * A {@link IOSConstants.WebpagePreferencesUpgradeToHTTPSPolicy}.
136
+ * @since iOS 18.2
137
+ */
138
+ preferredHTTPSNavigationPolicy?: number;
139
+ /**
140
+ * A {@link IOSConstants.SecurityRestrictionMode}.
141
+ * @since iOS 26.4
142
+ */
143
+ securityRestrictionMode?: number;
144
+ /** @since iOS 27.0 */
145
+ overrideReferrer?: string | null;
146
+ /** @since iOS 27.0 */
147
+ allowsJSHandleCreationInPageWorld?: boolean;
148
+ /** @since iOS 27.0 */
149
+ globalPrivacyControlEnabled?: boolean;
150
+ };
151
+ /** `WKWebView` */
152
+ webView: {
153
+ allowsBackForwardNavigationGestures?: boolean;
154
+ /** @since iOS 9.0 */
155
+ customUserAgent?: string | null;
156
+ /** @since iOS 9.0 */
157
+ allowsLinkPreview?: boolean;
158
+ /** @since iOS 14.0 */
159
+ pageZoom?: number;
160
+ /** @since iOS 14.0 */
161
+ mediaType?: string | null;
162
+ /** @since iOS 15.0 */
163
+ underPageBackgroundColor?: string | null;
164
+ /** @since iOS 16.0 */
165
+ findInteractionEnabled?: boolean;
166
+ /** @since iOS 16.4 */
167
+ inspectable?: boolean;
168
+ /** @since iOS 26.0 */
169
+ obscuredContentInsets?: UIEdgeInsets;
170
+ };
171
+ /** `UIScrollView` */
172
+ scrollView: {
173
+ contentOffset?: CGPoint;
174
+ contentSize?: CGSize;
175
+ contentInset?: UIEdgeInsets;
176
+ /** @since iOS 17.4 */
177
+ contentAlignmentPoint?: CGPoint;
178
+ /**
179
+ * A {@link IOSConstants.ContentInsetAdjustmentBehavior}.
180
+ * @since iOS 11.0
181
+ */
182
+ contentInsetAdjustmentBehavior?: number;
183
+ /** @since iOS 13.0 */
184
+ automaticallyAdjustsScrollIndicatorInsets?: boolean;
185
+ directionalLockEnabled?: boolean;
186
+ bounces?: boolean;
187
+ /** @since iOS 17.4 */
188
+ bouncesHorizontally?: boolean;
189
+ /** @since iOS 17.4 */
190
+ bouncesVertically?: boolean;
191
+ alwaysBounceVertical?: boolean;
192
+ alwaysBounceHorizontal?: boolean;
193
+ pagingEnabled?: boolean;
194
+ scrollEnabled?: boolean;
195
+ /** @since iOS 17.4 */
196
+ transfersHorizontalScrollingToParent?: boolean;
197
+ /** @since iOS 17.4 */
198
+ transfersVerticalScrollingToParent?: boolean;
199
+ showsVerticalScrollIndicator?: boolean;
200
+ showsHorizontalScrollIndicator?: boolean;
201
+ /** A {@link IOSConstants.IndicatorStyle}. */
202
+ indicatorStyle?: number;
203
+ /** @since iOS 11.1 */
204
+ verticalScrollIndicatorInsets?: UIEdgeInsets;
205
+ /** @since iOS 11.1 */
206
+ horizontalScrollIndicatorInsets?: UIEdgeInsets;
207
+ scrollIndicatorInsets?: UIEdgeInsets;
208
+ /** @since iOS 3.0 */
209
+ decelerationRate?: number;
210
+ delaysContentTouches?: boolean;
211
+ canCancelContentTouches?: boolean;
212
+ minimumZoomScale?: number;
213
+ maximumZoomScale?: number;
214
+ /** @since iOS 3.0 */
215
+ zoomScale?: number;
216
+ bouncesZoom?: boolean;
217
+ scrollsToTop?: boolean;
218
+ /**
219
+ * A {@link IOSConstants.KeyboardDismissMode}.
220
+ * @since iOS 7.0
221
+ */
222
+ keyboardDismissMode?: number;
223
+ /** @since iOS 17.0 */
224
+ allowsKeyboardScrolling?: boolean;
225
+ };
226
+ };
227
+
228
+ /**
229
+ * The Android settings keys by root: the one-argument `WebSettings`, `WebView` and `CookieManager` setters, then
230
+ * `WebSettingsCompat`'s and `WebViewCompat`'s statics, then the scroll setters `WebView` inherits from `View`.
231
+ *
232
+ * A key a newer SDK or androidx.webkit adds goes under the root's `other`.
233
+ * @group Platform settings
234
+ * @android
235
+ */
236
+ export type AndroidSettingKeys = {
237
+ /** `WebSettings`, then `WebSettingsCompat` */
238
+ settings: {
239
+ /** @since Android API 33 */
240
+ algorithmicDarkeningAllowed?: boolean;
241
+ /** @since Android API 11 */
242
+ allowContentAccess?: boolean;
243
+ /** @since Android API 3 */
244
+ allowFileAccess?: boolean;
245
+ /**
246
+ * @since Android API 16
247
+ * @deprecated since API 30
248
+ */
249
+ allowFileAccessFromFileURLs?: boolean;
250
+ /**
251
+ * @since Android API 16
252
+ * @deprecated since API 30
253
+ */
254
+ allowUniversalAccessFromFileURLs?: boolean;
255
+ /** @since Android API 1 */
256
+ blockNetworkImage?: boolean;
257
+ /** @since Android API 8 */
258
+ blockNetworkLoads?: boolean;
259
+ /** @since Android API 3 */
260
+ builtInZoomControls?: boolean;
261
+ /** @since Android API 1 */
262
+ cacheMode?: number;
263
+ /** @since Android API 1 */
264
+ cursiveFontFamily?: string | null;
265
+ /**
266
+ * @since Android API 5
267
+ * @deprecated since API 35
268
+ */
269
+ databaseEnabled?: boolean;
270
+ /**
271
+ * @since Android API 5
272
+ * @deprecated since API 19
273
+ */
274
+ databasePath?: string | null;
275
+ /** @since Android API 1 */
276
+ defaultFixedFontSize?: number;
277
+ /** @since Android API 1 */
278
+ defaultFontSize?: number;
279
+ /** @since Android API 1 */
280
+ defaultTextEncodingName?: string | null;
281
+ /** @since Android API 24 */
282
+ disabledActionModeMenuItems?: number;
283
+ /** @since Android API 11 */
284
+ displayZoomControls?: boolean;
285
+ /** @since Android API 7 */
286
+ domStorageEnabled?: boolean;
287
+ /**
288
+ * @since Android API 11
289
+ * @deprecated since API 17
290
+ */
291
+ enableSmoothTransition?: boolean;
292
+ /** @since Android API 1 */
293
+ fantasyFontFamily?: string | null;
294
+ /** @since Android API 1 */
295
+ fixedFontFamily?: string | null;
296
+ /**
297
+ * @since Android API 29
298
+ * @deprecated since API 33
299
+ */
300
+ forceDark?: number;
301
+ /**
302
+ * @since Android API 5
303
+ * @deprecated since API 24
304
+ */
305
+ geolocationDatabasePath?: string | null;
306
+ /** @since Android API 5 */
307
+ geolocationEnabled?: boolean;
308
+ /** @since Android API 1 */
309
+ javaScriptCanOpenWindowsAutomatically?: boolean;
310
+ /** @since Android API 1 */
311
+ javaScriptEnabled?: boolean;
312
+ /**
313
+ * @since Android API 1
314
+ * @deprecated since API 18
315
+ */
316
+ lightTouchEnabled?: boolean;
317
+ /** @since Android API 7 */
318
+ loadWithOverviewMode?: boolean;
319
+ /** @since Android API 1 */
320
+ loadsImagesAutomatically?: boolean;
321
+ /** @since Android API 17 */
322
+ mediaPlaybackRequiresUserGesture?: boolean;
323
+ /** @since Android API 1 */
324
+ minimumFontSize?: number;
325
+ /** @since Android API 1 */
326
+ minimumLogicalFontSize?: number;
327
+ /** @since Android API 21 */
328
+ mixedContentMode?: number;
329
+ /** @since Android API 1 */
330
+ needInitialFocus?: boolean;
331
+ /** @since Android API 23 */
332
+ offscreenPreRaster?: boolean;
333
+ /** @since Android API 26 */
334
+ safeBrowsingEnabled?: boolean;
335
+ /** @since Android API 1 */
336
+ sansSerifFontFamily?: string | null;
337
+ /**
338
+ * @since Android API 1
339
+ * @deprecated since API 26
340
+ */
341
+ saveFormData?: boolean;
342
+ /**
343
+ * @since Android API 1
344
+ * @deprecated since API 18
345
+ */
346
+ savePassword?: boolean;
347
+ /** @since Android API 1 */
348
+ serifFontFamily?: string | null;
349
+ /** @since Android API 1 */
350
+ standardFontFamily?: string | null;
351
+ /** @since Android API 1 */
352
+ supportMultipleWindows?: boolean;
353
+ /** @since Android API 1 */
354
+ supportZoom?: boolean;
355
+ /** @since Android API 14 */
356
+ textZoom?: number;
357
+ /** @since Android API 1 */
358
+ useWideViewPort?: boolean;
359
+ /** @since Android API 3 */
360
+ userAgentString?: string | null;
361
+ /** `WebSettingsCompat`, WebView feature `ATTRIBUTION_REGISTRATION_BEHAVIOR` */
362
+ attributionRegistrationBehavior?: number;
363
+ /** `WebSettingsCompat`, WebView feature `BACK_FORWARD_CACHE` */
364
+ backForwardCacheEnabled?: boolean;
365
+ /** `WebSettingsCompat`, WebView feature `COOKIE_INTERCEPT` */
366
+ cookiesIncludedInShouldInterceptRequest?: boolean;
367
+ /** `WebSettingsCompat`, WebView feature `DOWNLOAD_FAVICONS_ENABLED` */
368
+ downloadFaviconsEnabled?: boolean;
369
+ /** `WebSettingsCompat`, WebView feature `ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY` */
370
+ enterpriseAuthenticationAppLinkPolicyEnabled?: boolean;
371
+ /**
372
+ * `WebSettingsCompat`, WebView feature `FORCE_DARK_STRATEGY`
373
+ * @deprecated in androidx.webkit
374
+ */
375
+ forceDarkStrategy?: number;
376
+ /** `WebSettingsCompat`, WebView feature `PAYMENT_REQUEST` */
377
+ hasEnrolledInstrumentEnabled?: boolean;
378
+ /** `WebSettingsCompat`, WebView feature `HYPERLINK_CONTEXT_MENU_ITEMS` */
379
+ hyperlinkContextMenuItems?: number;
380
+ /** `WebSettingsCompat`, WebView feature `PAYMENT_REQUEST` */
381
+ paymentRequestEnabled?: boolean;
382
+ /** `WebSettingsCompat`, WebView feature `SPECULATIVE_LOADING` */
383
+ speculativeLoadingStatus?: number;
384
+ /** `WebSettingsCompat`, WebView feature `WEB_AUTHENTICATION` */
385
+ webAuthenticationSupport?: number;
386
+ };
387
+ /** `WebView`, then `WebViewCompat`, then `CookieManager`, then `View`'s scroll setters */
388
+ webView: {
389
+ /** @since Android API 28 */
390
+ dataDirectorySuffix?: string | null;
391
+ /**
392
+ * @since Android API 1
393
+ * @deprecated since API 23
394
+ */
395
+ horizontalScrollbarOverlay?: boolean;
396
+ /** @since Android API 1 */
397
+ initialScale?: number;
398
+ /**
399
+ * @since Android API 1
400
+ * @deprecated since API 17
401
+ */
402
+ mapTrackballToArrowKeys?: boolean;
403
+ /** @since Android API 3 */
404
+ networkAvailable?: boolean;
405
+ /**
406
+ * @since Android API 1
407
+ * @deprecated since API 23
408
+ */
409
+ verticalScrollbarOverlay?: boolean;
410
+ /** `WebViewCompat`, WebView feature `MUTE_AUDIO` */
411
+ audioMuted?: boolean;
412
+ /** `WebViewCompat`, WebView feature `MULTI_PROFILE` */
413
+ profile?: string | null;
414
+ /**
415
+ * `CookieManager`
416
+ * @since Android API 21
417
+ */
418
+ acceptThirdPartyCookies?: boolean;
419
+ /**
420
+ * `View`
421
+ * @since Android API 1
422
+ */
423
+ horizontalScrollBarEnabled?: boolean;
424
+ /**
425
+ * `View`
426
+ * @since Android API 21
427
+ */
428
+ nestedScrollingEnabled?: boolean;
429
+ /**
430
+ * `View`
431
+ * @since Android API 9
432
+ */
433
+ overScrollMode?: number;
434
+ /**
435
+ * `View`
436
+ * @since Android API 16
437
+ */
438
+ scrollBarDefaultDelayBeforeFade?: number;
439
+ /**
440
+ * `View`
441
+ * @since Android API 16
442
+ */
443
+ scrollBarFadeDuration?: number;
444
+ /**
445
+ * `View`
446
+ * @since Android API 16
447
+ */
448
+ scrollBarSize?: number;
449
+ /**
450
+ * `View`
451
+ * @since Android API 1
452
+ */
453
+ scrollBarStyle?: number;
454
+ /**
455
+ * `View`
456
+ * @since Android API 31
457
+ */
458
+ scrollCaptureHint?: number;
459
+ /**
460
+ * `View`
461
+ * @since Android API 3
462
+ */
463
+ scrollContainer?: boolean;
464
+ /**
465
+ * `View`
466
+ * @since Android API 23
467
+ */
468
+ scrollIndicators?: number;
469
+ /**
470
+ * `View`
471
+ * @since Android API 14
472
+ */
473
+ scrollX?: number;
474
+ /**
475
+ * `View`
476
+ * @since Android API 14
477
+ */
478
+ scrollY?: number;
479
+ /**
480
+ * `View`
481
+ * @since Android API 5
482
+ */
483
+ scrollbarFadingEnabled?: boolean;
484
+ /**
485
+ * `View`
486
+ * @since Android API 1
487
+ */
488
+ verticalScrollBarEnabled?: boolean;
489
+ /**
490
+ * `View`
491
+ * @since Android API 11
492
+ */
493
+ verticalScrollbarPosition?: number;
494
+ };
495
+ };
496
+
497
+ /**
498
+ * WebKit's and UIScrollView's enums and option sets by raw value, for the iOS keys that take one:
499
+ * `configuration: { dataDetectorTypes: IOSConstants.DataDetectorTypes.link }`.
500
+ *
501
+ * An option set's `all` is the OR of its listed bits, not `NSUIntegerMax`, which JSON can't carry.
502
+ * `WebsiteDataType` has the data type names the `websiteDataStore` methods take, for `call`; `WebViewDataType` is
503
+ * the option set `webView.fetchDataOfTypes:` takes, and `CookiePolicy` the value
504
+ * `httpCookieStore.setCookiePolicy:completionHandler:` takes.
505
+ * @group Platform settings
506
+ * @ios
507
+ * @namespace
508
+ * @hideGroups
509
+ */
510
+ export const IOSConstants = {
511
+ /** @enum */
512
+ IndicatorStyle: {
513
+ default: 0,
514
+ black: 1,
515
+ white: 2,
516
+ },
517
+ /** @enum */
518
+ KeyboardDismissMode: {
519
+ none: 0,
520
+ onDrag: 1,
521
+ interactive: 2,
522
+ onDragWithAccessory: 3,
523
+ interactiveWithAccessory: 4,
524
+ },
525
+ /** @enum */
526
+ ContentInsetAdjustmentBehavior: {
527
+ automatic: 0,
528
+ scrollableAxes: 1,
529
+ never: 2,
530
+ always: 3,
531
+ },
532
+ /** @enum */
533
+ DataDetectorTypes: {
534
+ none: 0,
535
+ phoneNumber: 1,
536
+ link: 2,
537
+ address: 4,
538
+ calendarEvent: 8,
539
+ trackingNumber: 16,
540
+ flightNumber: 32,
541
+ lookupSuggestion: 64,
542
+ all: 127,
543
+ },
544
+ /** @enum */
545
+ CookiePolicy: {
546
+ allow: 0,
547
+ disallow: 1,
548
+ },
549
+ /** @enum */
550
+ InactiveSchedulingPolicy: {
551
+ suspend: 0,
552
+ throttle: 1,
553
+ none: 2,
554
+ },
555
+ /** @enum */
556
+ MediaPlaybackState: {
557
+ none: 0,
558
+ playing: 1,
559
+ paused: 2,
560
+ suspended: 3,
561
+ },
562
+ /** @enum */
563
+ MediaCaptureState: {
564
+ none: 0,
565
+ active: 1,
566
+ muted: 2,
567
+ },
568
+ /** @enum */
569
+ FullscreenState: {
570
+ notInFullscreen: 0,
571
+ enteringFullscreen: 1,
572
+ inFullscreen: 2,
573
+ exitingFullscreen: 3,
574
+ },
575
+ /** @enum */
576
+ WebViewDataType: {
577
+ sessionStorage: 1,
578
+ },
579
+ /** @enum */
580
+ SelectionGranularity: {
581
+ dynamic: 0,
582
+ character: 1,
583
+ },
584
+ /** @enum */
585
+ AudiovisualMediaTypes: {
586
+ none: 0,
587
+ audio: 1,
588
+ video: 2,
589
+ all: 3,
590
+ },
591
+ /** @enum */
592
+ ContentMode: {
593
+ recommended: 0,
594
+ mobile: 1,
595
+ desktop: 2,
596
+ },
597
+ /** @enum */
598
+ WebpagePreferencesUpgradeToHTTPSPolicy: {
599
+ keepAsRequested: 0,
600
+ automaticFallbackToHTTP: 1,
601
+ userMediatedFallbackToHTTP: 2,
602
+ errorOnFailure: 3,
603
+ },
604
+ /** @enum */
605
+ SecurityRestrictionMode: {
606
+ none: 0,
607
+ maximizeCompatibility: 1,
608
+ lockdown: 2,
609
+ },
610
+ /** @enum */
611
+ WebsiteDataType: {
612
+ fetchCache: 'WKWebsiteDataTypeFetchCache',
613
+ diskCache: 'WKWebsiteDataTypeDiskCache',
614
+ memoryCache: 'WKWebsiteDataTypeMemoryCache',
615
+ cookies: 'WKWebsiteDataTypeCookies',
616
+ sessionStorage: 'WKWebsiteDataTypeSessionStorage',
617
+ localStorage: 'WKWebsiteDataTypeLocalStorage',
618
+ webSQLDatabases: 'WKWebsiteDataTypeWebSQLDatabases',
619
+ indexedDBDatabases: 'WKWebsiteDataTypeIndexedDBDatabases',
620
+ serviceWorkerRegistrations: 'WKWebsiteDataTypeServiceWorkerRegistrations',
621
+ fileSystem: 'WKWebsiteDataTypeFileSystem',
622
+ searchFieldRecentSearches: 'WKWebsiteDataTypeSearchFieldRecentSearches',
623
+ mediaKeys: 'WKWebsiteDataTypeMediaKeys',
624
+ hashSalt: 'WKWebsiteDataTypeHashSalt',
625
+ screenTime: 'WKWebsiteDataTypeScreenTime',
626
+ },
627
+ } as const;
628
+
629
+ /**
630
+ * The `WebSettings`, `WebView`, `WebSettingsCompat` and `WebViewCompat` constants:
631
+ * `settings: { cacheMode: AndroidConstants.WebSettings.LOAD_NO_CACHE }`.
632
+ * @group Platform settings
633
+ * @android
634
+ * @namespace
635
+ * @hideGroups
636
+ */
637
+ export const AndroidConstants = {
638
+ /** @enum */
639
+ WebSettings: {
640
+ FORCE_DARK_AUTO: 1,
641
+ FORCE_DARK_OFF: 0,
642
+ FORCE_DARK_ON: 2,
643
+ LOAD_CACHE_ELSE_NETWORK: 1,
644
+ LOAD_CACHE_ONLY: 3,
645
+ LOAD_DEFAULT: -1,
646
+ LOAD_NORMAL: 0,
647
+ LOAD_NO_CACHE: 2,
648
+ MENU_ITEM_NONE: 0,
649
+ MENU_ITEM_PROCESS_TEXT: 4,
650
+ MENU_ITEM_SHARE: 1,
651
+ MENU_ITEM_WEB_SEARCH: 2,
652
+ MIXED_CONTENT_ALWAYS_ALLOW: 0,
653
+ MIXED_CONTENT_COMPATIBILITY_MODE: 2,
654
+ MIXED_CONTENT_NEVER_ALLOW: 1,
655
+ },
656
+ /** @enum */
657
+ WebView: {
658
+ RENDERER_PRIORITY_BOUND: 1,
659
+ RENDERER_PRIORITY_IMPORTANT: 2,
660
+ RENDERER_PRIORITY_WAIVED: 0,
661
+ SCHEME_GEO: 'geo:0,0?q=',
662
+ SCHEME_MAILTO: 'mailto:',
663
+ SCHEME_TEL: 'tel:',
664
+ },
665
+ /** @enum */
666
+ WebSettingsCompat: {
667
+ ATTRIBUTION_BEHAVIOR_APP_SOURCE_AND_APP_TRIGGER: 3,
668
+ ATTRIBUTION_BEHAVIOR_APP_SOURCE_AND_WEB_TRIGGER: 1,
669
+ ATTRIBUTION_BEHAVIOR_DISABLED: 0,
670
+ ATTRIBUTION_BEHAVIOR_WEB_SOURCE_AND_WEB_TRIGGER: 2,
671
+ /** @deprecated */
672
+ DARK_STRATEGY_PREFER_WEB_THEME_OVER_USER_AGENT_DARKENING: 2,
673
+ /** @deprecated */
674
+ DARK_STRATEGY_USER_AGENT_DARKENING_ONLY: 0,
675
+ /** @deprecated */
676
+ DARK_STRATEGY_WEB_THEME_DARKENING_ONLY: 1,
677
+ /** @deprecated */
678
+ FORCE_DARK_AUTO: 1,
679
+ /** @deprecated */
680
+ FORCE_DARK_OFF: 0,
681
+ /** @deprecated */
682
+ FORCE_DARK_ON: 2,
683
+ SPECULATIVE_LOADING_DISABLED: 0,
684
+ SPECULATIVE_LOADING_PRERENDER_ENABLED: 1,
685
+ WEB_AUTHENTICATION_SUPPORT_FOR_APP: 1,
686
+ WEB_AUTHENTICATION_SUPPORT_FOR_BROWSER: 2,
687
+ WEB_AUTHENTICATION_SUPPORT_NONE: 0,
688
+ },
689
+ /** @enum */
690
+ WebViewCompat: {
691
+ INJECTION_EVENT_DOCUMENT_END: 1,
692
+ INJECTION_EVENT_DOCUMENT_START: 0,
693
+ },
694
+ } as const;
@@ -0,0 +1,13 @@
1
+ import type { AndroidSettings, IOSSettings } from './types';
2
+
3
+ /**
4
+ * Defaults taken from react-native-webview, so that an app migrated from it behaves as before. Each is a plain boolean
5
+ * an app sets back through `ios` or `android`, not a design decision of this package.
6
+ */
7
+ export const REACT_NATIVE_WEBVIEW_DEFAULTS = {
8
+ ios: { scrollView: { directionalLockEnabled: true } },
9
+ android: {
10
+ settings: { useWideViewPort: true, loadWithOverviewMode: true },
11
+ webView: { acceptThirdPartyCookies: true },
12
+ },
13
+ } satisfies { ios: IOSSettings; android: AndroidSettings };