RCTModuleMethod.h 981 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  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 <Foundation/Foundation.h>
  8. #import <React/RCTBridgeMethod.h>
  9. #import <React/RCTBridgeModule.h>
  10. #import <React/RCTNullability.h>
  11. @class RCTBridge;
  12. @interface RCTMethodArgument : NSObject
  13. @property (nonatomic, copy, readonly) NSString *type;
  14. @property (nonatomic, readonly) RCTNullability nullability;
  15. @property (nonatomic, readonly) BOOL unused;
  16. @end
  17. @interface RCTModuleMethod : NSObject <RCTBridgeMethod>
  18. @property (nonatomic, readonly) Class moduleClass;
  19. @property (nonatomic, readonly) SEL selector;
  20. - (instancetype)initWithExportedMethod:(const RCTMethodInfo *)exportMethod
  21. moduleClass:(Class)moduleClass NS_DESIGNATED_INITIALIZER;
  22. @end
  23. RCT_EXTERN NSString *RCTParseMethodSignature(const char *input, NSArray<RCTMethodArgument *> **arguments);