RCTNativeModule.h 881 B

123456789101112131415161718192021222324252627282930313233
  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 <React/RCTModuleData.h>
  8. #import <cxxreact/NativeModule.h>
  9. namespace facebook {
  10. namespace react {
  11. class RCTNativeModule : public NativeModule {
  12. public:
  13. RCTNativeModule(RCTBridge *bridge, RCTModuleData *moduleData);
  14. std::string getName() override;
  15. std::vector<MethodDescriptor> getMethods() override;
  16. folly::dynamic getConstants() override;
  17. void invoke(unsigned int methodId, folly::dynamic &&params, int callId)
  18. override;
  19. MethodCallResult callSerializableNativeHook(
  20. unsigned int reactMethodId,
  21. folly::dynamic &&params) override;
  22. private:
  23. __weak RCTBridge *m_bridge;
  24. RCTModuleData *m_moduleData;
  25. };
  26. } // namespace react
  27. } // namespace facebook