1 // Copyright © 2021-present 650 Industries, Inc. (aka Expo) 2 3 #pragma once 4 5 #include "JSIInteropModuleRegistry.h" 6 7 #include <jsi/jsi.h> 8 9 #include <vector> 10 11 namespace jsi = facebook::jsi; 12 13 namespace expo { 14 /** 15 * An entry point to all exported functionalities like modules. 16 * 17 * An instance of this class will be added to the JS global object. 18 */ 19 class ExpoModulesHostObject : public jsi::HostObject { 20 public: 21 ExpoModulesHostObject(JSIInteropModuleRegistry *installer); 22 23 ~ExpoModulesHostObject() override; 24 25 jsi::Value get(jsi::Runtime &, const jsi::PropNameID &name) override; 26 27 void set(jsi::Runtime &, const jsi::PropNameID &name, const jsi::Value &value) override; 28 29 std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime &rt) override; 30 31 private: 32 JSIInteropModuleRegistry *installer; 33 }; 34 } // namespace expo 35