No Description

MainApplicationTurboModuleManagerDelegate.h 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #include <memory>
  2. #include <string>
  3. #include <ReactCommon/TurboModuleManagerDelegate.h>
  4. #include <fbjni/fbjni.h>
  5. namespace facebook {
  6. namespace react {
  7. class MainApplicationTurboModuleManagerDelegate
  8. : public jni::HybridClass<
  9. MainApplicationTurboModuleManagerDelegate,
  10. TurboModuleManagerDelegate> {
  11. public:
  12. // Adapt it to the package you used for your Java class.
  13. static constexpr auto kJavaDescriptor =
  14. "Lcom/test/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;";
  15. static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject>);
  16. static void registerNatives();
  17. std::shared_ptr<TurboModule> getTurboModule(
  18. const std::string &name,
  19. const std::shared_ptr<CallInvoker> &jsInvoker) override;
  20. std::shared_ptr<TurboModule> getTurboModule(
  21. const std::string &name,
  22. const JavaTurboModule::InitParams &params) override;
  23. /**
  24. * Test-only method. Allows user to verify whether a TurboModule can be
  25. * created by instances of this class.
  26. */
  27. bool canCreateTurboModule(const std::string &name);
  28. };
  29. } // namespace react
  30. } // namespace facebook