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 jsi::Value get(jsi::Runtime &, const jsi::PropNameID &name) override; 24 25 void set(jsi::Runtime &, const jsi::PropNameID &name, const jsi::Value &value) override; 26 27 std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime &rt) override; 28 29 private: 30 JSIInteropModuleRegistry *installer; 31 }; 32 } // namespace expo 33