Нема описа

RNCWebView.h 3.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /**
  2. * Copyright (c) 2015-present, Facebook, Inc.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. #import <React/RCTView.h>
  8. #import <React/RCTDefines.h>
  9. #import <WebKit/WebKit.h>
  10. @class RNCWebView;
  11. @protocol RNCWebViewDelegate <NSObject>
  12. - (BOOL)webView:(RNCWebView *_Nonnull)webView
  13. shouldStartLoadForRequest:(NSMutableDictionary<NSString *, id> *_Nonnull)request
  14. withCallback:(RCTDirectEventBlock _Nonnull)callback;
  15. @end
  16. @interface RNCWeakScriptMessageDelegate : NSObject<WKScriptMessageHandler>
  17. @property (nonatomic, weak) id<WKScriptMessageHandler> scriptDelegate;
  18. - (instancetype)initWithDelegate:(id<WKScriptMessageHandler>)scriptDelegate;
  19. @end
  20. @interface RNCWebView : RCTView
  21. @property (nonatomic, weak) id<RNCWebViewDelegate> _Nullable delegate;
  22. @property (nonatomic, copy) NSDictionary * _Nullable source;
  23. @property (nonatomic, assign) BOOL messagingEnabled;
  24. @property (nonatomic, copy) NSString * _Nullable injectedJavaScript;
  25. @property (nonatomic, copy) NSString * _Nullable injectedJavaScriptBeforeContentLoaded;
  26. @property (nonatomic, assign) BOOL injectedJavaScriptForMainFrameOnly;
  27. @property (nonatomic, assign) BOOL injectedJavaScriptBeforeContentLoadedForMainFrameOnly;
  28. @property (nonatomic, assign) BOOL scrollEnabled;
  29. @property (nonatomic, assign) BOOL sharedCookiesEnabled;
  30. @property (nonatomic, assign) BOOL pagingEnabled;
  31. @property (nonatomic, assign) CGFloat decelerationRate;
  32. @property (nonatomic, assign) BOOL allowsInlineMediaPlayback;
  33. @property (nonatomic, assign) BOOL bounces;
  34. @property (nonatomic, assign) BOOL mediaPlaybackRequiresUserAction;
  35. #if WEBKIT_IOS_10_APIS_AVAILABLE
  36. @property (nonatomic, assign) WKDataDetectorTypes dataDetectorTypes;
  37. #endif
  38. @property (nonatomic, assign) UIEdgeInsets contentInset;
  39. @property (nonatomic, assign) BOOL automaticallyAdjustContentInsets;
  40. @property (nonatomic, assign) BOOL keyboardDisplayRequiresUserAction;
  41. @property (nonatomic, assign) BOOL hideKeyboardAccessoryView;
  42. @property (nonatomic, assign) BOOL allowsBackForwardNavigationGestures;
  43. @property (nonatomic, assign) BOOL incognito;
  44. @property (nonatomic, assign) BOOL useSharedProcessPool;
  45. @property (nonatomic, copy) NSString * _Nullable userAgent;
  46. @property (nonatomic, copy) NSString * _Nullable applicationNameForUserAgent;
  47. @property (nonatomic, assign) BOOL cacheEnabled;
  48. @property (nonatomic, assign) BOOL javaScriptEnabled;
  49. @property (nonatomic, assign) BOOL javaScriptCanOpenWindowsAutomatically;
  50. @property (nonatomic, assign) BOOL allowFileAccessFromFileURLs;
  51. @property (nonatomic, assign) BOOL allowsLinkPreview;
  52. @property (nonatomic, assign) BOOL showsHorizontalScrollIndicator;
  53. @property (nonatomic, assign) BOOL showsVerticalScrollIndicator;
  54. @property (nonatomic, assign) BOOL directionalLockEnabled;
  55. @property (nonatomic, assign) BOOL ignoreSilentHardwareSwitch;
  56. @property (nonatomic, copy) NSString * _Nullable allowingReadAccessToURL;
  57. + (void)setClientAuthenticationCredential:(nullable NSURLCredential*)credential;
  58. + (void)setCustomCertificatesForHost:(nullable NSDictionary *)certificates;
  59. - (void)postMessage:(NSString *_Nullable)message;
  60. - (void)injectJavaScript:(NSString *_Nullable)script;
  61. - (void)goForward;
  62. - (void)goBack;
  63. - (void)reload;
  64. - (void)stopLoading;
  65. @end