@iternio/react-native-auto-play 0.5.14-beta.1 → 0.6.0

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 (122) hide show
  1. package/README.md +214 -29
  2. package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/AndroidAutoSession.kt +5 -0
  3. package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridMapTemplate.kt +9 -2
  4. package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/NativeBackdrop.kt +40 -0
  5. package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/VirtualRenderer.kt +52 -0
  6. package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/template/GridTemplate.kt +47 -13
  7. package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/template/Parser.kt +21 -2
  8. package/ios/Types.swift +3 -0
  9. package/ios/extensions/UIImage+Toggle.swift +5 -2
  10. package/ios/hybrid/HybridAutoPlay.swift +28 -16
  11. package/ios/hybrid/HybridMapTemplate.swift +22 -5
  12. package/ios/scenes/AutoPlayInterfaceController.swift +261 -72
  13. package/ios/templates/AutoPlayMapPanelDelegate.swift +190 -0
  14. package/ios/templates/AutoPlayTemplate.swift +24 -2
  15. package/ios/templates/GridTemplate.swift +57 -57
  16. package/ios/templates/InformationTemplate.swift +84 -9
  17. package/ios/templates/ListTemplate.swift +66 -11
  18. package/ios/templates/MapTemplate.swift +83 -68
  19. package/ios/templates/MessageTemplate.swift +72 -6
  20. package/ios/templates/Parser.swift +564 -69
  21. package/ios/templates/SearchTemplate.swift +1 -1
  22. package/ios/templates/TemplateStore.swift +5 -15
  23. package/ios/utils/SymbolFont.swift +13 -28
  24. package/lib/Constants.d.ts +4 -0
  25. package/lib/Constants.js +6 -0
  26. package/lib/index.d.ts +1 -0
  27. package/lib/index.js +1 -0
  28. package/lib/specs/MapTemplate.nitro.d.ts +3 -1
  29. package/lib/templates/GridTemplate.d.ts +23 -3
  30. package/lib/templates/GridTemplate.js +8 -0
  31. package/lib/templates/InformationTemplate.d.ts +38 -12
  32. package/lib/templates/ListTemplate.d.ts +16 -47
  33. package/lib/templates/MapTemplate.d.ts +26 -2
  34. package/lib/templates/MapTemplate.js +16 -2
  35. package/lib/templates/MessageTemplate.d.ts +52 -11
  36. package/lib/templates/MessageTemplate.js +1 -1
  37. package/lib/utils/NitroOptionsPanel.d.ts +103 -0
  38. package/lib/utils/NitroOptionsPanel.js +63 -0
  39. package/lib/utils/NitroSection.d.ts +89 -2
  40. package/lib/utils/NitroSection.js +49 -2
  41. package/nitrogen/generated/android/ReactNativeAutoPlay+autolinking.cmake +1 -0
  42. package/nitrogen/generated/android/c++/JChargingConnector.hpp +79 -0
  43. package/nitrogen/generated/android/c++/JGridImageSize.hpp +64 -0
  44. package/nitrogen/generated/android/c++/JGridTemplateConfig.hpp +7 -1
  45. package/nitrogen/generated/android/c++/JHybridGridTemplateSpec.cpp +4 -0
  46. package/nitrogen/generated/android/c++/JHybridInformationTemplateSpec.cpp +12 -0
  47. package/nitrogen/generated/android/c++/JHybridListTemplateSpec.cpp +12 -0
  48. package/nitrogen/generated/android/c++/JHybridMapTemplateSpec.cpp +78 -3
  49. package/nitrogen/generated/android/c++/JHybridMapTemplateSpec.hpp +2 -1
  50. package/nitrogen/generated/android/c++/JHybridSearchTemplateSpec.cpp +12 -0
  51. package/nitrogen/generated/android/c++/JInformationTemplateConfig.hpp +6 -0
  52. package/nitrogen/generated/android/c++/JListImageType.hpp +67 -0
  53. package/nitrogen/generated/android/c++/JListTemplateConfig.hpp +6 -0
  54. package/nitrogen/generated/android/c++/JNitroChargerLocation.hpp +115 -0
  55. package/nitrogen/generated/android/c++/JNitroChargerOutlet.hpp +82 -0
  56. package/nitrogen/generated/android/c++/JNitroOptionsPanelChargerSection.hpp +112 -0
  57. package/nitrogen/generated/android/c++/JNitroOptionsPanelConfig.hpp +157 -0
  58. package/nitrogen/generated/android/c++/JNitroOptionsPanelGridSection.hpp +102 -0
  59. package/nitrogen/generated/android/c++/JNitroOptionsPanelSection.cpp +30 -0
  60. package/nitrogen/generated/android/c++/JNitroOptionsPanelSection.hpp +129 -0
  61. package/nitrogen/generated/android/c++/JNitroRow.hpp +33 -3
  62. package/nitrogen/generated/android/c++/JNitroSection.hpp +6 -0
  63. package/nitrogen/generated/android/c++/JSearchTemplateConfig.hpp +6 -0
  64. package/nitrogen/generated/android/c++/JWaypointCoordinate.hpp +65 -0
  65. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/ChargingConnector.kt +30 -0
  66. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/GridImageSize.kt +25 -0
  67. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/GridTemplateConfig.kt +9 -4
  68. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridMapTemplateSpec.kt +5 -1
  69. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/ListImageType.kt +26 -0
  70. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroChargerLocation.kt +90 -0
  71. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroChargerOutlet.kt +70 -0
  72. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroOptionsPanelChargerSection.kt +61 -0
  73. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroOptionsPanelConfig.kt +61 -0
  74. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroOptionsPanelGridSection.kt +56 -0
  75. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroOptionsPanelSection.kt +75 -0
  76. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroRow.kt +36 -6
  77. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/WaypointCoordinate.kt +61 -0
  78. package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Bridge.hpp +174 -0
  79. package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Umbrella.hpp +27 -0
  80. package/nitrogen/generated/ios/c++/HybridGridTemplateSpecSwift.hpp +3 -0
  81. package/nitrogen/generated/ios/c++/HybridInformationTemplateSpecSwift.hpp +9 -0
  82. package/nitrogen/generated/ios/c++/HybridListTemplateSpecSwift.hpp +9 -0
  83. package/nitrogen/generated/ios/c++/HybridMapTemplateSpecSwift.hpp +47 -1
  84. package/nitrogen/generated/ios/c++/HybridSearchTemplateSpecSwift.hpp +9 -0
  85. package/nitrogen/generated/ios/swift/ChargingConnector.swift +68 -0
  86. package/nitrogen/generated/ios/swift/GridImageSize.swift +48 -0
  87. package/nitrogen/generated/ios/swift/GridTemplateConfig.swift +12 -1
  88. package/nitrogen/generated/ios/swift/HybridMapTemplateSpec.swift +2 -1
  89. package/nitrogen/generated/ios/swift/HybridMapTemplateSpec_cxx.swift +31 -4
  90. package/nitrogen/generated/ios/swift/ListImageType.swift +52 -0
  91. package/nitrogen/generated/ios/swift/NitroChargerLocation.swift +161 -0
  92. package/nitrogen/generated/ios/swift/NitroChargerOutlet.swift +65 -0
  93. package/nitrogen/generated/ios/swift/NitroOptionsPanelChargerSection.swift +64 -0
  94. package/nitrogen/generated/ios/swift/NitroOptionsPanelConfig.swift +94 -0
  95. package/nitrogen/generated/ios/swift/NitroOptionsPanelGridSection.swift +53 -0
  96. package/nitrogen/generated/ios/swift/NitroOptionsPanelSection.swift +32 -0
  97. package/nitrogen/generated/ios/swift/NitroRow.swift +81 -1
  98. package/nitrogen/generated/ios/swift/WaypointCoordinate.swift +52 -0
  99. package/nitrogen/generated/shared/c++/ChargingConnector.hpp +104 -0
  100. package/nitrogen/generated/shared/c++/GridImageSize.hpp +84 -0
  101. package/nitrogen/generated/shared/c++/GridTemplateConfig.hpp +8 -1
  102. package/nitrogen/generated/shared/c++/HybridMapTemplateSpec.cpp +1 -0
  103. package/nitrogen/generated/shared/c++/HybridMapTemplateSpec.hpp +5 -1
  104. package/nitrogen/generated/shared/c++/ListImageType.hpp +88 -0
  105. package/nitrogen/generated/shared/c++/NitroChargerLocation.hpp +131 -0
  106. package/nitrogen/generated/shared/c++/NitroChargerOutlet.hpp +98 -0
  107. package/nitrogen/generated/shared/c++/NitroOptionsPanelChargerSection.hpp +98 -0
  108. package/nitrogen/generated/shared/c++/NitroOptionsPanelConfig.hpp +107 -0
  109. package/nitrogen/generated/shared/c++/NitroOptionsPanelGridSection.hpp +91 -0
  110. package/nitrogen/generated/shared/c++/NitroRow.hpp +39 -2
  111. package/nitrogen/generated/shared/c++/WaypointCoordinate.hpp +91 -0
  112. package/package.json +1 -1
  113. package/src/Constants.ts +9 -0
  114. package/src/index.ts +1 -0
  115. package/src/specs/MapTemplate.nitro.ts +3 -1
  116. package/src/templates/GridTemplate.ts +38 -3
  117. package/src/templates/InformationTemplate.ts +60 -29
  118. package/src/templates/ListTemplate.ts +27 -55
  119. package/src/templates/MapTemplate.ts +60 -2
  120. package/src/templates/MessageTemplate.ts +71 -24
  121. package/src/utils/NitroOptionsPanel.ts +218 -0
  122. package/src/utils/NitroSection.ts +160 -5
@@ -0,0 +1,88 @@
1
+ ///
2
+ /// ListImageType.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 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::swe::iternio::reactnativeautoplay {
27
+
28
+ /**
29
+ * An enum which can be represented as a JavaScript union (ListImageType).
30
+ */
31
+ enum class ListImageType {
32
+ LARGE SWIFT_NAME(large) = 0,
33
+ MEDIUM SWIFT_NAME(medium) = 1,
34
+ SMALL SWIFT_NAME(small) = 2,
35
+ EXTRA_SMALL SWIFT_NAME(extraSmall) = 3,
36
+ ICON SWIFT_NAME(icon) = 4,
37
+ } CLOSED_ENUM;
38
+
39
+ } // namespace margelo::nitro::swe::iternio::reactnativeautoplay
40
+
41
+ namespace margelo::nitro {
42
+
43
+ // C++ ListImageType <> JS ListImageType (union)
44
+ template <>
45
+ struct JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::ListImageType> final {
46
+ static inline margelo::nitro::swe::iternio::reactnativeautoplay::ListImageType 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("large"): return margelo::nitro::swe::iternio::reactnativeautoplay::ListImageType::LARGE;
50
+ case hashString("medium"): return margelo::nitro::swe::iternio::reactnativeautoplay::ListImageType::MEDIUM;
51
+ case hashString("small"): return margelo::nitro::swe::iternio::reactnativeautoplay::ListImageType::SMALL;
52
+ case hashString("extra_small"): return margelo::nitro::swe::iternio::reactnativeautoplay::ListImageType::EXTRA_SMALL;
53
+ case hashString("icon"): return margelo::nitro::swe::iternio::reactnativeautoplay::ListImageType::ICON;
54
+ default: [[unlikely]]
55
+ throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum ListImageType - invalid value!");
56
+ }
57
+ }
58
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::swe::iternio::reactnativeautoplay::ListImageType arg) {
59
+ switch (arg) {
60
+ case margelo::nitro::swe::iternio::reactnativeautoplay::ListImageType::LARGE: return JSIConverter<std::string>::toJSI(runtime, "large");
61
+ case margelo::nitro::swe::iternio::reactnativeautoplay::ListImageType::MEDIUM: return JSIConverter<std::string>::toJSI(runtime, "medium");
62
+ case margelo::nitro::swe::iternio::reactnativeautoplay::ListImageType::SMALL: return JSIConverter<std::string>::toJSI(runtime, "small");
63
+ case margelo::nitro::swe::iternio::reactnativeautoplay::ListImageType::EXTRA_SMALL: return JSIConverter<std::string>::toJSI(runtime, "extra_small");
64
+ case margelo::nitro::swe::iternio::reactnativeautoplay::ListImageType::ICON: return JSIConverter<std::string>::toJSI(runtime, "icon");
65
+ default: [[unlikely]]
66
+ throw std::invalid_argument("Cannot convert ListImageType 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("large"):
77
+ case hashString("medium"):
78
+ case hashString("small"):
79
+ case hashString("extra_small"):
80
+ case hashString("icon"):
81
+ return true;
82
+ default:
83
+ return false;
84
+ }
85
+ }
86
+ };
87
+
88
+ } // namespace margelo::nitro
@@ -0,0 +1,131 @@
1
+ ///
2
+ /// NitroChargerLocation.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 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
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
30
+
31
+ // Forward declaration of `WaypointCoordinate` to properly resolve imports.
32
+ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct WaypointCoordinate; }
33
+ // Forward declaration of `Distance` to properly resolve imports.
34
+ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct Distance; }
35
+ // Forward declaration of `DurationWithTimeZone` to properly resolve imports.
36
+ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct DurationWithTimeZone; }
37
+ // Forward declaration of `GlyphImage` to properly resolve imports.
38
+ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct GlyphImage; }
39
+ // Forward declaration of `AssetImage` to properly resolve imports.
40
+ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct AssetImage; }
41
+ // Forward declaration of `RemoteImage` to properly resolve imports.
42
+ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct RemoteImage; }
43
+
44
+ #include <string>
45
+ #include <optional>
46
+ #include "WaypointCoordinate.hpp"
47
+ #include "Distance.hpp"
48
+ #include "DurationWithTimeZone.hpp"
49
+ #include "GlyphImage.hpp"
50
+ #include "AssetImage.hpp"
51
+ #include "RemoteImage.hpp"
52
+ #include <variant>
53
+ #include <functional>
54
+
55
+ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
56
+
57
+ /**
58
+ * A struct which can be represented as a JavaScript object (NitroChargerLocation).
59
+ */
60
+ struct NitroChargerLocation final {
61
+ public:
62
+ std::optional<std::string> name SWIFT_PRIVATE;
63
+ std::optional<std::string> address SWIFT_PRIVATE;
64
+ WaypointCoordinate coordinate SWIFT_PRIVATE;
65
+ Distance distance SWIFT_PRIVATE;
66
+ DurationWithTimeZone duration SWIFT_PRIVATE;
67
+ std::optional<bool> visible SWIFT_PRIVATE;
68
+ std::optional<std::variant<GlyphImage, AssetImage, RemoteImage>> image SWIFT_PRIVATE;
69
+ std::optional<std::function<void()>> onPress SWIFT_PRIVATE;
70
+
71
+ public:
72
+ NitroChargerLocation() = default;
73
+ explicit NitroChargerLocation(std::optional<std::string> name, std::optional<std::string> address, WaypointCoordinate coordinate, Distance distance, DurationWithTimeZone duration, std::optional<bool> visible, std::optional<std::variant<GlyphImage, AssetImage, RemoteImage>> image, std::optional<std::function<void()>> onPress): name(name), address(address), coordinate(coordinate), distance(distance), duration(duration), visible(visible), image(image), onPress(onPress) {}
74
+
75
+ public:
76
+ // NitroChargerLocation is not equatable because these properties are not equatable: onPress
77
+ };
78
+
79
+ } // namespace margelo::nitro::swe::iternio::reactnativeautoplay
80
+
81
+ namespace margelo::nitro {
82
+
83
+ // C++ NitroChargerLocation <> JS NitroChargerLocation (object)
84
+ template <>
85
+ struct JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::NitroChargerLocation> final {
86
+ static inline margelo::nitro::swe::iternio::reactnativeautoplay::NitroChargerLocation fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
87
+ jsi::Object obj = arg.asObject(runtime);
88
+ return margelo::nitro::swe::iternio::reactnativeautoplay::NitroChargerLocation(
89
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "name"))),
90
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "address"))),
91
+ JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::WaypointCoordinate>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "coordinate"))),
92
+ JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::Distance>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "distance"))),
93
+ JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::DurationWithTimeZone>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "duration"))),
94
+ JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "visible"))),
95
+ JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage, margelo::nitro::swe::iternio::reactnativeautoplay::RemoteImage>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "image"))),
96
+ JSIConverter<std::optional<std::function<void()>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "onPress")))
97
+ );
98
+ }
99
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::swe::iternio::reactnativeautoplay::NitroChargerLocation& arg) {
100
+ jsi::Object obj(runtime);
101
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "name"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.name));
102
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "address"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.address));
103
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "coordinate"), JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::WaypointCoordinate>::toJSI(runtime, arg.coordinate));
104
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "distance"), JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::Distance>::toJSI(runtime, arg.distance));
105
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "duration"), JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::DurationWithTimeZone>::toJSI(runtime, arg.duration));
106
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "visible"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.visible));
107
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "image"), JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage, margelo::nitro::swe::iternio::reactnativeautoplay::RemoteImage>>>::toJSI(runtime, arg.image));
108
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "onPress"), JSIConverter<std::optional<std::function<void()>>>::toJSI(runtime, arg.onPress));
109
+ return obj;
110
+ }
111
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
112
+ if (!value.isObject()) {
113
+ return false;
114
+ }
115
+ jsi::Object obj = value.getObject(runtime);
116
+ if (!nitro::isPlainObject(runtime, obj)) {
117
+ return false;
118
+ }
119
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "name")))) return false;
120
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "address")))) return false;
121
+ if (!JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::WaypointCoordinate>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "coordinate")))) return false;
122
+ if (!JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::Distance>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "distance")))) return false;
123
+ if (!JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::DurationWithTimeZone>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "duration")))) return false;
124
+ if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "visible")))) return false;
125
+ if (!JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage, margelo::nitro::swe::iternio::reactnativeautoplay::RemoteImage>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "image")))) return false;
126
+ if (!JSIConverter<std::optional<std::function<void()>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "onPress")))) return false;
127
+ return true;
128
+ }
129
+ };
130
+
131
+ } // namespace margelo::nitro
@@ -0,0 +1,98 @@
1
+ ///
2
+ /// NitroChargerOutlet.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 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
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
30
+
31
+ // Forward declaration of `ChargingConnector` to properly resolve imports.
32
+ namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class ChargingConnector; }
33
+
34
+ #include "ChargingConnector.hpp"
35
+ #include <functional>
36
+ #include <optional>
37
+
38
+ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
39
+
40
+ /**
41
+ * A struct which can be represented as a JavaScript object (NitroChargerOutlet).
42
+ */
43
+ struct NitroChargerOutlet final {
44
+ public:
45
+ ChargingConnector connector SWIFT_PRIVATE;
46
+ double voltage SWIFT_PRIVATE;
47
+ double powerKw SWIFT_PRIVATE;
48
+ std::optional<std::function<void()>> onPress SWIFT_PRIVATE;
49
+
50
+ public:
51
+ NitroChargerOutlet() = default;
52
+ explicit NitroChargerOutlet(ChargingConnector connector, double voltage, double powerKw, std::optional<std::function<void()>> onPress): connector(connector), voltage(voltage), powerKw(powerKw), onPress(onPress) {}
53
+
54
+ public:
55
+ // NitroChargerOutlet is not equatable because these properties are not equatable: onPress
56
+ };
57
+
58
+ } // namespace margelo::nitro::swe::iternio::reactnativeautoplay
59
+
60
+ namespace margelo::nitro {
61
+
62
+ // C++ NitroChargerOutlet <> JS NitroChargerOutlet (object)
63
+ template <>
64
+ struct JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::NitroChargerOutlet> final {
65
+ static inline margelo::nitro::swe::iternio::reactnativeautoplay::NitroChargerOutlet fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
66
+ jsi::Object obj = arg.asObject(runtime);
67
+ return margelo::nitro::swe::iternio::reactnativeautoplay::NitroChargerOutlet(
68
+ JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::ChargingConnector>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "connector"))),
69
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "voltage"))),
70
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "powerKw"))),
71
+ JSIConverter<std::optional<std::function<void()>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "onPress")))
72
+ );
73
+ }
74
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::swe::iternio::reactnativeautoplay::NitroChargerOutlet& arg) {
75
+ jsi::Object obj(runtime);
76
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "connector"), JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::ChargingConnector>::toJSI(runtime, arg.connector));
77
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "voltage"), JSIConverter<double>::toJSI(runtime, arg.voltage));
78
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "powerKw"), JSIConverter<double>::toJSI(runtime, arg.powerKw));
79
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "onPress"), JSIConverter<std::optional<std::function<void()>>>::toJSI(runtime, arg.onPress));
80
+ return obj;
81
+ }
82
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
83
+ if (!value.isObject()) {
84
+ return false;
85
+ }
86
+ jsi::Object obj = value.getObject(runtime);
87
+ if (!nitro::isPlainObject(runtime, obj)) {
88
+ return false;
89
+ }
90
+ if (!JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::ChargingConnector>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "connector")))) return false;
91
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "voltage")))) return false;
92
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "powerKw")))) return false;
93
+ if (!JSIConverter<std::optional<std::function<void()>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "onPress")))) return false;
94
+ return true;
95
+ }
96
+ };
97
+
98
+ } // namespace margelo::nitro
@@ -0,0 +1,98 @@
1
+ ///
2
+ /// NitroOptionsPanelChargerSection.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 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
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
30
+
31
+ // Forward declaration of `NitroChargerOutlet` to properly resolve imports.
32
+ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NitroChargerOutlet; }
33
+ // Forward declaration of `NitroChargerLocation` to properly resolve imports.
34
+ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NitroChargerLocation; }
35
+
36
+ #include <string>
37
+ #include <optional>
38
+ #include "NitroChargerOutlet.hpp"
39
+ #include <vector>
40
+ #include "NitroChargerLocation.hpp"
41
+
42
+ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
43
+
44
+ /**
45
+ * A struct which can be represented as a JavaScript object (NitroOptionsPanelChargerSection).
46
+ */
47
+ struct NitroOptionsPanelChargerSection final {
48
+ public:
49
+ std::optional<std::string> title SWIFT_PRIVATE;
50
+ std::vector<NitroChargerOutlet> outlets SWIFT_PRIVATE;
51
+ std::optional<NitroChargerLocation> location SWIFT_PRIVATE;
52
+
53
+ public:
54
+ NitroOptionsPanelChargerSection() = default;
55
+ explicit NitroOptionsPanelChargerSection(std::optional<std::string> title, std::vector<NitroChargerOutlet> outlets, std::optional<NitroChargerLocation> location): title(title), outlets(outlets), location(location) {}
56
+
57
+ public:
58
+ // NitroOptionsPanelChargerSection is not equatable because these properties are not equatable: outlets, location
59
+ };
60
+
61
+ } // namespace margelo::nitro::swe::iternio::reactnativeautoplay
62
+
63
+ namespace margelo::nitro {
64
+
65
+ // C++ NitroOptionsPanelChargerSection <> JS NitroOptionsPanelChargerSection (object)
66
+ template <>
67
+ struct JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::NitroOptionsPanelChargerSection> final {
68
+ static inline margelo::nitro::swe::iternio::reactnativeautoplay::NitroOptionsPanelChargerSection fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
69
+ jsi::Object obj = arg.asObject(runtime);
70
+ return margelo::nitro::swe::iternio::reactnativeautoplay::NitroOptionsPanelChargerSection(
71
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "title"))),
72
+ JSIConverter<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroChargerOutlet>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "outlets"))),
73
+ JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NitroChargerLocation>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "location")))
74
+ );
75
+ }
76
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::swe::iternio::reactnativeautoplay::NitroOptionsPanelChargerSection& arg) {
77
+ jsi::Object obj(runtime);
78
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "title"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.title));
79
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "outlets"), JSIConverter<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroChargerOutlet>>::toJSI(runtime, arg.outlets));
80
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "location"), JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NitroChargerLocation>>::toJSI(runtime, arg.location));
81
+ return obj;
82
+ }
83
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
84
+ if (!value.isObject()) {
85
+ return false;
86
+ }
87
+ jsi::Object obj = value.getObject(runtime);
88
+ if (!nitro::isPlainObject(runtime, obj)) {
89
+ return false;
90
+ }
91
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "title")))) return false;
92
+ if (!JSIConverter<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroChargerOutlet>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "outlets")))) return false;
93
+ if (!JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NitroChargerLocation>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "location")))) return false;
94
+ return true;
95
+ }
96
+ };
97
+
98
+ } // namespace margelo::nitro
@@ -0,0 +1,107 @@
1
+ ///
2
+ /// NitroOptionsPanelConfig.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 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
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
30
+
31
+ // Forward declaration of `AutoText` to properly resolve imports.
32
+ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct AutoText; }
33
+ // Forward declaration of `NitroSection` to properly resolve imports.
34
+ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NitroSection; }
35
+ // Forward declaration of `NitroOptionsPanelGridSection` to properly resolve imports.
36
+ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NitroOptionsPanelGridSection; }
37
+ // Forward declaration of `NitroOptionsPanelChargerSection` to properly resolve imports.
38
+ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NitroOptionsPanelChargerSection; }
39
+ // Forward declaration of `NitroAction` to properly resolve imports.
40
+ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NitroAction; }
41
+
42
+ #include "AutoText.hpp"
43
+ #include <optional>
44
+ #include "NitroSection.hpp"
45
+ #include "NitroOptionsPanelGridSection.hpp"
46
+ #include "NitroOptionsPanelChargerSection.hpp"
47
+ #include <variant>
48
+ #include <vector>
49
+ #include "NitroAction.hpp"
50
+
51
+ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
52
+
53
+ /**
54
+ * A struct which can be represented as a JavaScript object (NitroOptionsPanelConfig).
55
+ */
56
+ struct NitroOptionsPanelConfig final {
57
+ public:
58
+ std::optional<AutoText> title SWIFT_PRIVATE;
59
+ std::vector<std::variant<NitroSection, NitroOptionsPanelGridSection, NitroOptionsPanelChargerSection>> sections SWIFT_PRIVATE;
60
+ std::optional<std::vector<NitroAction>> actions SWIFT_PRIVATE;
61
+
62
+ public:
63
+ NitroOptionsPanelConfig() = default;
64
+ explicit NitroOptionsPanelConfig(std::optional<AutoText> title, std::vector<std::variant<NitroSection, NitroOptionsPanelGridSection, NitroOptionsPanelChargerSection>> sections, std::optional<std::vector<NitroAction>> actions): title(title), sections(sections), actions(actions) {}
65
+
66
+ public:
67
+ // NitroOptionsPanelConfig is not equatable because these properties are not equatable: sections, actions
68
+ };
69
+
70
+ } // namespace margelo::nitro::swe::iternio::reactnativeautoplay
71
+
72
+ namespace margelo::nitro {
73
+
74
+ // C++ NitroOptionsPanelConfig <> JS NitroOptionsPanelConfig (object)
75
+ template <>
76
+ struct JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::NitroOptionsPanelConfig> final {
77
+ static inline margelo::nitro::swe::iternio::reactnativeautoplay::NitroOptionsPanelConfig fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
78
+ jsi::Object obj = arg.asObject(runtime);
79
+ return margelo::nitro::swe::iternio::reactnativeautoplay::NitroOptionsPanelConfig(
80
+ JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::AutoText>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "title"))),
81
+ JSIConverter<std::vector<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::NitroSection, margelo::nitro::swe::iternio::reactnativeautoplay::NitroOptionsPanelGridSection, margelo::nitro::swe::iternio::reactnativeautoplay::NitroOptionsPanelChargerSection>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sections"))),
82
+ JSIConverter<std::optional<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroAction>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "actions")))
83
+ );
84
+ }
85
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::swe::iternio::reactnativeautoplay::NitroOptionsPanelConfig& arg) {
86
+ jsi::Object obj(runtime);
87
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "title"), JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::AutoText>>::toJSI(runtime, arg.title));
88
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "sections"), JSIConverter<std::vector<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::NitroSection, margelo::nitro::swe::iternio::reactnativeautoplay::NitroOptionsPanelGridSection, margelo::nitro::swe::iternio::reactnativeautoplay::NitroOptionsPanelChargerSection>>>::toJSI(runtime, arg.sections));
89
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "actions"), JSIConverter<std::optional<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroAction>>>::toJSI(runtime, arg.actions));
90
+ return obj;
91
+ }
92
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
93
+ if (!value.isObject()) {
94
+ return false;
95
+ }
96
+ jsi::Object obj = value.getObject(runtime);
97
+ if (!nitro::isPlainObject(runtime, obj)) {
98
+ return false;
99
+ }
100
+ if (!JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::AutoText>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "title")))) return false;
101
+ if (!JSIConverter<std::vector<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::NitroSection, margelo::nitro::swe::iternio::reactnativeautoplay::NitroOptionsPanelGridSection, margelo::nitro::swe::iternio::reactnativeautoplay::NitroOptionsPanelChargerSection>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sections")))) return false;
102
+ if (!JSIConverter<std::optional<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroAction>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "actions")))) return false;
103
+ return true;
104
+ }
105
+ };
106
+
107
+ } // namespace margelo::nitro
@@ -0,0 +1,91 @@
1
+ ///
2
+ /// NitroOptionsPanelGridSection.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 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
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
30
+
31
+ // Forward declaration of `NitroGridButton` to properly resolve imports.
32
+ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NitroGridButton; }
33
+
34
+ #include <string>
35
+ #include <optional>
36
+ #include "NitroGridButton.hpp"
37
+ #include <vector>
38
+
39
+ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
40
+
41
+ /**
42
+ * A struct which can be represented as a JavaScript object (NitroOptionsPanelGridSection).
43
+ */
44
+ struct NitroOptionsPanelGridSection final {
45
+ public:
46
+ std::optional<std::string> title SWIFT_PRIVATE;
47
+ std::vector<NitroGridButton> buttons SWIFT_PRIVATE;
48
+
49
+ public:
50
+ NitroOptionsPanelGridSection() = default;
51
+ explicit NitroOptionsPanelGridSection(std::optional<std::string> title, std::vector<NitroGridButton> buttons): title(title), buttons(buttons) {}
52
+
53
+ public:
54
+ // NitroOptionsPanelGridSection is not equatable because these properties are not equatable: buttons
55
+ };
56
+
57
+ } // namespace margelo::nitro::swe::iternio::reactnativeautoplay
58
+
59
+ namespace margelo::nitro {
60
+
61
+ // C++ NitroOptionsPanelGridSection <> JS NitroOptionsPanelGridSection (object)
62
+ template <>
63
+ struct JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::NitroOptionsPanelGridSection> final {
64
+ static inline margelo::nitro::swe::iternio::reactnativeautoplay::NitroOptionsPanelGridSection fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
65
+ jsi::Object obj = arg.asObject(runtime);
66
+ return margelo::nitro::swe::iternio::reactnativeautoplay::NitroOptionsPanelGridSection(
67
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "title"))),
68
+ JSIConverter<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroGridButton>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "buttons")))
69
+ );
70
+ }
71
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::swe::iternio::reactnativeautoplay::NitroOptionsPanelGridSection& arg) {
72
+ jsi::Object obj(runtime);
73
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "title"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.title));
74
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "buttons"), JSIConverter<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroGridButton>>::toJSI(runtime, arg.buttons));
75
+ return obj;
76
+ }
77
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
78
+ if (!value.isObject()) {
79
+ return false;
80
+ }
81
+ jsi::Object obj = value.getObject(runtime);
82
+ if (!nitro::isPlainObject(runtime, obj)) {
83
+ return false;
84
+ }
85
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "title")))) return false;
86
+ if (!JSIConverter<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroGridButton>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "buttons")))) return false;
87
+ return true;
88
+ }
89
+ };
90
+
91
+ } // namespace margelo::nitro