// Copyright 2004-present Facebook. All Rights Reserved. #pragma once #include "NativeModule.h" #include namespace facebook { namespace react { class Instance; std::function makeCallback( std::weak_ptr instance, ExecutorToken token, const folly::dynamic& callbackId); class CxxNativeModule : public NativeModule { public: CxxNativeModule(std::weak_ptr instance, std::unique_ptr module); std::string getName() override; std::vector getMethods() override; folly::dynamic getConstants() override; bool supportsWebWorkers() override; void invoke(ExecutorToken token, unsigned int reactMethodId, folly::dynamic&& params) override; MethodCallResult callSerializableNativeHook( ExecutorToken token, unsigned int hookId, folly::dynamic&& args) override; private: std::weak_ptr instance_; std::unique_ptr module_; std::vector methods_; }; } }