mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
6874bade43
Summary: ## Overview This diff adds flow parser support for number unions as Int32Enums The following will be supported as an Int32 enum: ``` interval?: WithDefault<0 | 15 | 30 | 60, 0>, ``` ## Number type issues We assume that all number enums are ints (so far there's not been a valid use case for unions of floats). If we think there would be a use case for float unions we would need to update this to something like: ``` // Int32 intervalInt?: WithDefault<Int32Enum<0 | 15 | 30 | 60>, 0>, // Float intervalInt?: WithDefault<FloatEnum<0.0 | 15.1 | 30.2 | 60.3>, 0.0>, ``` My recommendation is that we default number unions to ints and if a use case arises later for floats, we would add the Float support as: ``` // Int32 intervalInt?: WithDefault<0 | 15 | 30 | 60, 0>, // Float intervalInt?: WithDefault<FloatEnum<0.0 | 15.1 | 30.2 | 60.3>, 0.0>, ``` Reviewed By: JoshuaGross Differential Revision: D17161701 fbshipit-source-id: 4b016eee45bf28bf505afd14a6c1aeea6ca8c04f