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
31 lines (21 loc) · 770 Bytes
/
WKPluginResult.h
File metadata and controls
31 lines (21 loc) · 770 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
//
// WKPluginResult.h
// Hybrid-framework
//
// Created by Kevin on 2019/4/23.
// Copyright © 2019 王凯. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, WKCommandStatus) {
WKCommandStatus_ERROR = 0,
WKCommandStatus_OK
};
@interface WKPluginResult : NSObject
@property (nonatomic, strong, readonly) NSNumber* status;
@property (nonatomic, strong, readonly) id message;
+ (WKPluginResult*)resultWithStatus:(WKCommandStatus)statusOrdinal messageAsDictionary:(NSDictionary*)theMessage;
+ (WKPluginResult *)resultWithStatus:(WKCommandStatus)statusOrdinal messageAsString:(NSString *)theMessage;
+ (NSString *)jsSerializeWithJson:(NSDictionary * _Nullable)json;
@end
NS_ASSUME_NONNULL_END