react-native-google-maps-plus 0.1.0 → 1.0.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +156 -0
  3. package/RNGoogleMapsPlus.podspec +34 -0
  4. package/android/CMakeLists.txt +32 -0
  5. package/android/build.gradle +135 -0
  6. package/android/fix-prefab.gradle +51 -0
  7. package/android/gradle.properties +8 -0
  8. package/android/src/main/AndroidManifest.xml +2 -0
  9. package/android/src/main/cpp/cpp-adapter.cpp +6 -0
  10. package/android/src/main/java/com/rngooglemapsplus/Color.kt +65 -0
  11. package/android/src/main/java/com/rngooglemapsplus/GoogleMapsViewImpl.kt +847 -0
  12. package/android/src/main/java/com/rngooglemapsplus/LocationHandler.kt +205 -0
  13. package/android/src/main/java/com/rngooglemapsplus/MapCircle.kt +29 -0
  14. package/android/src/main/java/com/rngooglemapsplus/MapMarker.kt +146 -0
  15. package/android/src/main/java/com/rngooglemapsplus/MapPolygon.kt +38 -0
  16. package/android/src/main/java/com/rngooglemapsplus/MapPolyline.kt +61 -0
  17. package/android/src/main/java/com/rngooglemapsplus/PermissionHandler.kt +116 -0
  18. package/android/src/main/java/com/rngooglemapsplus/PlayServicesHandler.kt +25 -0
  19. package/android/src/main/java/com/rngooglemapsplus/RNGoogleMapsPlusModule.kt +22 -0
  20. package/android/src/main/java/com/rngooglemapsplus/RNGoogleMapsPlusPackage.kt +35 -0
  21. package/android/src/main/java/com/rngooglemapsplus/RNGoogleMapsPlusView.kt +364 -0
  22. package/ios/Color.swift +109 -0
  23. package/ios/GoogleMapViewImpl.swift +645 -0
  24. package/ios/LocationHandler.swift +205 -0
  25. package/ios/MapCircle.swift +43 -0
  26. package/ios/MapHelper.swift +18 -0
  27. package/ios/MapMarker.swift +200 -0
  28. package/ios/MapPolygon.swift +58 -0
  29. package/ios/MapPolyline.swift +85 -0
  30. package/ios/PermissionHandler.swift +73 -0
  31. package/ios/RNGoogleMapsPlusModule.swift +27 -0
  32. package/ios/RNGoogleMapsPlusView.swift +391 -0
  33. package/lib/module/RNGoogleMapsPlusModule.nitro.js +4 -0
  34. package/lib/module/RNGoogleMapsPlusModule.nitro.js.map +1 -0
  35. package/lib/module/RNGoogleMapsPlusView.nitro.js +4 -0
  36. package/lib/module/RNGoogleMapsPlusView.nitro.js.map +1 -0
  37. package/lib/module/index.js +8 -0
  38. package/lib/module/index.js.map +1 -0
  39. package/lib/module/package.json +1 -0
  40. package/lib/module/types.js +78 -0
  41. package/lib/module/types.js.map +1 -0
  42. package/lib/typescript/package.json +1 -0
  43. package/lib/typescript/src/RNGoogleMapsPlusModule.nitro.d.ts +12 -0
  44. package/lib/typescript/src/RNGoogleMapsPlusModule.nitro.d.ts.map +1 -0
  45. package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts +39 -0
  46. package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts.map +1 -0
  47. package/lib/typescript/src/index.d.ts +7 -0
  48. package/lib/typescript/src/index.d.ts.map +1 -0
  49. package/lib/typescript/src/types.d.ts +131 -0
  50. package/lib/typescript/src/types.d.ts.map +1 -0
  51. package/nitro.json +28 -0
  52. package/nitrogen/generated/.gitattributes +1 -0
  53. package/nitrogen/generated/android/RNGoogleMapsPlus+autolinking.cmake +85 -0
  54. package/nitrogen/generated/android/RNGoogleMapsPlus+autolinking.gradle +27 -0
  55. package/nitrogen/generated/android/RNGoogleMapsPlusOnLoad.cpp +70 -0
  56. package/nitrogen/generated/android/RNGoogleMapsPlusOnLoad.hpp +25 -0
  57. package/nitrogen/generated/android/c++/JFunc_void_RNLatLng.hpp +76 -0
  58. package/nitrogen/generated/android/c++/JFunc_void_RNLocation.hpp +78 -0
  59. package/nitrogen/generated/android/c++/JFunc_void_RNLocationErrorCode.hpp +76 -0
  60. package/nitrogen/generated/android/c++/JFunc_void_RNMapErrorCode.hpp +76 -0
  61. package/nitrogen/generated/android/c++/JFunc_void_RNRegion_RNCamera_bool.hpp +81 -0
  62. package/nitrogen/generated/android/c++/JFunc_void_bool.hpp +74 -0
  63. package/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +75 -0
  64. package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusModuleSpec.cpp +83 -0
  65. package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusModuleSpec.hpp +67 -0
  66. package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.cpp +589 -0
  67. package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.hpp +118 -0
  68. package/nitrogen/generated/android/c++/JRNAndroidLocationPermissionResult.hpp +62 -0
  69. package/nitrogen/generated/android/c++/JRNCamera.hpp +67 -0
  70. package/nitrogen/generated/android/c++/JRNCircle.hpp +84 -0
  71. package/nitrogen/generated/android/c++/JRNIOSPermissionResult.hpp +59 -0
  72. package/nitrogen/generated/android/c++/JRNInitialProps.hpp +66 -0
  73. package/nitrogen/generated/android/c++/JRNLatLng.hpp +57 -0
  74. package/nitrogen/generated/android/c++/JRNLineCapType.hpp +62 -0
  75. package/nitrogen/generated/android/c++/JRNLineJoinType.hpp +62 -0
  76. package/nitrogen/generated/android/c++/JRNLocation.hpp +58 -0
  77. package/nitrogen/generated/android/c++/JRNLocationErrorCode.hpp +71 -0
  78. package/nitrogen/generated/android/c++/JRNLocationPermissionResult.hpp +61 -0
  79. package/nitrogen/generated/android/c++/JRNMapErrorCode.hpp +74 -0
  80. package/nitrogen/generated/android/c++/JRNMapPadding.hpp +65 -0
  81. package/nitrogen/generated/android/c++/JRNMapType.hpp +68 -0
  82. package/nitrogen/generated/android/c++/JRNMarker.hpp +82 -0
  83. package/nitrogen/generated/android/c++/JRNPolygon.hpp +98 -0
  84. package/nitrogen/generated/android/c++/JRNPolyline.hpp +106 -0
  85. package/nitrogen/generated/android/c++/JRNPosition.hpp +57 -0
  86. package/nitrogen/generated/android/c++/JRNRegion.hpp +62 -0
  87. package/nitrogen/generated/android/c++/JRNUserInterfaceStyle.hpp +62 -0
  88. package/nitrogen/generated/android/c++/views/JHybridRNGoogleMapsPlusViewStateUpdater.cpp +152 -0
  89. package/nitrogen/generated/android/c++/views/JHybridRNGoogleMapsPlusViewStateUpdater.hpp +49 -0
  90. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_RNLatLng.kt +81 -0
  91. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_RNLocation.kt +81 -0
  92. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_RNLocationErrorCode.kt +81 -0
  93. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_RNMapErrorCode.kt +81 -0
  94. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_RNRegion_RNCamera_bool.kt +81 -0
  95. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_bool.kt +81 -0
  96. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_std__string.kt +81 -0
  97. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/HybridRNGoogleMapsPlusModuleSpec.kt +64 -0
  98. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/HybridRNGoogleMapsPlusViewSpec.kt +317 -0
  99. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNAndroidLocationPermissionResult.kt +22 -0
  100. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNCamera.kt +38 -0
  101. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNCircle.kt +50 -0
  102. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNGoogleMapsPlusOnLoad.kt +35 -0
  103. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNIOSPermissionResult.kt +21 -0
  104. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNInitialProps.kt +35 -0
  105. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLatLng.kt +32 -0
  106. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLineCapType.kt +22 -0
  107. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLineJoinType.kt +22 -0
  108. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLocation.kt +32 -0
  109. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLocationErrorCode.kt +25 -0
  110. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLocationPermissionResult.kt +32 -0
  111. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMapErrorCode.kt +26 -0
  112. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMapPadding.kt +38 -0
  113. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMapType.kt +24 -0
  114. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMarker.kt +47 -0
  115. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNPolygon.kt +47 -0
  116. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNPolyline.kt +50 -0
  117. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNPosition.kt +32 -0
  118. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNRegion.kt +35 -0
  119. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNUserInterfaceStyle.kt +22 -0
  120. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/views/HybridRNGoogleMapsPlusViewManager.kt +56 -0
  121. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/views/HybridRNGoogleMapsPlusViewStateUpdater.kt +23 -0
  122. package/nitrogen/generated/ios/RNGoogleMapsPlus+autolinking.rb +60 -0
  123. package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.cpp +121 -0
  124. package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.hpp +792 -0
  125. package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Umbrella.hpp +113 -0
  126. package/nitrogen/generated/ios/RNGoogleMapsPlusAutolinking.mm +41 -0
  127. package/nitrogen/generated/ios/RNGoogleMapsPlusAutolinking.swift +40 -0
  128. package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusModuleSpecSwift.cpp +11 -0
  129. package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusModuleSpecSwift.hpp +102 -0
  130. package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.cpp +11 -0
  131. package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +342 -0
  132. package/nitrogen/generated/ios/c++/views/HybridRNGoogleMapsPlusViewComponent.mm +216 -0
  133. package/nitrogen/generated/ios/swift/Func_void_RNLatLng.swift +47 -0
  134. package/nitrogen/generated/ios/swift/Func_void_RNLocation.swift +47 -0
  135. package/nitrogen/generated/ios/swift/Func_void_RNLocationErrorCode.swift +47 -0
  136. package/nitrogen/generated/ios/swift/Func_void_RNLocationPermissionResult.swift +47 -0
  137. package/nitrogen/generated/ios/swift/Func_void_RNMapErrorCode.swift +47 -0
  138. package/nitrogen/generated/ios/swift/Func_void_RNRegion_RNCamera_bool.swift +47 -0
  139. package/nitrogen/generated/ios/swift/Func_void_bool.swift +47 -0
  140. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +47 -0
  141. package/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
  142. package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusModuleSpec.swift +52 -0
  143. package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusModuleSpec_cxx.swift +164 -0
  144. package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec.swift +78 -0
  145. package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec_cxx.swift +881 -0
  146. package/nitrogen/generated/ios/swift/RNAndroidLocationPermissionResult.swift +44 -0
  147. package/nitrogen/generated/ios/swift/RNCamera.swift +123 -0
  148. package/nitrogen/generated/ios/swift/RNCircle.swift +198 -0
  149. package/nitrogen/generated/ios/swift/RNIOSPermissionResult.swift +40 -0
  150. package/nitrogen/generated/ios/swift/RNInitialProps.swift +107 -0
  151. package/nitrogen/generated/ios/swift/RNLatLng.swift +46 -0
  152. package/nitrogen/generated/ios/swift/RNLineCapType.swift +44 -0
  153. package/nitrogen/generated/ios/swift/RNLineJoinType.swift +44 -0
  154. package/nitrogen/generated/ios/swift/RNLocation.swift +46 -0
  155. package/nitrogen/generated/ios/swift/RNLocationErrorCode.swift +56 -0
  156. package/nitrogen/generated/ios/swift/RNLocationPermissionResult.swift +70 -0
  157. package/nitrogen/generated/ios/swift/RNMapErrorCode.swift +60 -0
  158. package/nitrogen/generated/ios/swift/RNMapPadding.swift +68 -0
  159. package/nitrogen/generated/ios/swift/RNMapType.swift +52 -0
  160. package/nitrogen/generated/ios/swift/RNMarker.swift +132 -0
  161. package/nitrogen/generated/ios/swift/RNPolygon.swift +187 -0
  162. package/nitrogen/generated/ios/swift/RNPolyline.swift +203 -0
  163. package/nitrogen/generated/ios/swift/RNPosition.swift +46 -0
  164. package/nitrogen/generated/ios/swift/RNRegion.swift +57 -0
  165. package/nitrogen/generated/ios/swift/RNUserInterfaceStyle.swift +44 -0
  166. package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusModuleSpec.cpp +24 -0
  167. package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusModuleSpec.hpp +67 -0
  168. package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.cpp +76 -0
  169. package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.hpp +164 -0
  170. package/nitrogen/generated/shared/c++/RNAndroidLocationPermissionResult.hpp +67 -0
  171. package/nitrogen/generated/shared/c++/RNCamera.hpp +81 -0
  172. package/nitrogen/generated/shared/c++/RNCircle.hpp +98 -0
  173. package/nitrogen/generated/shared/c++/RNIOSPermissionResult.hpp +65 -0
  174. package/nitrogen/generated/shared/c++/RNInitialProps.hpp +78 -0
  175. package/nitrogen/generated/shared/c++/RNLatLng.hpp +71 -0
  176. package/nitrogen/generated/shared/c++/RNLineCapType.hpp +80 -0
  177. package/nitrogen/generated/shared/c++/RNLineJoinType.hpp +80 -0
  178. package/nitrogen/generated/shared/c++/RNLocation.hpp +72 -0
  179. package/nitrogen/generated/shared/c++/RNLocationErrorCode.hpp +73 -0
  180. package/nitrogen/generated/shared/c++/RNLocationPermissionResult.hpp +76 -0
  181. package/nitrogen/generated/shared/c++/RNMapErrorCode.hpp +67 -0
  182. package/nitrogen/generated/shared/c++/RNMapPadding.hpp +79 -0
  183. package/nitrogen/generated/shared/c++/RNMapType.hpp +88 -0
  184. package/nitrogen/generated/shared/c++/RNMarker.hpp +97 -0
  185. package/nitrogen/generated/shared/c++/RNPolygon.hpp +95 -0
  186. package/nitrogen/generated/shared/c++/RNPolyline.hpp +105 -0
  187. package/nitrogen/generated/shared/c++/RNPosition.hpp +71 -0
  188. package/nitrogen/generated/shared/c++/RNRegion.hpp +76 -0
  189. package/nitrogen/generated/shared/c++/RNUserInterfaceStyle.hpp +80 -0
  190. package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.cpp +375 -0
  191. package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.hpp +147 -0
  192. package/nitrogen/generated/shared/json/RNGoogleMapsPlusViewConfig.json +34 -0
  193. package/package.json +24 -8
  194. package/src/RNGoogleMapsPlusModule.nitro.ts +13 -0
  195. package/src/RNGoogleMapsPlusView.nitro.ts +86 -0
  196. package/src/index.tsx +24 -0
  197. package/src/types.ts +195 -0
@@ -0,0 +1,80 @@
1
+ ///
2
+ /// RNLineCapType.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/NitroHash.hpp>)
11
+ #include <NitroModules/NitroHash.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
16
+ #include <NitroModules/JSIConverter.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
21
+ #include <NitroModules/NitroDefines.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+
26
+ namespace margelo::nitro::rngooglemapsplus {
27
+
28
+ /**
29
+ * An enum which can be represented as a JavaScript union (RNLineCapType).
30
+ */
31
+ enum class RNLineCapType {
32
+ BUTT SWIFT_NAME(butt) = 0,
33
+ ROUND SWIFT_NAME(round) = 1,
34
+ SQUARE SWIFT_NAME(square) = 2,
35
+ } CLOSED_ENUM;
36
+
37
+ } // namespace margelo::nitro::rngooglemapsplus
38
+
39
+ namespace margelo::nitro {
40
+
41
+ // C++ RNLineCapType <> JS RNLineCapType (union)
42
+ template <>
43
+ struct JSIConverter<margelo::nitro::rngooglemapsplus::RNLineCapType> final {
44
+ static inline margelo::nitro::rngooglemapsplus::RNLineCapType fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
45
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
46
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
47
+ case hashString("butt"): return margelo::nitro::rngooglemapsplus::RNLineCapType::BUTT;
48
+ case hashString("round"): return margelo::nitro::rngooglemapsplus::RNLineCapType::ROUND;
49
+ case hashString("square"): return margelo::nitro::rngooglemapsplus::RNLineCapType::SQUARE;
50
+ default: [[unlikely]]
51
+ throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum RNLineCapType - invalid value!");
52
+ }
53
+ }
54
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::rngooglemapsplus::RNLineCapType arg) {
55
+ switch (arg) {
56
+ case margelo::nitro::rngooglemapsplus::RNLineCapType::BUTT: return JSIConverter<std::string>::toJSI(runtime, "butt");
57
+ case margelo::nitro::rngooglemapsplus::RNLineCapType::ROUND: return JSIConverter<std::string>::toJSI(runtime, "round");
58
+ case margelo::nitro::rngooglemapsplus::RNLineCapType::SQUARE: return JSIConverter<std::string>::toJSI(runtime, "square");
59
+ default: [[unlikely]]
60
+ throw std::invalid_argument("Cannot convert RNLineCapType to JS - invalid value: "
61
+ + std::to_string(static_cast<int>(arg)) + "!");
62
+ }
63
+ }
64
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
65
+ if (!value.isString()) {
66
+ return false;
67
+ }
68
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
69
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
70
+ case hashString("butt"):
71
+ case hashString("round"):
72
+ case hashString("square"):
73
+ return true;
74
+ default:
75
+ return false;
76
+ }
77
+ }
78
+ };
79
+
80
+ } // namespace margelo::nitro
@@ -0,0 +1,80 @@
1
+ ///
2
+ /// RNLineJoinType.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/NitroHash.hpp>)
11
+ #include <NitroModules/NitroHash.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
16
+ #include <NitroModules/JSIConverter.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
21
+ #include <NitroModules/NitroDefines.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+
26
+ namespace margelo::nitro::rngooglemapsplus {
27
+
28
+ /**
29
+ * An enum which can be represented as a JavaScript union (RNLineJoinType).
30
+ */
31
+ enum class RNLineJoinType {
32
+ ROUND SWIFT_NAME(round) = 0,
33
+ MITER SWIFT_NAME(miter) = 1,
34
+ BEVEL SWIFT_NAME(bevel) = 2,
35
+ } CLOSED_ENUM;
36
+
37
+ } // namespace margelo::nitro::rngooglemapsplus
38
+
39
+ namespace margelo::nitro {
40
+
41
+ // C++ RNLineJoinType <> JS RNLineJoinType (union)
42
+ template <>
43
+ struct JSIConverter<margelo::nitro::rngooglemapsplus::RNLineJoinType> final {
44
+ static inline margelo::nitro::rngooglemapsplus::RNLineJoinType fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
45
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
46
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
47
+ case hashString("round"): return margelo::nitro::rngooglemapsplus::RNLineJoinType::ROUND;
48
+ case hashString("miter"): return margelo::nitro::rngooglemapsplus::RNLineJoinType::MITER;
49
+ case hashString("bevel"): return margelo::nitro::rngooglemapsplus::RNLineJoinType::BEVEL;
50
+ default: [[unlikely]]
51
+ throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum RNLineJoinType - invalid value!");
52
+ }
53
+ }
54
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::rngooglemapsplus::RNLineJoinType arg) {
55
+ switch (arg) {
56
+ case margelo::nitro::rngooglemapsplus::RNLineJoinType::ROUND: return JSIConverter<std::string>::toJSI(runtime, "round");
57
+ case margelo::nitro::rngooglemapsplus::RNLineJoinType::MITER: return JSIConverter<std::string>::toJSI(runtime, "miter");
58
+ case margelo::nitro::rngooglemapsplus::RNLineJoinType::BEVEL: return JSIConverter<std::string>::toJSI(runtime, "bevel");
59
+ default: [[unlikely]]
60
+ throw std::invalid_argument("Cannot convert RNLineJoinType to JS - invalid value: "
61
+ + std::to_string(static_cast<int>(arg)) + "!");
62
+ }
63
+ }
64
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
65
+ if (!value.isString()) {
66
+ return false;
67
+ }
68
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
69
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
70
+ case hashString("round"):
71
+ case hashString("miter"):
72
+ case hashString("bevel"):
73
+ return true;
74
+ default:
75
+ return false;
76
+ }
77
+ }
78
+ };
79
+
80
+ } // namespace margelo::nitro
@@ -0,0 +1,72 @@
1
+ ///
2
+ /// RNLocation.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+
21
+ // Forward declaration of `RNLatLng` to properly resolve imports.
22
+ namespace margelo::nitro::rngooglemapsplus { struct RNLatLng; }
23
+
24
+ #include "RNLatLng.hpp"
25
+
26
+ namespace margelo::nitro::rngooglemapsplus {
27
+
28
+ /**
29
+ * A struct which can be represented as a JavaScript object (RNLocation).
30
+ */
31
+ struct RNLocation {
32
+ public:
33
+ RNLatLng center SWIFT_PRIVATE;
34
+ double bearing SWIFT_PRIVATE;
35
+
36
+ public:
37
+ RNLocation() = default;
38
+ explicit RNLocation(RNLatLng center, double bearing): center(center), bearing(bearing) {}
39
+ };
40
+
41
+ } // namespace margelo::nitro::rngooglemapsplus
42
+
43
+ namespace margelo::nitro {
44
+
45
+ // C++ RNLocation <> JS RNLocation (object)
46
+ template <>
47
+ struct JSIConverter<margelo::nitro::rngooglemapsplus::RNLocation> final {
48
+ static inline margelo::nitro::rngooglemapsplus::RNLocation fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
49
+ jsi::Object obj = arg.asObject(runtime);
50
+ return margelo::nitro::rngooglemapsplus::RNLocation(
51
+ JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::fromJSI(runtime, obj.getProperty(runtime, "center")),
52
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "bearing"))
53
+ );
54
+ }
55
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNLocation& arg) {
56
+ jsi::Object obj(runtime);
57
+ obj.setProperty(runtime, "center", JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::toJSI(runtime, arg.center));
58
+ obj.setProperty(runtime, "bearing", JSIConverter<double>::toJSI(runtime, arg.bearing));
59
+ return obj;
60
+ }
61
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
62
+ if (!value.isObject()) {
63
+ return false;
64
+ }
65
+ jsi::Object obj = value.getObject(runtime);
66
+ if (!JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::canConvert(runtime, obj.getProperty(runtime, "center"))) return false;
67
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "bearing"))) return false;
68
+ return true;
69
+ }
70
+ };
71
+
72
+ } // namespace margelo::nitro
@@ -0,0 +1,73 @@
1
+ ///
2
+ /// RNLocationErrorCode.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+
21
+ namespace margelo::nitro::rngooglemapsplus {
22
+
23
+ /**
24
+ * An enum which can be represented as a JavaScript enum (RNLocationErrorCode).
25
+ */
26
+ enum class RNLocationErrorCode {
27
+ PERMISSION_DENIED SWIFT_NAME(permissionDenied) = 1,
28
+ POSITION_UNAVAILABLE SWIFT_NAME(positionUnavailable) = 2,
29
+ TIMEOUT SWIFT_NAME(timeout) = 3,
30
+ PLAY_SERVICE_NOT_AVAILABLE SWIFT_NAME(playServiceNotAvailable) = 4,
31
+ SETTINGS_NOT_SATISFIED SWIFT_NAME(settingsNotSatisfied) = 5,
32
+ INTERNAL_ERROR SWIFT_NAME(internalError) = -1,
33
+ } CLOSED_ENUM;
34
+
35
+ } // namespace margelo::nitro::rngooglemapsplus
36
+
37
+ namespace margelo::nitro {
38
+
39
+ // C++ RNLocationErrorCode <> JS RNLocationErrorCode (enum)
40
+ template <>
41
+ struct JSIConverter<margelo::nitro::rngooglemapsplus::RNLocationErrorCode> final {
42
+ static inline margelo::nitro::rngooglemapsplus::RNLocationErrorCode fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
43
+ int enumValue = JSIConverter<int>::fromJSI(runtime, arg);
44
+ return static_cast<margelo::nitro::rngooglemapsplus::RNLocationErrorCode>(enumValue);
45
+ }
46
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::rngooglemapsplus::RNLocationErrorCode arg) {
47
+ int enumValue = static_cast<int>(arg);
48
+ return JSIConverter<int>::toJSI(runtime, enumValue);
49
+ }
50
+ static inline bool canConvert(jsi::Runtime&, const jsi::Value& value) {
51
+ if (!value.isNumber()) {
52
+ return false;
53
+ }
54
+ double number = value.getNumber();
55
+ int integer = static_cast<int>(number);
56
+ if (number != integer) {
57
+ // The integer is not the same value as the double - we truncated floating points.
58
+ // Enums are all integers, so the input floating point number is obviously invalid.
59
+ return false;
60
+ }
61
+ switch (integer) {
62
+ case 1 /* PERMISSION_DENIED */: return true;
63
+ case 2 /* POSITION_UNAVAILABLE */: return true;
64
+ case 3 /* TIMEOUT */: return true;
65
+ case 4 /* PLAY_SERVICE_NOT_AVAILABLE */: return true;
66
+ case 5 /* SETTINGS_NOT_SATISFIED */: return true;
67
+ case -1 /* INTERNAL_ERROR */: return true;
68
+ default: return false;
69
+ }
70
+ }
71
+ };
72
+
73
+ } // namespace margelo::nitro
@@ -0,0 +1,76 @@
1
+ ///
2
+ /// RNLocationPermissionResult.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+
21
+ // Forward declaration of `RNAndroidLocationPermissionResult` to properly resolve imports.
22
+ namespace margelo::nitro::rngooglemapsplus { enum class RNAndroidLocationPermissionResult; }
23
+ // Forward declaration of `RNIOSPermissionResult` to properly resolve imports.
24
+ namespace margelo::nitro::rngooglemapsplus { enum class RNIOSPermissionResult; }
25
+
26
+ #include "RNAndroidLocationPermissionResult.hpp"
27
+ #include <optional>
28
+ #include "RNIOSPermissionResult.hpp"
29
+
30
+ namespace margelo::nitro::rngooglemapsplus {
31
+
32
+ /**
33
+ * A struct which can be represented as a JavaScript object (RNLocationPermissionResult).
34
+ */
35
+ struct RNLocationPermissionResult {
36
+ public:
37
+ std::optional<RNAndroidLocationPermissionResult> android SWIFT_PRIVATE;
38
+ std::optional<RNIOSPermissionResult> ios SWIFT_PRIVATE;
39
+
40
+ public:
41
+ RNLocationPermissionResult() = default;
42
+ explicit RNLocationPermissionResult(std::optional<RNAndroidLocationPermissionResult> android, std::optional<RNIOSPermissionResult> ios): android(android), ios(ios) {}
43
+ };
44
+
45
+ } // namespace margelo::nitro::rngooglemapsplus
46
+
47
+ namespace margelo::nitro {
48
+
49
+ // C++ RNLocationPermissionResult <> JS RNLocationPermissionResult (object)
50
+ template <>
51
+ struct JSIConverter<margelo::nitro::rngooglemapsplus::RNLocationPermissionResult> final {
52
+ static inline margelo::nitro::rngooglemapsplus::RNLocationPermissionResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
53
+ jsi::Object obj = arg.asObject(runtime);
54
+ return margelo::nitro::rngooglemapsplus::RNLocationPermissionResult(
55
+ JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNAndroidLocationPermissionResult>>::fromJSI(runtime, obj.getProperty(runtime, "android")),
56
+ JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNIOSPermissionResult>>::fromJSI(runtime, obj.getProperty(runtime, "ios"))
57
+ );
58
+ }
59
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNLocationPermissionResult& arg) {
60
+ jsi::Object obj(runtime);
61
+ obj.setProperty(runtime, "android", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNAndroidLocationPermissionResult>>::toJSI(runtime, arg.android));
62
+ obj.setProperty(runtime, "ios", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNIOSPermissionResult>>::toJSI(runtime, arg.ios));
63
+ return obj;
64
+ }
65
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
66
+ if (!value.isObject()) {
67
+ return false;
68
+ }
69
+ jsi::Object obj = value.getObject(runtime);
70
+ if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNAndroidLocationPermissionResult>>::canConvert(runtime, obj.getProperty(runtime, "android"))) return false;
71
+ if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNIOSPermissionResult>>::canConvert(runtime, obj.getProperty(runtime, "ios"))) return false;
72
+ return true;
73
+ }
74
+ };
75
+
76
+ } // namespace margelo::nitro
@@ -0,0 +1,67 @@
1
+ ///
2
+ /// RNMapErrorCode.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+
21
+ namespace margelo::nitro::rngooglemapsplus {
22
+
23
+ /**
24
+ * An enum which can be represented as a JavaScript enum (RNMapErrorCode).
25
+ */
26
+ enum class RNMapErrorCode {
27
+ PLAY_SERVICES_MISSING SWIFT_NAME(playServicesMissing) = 0,
28
+ PLAY_SERVICES_INVALID SWIFT_NAME(playServicesInvalid) = 1,
29
+ PLAY_SERVICES_DISABLED SWIFT_NAME(playServicesDisabled) = 2,
30
+ PLAY_SERVICES_OUTDATED SWIFT_NAME(playServicesOutdated) = 3,
31
+ PLAY_SERVICE_UPDATE_AVAILABLE SWIFT_NAME(playServiceUpdateAvailable) = 4,
32
+ PLAY_SERVICE_UPDATING SWIFT_NAME(playServiceUpdating) = 5,
33
+ UNKNOWN SWIFT_NAME(unknown) = 6,
34
+ } CLOSED_ENUM;
35
+
36
+ } // namespace margelo::nitro::rngooglemapsplus
37
+
38
+ namespace margelo::nitro {
39
+
40
+ // C++ RNMapErrorCode <> JS RNMapErrorCode (enum)
41
+ template <>
42
+ struct JSIConverter<margelo::nitro::rngooglemapsplus::RNMapErrorCode> final {
43
+ static inline margelo::nitro::rngooglemapsplus::RNMapErrorCode fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
44
+ int enumValue = JSIConverter<int>::fromJSI(runtime, arg);
45
+ return static_cast<margelo::nitro::rngooglemapsplus::RNMapErrorCode>(enumValue);
46
+ }
47
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::rngooglemapsplus::RNMapErrorCode arg) {
48
+ int enumValue = static_cast<int>(arg);
49
+ return JSIConverter<int>::toJSI(runtime, enumValue);
50
+ }
51
+ static inline bool canConvert(jsi::Runtime&, const jsi::Value& value) {
52
+ if (!value.isNumber()) {
53
+ return false;
54
+ }
55
+ double number = value.getNumber();
56
+ int integer = static_cast<int>(number);
57
+ if (number != integer) {
58
+ // The integer is not the same value as the double - we truncated floating points.
59
+ // Enums are all integers, so the input floating point number is obviously invalid.
60
+ return false;
61
+ }
62
+ // Check if we are within the bounds of the enum.
63
+ return integer >= 0 && integer <= 6;
64
+ }
65
+ };
66
+
67
+ } // namespace margelo::nitro
@@ -0,0 +1,79 @@
1
+ ///
2
+ /// RNMapPadding.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+
21
+
22
+
23
+
24
+
25
+ namespace margelo::nitro::rngooglemapsplus {
26
+
27
+ /**
28
+ * A struct which can be represented as a JavaScript object (RNMapPadding).
29
+ */
30
+ struct RNMapPadding {
31
+ public:
32
+ double top SWIFT_PRIVATE;
33
+ double left SWIFT_PRIVATE;
34
+ double bottom SWIFT_PRIVATE;
35
+ double right SWIFT_PRIVATE;
36
+
37
+ public:
38
+ RNMapPadding() = default;
39
+ explicit RNMapPadding(double top, double left, double bottom, double right): top(top), left(left), bottom(bottom), right(right) {}
40
+ };
41
+
42
+ } // namespace margelo::nitro::rngooglemapsplus
43
+
44
+ namespace margelo::nitro {
45
+
46
+ // C++ RNMapPadding <> JS RNMapPadding (object)
47
+ template <>
48
+ struct JSIConverter<margelo::nitro::rngooglemapsplus::RNMapPadding> final {
49
+ static inline margelo::nitro::rngooglemapsplus::RNMapPadding fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
50
+ jsi::Object obj = arg.asObject(runtime);
51
+ return margelo::nitro::rngooglemapsplus::RNMapPadding(
52
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "top")),
53
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "left")),
54
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "bottom")),
55
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "right"))
56
+ );
57
+ }
58
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNMapPadding& arg) {
59
+ jsi::Object obj(runtime);
60
+ obj.setProperty(runtime, "top", JSIConverter<double>::toJSI(runtime, arg.top));
61
+ obj.setProperty(runtime, "left", JSIConverter<double>::toJSI(runtime, arg.left));
62
+ obj.setProperty(runtime, "bottom", JSIConverter<double>::toJSI(runtime, arg.bottom));
63
+ obj.setProperty(runtime, "right", JSIConverter<double>::toJSI(runtime, arg.right));
64
+ return obj;
65
+ }
66
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
67
+ if (!value.isObject()) {
68
+ return false;
69
+ }
70
+ jsi::Object obj = value.getObject(runtime);
71
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "top"))) return false;
72
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "left"))) return false;
73
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "bottom"))) return false;
74
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "right"))) return false;
75
+ return true;
76
+ }
77
+ };
78
+
79
+ } // namespace margelo::nitro
@@ -0,0 +1,88 @@
1
+ ///
2
+ /// RNMapType.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/NitroHash.hpp>)
11
+ #include <NitroModules/NitroHash.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
16
+ #include <NitroModules/JSIConverter.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
21
+ #include <NitroModules/NitroDefines.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+
26
+ namespace margelo::nitro::rngooglemapsplus {
27
+
28
+ /**
29
+ * An enum which can be represented as a JavaScript union (RNMapType).
30
+ */
31
+ enum class RNMapType {
32
+ NONE SWIFT_NAME(none) = 0,
33
+ NORMAL SWIFT_NAME(normal) = 1,
34
+ HYBRID SWIFT_NAME(hybrid) = 2,
35
+ SATELLITE SWIFT_NAME(satellite) = 3,
36
+ TERRAIN SWIFT_NAME(terrain) = 4,
37
+ } CLOSED_ENUM;
38
+
39
+ } // namespace margelo::nitro::rngooglemapsplus
40
+
41
+ namespace margelo::nitro {
42
+
43
+ // C++ RNMapType <> JS RNMapType (union)
44
+ template <>
45
+ struct JSIConverter<margelo::nitro::rngooglemapsplus::RNMapType> final {
46
+ static inline margelo::nitro::rngooglemapsplus::RNMapType fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
47
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
48
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
49
+ case hashString("none"): return margelo::nitro::rngooglemapsplus::RNMapType::NONE;
50
+ case hashString("normal"): return margelo::nitro::rngooglemapsplus::RNMapType::NORMAL;
51
+ case hashString("hybrid"): return margelo::nitro::rngooglemapsplus::RNMapType::HYBRID;
52
+ case hashString("satellite"): return margelo::nitro::rngooglemapsplus::RNMapType::SATELLITE;
53
+ case hashString("terrain"): return margelo::nitro::rngooglemapsplus::RNMapType::TERRAIN;
54
+ default: [[unlikely]]
55
+ throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum RNMapType - invalid value!");
56
+ }
57
+ }
58
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::rngooglemapsplus::RNMapType arg) {
59
+ switch (arg) {
60
+ case margelo::nitro::rngooglemapsplus::RNMapType::NONE: return JSIConverter<std::string>::toJSI(runtime, "none");
61
+ case margelo::nitro::rngooglemapsplus::RNMapType::NORMAL: return JSIConverter<std::string>::toJSI(runtime, "normal");
62
+ case margelo::nitro::rngooglemapsplus::RNMapType::HYBRID: return JSIConverter<std::string>::toJSI(runtime, "hybrid");
63
+ case margelo::nitro::rngooglemapsplus::RNMapType::SATELLITE: return JSIConverter<std::string>::toJSI(runtime, "satellite");
64
+ case margelo::nitro::rngooglemapsplus::RNMapType::TERRAIN: return JSIConverter<std::string>::toJSI(runtime, "terrain");
65
+ default: [[unlikely]]
66
+ throw std::invalid_argument("Cannot convert RNMapType to JS - invalid value: "
67
+ + std::to_string(static_cast<int>(arg)) + "!");
68
+ }
69
+ }
70
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
71
+ if (!value.isString()) {
72
+ return false;
73
+ }
74
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
75
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
76
+ case hashString("none"):
77
+ case hashString("normal"):
78
+ case hashString("hybrid"):
79
+ case hashString("satellite"):
80
+ case hashString("terrain"):
81
+ return true;
82
+ default:
83
+ return false;
84
+ }
85
+ }
86
+ };
87
+
88
+ } // namespace margelo::nitro