forked from illusionspaces/WKJavaScriptBridge
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWKPluginResult.h
More file actions
32 lines (22 loc) · 913 Bytes
/
Copy pathWKPluginResult.h
File metadata and controls
32 lines (22 loc) · 913 Bytes
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
//
// WKPluginResult.h
// WKJavaScriptBridge-demo
//
// Created by Kevin on 2019/10/22.
// Copyright © 2019 王凯. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, WKJavaScriptBridgeCommandStatus) {
WKJavaScriptBridgeCommandStatus_NO_RESULT = 0,
WKJavaScriptBridgeCommandStatus_ERROR = 1,
WKJavaScriptBridgeCommandStatus_OK = 2
};
@interface WKPluginResult : NSObject
@property (nonatomic, strong, readonly) NSNumber* status;
@property (nonatomic, strong, readonly) id message;
+ (WKPluginResult*)resultWithStatus:(WKJavaScriptBridgeCommandStatus)statusOrdinal messageAsDictionary:(NSDictionary*)theMessage;
+ (WKPluginResult *)resultWithStatus:(WKJavaScriptBridgeCommandStatus)statusOrdinal messageAsString:(NSString *)theMessage;
+ (NSString *)jsSerializeWithJson:(NSDictionary * _Nullable)json;
@end
NS_ASSUME_NONNULL_END