react-native-nitro-input 0.2.0 → 0.3.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 (222) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/README.md +132 -2
  3. package/android/CMakeLists.txt +4 -0
  4. package/android/gradle.properties +1 -1
  5. package/android/src/main/cpp/JReflowEngine.cpp +32 -0
  6. package/android/src/main/cpp/JReflowEngine.hpp +13 -0
  7. package/android/src/main/cpp/JRollingEngine.cpp +43 -2
  8. package/android/src/main/cpp/JRollingEngine.hpp +9 -1
  9. package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroInputView.kt +20 -0
  10. package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberFormatPlatform.kt +284 -0
  11. package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberView.kt +113 -0
  12. package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroTextMeasure.kt +25 -0
  13. package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroTextView.kt +140 -0
  14. package/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputPackage.kt +2 -1
  15. package/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputView.kt +69 -10
  16. package/android/src/main/java/com/margelo/nitro/nitroinput/NitroNumberView.kt +522 -130
  17. package/android/src/main/java/com/margelo/nitro/nitroinput/NitroTextView.kt +868 -0
  18. package/android/src/main/java/com/margelo/nitro/nitroinput/ReflowEngine.kt +21 -0
  19. package/android/src/main/java/com/margelo/nitro/nitroinput/RollingEngine.kt +14 -2
  20. package/cpp/RollingEngine.cpp +102 -8
  21. package/cpp/RollingEngine.hpp +44 -3
  22. package/cpp/numberformat/HybridNitroNumberFormat.cpp +498 -0
  23. package/cpp/numberformat/HybridNitroNumberFormat.hpp +74 -0
  24. package/cpp/numberformat/HybridNitroNumberFormatFactory.hpp +11 -0
  25. package/cpp/numberformat/NumberFormatCore.cpp +629 -0
  26. package/cpp/numberformat/NumberFormatCore.hpp +154 -0
  27. package/cpp/numberformat/NumberFormatProbe.cpp +354 -0
  28. package/cpp/numberformat/NumberFormatProbe.hpp +63 -0
  29. package/ios/HybridNitroInputView.swift +15 -0
  30. package/ios/HybridNitroNumberFormatPlatform.swift +426 -0
  31. package/ios/HybridNitroNumberView.swift +101 -1
  32. package/ios/HybridNitroTextView.swift +134 -0
  33. package/ios/NitroInputView.swift +79 -19
  34. package/ios/NitroNumberView.swift +520 -147
  35. package/ios/NitroTextView.swift +583 -0
  36. package/lib/commonjs/nitrogen/generated/shared/json/NitroInputViewConfig.json +5 -0
  37. package/lib/commonjs/nitrogen/generated/shared/json/NitroNumberViewConfig.json +26 -0
  38. package/lib/commonjs/nitrogen/generated/shared/json/NitroTextViewConfig.json +30 -0
  39. package/lib/commonjs/src/NitroInput.js +8 -6
  40. package/lib/commonjs/src/NitroNumber.js +54 -3
  41. package/lib/commonjs/src/NitroText.js +138 -0
  42. package/lib/commonjs/src/NitroTime.js +65 -0
  43. package/lib/commonjs/src/NumberFormat.js +525 -0
  44. package/lib/commonjs/src/formatProps.js +108 -0
  45. package/lib/commonjs/src/index.js +8 -1
  46. package/lib/commonjs/src/specs/NitroText.nitro.js +2 -0
  47. package/lib/commonjs/src/specs/NumberFormat.nitro.js +2 -0
  48. package/lib/module/nitrogen/generated/shared/json/NitroInputViewConfig.json +5 -0
  49. package/lib/module/nitrogen/generated/shared/json/NitroNumberViewConfig.json +26 -0
  50. package/lib/module/nitrogen/generated/shared/json/NitroTextViewConfig.json +30 -0
  51. package/lib/module/src/NitroInput.js +8 -6
  52. package/lib/module/src/NitroNumber.js +54 -3
  53. package/lib/module/src/NitroText.js +98 -0
  54. package/lib/module/src/NitroTime.js +29 -0
  55. package/lib/module/src/NumberFormat.js +521 -0
  56. package/lib/module/src/formatProps.js +104 -0
  57. package/lib/module/src/index.js +3 -0
  58. package/lib/module/src/specs/NitroText.nitro.js +1 -0
  59. package/lib/module/src/specs/NumberFormat.nitro.js +1 -0
  60. package/lib/typescript/src/NitroInput.d.ts +22 -0
  61. package/lib/typescript/src/NitroNumber.d.ts +115 -2
  62. package/lib/typescript/src/NitroText.d.ts +67 -0
  63. package/lib/typescript/src/NitroTime.d.ts +19 -0
  64. package/lib/typescript/src/NumberFormat.d.ts +47 -0
  65. package/lib/typescript/src/formatProps.d.ts +47 -0
  66. package/lib/typescript/src/index.d.ts +6 -1
  67. package/lib/typescript/src/specs/NitroInput.nitro.d.ts +10 -0
  68. package/lib/typescript/src/specs/NitroNumber.nitro.d.ts +80 -1
  69. package/lib/typescript/src/specs/NitroText.nitro.d.ts +60 -0
  70. package/lib/typescript/src/specs/NumberFormat.nitro.d.ts +139 -0
  71. package/nitro.json +36 -0
  72. package/nitrogen/generated/android/NitroInput+autolinking.cmake +12 -0
  73. package/nitrogen/generated/android/NitroInputOnLoad.cpp +62 -0
  74. package/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.cpp +45 -0
  75. package/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.hpp +10 -0
  76. package/nitrogen/generated/android/c++/JHybridNitroNumberFormatPlatformSpec.cpp +118 -0
  77. package/nitrogen/generated/android/c++/JHybridNitroNumberFormatPlatformSpec.hpp +64 -0
  78. package/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.cpp +297 -0
  79. package/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.hpp +52 -0
  80. package/nitrogen/generated/android/c++/JHybridNitroPlatformNumberFormatterSpec.cpp +65 -0
  81. package/nitrogen/generated/android/c++/JHybridNitroPlatformNumberFormatterSpec.hpp +64 -0
  82. package/nitrogen/generated/android/c++/JHybridNitroTextMeasureSpec.cpp +58 -0
  83. package/nitrogen/generated/android/c++/JHybridNitroTextMeasureSpec.hpp +64 -0
  84. package/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.cpp +253 -0
  85. package/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.hpp +104 -0
  86. package/nitrogen/generated/android/c++/JNitroNumberDirection.hpp +3 -0
  87. package/nitrogen/generated/android/c++/JNitroNumberShimmerDirection.hpp +61 -0
  88. package/nitrogen/generated/android/c++/JNitroNumberSignDisplay.hpp +67 -0
  89. package/nitrogen/generated/android/c++/JNumberFormatCompactDisplay.hpp +58 -0
  90. package/nitrogen/generated/android/c++/JNumberFormatCurrencyDisplay.hpp +64 -0
  91. package/nitrogen/generated/android/c++/JNumberFormatCurrencySign.hpp +58 -0
  92. package/nitrogen/generated/android/c++/JNumberFormatNotation.hpp +64 -0
  93. package/nitrogen/generated/android/c++/JNumberFormatPlatformOptions.hpp +161 -0
  94. package/nitrogen/generated/android/c++/JNumberFormatPlatformSymbols.hpp +89 -0
  95. package/nitrogen/generated/android/c++/JNumberFormatRoundingMode.hpp +79 -0
  96. package/nitrogen/generated/android/c++/JNumberFormatSignDisplay.hpp +67 -0
  97. package/nitrogen/generated/android/c++/JNumberFormatStyle.hpp +64 -0
  98. package/nitrogen/generated/android/c++/JNumberFormatUnitDisplay.hpp +61 -0
  99. package/nitrogen/generated/android/c++/views/JHybridNitroInputViewStateUpdater.cpp +25 -0
  100. package/nitrogen/generated/android/c++/views/JHybridNitroNumberViewStateUpdater.cpp +130 -0
  101. package/nitrogen/generated/android/c++/views/JHybridNitroTextViewStateUpdater.cpp +174 -0
  102. package/nitrogen/generated/android/c++/views/JHybridNitroTextViewStateUpdater.hpp +54 -0
  103. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroInputViewSpec.kt +30 -0
  104. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroNumberFormatPlatformSpec.kt +60 -0
  105. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroNumberViewSpec.kt +172 -0
  106. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroPlatformNumberFormatterSpec.kt +62 -0
  107. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextMeasureSpec.kt +60 -0
  108. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextViewSpec.kt +179 -0
  109. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberDirection.kt +2 -1
  110. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberShimmerDirection.kt +24 -0
  111. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberSignDisplay.kt +26 -0
  112. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatCompactDisplay.kt +23 -0
  113. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatCurrencyDisplay.kt +25 -0
  114. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatCurrencySign.kt +23 -0
  115. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatNotation.kt +25 -0
  116. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatPlatformOptions.kt +136 -0
  117. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatPlatformSymbols.kt +91 -0
  118. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatRoundingMode.kt +30 -0
  119. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatSignDisplay.kt +26 -0
  120. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatStyle.kt +25 -0
  121. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatUnitDisplay.kt +24 -0
  122. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/views/HybridNitroTextViewManager.kt +96 -0
  123. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/views/HybridNitroTextViewStateUpdater.kt +23 -0
  124. package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.cpp +68 -0
  125. package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.hpp +184 -0
  126. package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Umbrella.hpp +56 -0
  127. package/nitrogen/generated/ios/NitroInputAutolinking.mm +34 -0
  128. package/nitrogen/generated/ios/NitroInputAutolinking.swift +36 -0
  129. package/nitrogen/generated/ios/c++/HybridNitroInputViewSpecSwift.hpp +30 -0
  130. package/nitrogen/generated/ios/c++/HybridNitroNumberFormatPlatformSpecSwift.cpp +11 -0
  131. package/nitrogen/generated/ios/c++/HybridNitroNumberFormatPlatformSpecSwift.hpp +122 -0
  132. package/nitrogen/generated/ios/c++/HybridNitroNumberViewSpecSwift.hpp +188 -0
  133. package/nitrogen/generated/ios/c++/HybridNitroPlatformNumberFormatterSpecSwift.cpp +11 -0
  134. package/nitrogen/generated/ios/c++/HybridNitroPlatformNumberFormatterSpecSwift.hpp +94 -0
  135. package/nitrogen/generated/ios/c++/HybridNitroTextMeasureSpecSwift.cpp +11 -0
  136. package/nitrogen/generated/ios/c++/HybridNitroTextMeasureSpecSwift.hpp +90 -0
  137. package/nitrogen/generated/ios/c++/HybridNitroTextViewSpecSwift.cpp +11 -0
  138. package/nitrogen/generated/ios/c++/HybridNitroTextViewSpecSwift.hpp +233 -0
  139. package/nitrogen/generated/ios/c++/views/HybridNitroInputViewComponent.mm +30 -0
  140. package/nitrogen/generated/ios/c++/views/HybridNitroNumberViewComponent.mm +156 -0
  141. package/nitrogen/generated/ios/c++/views/HybridNitroTextViewComponent.mm +264 -0
  142. package/nitrogen/generated/ios/swift/HybridNitroInputViewSpec.swift +5 -0
  143. package/nitrogen/generated/ios/swift/HybridNitroInputViewSpec_cxx.swift +55 -0
  144. package/nitrogen/generated/ios/swift/HybridNitroNumberFormatPlatformSpec.swift +56 -0
  145. package/nitrogen/generated/ios/swift/HybridNitroNumberFormatPlatformSpec_cxx.swift +159 -0
  146. package/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec.swift +26 -0
  147. package/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec_cxx.swift +658 -21
  148. package/nitrogen/generated/ios/swift/HybridNitroPlatformNumberFormatterSpec.swift +56 -0
  149. package/nitrogen/generated/ios/swift/HybridNitroPlatformNumberFormatterSpec_cxx.swift +155 -0
  150. package/nitrogen/generated/ios/swift/HybridNitroTextMeasureSpec.swift +56 -0
  151. package/nitrogen/generated/ios/swift/HybridNitroTextMeasureSpec_cxx.swift +150 -0
  152. package/nitrogen/generated/ios/swift/HybridNitroTextViewSpec.swift +75 -0
  153. package/nitrogen/generated/ios/swift/HybridNitroTextViewSpec_cxx.swift +608 -0
  154. package/nitrogen/generated/ios/swift/NitroNumberDirection.swift +4 -0
  155. package/nitrogen/generated/ios/swift/NitroNumberShimmerDirection.swift +44 -0
  156. package/nitrogen/generated/ios/swift/NitroNumberSignDisplay.swift +52 -0
  157. package/nitrogen/generated/ios/swift/NumberFormatCompactDisplay.swift +40 -0
  158. package/nitrogen/generated/ios/swift/NumberFormatCurrencyDisplay.swift +48 -0
  159. package/nitrogen/generated/ios/swift/NumberFormatCurrencySign.swift +40 -0
  160. package/nitrogen/generated/ios/swift/NumberFormatNotation.swift +48 -0
  161. package/nitrogen/generated/ios/swift/NumberFormatPlatformOptions.swift +159 -0
  162. package/nitrogen/generated/ios/swift/NumberFormatPlatformSymbols.swift +69 -0
  163. package/nitrogen/generated/ios/swift/NumberFormatRoundingMode.swift +68 -0
  164. package/nitrogen/generated/ios/swift/NumberFormatSignDisplay.swift +52 -0
  165. package/nitrogen/generated/ios/swift/NumberFormatStyle.swift +48 -0
  166. package/nitrogen/generated/ios/swift/NumberFormatUnitDisplay.swift +44 -0
  167. package/nitrogen/generated/shared/c++/HybridNitroInputViewSpec.cpp +10 -0
  168. package/nitrogen/generated/shared/c++/HybridNitroInputViewSpec.hpp +10 -0
  169. package/nitrogen/generated/shared/c++/HybridNitroNumberFormatFactorySpec.cpp +22 -0
  170. package/nitrogen/generated/shared/c++/HybridNitroNumberFormatFactorySpec.hpp +70 -0
  171. package/nitrogen/generated/shared/c++/HybridNitroNumberFormatPlatformSpec.cpp +22 -0
  172. package/nitrogen/generated/shared/c++/HybridNitroNumberFormatPlatformSpec.hpp +70 -0
  173. package/nitrogen/generated/shared/c++/HybridNitroNumberFormatSpec.cpp +23 -0
  174. package/nitrogen/generated/shared/c++/HybridNitroNumberFormatSpec.hpp +71 -0
  175. package/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.cpp +52 -0
  176. package/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.hpp +58 -0
  177. package/nitrogen/generated/shared/c++/HybridNitroPlatformNumberFormatterSpec.cpp +23 -0
  178. package/nitrogen/generated/shared/c++/HybridNitroPlatformNumberFormatterSpec.hpp +65 -0
  179. package/nitrogen/generated/shared/c++/HybridNitroTextMeasureSpec.cpp +22 -0
  180. package/nitrogen/generated/shared/c++/HybridNitroTextMeasureSpec.hpp +63 -0
  181. package/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.cpp +62 -0
  182. package/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.hpp +115 -0
  183. package/nitrogen/generated/shared/c++/NitroNumberDirection.hpp +4 -0
  184. package/nitrogen/generated/shared/c++/NitroNumberShimmerDirection.hpp +80 -0
  185. package/nitrogen/generated/shared/c++/NitroNumberSignDisplay.hpp +88 -0
  186. package/nitrogen/generated/shared/c++/NumberFormatCompactDisplay.hpp +76 -0
  187. package/nitrogen/generated/shared/c++/NumberFormatCurrencyDisplay.hpp +84 -0
  188. package/nitrogen/generated/shared/c++/NumberFormatCurrencySign.hpp +76 -0
  189. package/nitrogen/generated/shared/c++/NumberFormatGrouping.hpp +80 -0
  190. package/nitrogen/generated/shared/c++/NumberFormatNotation.hpp +84 -0
  191. package/nitrogen/generated/shared/c++/NumberFormatOptions.hpp +193 -0
  192. package/nitrogen/generated/shared/c++/NumberFormatPart.hpp +87 -0
  193. package/nitrogen/generated/shared/c++/NumberFormatPlatformOptions.hpp +176 -0
  194. package/nitrogen/generated/shared/c++/NumberFormatPlatformSymbols.hpp +115 -0
  195. package/nitrogen/generated/shared/c++/NumberFormatRoundingMode.hpp +104 -0
  196. package/nitrogen/generated/shared/c++/NumberFormatRoundingPriority.hpp +80 -0
  197. package/nitrogen/generated/shared/c++/NumberFormatSignDisplay.hpp +88 -0
  198. package/nitrogen/generated/shared/c++/NumberFormatStyle.hpp +84 -0
  199. package/nitrogen/generated/shared/c++/NumberFormatTrailingZeroDisplay.hpp +76 -0
  200. package/nitrogen/generated/shared/c++/NumberFormatUnitDisplay.hpp +80 -0
  201. package/nitrogen/generated/shared/c++/ResolvedNumberFormatOptions.hpp +197 -0
  202. package/nitrogen/generated/shared/c++/views/HybridNitroInputViewComponent.cpp +10 -0
  203. package/nitrogen/generated/shared/c++/views/HybridNitroInputViewComponent.hpp +15 -0
  204. package/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.cpp +52 -0
  205. package/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.hpp +80 -0
  206. package/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.cpp +74 -0
  207. package/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.hpp +149 -0
  208. package/nitrogen/generated/shared/json/NitroInputViewConfig.json +5 -0
  209. package/nitrogen/generated/shared/json/NitroNumberViewConfig.json +26 -0
  210. package/nitrogen/generated/shared/json/NitroTextViewConfig.json +30 -0
  211. package/package.json +2 -2
  212. package/src/NitroInput.tsx +42 -7
  213. package/src/NitroNumber.tsx +236 -12
  214. package/src/NitroText.tsx +166 -0
  215. package/src/NitroTime.tsx +68 -0
  216. package/src/NumberFormat.ts +563 -0
  217. package/src/formatProps.ts +149 -0
  218. package/src/index.ts +23 -0
  219. package/src/specs/NitroInput.nitro.ts +10 -0
  220. package/src/specs/NitroNumber.nitro.ts +82 -1
  221. package/src/specs/NitroText.nitro.ts +65 -0
  222. package/src/specs/NumberFormat.nitro.ts +145 -0
@@ -0,0 +1,62 @@
1
+ ///
2
+ /// HybridNitroTextViewSpec.cpp
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
+ #include "HybridNitroTextViewSpec.hpp"
9
+
10
+ namespace margelo::nitro::nitroinput {
11
+
12
+ void HybridNitroTextViewSpec::loadHybridMethods() {
13
+ // load base methods/properties
14
+ HybridObject::loadHybridMethods();
15
+ // load custom methods/properties
16
+ registerHybrids(this, [](Prototype& prototype) {
17
+ prototype.registerHybridGetter("text", &HybridNitroTextViewSpec::getText);
18
+ prototype.registerHybridSetter("text", &HybridNitroTextViewSpec::setText);
19
+ prototype.registerHybridGetter("fontSize", &HybridNitroTextViewSpec::getFontSize);
20
+ prototype.registerHybridSetter("fontSize", &HybridNitroTextViewSpec::setFontSize);
21
+ prototype.registerHybridGetter("fontWeight", &HybridNitroTextViewSpec::getFontWeight);
22
+ prototype.registerHybridSetter("fontWeight", &HybridNitroTextViewSpec::setFontWeight);
23
+ prototype.registerHybridGetter("fontFamily", &HybridNitroTextViewSpec::getFontFamily);
24
+ prototype.registerHybridSetter("fontFamily", &HybridNitroTextViewSpec::setFontFamily);
25
+ prototype.registerHybridGetter("color", &HybridNitroTextViewSpec::getColor);
26
+ prototype.registerHybridSetter("color", &HybridNitroTextViewSpec::setColor);
27
+ prototype.registerHybridGetter("letterSpacing", &HybridNitroTextViewSpec::getLetterSpacing);
28
+ prototype.registerHybridSetter("letterSpacing", &HybridNitroTextViewSpec::setLetterSpacing);
29
+ prototype.registerHybridGetter("textAlign", &HybridNitroTextViewSpec::getTextAlign);
30
+ prototype.registerHybridSetter("textAlign", &HybridNitroTextViewSpec::setTextAlign);
31
+ prototype.registerHybridGetter("rightToLeft", &HybridNitroTextViewSpec::getRightToLeft);
32
+ prototype.registerHybridSetter("rightToLeft", &HybridNitroTextViewSpec::setRightToLeft);
33
+ prototype.registerHybridGetter("duration", &HybridNitroTextViewSpec::getDuration);
34
+ prototype.registerHybridSetter("duration", &HybridNitroTextViewSpec::setDuration);
35
+ prototype.registerHybridGetter("easing", &HybridNitroTextViewSpec::getEasing);
36
+ prototype.registerHybridSetter("easing", &HybridNitroTextViewSpec::setEasing);
37
+ prototype.registerHybridGetter("bounce", &HybridNitroTextViewSpec::getBounce);
38
+ prototype.registerHybridSetter("bounce", &HybridNitroTextViewSpec::setBounce);
39
+ prototype.registerHybridGetter("effect", &HybridNitroTextViewSpec::getEffect);
40
+ prototype.registerHybridSetter("effect", &HybridNitroTextViewSpec::setEffect);
41
+ prototype.registerHybridGetter("respectReduceMotion", &HybridNitroTextViewSpec::getRespectReduceMotion);
42
+ prototype.registerHybridSetter("respectReduceMotion", &HybridNitroTextViewSpec::setRespectReduceMotion);
43
+ prototype.registerHybridGetter("loading", &HybridNitroTextViewSpec::getLoading);
44
+ prototype.registerHybridSetter("loading", &HybridNitroTextViewSpec::setLoading);
45
+ prototype.registerHybridGetter("shimmerColor", &HybridNitroTextViewSpec::getShimmerColor);
46
+ prototype.registerHybridSetter("shimmerColor", &HybridNitroTextViewSpec::setShimmerColor);
47
+ prototype.registerHybridGetter("shimmerDuration", &HybridNitroTextViewSpec::getShimmerDuration);
48
+ prototype.registerHybridSetter("shimmerDuration", &HybridNitroTextViewSpec::setShimmerDuration);
49
+ prototype.registerHybridGetter("shimmerAngle", &HybridNitroTextViewSpec::getShimmerAngle);
50
+ prototype.registerHybridSetter("shimmerAngle", &HybridNitroTextViewSpec::setShimmerAngle);
51
+ prototype.registerHybridGetter("shimmerWidth", &HybridNitroTextViewSpec::getShimmerWidth);
52
+ prototype.registerHybridSetter("shimmerWidth", &HybridNitroTextViewSpec::setShimmerWidth);
53
+ prototype.registerHybridGetter("shimmerBaseColor", &HybridNitroTextViewSpec::getShimmerBaseColor);
54
+ prototype.registerHybridSetter("shimmerBaseColor", &HybridNitroTextViewSpec::setShimmerBaseColor);
55
+ prototype.registerHybridGetter("shimmerDirection", &HybridNitroTextViewSpec::getShimmerDirection);
56
+ prototype.registerHybridSetter("shimmerDirection", &HybridNitroTextViewSpec::setShimmerDirection);
57
+ prototype.registerHybridGetter("shimmerDelay", &HybridNitroTextViewSpec::getShimmerDelay);
58
+ prototype.registerHybridSetter("shimmerDelay", &HybridNitroTextViewSpec::setShimmerDelay);
59
+ });
60
+ }
61
+
62
+ } // namespace margelo::nitro::nitroinput
@@ -0,0 +1,115 @@
1
+ ///
2
+ /// HybridNitroTextViewSpec.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/HybridObject.hpp>)
11
+ #include <NitroModules/HybridObject.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+
16
+ // Forward declaration of `NitroNumberTextAlign` to properly resolve imports.
17
+ namespace margelo::nitro::nitroinput { enum class NitroNumberTextAlign; }
18
+ // Forward declaration of `NitroInputEasing` to properly resolve imports.
19
+ namespace margelo::nitro::nitroinput { enum class NitroInputEasing; }
20
+ // Forward declaration of `NitroInputEffect` to properly resolve imports.
21
+ namespace margelo::nitro::nitroinput { enum class NitroInputEffect; }
22
+ // Forward declaration of `NitroNumberShimmerDirection` to properly resolve imports.
23
+ namespace margelo::nitro::nitroinput { enum class NitroNumberShimmerDirection; }
24
+
25
+ #include <string>
26
+ #include <optional>
27
+ #include "NitroNumberTextAlign.hpp"
28
+ #include "NitroInputEasing.hpp"
29
+ #include "NitroInputEffect.hpp"
30
+ #include "NitroNumberShimmerDirection.hpp"
31
+
32
+ namespace margelo::nitro::nitroinput {
33
+
34
+ using namespace margelo::nitro;
35
+
36
+ /**
37
+ * An abstract base class for `NitroTextView`
38
+ * Inherit this class to create instances of `HybridNitroTextViewSpec` in C++.
39
+ * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
40
+ * @example
41
+ * ```cpp
42
+ * class HybridNitroTextView: public HybridNitroTextViewSpec {
43
+ * public:
44
+ * HybridNitroTextView(...): HybridObject(TAG) { ... }
45
+ * // ...
46
+ * };
47
+ * ```
48
+ */
49
+ class HybridNitroTextViewSpec: public virtual HybridObject {
50
+ public:
51
+ // Constructor
52
+ explicit HybridNitroTextViewSpec(): HybridObject(TAG) { }
53
+
54
+ // Destructor
55
+ ~HybridNitroTextViewSpec() override = default;
56
+
57
+ public:
58
+ // Properties
59
+ virtual std::string getText() = 0;
60
+ virtual void setText(const std::string& text) = 0;
61
+ virtual std::optional<double> getFontSize() = 0;
62
+ virtual void setFontSize(std::optional<double> fontSize) = 0;
63
+ virtual std::optional<double> getFontWeight() = 0;
64
+ virtual void setFontWeight(std::optional<double> fontWeight) = 0;
65
+ virtual std::optional<std::string> getFontFamily() = 0;
66
+ virtual void setFontFamily(const std::optional<std::string>& fontFamily) = 0;
67
+ virtual std::optional<double> getColor() = 0;
68
+ virtual void setColor(std::optional<double> color) = 0;
69
+ virtual std::optional<double> getLetterSpacing() = 0;
70
+ virtual void setLetterSpacing(std::optional<double> letterSpacing) = 0;
71
+ virtual std::optional<NitroNumberTextAlign> getTextAlign() = 0;
72
+ virtual void setTextAlign(std::optional<NitroNumberTextAlign> textAlign) = 0;
73
+ virtual std::optional<bool> getRightToLeft() = 0;
74
+ virtual void setRightToLeft(std::optional<bool> rightToLeft) = 0;
75
+ virtual std::optional<double> getDuration() = 0;
76
+ virtual void setDuration(std::optional<double> duration) = 0;
77
+ virtual std::optional<NitroInputEasing> getEasing() = 0;
78
+ virtual void setEasing(std::optional<NitroInputEasing> easing) = 0;
79
+ virtual std::optional<double> getBounce() = 0;
80
+ virtual void setBounce(std::optional<double> bounce) = 0;
81
+ virtual std::optional<NitroInputEffect> getEffect() = 0;
82
+ virtual void setEffect(std::optional<NitroInputEffect> effect) = 0;
83
+ virtual std::optional<bool> getRespectReduceMotion() = 0;
84
+ virtual void setRespectReduceMotion(std::optional<bool> respectReduceMotion) = 0;
85
+ virtual std::optional<bool> getLoading() = 0;
86
+ virtual void setLoading(std::optional<bool> loading) = 0;
87
+ virtual std::optional<double> getShimmerColor() = 0;
88
+ virtual void setShimmerColor(std::optional<double> shimmerColor) = 0;
89
+ virtual std::optional<double> getShimmerDuration() = 0;
90
+ virtual void setShimmerDuration(std::optional<double> shimmerDuration) = 0;
91
+ virtual std::optional<double> getShimmerAngle() = 0;
92
+ virtual void setShimmerAngle(std::optional<double> shimmerAngle) = 0;
93
+ virtual std::optional<double> getShimmerWidth() = 0;
94
+ virtual void setShimmerWidth(std::optional<double> shimmerWidth) = 0;
95
+ virtual std::optional<double> getShimmerBaseColor() = 0;
96
+ virtual void setShimmerBaseColor(std::optional<double> shimmerBaseColor) = 0;
97
+ virtual std::optional<NitroNumberShimmerDirection> getShimmerDirection() = 0;
98
+ virtual void setShimmerDirection(std::optional<NitroNumberShimmerDirection> shimmerDirection) = 0;
99
+ virtual std::optional<double> getShimmerDelay() = 0;
100
+ virtual void setShimmerDelay(std::optional<double> shimmerDelay) = 0;
101
+
102
+ public:
103
+ // Methods
104
+
105
+
106
+ protected:
107
+ // Hybrid Setup
108
+ void loadHybridMethods() override;
109
+
110
+ protected:
111
+ // Tag for logging
112
+ static constexpr auto TAG = "NitroTextView";
113
+ };
114
+
115
+ } // namespace margelo::nitro::nitroinput
@@ -32,6 +32,7 @@ namespace margelo::nitro::nitroinput {
32
32
  AUTO SWIFT_NAME(auto) = 0,
33
33
  UP SWIFT_NAME(up) = 1,
34
34
  DOWN SWIFT_NAME(down) = 2,
35
+ SHORTEST SWIFT_NAME(shortest) = 3,
35
36
  } CLOSED_ENUM;
36
37
 
37
38
  } // namespace margelo::nitro::nitroinput
@@ -47,6 +48,7 @@ namespace margelo::nitro {
47
48
  case hashString("auto"): return margelo::nitro::nitroinput::NitroNumberDirection::AUTO;
48
49
  case hashString("up"): return margelo::nitro::nitroinput::NitroNumberDirection::UP;
49
50
  case hashString("down"): return margelo::nitro::nitroinput::NitroNumberDirection::DOWN;
51
+ case hashString("shortest"): return margelo::nitro::nitroinput::NitroNumberDirection::SHORTEST;
50
52
  default: [[unlikely]]
51
53
  throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum NitroNumberDirection - invalid value!");
52
54
  }
@@ -56,6 +58,7 @@ namespace margelo::nitro {
56
58
  case margelo::nitro::nitroinput::NitroNumberDirection::AUTO: return JSIConverter<std::string>::toJSI(runtime, "auto");
57
59
  case margelo::nitro::nitroinput::NitroNumberDirection::UP: return JSIConverter<std::string>::toJSI(runtime, "up");
58
60
  case margelo::nitro::nitroinput::NitroNumberDirection::DOWN: return JSIConverter<std::string>::toJSI(runtime, "down");
61
+ case margelo::nitro::nitroinput::NitroNumberDirection::SHORTEST: return JSIConverter<std::string>::toJSI(runtime, "shortest");
59
62
  default: [[unlikely]]
60
63
  throw std::invalid_argument("Cannot convert NitroNumberDirection to JS - invalid value: "
61
64
  + std::to_string(static_cast<int>(arg)) + "!");
@@ -70,6 +73,7 @@ namespace margelo::nitro {
70
73
  case hashString("auto"):
71
74
  case hashString("up"):
72
75
  case hashString("down"):
76
+ case hashString("shortest"):
73
77
  return true;
74
78
  default:
75
79
  return false;
@@ -0,0 +1,80 @@
1
+ ///
2
+ /// NitroNumberShimmerDirection.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::nitroinput {
27
+
28
+ /**
29
+ * An enum which can be represented as a JavaScript union (NitroNumberShimmerDirection).
30
+ */
31
+ enum class NitroNumberShimmerDirection {
32
+ AUTO SWIFT_NAME(auto) = 0,
33
+ LTR SWIFT_NAME(ltr) = 1,
34
+ RTL SWIFT_NAME(rtl) = 2,
35
+ } CLOSED_ENUM;
36
+
37
+ } // namespace margelo::nitro::nitroinput
38
+
39
+ namespace margelo::nitro {
40
+
41
+ // C++ NitroNumberShimmerDirection <> JS NitroNumberShimmerDirection (union)
42
+ template <>
43
+ struct JSIConverter<margelo::nitro::nitroinput::NitroNumberShimmerDirection> final {
44
+ static inline margelo::nitro::nitroinput::NitroNumberShimmerDirection 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("auto"): return margelo::nitro::nitroinput::NitroNumberShimmerDirection::AUTO;
48
+ case hashString("ltr"): return margelo::nitro::nitroinput::NitroNumberShimmerDirection::LTR;
49
+ case hashString("rtl"): return margelo::nitro::nitroinput::NitroNumberShimmerDirection::RTL;
50
+ default: [[unlikely]]
51
+ throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum NitroNumberShimmerDirection - invalid value!");
52
+ }
53
+ }
54
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::nitroinput::NitroNumberShimmerDirection arg) {
55
+ switch (arg) {
56
+ case margelo::nitro::nitroinput::NitroNumberShimmerDirection::AUTO: return JSIConverter<std::string>::toJSI(runtime, "auto");
57
+ case margelo::nitro::nitroinput::NitroNumberShimmerDirection::LTR: return JSIConverter<std::string>::toJSI(runtime, "ltr");
58
+ case margelo::nitro::nitroinput::NitroNumberShimmerDirection::RTL: return JSIConverter<std::string>::toJSI(runtime, "rtl");
59
+ default: [[unlikely]]
60
+ throw std::invalid_argument("Cannot convert NitroNumberShimmerDirection 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("auto"):
71
+ case hashString("ltr"):
72
+ case hashString("rtl"):
73
+ return true;
74
+ default:
75
+ return false;
76
+ }
77
+ }
78
+ };
79
+
80
+ } // namespace margelo::nitro
@@ -0,0 +1,88 @@
1
+ ///
2
+ /// NitroNumberSignDisplay.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::nitroinput {
27
+
28
+ /**
29
+ * An enum which can be represented as a JavaScript union (NitroNumberSignDisplay).
30
+ */
31
+ enum class NitroNumberSignDisplay {
32
+ AUTO SWIFT_NAME(auto) = 0,
33
+ ALWAYS SWIFT_NAME(always) = 1,
34
+ NEVER SWIFT_NAME(never) = 2,
35
+ EXCEPTZERO SWIFT_NAME(exceptzero) = 3,
36
+ NEGATIVE SWIFT_NAME(negative) = 4,
37
+ } CLOSED_ENUM;
38
+
39
+ } // namespace margelo::nitro::nitroinput
40
+
41
+ namespace margelo::nitro {
42
+
43
+ // C++ NitroNumberSignDisplay <> JS NitroNumberSignDisplay (union)
44
+ template <>
45
+ struct JSIConverter<margelo::nitro::nitroinput::NitroNumberSignDisplay> final {
46
+ static inline margelo::nitro::nitroinput::NitroNumberSignDisplay 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("auto"): return margelo::nitro::nitroinput::NitroNumberSignDisplay::AUTO;
50
+ case hashString("always"): return margelo::nitro::nitroinput::NitroNumberSignDisplay::ALWAYS;
51
+ case hashString("never"): return margelo::nitro::nitroinput::NitroNumberSignDisplay::NEVER;
52
+ case hashString("exceptZero"): return margelo::nitro::nitroinput::NitroNumberSignDisplay::EXCEPTZERO;
53
+ case hashString("negative"): return margelo::nitro::nitroinput::NitroNumberSignDisplay::NEGATIVE;
54
+ default: [[unlikely]]
55
+ throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum NitroNumberSignDisplay - invalid value!");
56
+ }
57
+ }
58
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::nitroinput::NitroNumberSignDisplay arg) {
59
+ switch (arg) {
60
+ case margelo::nitro::nitroinput::NitroNumberSignDisplay::AUTO: return JSIConverter<std::string>::toJSI(runtime, "auto");
61
+ case margelo::nitro::nitroinput::NitroNumberSignDisplay::ALWAYS: return JSIConverter<std::string>::toJSI(runtime, "always");
62
+ case margelo::nitro::nitroinput::NitroNumberSignDisplay::NEVER: return JSIConverter<std::string>::toJSI(runtime, "never");
63
+ case margelo::nitro::nitroinput::NitroNumberSignDisplay::EXCEPTZERO: return JSIConverter<std::string>::toJSI(runtime, "exceptZero");
64
+ case margelo::nitro::nitroinput::NitroNumberSignDisplay::NEGATIVE: return JSIConverter<std::string>::toJSI(runtime, "negative");
65
+ default: [[unlikely]]
66
+ throw std::invalid_argument("Cannot convert NitroNumberSignDisplay 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("auto"):
77
+ case hashString("always"):
78
+ case hashString("never"):
79
+ case hashString("exceptZero"):
80
+ case hashString("negative"):
81
+ return true;
82
+ default:
83
+ return false;
84
+ }
85
+ }
86
+ };
87
+
88
+ } // namespace margelo::nitro
@@ -0,0 +1,76 @@
1
+ ///
2
+ /// NumberFormatCompactDisplay.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::nitroinput {
27
+
28
+ /**
29
+ * An enum which can be represented as a JavaScript union (NumberFormatCompactDisplay).
30
+ */
31
+ enum class NumberFormatCompactDisplay {
32
+ SHORT SWIFT_NAME(short) = 0,
33
+ LONG SWIFT_NAME(long) = 1,
34
+ } CLOSED_ENUM;
35
+
36
+ } // namespace margelo::nitro::nitroinput
37
+
38
+ namespace margelo::nitro {
39
+
40
+ // C++ NumberFormatCompactDisplay <> JS NumberFormatCompactDisplay (union)
41
+ template <>
42
+ struct JSIConverter<margelo::nitro::nitroinput::NumberFormatCompactDisplay> final {
43
+ static inline margelo::nitro::nitroinput::NumberFormatCompactDisplay fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
44
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
45
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
46
+ case hashString("short"): return margelo::nitro::nitroinput::NumberFormatCompactDisplay::SHORT;
47
+ case hashString("long"): return margelo::nitro::nitroinput::NumberFormatCompactDisplay::LONG;
48
+ default: [[unlikely]]
49
+ throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum NumberFormatCompactDisplay - invalid value!");
50
+ }
51
+ }
52
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::nitroinput::NumberFormatCompactDisplay arg) {
53
+ switch (arg) {
54
+ case margelo::nitro::nitroinput::NumberFormatCompactDisplay::SHORT: return JSIConverter<std::string>::toJSI(runtime, "short");
55
+ case margelo::nitro::nitroinput::NumberFormatCompactDisplay::LONG: return JSIConverter<std::string>::toJSI(runtime, "long");
56
+ default: [[unlikely]]
57
+ throw std::invalid_argument("Cannot convert NumberFormatCompactDisplay to JS - invalid value: "
58
+ + std::to_string(static_cast<int>(arg)) + "!");
59
+ }
60
+ }
61
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
62
+ if (!value.isString()) {
63
+ return false;
64
+ }
65
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
66
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
67
+ case hashString("short"):
68
+ case hashString("long"):
69
+ return true;
70
+ default:
71
+ return false;
72
+ }
73
+ }
74
+ };
75
+
76
+ } // namespace margelo::nitro
@@ -0,0 +1,84 @@
1
+ ///
2
+ /// NumberFormatCurrencyDisplay.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::nitroinput {
27
+
28
+ /**
29
+ * An enum which can be represented as a JavaScript union (NumberFormatCurrencyDisplay).
30
+ */
31
+ enum class NumberFormatCurrencyDisplay {
32
+ SYMBOL SWIFT_NAME(symbol) = 0,
33
+ NARROWSYMBOL SWIFT_NAME(narrowsymbol) = 1,
34
+ CODE SWIFT_NAME(code) = 2,
35
+ NAME SWIFT_NAME(name) = 3,
36
+ } CLOSED_ENUM;
37
+
38
+ } // namespace margelo::nitro::nitroinput
39
+
40
+ namespace margelo::nitro {
41
+
42
+ // C++ NumberFormatCurrencyDisplay <> JS NumberFormatCurrencyDisplay (union)
43
+ template <>
44
+ struct JSIConverter<margelo::nitro::nitroinput::NumberFormatCurrencyDisplay> final {
45
+ static inline margelo::nitro::nitroinput::NumberFormatCurrencyDisplay fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
46
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
47
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
48
+ case hashString("symbol"): return margelo::nitro::nitroinput::NumberFormatCurrencyDisplay::SYMBOL;
49
+ case hashString("narrowSymbol"): return margelo::nitro::nitroinput::NumberFormatCurrencyDisplay::NARROWSYMBOL;
50
+ case hashString("code"): return margelo::nitro::nitroinput::NumberFormatCurrencyDisplay::CODE;
51
+ case hashString("name"): return margelo::nitro::nitroinput::NumberFormatCurrencyDisplay::NAME;
52
+ default: [[unlikely]]
53
+ throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum NumberFormatCurrencyDisplay - invalid value!");
54
+ }
55
+ }
56
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::nitroinput::NumberFormatCurrencyDisplay arg) {
57
+ switch (arg) {
58
+ case margelo::nitro::nitroinput::NumberFormatCurrencyDisplay::SYMBOL: return JSIConverter<std::string>::toJSI(runtime, "symbol");
59
+ case margelo::nitro::nitroinput::NumberFormatCurrencyDisplay::NARROWSYMBOL: return JSIConverter<std::string>::toJSI(runtime, "narrowSymbol");
60
+ case margelo::nitro::nitroinput::NumberFormatCurrencyDisplay::CODE: return JSIConverter<std::string>::toJSI(runtime, "code");
61
+ case margelo::nitro::nitroinput::NumberFormatCurrencyDisplay::NAME: return JSIConverter<std::string>::toJSI(runtime, "name");
62
+ default: [[unlikely]]
63
+ throw std::invalid_argument("Cannot convert NumberFormatCurrencyDisplay to JS - invalid value: "
64
+ + std::to_string(static_cast<int>(arg)) + "!");
65
+ }
66
+ }
67
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
68
+ if (!value.isString()) {
69
+ return false;
70
+ }
71
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
72
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
73
+ case hashString("symbol"):
74
+ case hashString("narrowSymbol"):
75
+ case hashString("code"):
76
+ case hashString("name"):
77
+ return true;
78
+ default:
79
+ return false;
80
+ }
81
+ }
82
+ };
83
+
84
+ } // namespace margelo::nitro
@@ -0,0 +1,76 @@
1
+ ///
2
+ /// NumberFormatCurrencySign.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::nitroinput {
27
+
28
+ /**
29
+ * An enum which can be represented as a JavaScript union (NumberFormatCurrencySign).
30
+ */
31
+ enum class NumberFormatCurrencySign {
32
+ STANDARD SWIFT_NAME(standard) = 0,
33
+ ACCOUNTING SWIFT_NAME(accounting) = 1,
34
+ } CLOSED_ENUM;
35
+
36
+ } // namespace margelo::nitro::nitroinput
37
+
38
+ namespace margelo::nitro {
39
+
40
+ // C++ NumberFormatCurrencySign <> JS NumberFormatCurrencySign (union)
41
+ template <>
42
+ struct JSIConverter<margelo::nitro::nitroinput::NumberFormatCurrencySign> final {
43
+ static inline margelo::nitro::nitroinput::NumberFormatCurrencySign fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
44
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
45
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
46
+ case hashString("standard"): return margelo::nitro::nitroinput::NumberFormatCurrencySign::STANDARD;
47
+ case hashString("accounting"): return margelo::nitro::nitroinput::NumberFormatCurrencySign::ACCOUNTING;
48
+ default: [[unlikely]]
49
+ throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum NumberFormatCurrencySign - invalid value!");
50
+ }
51
+ }
52
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::nitroinput::NumberFormatCurrencySign arg) {
53
+ switch (arg) {
54
+ case margelo::nitro::nitroinput::NumberFormatCurrencySign::STANDARD: return JSIConverter<std::string>::toJSI(runtime, "standard");
55
+ case margelo::nitro::nitroinput::NumberFormatCurrencySign::ACCOUNTING: return JSIConverter<std::string>::toJSI(runtime, "accounting");
56
+ default: [[unlikely]]
57
+ throw std::invalid_argument("Cannot convert NumberFormatCurrencySign to JS - invalid value: "
58
+ + std::to_string(static_cast<int>(arg)) + "!");
59
+ }
60
+ }
61
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
62
+ if (!value.isString()) {
63
+ return false;
64
+ }
65
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
66
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
67
+ case hashString("standard"):
68
+ case hashString("accounting"):
69
+ return true;
70
+ default:
71
+ return false;
72
+ }
73
+ }
74
+ };
75
+
76
+ } // namespace margelo::nitro