2019-10-16 20:03:47 +03:00
|
|
|
/*
|
2018-09-12 01:27:47 +03:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2015-09-19 01:01:21 +03:00
|
|
|
*
|
2018-02-17 05:24:55 +03:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2015-09-19 01:01:21 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
|
|
|
|
@class RCTBridge;
|
|
|
|
|
2021-11-25 02:43:35 +03:00
|
|
|
typedef NS_ENUM(NSInteger, RCTFunctionType) {
|
2015-09-19 01:01:21 +03:00
|
|
|
RCTFunctionTypeNormal,
|
|
|
|
RCTFunctionTypePromise,
|
2016-09-05 17:32:20 +03:00
|
|
|
RCTFunctionTypeSync,
|
2015-09-19 01:01:21 +03:00
|
|
|
};
|
|
|
|
|
2020-03-09 08:58:01 +03:00
|
|
|
static inline const char *RCTFunctionDescriptorFromType(RCTFunctionType type)
|
|
|
|
{
|
2017-04-27 21:49:49 +03:00
|
|
|
switch (type) {
|
|
|
|
case RCTFunctionTypeNormal:
|
|
|
|
return "async";
|
|
|
|
case RCTFunctionTypePromise:
|
|
|
|
return "promise";
|
|
|
|
case RCTFunctionTypeSync:
|
|
|
|
return "sync";
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-09-19 01:01:21 +03:00
|
|
|
@protocol RCTBridgeMethod <NSObject>
|
|
|
|
|
2017-07-24 16:46:01 +03:00
|
|
|
@property (nonatomic, readonly) const char *JSMethodName;
|
2015-09-19 01:01:21 +03:00
|
|
|
@property (nonatomic, readonly) RCTFunctionType functionType;
|
|
|
|
|
2020-03-09 08:58:01 +03:00
|
|
|
- (id)invokeWithBridge:(RCTBridge *)bridge module:(id)module arguments:(NSArray *)arguments;
|
2015-09-19 01:01:21 +03:00
|
|
|
|
|
|
|
@end
|