forked from illusionspaces/WKJavaScriptBridge
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSHRMWebViewEngine.h
More file actions
executable file
·66 lines (50 loc) · 1.53 KB
/
Copy pathSHRMWebViewEngine.h
File metadata and controls
executable file
·66 lines (50 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//
// SHRMWebViewEngine.h
// Hybrid-framework
//
// Created by 王凯 on 2018/12/5.
// Copyright © 2018 王凯. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <WebKit/WebKit.h>
#import "SHRMWebPluginAnnotation.h"
#import "SHRMWebViewCookieMgr.h"
#import "SHRMCommandProtocol.h"
#import "SHRMJavaScriptBridgeProtocol.h"
#import "SHRMWebViewHandleFactory.h"
#import "SHRMBasePlugin.h"
#define WVJB_WEBVIEW_DELEGATE_TYPE NSObject<UIWebViewDelegate>
NS_ASSUME_NONNULL_BEGIN
@class SHRMWebViewHandleFactory;
@interface SHRMWebViewEngine : NSObject<WKScriptMessageHandler, SHRMJavaScriptBridgeProtocol>
@property (nonatomic, readonly, strong) id <SHRMCommandProtocol> commandDelegate;
@property (nonatomic, readonly, strong) SHRMWebViewHandleFactory *webViewhandleFactory;
@property (nonatomic, readonly, strong) id <SHRMJavaScriptBridgeProtocol>bridge;
/**
外部提供的webView
*/
@property (nonatomic, readonly, weak) id webView;
/**
webView容器VC
*/
@property (nonatomic, weak) id webViewDelegate;
/**
webView绑定 bridge初始化
@param webView WKWebView & UIWebView
@return bridge
*/
+ (instancetype)bindBridgeWithWebView:(id)webView;
/**
插件预加载接口 onload 为 1 表示提前初始化此插件对象 否则在调用时初始化
@param pluginName name
@param onload onload
*/
- (void)setupPluginName:(NSString *)pluginName onload:(NSNumber *)onload;
/**
获取plugin实例
@param pluginName plugin name
@return instance
*/
- (id)getCommandInstance:(NSString*)pluginName;
@end
NS_ASSUME_NONNULL_END