Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate enum types instead of using string/number in c++ turbo modul…
…es generators (#36030) Summary: Pull Request resolved: #36030 Generate enum types in c++ turbo modules. This would export enums to TM H files such as: ``` enum class NativeEnumTurboModuleStatusNumEnum { Active = 2, Paused = 1, Off = 0 }; ``` And then use these enums in the TM schema such as: ``` public: virtual StatusStrEnum getStatus(jsi::Runtime &rt, jsi::Object statusProp) = 0; virtual StatusNumEnum getStatusState(jsi::Runtime &rt, jsi::Object statusProp) = 0; virtual jsi::Object getStateType(jsi::Runtime &rt, StatusStrEnum a, StatusNumEnum b) = 0; ``` Previously, we've only supporting generating these as jsi::String / double, ignoring the enum members. ``` public: virtual jsi::String getStatus(jsi::Runtime &rt, jsi::Object statusProp) = 0; virtual double getStatusState(jsi::Runtime &rt, jsi::Object statusProp) = 0; virtual jsi::Object getStateType(jsi::Runtime &rt, jsi::String a, double b) = 0; ``` Changelog: [General] [Added] Generate enum types instead of using string/number in c++ turbo modules generators Differential Revision: D42884147 fbshipit-source-id: 3245e4995501fd0436013bad1cb1a2d570618861
- Loading branch information