#pragma once #include #include #include #include #include #include #include #include #include #include "WorkletRuntime.h" using namespace facebook; namespace reanimated { class WorkletEventHandler; class EventHandlerRegistry { std::map< std::pair, std::unordered_map>> eventMappingsWithTag; std::map< std::string, std::unordered_map>> eventMappingsWithoutTag; std::map> eventHandlers; std::mutex instanceMutex; public: void registerEventHandler( const std::shared_ptr &eventHandler); void unregisterEventHandler(const uint64_t id); void processEvent( const std::shared_ptr &uiWorkletRuntime, const double eventTimestamp, const std::string &eventName, const int emitterReactTag, const jsi::Value &eventPayload); bool isAnyHandlerWaitingForEvent( const std::string &eventName, const int emitterReactTag); }; } // namespace reanimated