one 2.6.18 → 2.6.19

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 (294) hide show
  1. package/One.podspec +2 -0
  2. package/android/src/main/java/com/margelo/nitro/one/HybridOneDevice.kt +124 -0
  3. package/android/src/main/java/com/margelo/nitro/one/HybridOneHaptics.kt +31 -0
  4. package/android/src/main/java/com/margelo/nitro/one/HybridOneImageManipulator.kt +25 -5
  5. package/android/src/main/java/com/margelo/nitro/one/HybridOneKeepAwake.kt +34 -9
  6. package/android/src/main/java/com/margelo/nitro/one/HybridOneSecureStore.kt +269 -78
  7. package/dist/cjs/index.cjs +3 -0
  8. package/dist/cjs/index.native.cjs +3 -0
  9. package/dist/cjs/index.native.js +3 -0
  10. package/dist/cjs/index.native.js.map +1 -1
  11. package/dist/cjs/one.cjs +1 -0
  12. package/dist/cjs/one.native.cjs +1 -0
  13. package/dist/cjs/one.native.js +1 -0
  14. package/dist/cjs/one.native.js.map +1 -1
  15. package/dist/cjs/platform/extras.cjs +4 -0
  16. package/dist/cjs/platform/extras.native.cjs +4 -0
  17. package/dist/cjs/platform/extras.native.js +4 -0
  18. package/dist/cjs/platform/extras.native.js.map +1 -1
  19. package/dist/cjs/platform/haptics/index.cjs +3 -0
  20. package/dist/cjs/platform/haptics/index.native.cjs +4 -0
  21. package/dist/cjs/platform/haptics/index.native.js +4 -0
  22. package/dist/cjs/platform/haptics/index.native.js.map +1 -1
  23. package/dist/cjs/platform/haptics/validation.cjs +28 -0
  24. package/dist/cjs/platform/haptics/validation.native.cjs +28 -0
  25. package/dist/cjs/platform/haptics/validation.native.js +28 -0
  26. package/dist/cjs/platform/haptics/validation.native.js.map +1 -1
  27. package/dist/cjs/platform/image-manipulator/index.cjs +10 -3
  28. package/dist/cjs/platform/image-manipulator/index.native.cjs +1 -0
  29. package/dist/cjs/platform/image-manipulator/index.native.js +1 -0
  30. package/dist/cjs/platform/image-manipulator/index.native.js.map +1 -1
  31. package/dist/cjs/platform/index.cjs +1 -0
  32. package/dist/cjs/platform/index.native.cjs +1 -0
  33. package/dist/cjs/platform/index.native.js +1 -0
  34. package/dist/cjs/platform/index.native.js.map +1 -1
  35. package/dist/cjs/platform/keep-awake/index.cjs +53 -14
  36. package/dist/cjs/platform/keep-awake/index.native.cjs +29 -2
  37. package/dist/cjs/platform/keep-awake/index.native.js +29 -2
  38. package/dist/cjs/platform/keep-awake/index.native.js.map +1 -1
  39. package/dist/cjs/platform/keep-awake/unavailable.cjs +11 -1
  40. package/dist/cjs/platform/keep-awake/unavailable.native.cjs +11 -1
  41. package/dist/cjs/platform/keep-awake/unavailable.native.js +11 -1
  42. package/dist/cjs/platform/keep-awake/unavailable.native.js.map +1 -1
  43. package/dist/cjs/platform/keep-awake/validate.cjs +15 -1
  44. package/dist/cjs/platform/keep-awake/validate.native.cjs +15 -1
  45. package/dist/cjs/platform/keep-awake/validate.native.js +15 -1
  46. package/dist/cjs/platform/keep-awake/validate.native.js.map +1 -1
  47. package/dist/cjs/platform/localization/index.cjs +100 -0
  48. package/dist/cjs/platform/localization/index.native.cjs +71 -0
  49. package/dist/cjs/platform/localization/index.native.js +73 -0
  50. package/dist/cjs/platform/localization/index.native.js.map +1 -0
  51. package/dist/cjs/platform/localization/map.cjs +86 -0
  52. package/dist/cjs/platform/localization/map.native.cjs +90 -0
  53. package/dist/cjs/platform/localization/map.native.js +92 -0
  54. package/dist/cjs/platform/localization/map.native.js.map +1 -0
  55. package/dist/cjs/platform/localization/types.cjs +16 -0
  56. package/dist/cjs/platform/localization/types.native.cjs +18 -0
  57. package/dist/cjs/platform/localization/types.native.js +20 -0
  58. package/dist/cjs/platform/localization/types.native.js.map +1 -0
  59. package/dist/cjs/platform/secure-store/index.cjs +12 -6
  60. package/dist/cjs/platform/secure-store/index.native.cjs +18 -12
  61. package/dist/cjs/platform/secure-store/index.native.js +18 -12
  62. package/dist/cjs/platform/secure-store/index.native.js.map +1 -1
  63. package/dist/cjs/platform/secure-store/types.cjs +16 -0
  64. package/dist/cjs/platform/secure-store/types.native.cjs +18 -0
  65. package/dist/cjs/platform/secure-store/types.native.js +20 -0
  66. package/dist/cjs/platform/secure-store/types.native.js.map +1 -0
  67. package/dist/cjs/platform/secure-store/validate.cjs +34 -0
  68. package/dist/cjs/platform/secure-store/validate.native.cjs +34 -0
  69. package/dist/cjs/platform/secure-store/validate.native.js +34 -0
  70. package/dist/cjs/platform/secure-store/validate.native.js.map +1 -1
  71. package/dist/esm/index.js +2 -2
  72. package/dist/esm/index.mjs +2 -2
  73. package/dist/esm/index.native.js +2 -2
  74. package/dist/esm/one.mjs +2 -1
  75. package/dist/esm/one.mjs.map +1 -1
  76. package/dist/esm/one.native.js +2 -1
  77. package/dist/esm/one.native.js.map +1 -1
  78. package/dist/esm/platform/extras.mjs +2 -1
  79. package/dist/esm/platform/extras.native.js +2 -1
  80. package/dist/esm/platform/haptics/index.mjs +4 -1
  81. package/dist/esm/platform/haptics/index.mjs.map +1 -1
  82. package/dist/esm/platform/haptics/index.native.js +5 -1
  83. package/dist/esm/platform/haptics/index.native.js.map +1 -1
  84. package/dist/esm/platform/haptics/validation.mjs +27 -1
  85. package/dist/esm/platform/haptics/validation.mjs.map +1 -1
  86. package/dist/esm/platform/haptics/validation.native.js +27 -1
  87. package/dist/esm/platform/haptics/validation.native.js.map +1 -1
  88. package/dist/esm/platform/image-manipulator/index.mjs +10 -3
  89. package/dist/esm/platform/image-manipulator/index.mjs.map +1 -1
  90. package/dist/esm/platform/image-manipulator/index.native.js +1 -0
  91. package/dist/esm/platform/image-manipulator/index.native.js.map +1 -1
  92. package/dist/esm/platform/index.mjs +2 -2
  93. package/dist/esm/platform/index.mjs.map +1 -1
  94. package/dist/esm/platform/index.native.js +2 -2
  95. package/dist/esm/platform/index.native.js.map +1 -1
  96. package/dist/esm/platform/keep-awake/index.mjs +51 -15
  97. package/dist/esm/platform/keep-awake/index.mjs.map +1 -1
  98. package/dist/esm/platform/keep-awake/index.native.js +27 -3
  99. package/dist/esm/platform/keep-awake/index.native.js.map +1 -1
  100. package/dist/esm/platform/keep-awake/unavailable.mjs +12 -2
  101. package/dist/esm/platform/keep-awake/unavailable.mjs.map +1 -1
  102. package/dist/esm/platform/keep-awake/unavailable.native.js +12 -2
  103. package/dist/esm/platform/keep-awake/unavailable.native.js.map +1 -1
  104. package/dist/esm/platform/keep-awake/validate.mjs +10 -1
  105. package/dist/esm/platform/keep-awake/validate.mjs.map +1 -1
  106. package/dist/esm/platform/keep-awake/validate.native.js +10 -1
  107. package/dist/esm/platform/keep-awake/validate.native.js.map +1 -1
  108. package/dist/esm/platform/localization/index.mjs +77 -0
  109. package/dist/esm/platform/localization/index.mjs.map +1 -0
  110. package/dist/esm/platform/localization/index.native.js +46 -0
  111. package/dist/esm/platform/localization/index.native.js.map +1 -0
  112. package/dist/esm/platform/localization/map.mjs +59 -0
  113. package/dist/esm/platform/localization/map.mjs.map +1 -0
  114. package/dist/esm/platform/localization/map.native.js +61 -0
  115. package/dist/esm/platform/localization/map.native.js.map +1 -0
  116. package/dist/esm/platform/localization/types.mjs +0 -0
  117. package/dist/esm/platform/localization/types.native.js +0 -0
  118. package/dist/esm/platform/secure-store/index.mjs +13 -7
  119. package/dist/esm/platform/secure-store/index.mjs.map +1 -1
  120. package/dist/esm/platform/secure-store/index.native.js +19 -13
  121. package/dist/esm/platform/secure-store/index.native.js.map +1 -1
  122. package/dist/esm/platform/secure-store/types.mjs +0 -0
  123. package/dist/esm/platform/secure-store/types.native.js +0 -0
  124. package/dist/esm/platform/secure-store/validate.mjs +33 -1
  125. package/dist/esm/platform/secure-store/validate.mjs.map +1 -1
  126. package/dist/esm/platform/secure-store/validate.native.js +33 -1
  127. package/dist/esm/platform/secure-store/validate.native.js.map +1 -1
  128. package/ios/Nitro/HybridOneDevice.swift +117 -0
  129. package/ios/Nitro/HybridOneHaptics.swift +4 -0
  130. package/ios/Nitro/HybridOneImageManipulator.swift +25 -8
  131. package/ios/Nitro/HybridOneKeepAwake.swift +34 -2
  132. package/ios/Nitro/HybridOneSecureStore.swift +112 -46
  133. package/ios/Tests/ImageManipulator/Package.swift +12 -0
  134. package/ios/Tests/ImageManipulator/README.md +21 -0
  135. package/ios/Tests/ImageManipulator/Sources/NitroModules/Promise.swift +33 -0
  136. package/ios/Tests/ImageManipulator/Sources/OneImageManipulatorCore/Types.swift +41 -0
  137. package/ios/Tests/ImageManipulator/Sources/SDWebImageWebPCoder/SDImageWebPCoder.swift +23 -0
  138. package/nitrogen/generated/android/c++/JAndroidHaptic.hpp +109 -0
  139. package/nitrogen/generated/android/c++/JCalendarInfo.hpp +70 -0
  140. package/nitrogen/generated/android/c++/JHapticImpact.hpp +3 -3
  141. package/nitrogen/generated/android/c++/JHybridOneDeviceSpec.cpp +52 -0
  142. package/nitrogen/generated/android/c++/JHybridOneDeviceSpec.hpp +3 -0
  143. package/nitrogen/generated/android/c++/JHybridOneHapticsSpec.cpp +8 -0
  144. package/nitrogen/generated/android/c++/JHybridOneHapticsSpec.hpp +1 -0
  145. package/nitrogen/generated/android/c++/JHybridOneImageManipulatorSpec.cpp +5 -1
  146. package/nitrogen/generated/android/c++/JHybridOneKeepAwakeSpec.cpp +31 -0
  147. package/nitrogen/generated/android/c++/JHybridOneKeepAwakeSpec.hpp +2 -0
  148. package/nitrogen/generated/android/c++/JHybridOneSecureStoreSpec.cpp +26 -19
  149. package/nitrogen/generated/android/c++/JHybridOneSecureStoreSpec.hpp +6 -6
  150. package/nitrogen/generated/android/c++/JImageTransformOptions.hpp +7 -1
  151. package/nitrogen/generated/android/c++/JLocaleInfo.hpp +110 -0
  152. package/nitrogen/generated/android/c++/JOneImageFlip.hpp +58 -0
  153. package/nitrogen/generated/android/c++/JOneImageFormat.hpp +3 -0
  154. package/nitrogen/generated/android/c++/JSecureStoreAccessibility.hpp +73 -0
  155. package/nitrogen/generated/android/c++/JSecureStoreOptions.hpp +76 -0
  156. package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/AndroidHaptic.kt +40 -0
  157. package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/CalendarInfo.kt +66 -0
  158. package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/HapticImpact.kt +2 -2
  159. package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/HybridOneDeviceSpec.kt +17 -0
  160. package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/HybridOneHapticsSpec.kt +4 -0
  161. package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/HybridOneKeepAwakeSpec.kt +8 -0
  162. package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/HybridOneSecureStoreSpec.kt +6 -6
  163. package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/ImageTransformOptions.kt +7 -2
  164. package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/LocaleInfo.kt +116 -0
  165. package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/OneImageFlip.kt +23 -0
  166. package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/OneImageFormat.kt +2 -1
  167. package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/SecureStoreAccessibility.kt +28 -0
  168. package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/SecureStoreOptions.kt +71 -0
  169. package/nitrogen/generated/ios/One-Swift-Cxx-Bridge.hpp +133 -51
  170. package/nitrogen/generated/ios/One-Swift-Cxx-Umbrella.hpp +19 -1
  171. package/nitrogen/generated/ios/c++/HybridOneDeviceSpecSwift.hpp +31 -0
  172. package/nitrogen/generated/ios/c++/HybridOneHapticsSpecSwift.hpp +9 -0
  173. package/nitrogen/generated/ios/c++/HybridOneImageManipulatorSpecSwift.hpp +4 -1
  174. package/nitrogen/generated/ios/c++/HybridOneKeepAwakeSpecSwift.hpp +18 -1
  175. package/nitrogen/generated/ios/c++/HybridOneSecureStoreSpecSwift.hpp +18 -13
  176. package/nitrogen/generated/ios/swift/AndroidHaptic.swift +108 -0
  177. package/nitrogen/generated/ios/swift/CalendarInfo.swift +96 -0
  178. package/nitrogen/generated/ios/swift/HapticImpact.swift +4 -4
  179. package/nitrogen/generated/ios/swift/HybridOneDeviceSpec.swift +3 -0
  180. package/nitrogen/generated/ios/swift/HybridOneDeviceSpec_cxx.swift +56 -0
  181. package/nitrogen/generated/ios/swift/HybridOneHapticsSpec.swift +1 -0
  182. package/nitrogen/generated/ios/swift/HybridOneHapticsSpec_cxx.swift +11 -0
  183. package/nitrogen/generated/ios/swift/HybridOneKeepAwakeSpec.swift +3 -1
  184. package/nitrogen/generated/ios/swift/HybridOneKeepAwakeSpec_cxx.swift +41 -3
  185. package/nitrogen/generated/ios/swift/HybridOneSecureStoreSpec.swift +6 -6
  186. package/nitrogen/generated/ios/swift/HybridOneSecureStoreSpec_cxx.swift +12 -12
  187. package/nitrogen/generated/ios/swift/ImageTransformOptions.swift +16 -5
  188. package/nitrogen/generated/ios/swift/LocaleInfo.swift +250 -0
  189. package/nitrogen/generated/ios/swift/OneImageFlip.swift +40 -0
  190. package/nitrogen/generated/ios/swift/OneImageFormat.swift +4 -0
  191. package/nitrogen/generated/ios/swift/SecureStoreAccessibility.swift +60 -0
  192. package/nitrogen/generated/ios/swift/SecureStoreOptions.swift +107 -0
  193. package/nitrogen/generated/shared/c++/AndroidHaptic.hpp +144 -0
  194. package/nitrogen/generated/shared/c++/CalendarInfo.hpp +96 -0
  195. package/nitrogen/generated/shared/c++/HapticImpact.hpp +5 -5
  196. package/nitrogen/generated/shared/c++/HybridOneDeviceSpec.cpp +3 -0
  197. package/nitrogen/generated/shared/c++/HybridOneDeviceSpec.hpp +11 -0
  198. package/nitrogen/generated/shared/c++/HybridOneHapticsSpec.cpp +1 -0
  199. package/nitrogen/generated/shared/c++/HybridOneHapticsSpec.hpp +4 -0
  200. package/nitrogen/generated/shared/c++/HybridOneKeepAwakeSpec.cpp +2 -0
  201. package/nitrogen/generated/shared/c++/HybridOneKeepAwakeSpec.hpp +4 -1
  202. package/nitrogen/generated/shared/c++/HybridOneSecureStoreSpec.hpp +9 -7
  203. package/nitrogen/generated/shared/c++/ImageTransformOptions.hpp +8 -1
  204. package/nitrogen/generated/shared/c++/LocaleInfo.hpp +136 -0
  205. package/nitrogen/generated/shared/c++/OneImageFlip.hpp +76 -0
  206. package/nitrogen/generated/shared/c++/OneImageFormat.hpp +4 -0
  207. package/nitrogen/generated/shared/c++/SecureStoreAccessibility.hpp +96 -0
  208. package/nitrogen/generated/shared/c++/SecureStoreOptions.hpp +102 -0
  209. package/package.json +15 -15
  210. package/src/index.ts +3 -0
  211. package/src/one.test.ts +2 -0
  212. package/src/one.ts +3 -0
  213. package/src/platform/extras.ts +3 -0
  214. package/src/platform/haptics/index.native.ts +13 -3
  215. package/src/platform/haptics/index.ts +12 -3
  216. package/src/platform/haptics/types.ts +25 -0
  217. package/src/platform/haptics/validation.ts +31 -1
  218. package/src/platform/image-manipulator/index.native.ts +3 -0
  219. package/src/platform/image-manipulator/index.ts +10 -3
  220. package/src/platform/index.native.ts +3 -2
  221. package/src/platform/index.ts +3 -2
  222. package/src/platform/keep-awake/index.native.ts +31 -2
  223. package/src/platform/keep-awake/index.ts +66 -17
  224. package/src/platform/keep-awake/unavailable.ts +12 -2
  225. package/src/platform/keep-awake/validate.ts +16 -0
  226. package/src/platform/localization/index.native.ts +47 -0
  227. package/src/platform/localization/index.ts +90 -0
  228. package/src/platform/localization/map.ts +77 -0
  229. package/src/platform/localization/types.ts +36 -0
  230. package/src/platform/secure-store/index.native.ts +26 -13
  231. package/src/platform/secure-store/index.ts +20 -7
  232. package/src/platform/secure-store/types.ts +33 -0
  233. package/src/platform/secure-store/validate.ts +48 -0
  234. package/src/platform/specs/OneDevice.nitro.ts +34 -0
  235. package/src/platform/specs/OneHaptics.nitro.ts +4 -1
  236. package/src/platform/specs/OneImageManipulator.nitro.ts +4 -1
  237. package/src/platform/specs/OneKeepAwake.nitro.ts +2 -0
  238. package/src/platform/specs/OneSecureStore.nitro.ts +12 -8
  239. package/types/index.d.ts +1 -1
  240. package/types/index.d.ts.map +1 -1
  241. package/types/one.d.ts +2 -1
  242. package/types/one.d.ts.map +1 -1
  243. package/types/platform/extras.d.ts +3 -0
  244. package/types/platform/extras.d.ts.map +1 -1
  245. package/types/platform/haptics/index.d.ts +2 -2
  246. package/types/platform/haptics/index.d.ts.map +1 -1
  247. package/types/platform/haptics/index.native.d.ts +2 -2
  248. package/types/platform/haptics/index.native.d.ts.map +1 -1
  249. package/types/platform/haptics/types.d.ts +3 -0
  250. package/types/platform/haptics/types.d.ts.map +1 -1
  251. package/types/platform/haptics/validation.d.ts +3 -1
  252. package/types/platform/haptics/validation.d.ts.map +1 -1
  253. package/types/platform/image-manipulator/index.d.ts +1 -1
  254. package/types/platform/image-manipulator/index.d.ts.map +1 -1
  255. package/types/platform/image-manipulator/index.native.d.ts +1 -1
  256. package/types/platform/image-manipulator/index.native.d.ts.map +1 -1
  257. package/types/platform/index.d.ts +3 -3
  258. package/types/platform/index.d.ts.map +1 -1
  259. package/types/platform/index.native.d.ts +3 -3
  260. package/types/platform/index.native.d.ts.map +1 -1
  261. package/types/platform/keep-awake/index.d.ts +3 -0
  262. package/types/platform/keep-awake/index.d.ts.map +1 -1
  263. package/types/platform/keep-awake/index.native.d.ts +5 -0
  264. package/types/platform/keep-awake/index.native.d.ts.map +1 -1
  265. package/types/platform/keep-awake/unavailable.d.ts +4 -0
  266. package/types/platform/keep-awake/unavailable.d.ts.map +1 -1
  267. package/types/platform/keep-awake/validate.d.ts +3 -0
  268. package/types/platform/keep-awake/validate.d.ts.map +1 -1
  269. package/types/platform/localization/index.d.ts +7 -0
  270. package/types/platform/localization/index.d.ts.map +1 -0
  271. package/types/platform/localization/index.native.d.ts +7 -0
  272. package/types/platform/localization/index.native.d.ts.map +1 -0
  273. package/types/platform/localization/map.d.ts +9 -0
  274. package/types/platform/localization/map.d.ts.map +1 -0
  275. package/types/platform/localization/types.d.ts +31 -0
  276. package/types/platform/localization/types.d.ts.map +1 -0
  277. package/types/platform/secure-store/index.d.ts +8 -7
  278. package/types/platform/secure-store/index.d.ts.map +1 -1
  279. package/types/platform/secure-store/index.native.d.ts +8 -7
  280. package/types/platform/secure-store/index.native.d.ts.map +1 -1
  281. package/types/platform/secure-store/types.d.ts +24 -0
  282. package/types/platform/secure-store/types.d.ts.map +1 -0
  283. package/types/platform/secure-store/validate.d.ts +3 -0
  284. package/types/platform/secure-store/validate.d.ts.map +1 -1
  285. package/types/platform/specs/OneDevice.nitro.d.ts +25 -0
  286. package/types/platform/specs/OneDevice.nitro.d.ts.map +1 -1
  287. package/types/platform/specs/OneHaptics.nitro.d.ts +2 -1
  288. package/types/platform/specs/OneHaptics.nitro.d.ts.map +1 -1
  289. package/types/platform/specs/OneImageManipulator.nitro.d.ts +3 -1
  290. package/types/platform/specs/OneImageManipulator.nitro.d.ts.map +1 -1
  291. package/types/platform/specs/OneKeepAwake.nitro.d.ts +2 -0
  292. package/types/platform/specs/OneKeepAwake.nitro.d.ts.map +1 -1
  293. package/types/platform/specs/OneSecureStore.nitro.d.ts +8 -6
  294. package/types/platform/specs/OneSecureStore.nitro.d.ts.map +1 -1
@@ -0,0 +1,76 @@
1
+ ///
2
+ /// OneImageFlip.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::one {
27
+
28
+ /**
29
+ * An enum which can be represented as a JavaScript union (OneImageFlip).
30
+ */
31
+ enum class OneImageFlip {
32
+ HORIZONTAL SWIFT_NAME(horizontal) = 0,
33
+ VERTICAL SWIFT_NAME(vertical) = 1,
34
+ } CLOSED_ENUM;
35
+
36
+ } // namespace margelo::nitro::one
37
+
38
+ namespace margelo::nitro {
39
+
40
+ // C++ OneImageFlip <> JS OneImageFlip (union)
41
+ template <>
42
+ struct JSIConverter<margelo::nitro::one::OneImageFlip> final {
43
+ static inline margelo::nitro::one::OneImageFlip 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("horizontal"): return margelo::nitro::one::OneImageFlip::HORIZONTAL;
47
+ case hashString("vertical"): return margelo::nitro::one::OneImageFlip::VERTICAL;
48
+ default: [[unlikely]]
49
+ throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum OneImageFlip - invalid value!");
50
+ }
51
+ }
52
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::one::OneImageFlip arg) {
53
+ switch (arg) {
54
+ case margelo::nitro::one::OneImageFlip::HORIZONTAL: return JSIConverter<std::string>::toJSI(runtime, "horizontal");
55
+ case margelo::nitro::one::OneImageFlip::VERTICAL: return JSIConverter<std::string>::toJSI(runtime, "vertical");
56
+ default: [[unlikely]]
57
+ throw std::invalid_argument("Cannot convert OneImageFlip 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("horizontal"):
68
+ case hashString("vertical"):
69
+ return true;
70
+ default:
71
+ return false;
72
+ }
73
+ }
74
+ };
75
+
76
+ } // namespace margelo::nitro
@@ -31,6 +31,7 @@ namespace margelo::nitro::one {
31
31
  enum class OneImageFormat {
32
32
  JPEG SWIFT_NAME(jpeg) = 0,
33
33
  PNG SWIFT_NAME(png) = 1,
34
+ WEBP SWIFT_NAME(webp) = 2,
34
35
  } CLOSED_ENUM;
35
36
 
36
37
  } // namespace margelo::nitro::one
@@ -45,6 +46,7 @@ namespace margelo::nitro {
45
46
  switch (hashString(unionValue.c_str(), unionValue.size())) {
46
47
  case hashString("jpeg"): return margelo::nitro::one::OneImageFormat::JPEG;
47
48
  case hashString("png"): return margelo::nitro::one::OneImageFormat::PNG;
49
+ case hashString("webp"): return margelo::nitro::one::OneImageFormat::WEBP;
48
50
  default: [[unlikely]]
49
51
  throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum OneImageFormat - invalid value!");
50
52
  }
@@ -53,6 +55,7 @@ namespace margelo::nitro {
53
55
  switch (arg) {
54
56
  case margelo::nitro::one::OneImageFormat::JPEG: return JSIConverter<std::string>::toJSI(runtime, "jpeg");
55
57
  case margelo::nitro::one::OneImageFormat::PNG: return JSIConverter<std::string>::toJSI(runtime, "png");
58
+ case margelo::nitro::one::OneImageFormat::WEBP: return JSIConverter<std::string>::toJSI(runtime, "webp");
56
59
  default: [[unlikely]]
57
60
  throw std::invalid_argument("Cannot convert OneImageFormat to JS - invalid value: "
58
61
  + std::to_string(static_cast<int>(arg)) + "!");
@@ -66,6 +69,7 @@ namespace margelo::nitro {
66
69
  switch (hashString(unionValue.c_str(), unionValue.size())) {
67
70
  case hashString("jpeg"):
68
71
  case hashString("png"):
72
+ case hashString("webp"):
69
73
  return true;
70
74
  default:
71
75
  return false;
@@ -0,0 +1,96 @@
1
+ ///
2
+ /// SecureStoreAccessibility.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::one {
27
+
28
+ /**
29
+ * An enum which can be represented as a JavaScript union (SecureStoreAccessibility).
30
+ */
31
+ enum class SecureStoreAccessibility {
32
+ ALWAYS SWIFT_NAME(always) = 0,
33
+ AFTERFIRSTUNLOCK SWIFT_NAME(afterfirstunlock) = 1,
34
+ AFTERFIRSTUNLOCKTHISDEVICEONLY SWIFT_NAME(afterfirstunlockthisdeviceonly) = 2,
35
+ ALWAYSTHISDEVICEONLY SWIFT_NAME(alwaysthisdeviceonly) = 3,
36
+ WHENPASSCODESETTHISDEVICEONLY SWIFT_NAME(whenpasscodesetthisdeviceonly) = 4,
37
+ WHENUNLOCKED SWIFT_NAME(whenunlocked) = 5,
38
+ WHENUNLOCKEDTHISDEVICEONLY SWIFT_NAME(whenunlockedthisdeviceonly) = 6,
39
+ } CLOSED_ENUM;
40
+
41
+ } // namespace margelo::nitro::one
42
+
43
+ namespace margelo::nitro {
44
+
45
+ // C++ SecureStoreAccessibility <> JS SecureStoreAccessibility (union)
46
+ template <>
47
+ struct JSIConverter<margelo::nitro::one::SecureStoreAccessibility> final {
48
+ static inline margelo::nitro::one::SecureStoreAccessibility fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
49
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
50
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
51
+ case hashString("always"): return margelo::nitro::one::SecureStoreAccessibility::ALWAYS;
52
+ case hashString("afterFirstUnlock"): return margelo::nitro::one::SecureStoreAccessibility::AFTERFIRSTUNLOCK;
53
+ case hashString("afterFirstUnlockThisDeviceOnly"): return margelo::nitro::one::SecureStoreAccessibility::AFTERFIRSTUNLOCKTHISDEVICEONLY;
54
+ case hashString("alwaysThisDeviceOnly"): return margelo::nitro::one::SecureStoreAccessibility::ALWAYSTHISDEVICEONLY;
55
+ case hashString("whenPasscodeSetThisDeviceOnly"): return margelo::nitro::one::SecureStoreAccessibility::WHENPASSCODESETTHISDEVICEONLY;
56
+ case hashString("whenUnlocked"): return margelo::nitro::one::SecureStoreAccessibility::WHENUNLOCKED;
57
+ case hashString("whenUnlockedThisDeviceOnly"): return margelo::nitro::one::SecureStoreAccessibility::WHENUNLOCKEDTHISDEVICEONLY;
58
+ default: [[unlikely]]
59
+ throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum SecureStoreAccessibility - invalid value!");
60
+ }
61
+ }
62
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::one::SecureStoreAccessibility arg) {
63
+ switch (arg) {
64
+ case margelo::nitro::one::SecureStoreAccessibility::ALWAYS: return JSIConverter<std::string>::toJSI(runtime, "always");
65
+ case margelo::nitro::one::SecureStoreAccessibility::AFTERFIRSTUNLOCK: return JSIConverter<std::string>::toJSI(runtime, "afterFirstUnlock");
66
+ case margelo::nitro::one::SecureStoreAccessibility::AFTERFIRSTUNLOCKTHISDEVICEONLY: return JSIConverter<std::string>::toJSI(runtime, "afterFirstUnlockThisDeviceOnly");
67
+ case margelo::nitro::one::SecureStoreAccessibility::ALWAYSTHISDEVICEONLY: return JSIConverter<std::string>::toJSI(runtime, "alwaysThisDeviceOnly");
68
+ case margelo::nitro::one::SecureStoreAccessibility::WHENPASSCODESETTHISDEVICEONLY: return JSIConverter<std::string>::toJSI(runtime, "whenPasscodeSetThisDeviceOnly");
69
+ case margelo::nitro::one::SecureStoreAccessibility::WHENUNLOCKED: return JSIConverter<std::string>::toJSI(runtime, "whenUnlocked");
70
+ case margelo::nitro::one::SecureStoreAccessibility::WHENUNLOCKEDTHISDEVICEONLY: return JSIConverter<std::string>::toJSI(runtime, "whenUnlockedThisDeviceOnly");
71
+ default: [[unlikely]]
72
+ throw std::invalid_argument("Cannot convert SecureStoreAccessibility to JS - invalid value: "
73
+ + std::to_string(static_cast<int>(arg)) + "!");
74
+ }
75
+ }
76
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
77
+ if (!value.isString()) {
78
+ return false;
79
+ }
80
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
81
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
82
+ case hashString("always"):
83
+ case hashString("afterFirstUnlock"):
84
+ case hashString("afterFirstUnlockThisDeviceOnly"):
85
+ case hashString("alwaysThisDeviceOnly"):
86
+ case hashString("whenPasscodeSetThisDeviceOnly"):
87
+ case hashString("whenUnlocked"):
88
+ case hashString("whenUnlockedThisDeviceOnly"):
89
+ return true;
90
+ default:
91
+ return false;
92
+ }
93
+ }
94
+ };
95
+
96
+ } // namespace margelo::nitro
@@ -0,0 +1,102 @@
1
+ ///
2
+ /// SecureStoreOptions.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 `SecureStoreAccessibility` to properly resolve imports.
32
+ namespace margelo::nitro::one { enum class SecureStoreAccessibility; }
33
+
34
+ #include <string>
35
+ #include <optional>
36
+ #include "SecureStoreAccessibility.hpp"
37
+
38
+ namespace margelo::nitro::one {
39
+
40
+ /**
41
+ * A struct which can be represented as a JavaScript object (SecureStoreOptions).
42
+ */
43
+ struct SecureStoreOptions final {
44
+ public:
45
+ std::optional<std::string> keychainService SWIFT_PRIVATE;
46
+ std::optional<SecureStoreAccessibility> keychainAccessible SWIFT_PRIVATE;
47
+ std::optional<bool> requireAuthentication SWIFT_PRIVATE;
48
+ std::optional<std::string> authenticationPrompt SWIFT_PRIVATE;
49
+ std::optional<std::string> accessGroup SWIFT_PRIVATE;
50
+
51
+ public:
52
+ SecureStoreOptions() = default;
53
+ explicit SecureStoreOptions(std::optional<std::string> keychainService, std::optional<SecureStoreAccessibility> keychainAccessible, std::optional<bool> requireAuthentication, std::optional<std::string> authenticationPrompt, std::optional<std::string> accessGroup): keychainService(keychainService), keychainAccessible(keychainAccessible), requireAuthentication(requireAuthentication), authenticationPrompt(authenticationPrompt), accessGroup(accessGroup) {}
54
+
55
+ public:
56
+ friend bool operator==(const SecureStoreOptions& lhs, const SecureStoreOptions& rhs) = default;
57
+ };
58
+
59
+ } // namespace margelo::nitro::one
60
+
61
+ namespace margelo::nitro {
62
+
63
+ // C++ SecureStoreOptions <> JS SecureStoreOptions (object)
64
+ template <>
65
+ struct JSIConverter<margelo::nitro::one::SecureStoreOptions> final {
66
+ static inline margelo::nitro::one::SecureStoreOptions fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
67
+ jsi::Object obj = arg.asObject(runtime);
68
+ return margelo::nitro::one::SecureStoreOptions(
69
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "keychainService"))),
70
+ JSIConverter<std::optional<margelo::nitro::one::SecureStoreAccessibility>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "keychainAccessible"))),
71
+ JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "requireAuthentication"))),
72
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "authenticationPrompt"))),
73
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "accessGroup")))
74
+ );
75
+ }
76
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::one::SecureStoreOptions& arg) {
77
+ jsi::Object obj(runtime);
78
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "keychainService"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.keychainService));
79
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "keychainAccessible"), JSIConverter<std::optional<margelo::nitro::one::SecureStoreAccessibility>>::toJSI(runtime, arg.keychainAccessible));
80
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "requireAuthentication"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.requireAuthentication));
81
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "authenticationPrompt"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.authenticationPrompt));
82
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "accessGroup"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.accessGroup));
83
+ return obj;
84
+ }
85
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
86
+ if (!value.isObject()) {
87
+ return false;
88
+ }
89
+ jsi::Object obj = value.getObject(runtime);
90
+ if (!nitro::isPlainObject(runtime, obj)) {
91
+ return false;
92
+ }
93
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "keychainService")))) return false;
94
+ if (!JSIConverter<std::optional<margelo::nitro::one::SecureStoreAccessibility>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "keychainAccessible")))) return false;
95
+ if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "requireAuthentication")))) return false;
96
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "authenticationPrompt")))) return false;
97
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "accessGroup")))) return false;
98
+ return true;
99
+ }
100
+ };
101
+
102
+ } // namespace margelo::nitro
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "one",
3
- "version": "2.6.18",
3
+ "version": "2.6.19",
4
4
  "description": "One is a React framework for web, iOS, and Android apps.",
5
5
  "license": "BSD-3-Clause",
6
6
  "sideEffects": [
@@ -236,18 +236,18 @@
236
236
  "@react-navigation/native-stack": "8.0.0-alpha.58",
237
237
  "@react-navigation/routers": "8.0.0-alpha.20",
238
238
  "@ungap/structured-clone": "^1.2.0",
239
- "@vxrn/color-scheme": "2.6.18",
240
- "@vxrn/compiler": "2.6.18",
241
- "@vxrn/resolve": "2.6.18",
242
- "@vxrn/tslib-lite": "2.6.18",
243
- "@vxrn/use-isomorphic-layout-effect": "2.6.18",
244
- "@vxrn/utils": "2.6.18",
245
- "@vxrn/vite-plugin-metro": "2.6.18",
239
+ "@vxrn/color-scheme": "2.6.19",
240
+ "@vxrn/compiler": "2.6.19",
241
+ "@vxrn/resolve": "2.6.19",
242
+ "@vxrn/tslib-lite": "2.6.19",
243
+ "@vxrn/use-isomorphic-layout-effect": "2.6.19",
244
+ "@vxrn/utils": "2.6.19",
245
+ "@vxrn/vite-plugin-metro": "2.6.19",
246
246
  "babel-dead-code-elimination": "1.0.10",
247
247
  "babel-plugin-module-resolver": "^5.0.2",
248
248
  "citty": "^0.1.6",
249
249
  "core-js": "^3.38.1",
250
- "create-vxrn": "2.6.18",
250
+ "create-vxrn": "2.6.19",
251
251
  "escape-string-regexp": "^5.0.0",
252
252
  "fast-deep-equal": "^3.1.3",
253
253
  "fast-glob": "^3.3.3",
@@ -269,7 +269,7 @@
269
269
  "tsconfig-paths": "^4",
270
270
  "use-latest-callback": "^0.2.3",
271
271
  "vite": "^8.2.2",
272
- "vxrn": "2.6.18",
272
+ "vxrn": "2.6.19",
273
273
  "web-streams-polyfill": "^4.3.0",
274
274
  "ws": "^8.21.0",
275
275
  "xxhashjs": "^0.2.2"
@@ -325,19 +325,19 @@
325
325
  }
326
326
  },
327
327
  "devDependencies": {
328
- "@tamagui/sheet": "3.0.7",
328
+ "@tamagui/sheet": "3.0.9",
329
329
  "@callstack/liquid-glass": "^0.8.1",
330
330
  "@react-native/babel-plugin-codegen": "0.87.1",
331
331
  "@react-native/codegen": "^0.87.1",
332
332
  "@react-navigation/core": "8.0.0-alpha.40",
333
333
  "@react-navigation/drawer": "8.0.0-alpha.57",
334
334
  "@react-navigation/native": "8.0.0-alpha.50",
335
- "@tamagui/build": "3.0.7",
335
+ "@tamagui/build": "3.0.9",
336
336
  "@types/node": "^24.10.0",
337
337
  "@types/react-dom": "^19.2.2",
338
338
  "@types/react-test-renderer": "^19.1.0",
339
339
  "@types/xxhashjs": "^0.2.4",
340
- "@vxrn/emitter": "2.6.18",
340
+ "@vxrn/emitter": "2.6.19",
341
341
  "depcheck": "^1.4.7",
342
342
  "esbuild": "^0.25.12",
343
343
  "immer": "^10.1.1",
@@ -356,7 +356,7 @@
356
356
  "typescript": "7.0.2",
357
357
  "vitest": "^4.1.0",
358
358
  "yoga-layout": "^3.2.1",
359
- "@tamagui/web": "3.0.7"
359
+ "@tamagui/web": "3.0.9"
360
360
  },
361
361
  "publishConfig": {
362
362
  "access": "public"
@@ -513,7 +513,7 @@
513
513
  }
514
514
  }
515
515
  },
516
- "releaseSourceCommit": "36867c8a9754398e5ed511c7d6c4beaf2d8ed181",
516
+ "releaseSourceCommit": "d9ca52ca8d6d6616f161708cbed988c415f056d9",
517
517
  "repository": {
518
518
  "type": "git",
519
519
  "url": "git+https://github.com/onejs/one.git",
package/src/index.ts CHANGED
@@ -4,8 +4,11 @@ export { One } from './one'
4
4
  // native hooks and adaptive reads are named exports for react-hooks lint.
5
5
  export {
6
6
  useFonts,
7
+ useKeepAwake,
7
8
  useNativeState,
8
9
  useNetworkState,
10
+ useLocales,
11
+ useCalendars,
9
12
  usePreventScreenCapture,
10
13
  useAudioPlayer,
11
14
  useAudioPlayerStatus,
package/src/one.test.ts CHANGED
@@ -5,6 +5,7 @@ import {
5
5
  onHingeChange,
6
6
  useFonts,
7
7
  useHinge,
8
+ useKeepAwake,
8
9
  useNativeState,
9
10
  useNetworkState,
10
11
  useReservedRegions,
@@ -36,6 +37,7 @@ describe('root One export', () => {
36
37
  expect(One.UI.SafeArea.Provider).toBeTypeOf('function')
37
38
  expect(One.UI.SafeArea.View).toBeTypeOf('object')
38
39
  expect(useFonts).toBeTypeOf('function')
40
+ expect(useKeepAwake).toBeTypeOf('function')
39
41
  expect(useNativeState).toBeTypeOf('function')
40
42
  expect(useNetworkState).toBeTypeOf('function')
41
43
  expect(useSafeAreaInsets).toBeTypeOf('function')
package/src/one.ts CHANGED
@@ -27,6 +27,7 @@ import {
27
27
  Purchases,
28
28
  ImageManipulator,
29
29
  Device,
30
+ Localization,
30
31
  Motion,
31
32
  BackgroundTasks,
32
33
  AppIntents,
@@ -156,6 +157,7 @@ export type OneAPI = {
156
157
  readonly Purchases: typeof Purchases
157
158
  readonly ImageManipulator: typeof ImageManipulator
158
159
  readonly Device: typeof Device
160
+ readonly Localization: typeof Localization
159
161
  readonly Motion: typeof Motion
160
162
  readonly BackgroundTasks: typeof BackgroundTasks
161
163
  readonly AppIntents: typeof AppIntents
@@ -266,6 +268,7 @@ export const One: OneAPI = Object.freeze({
266
268
  Purchases,
267
269
  ImageManipulator,
268
270
  Device,
271
+ Localization,
269
272
  Motion,
270
273
  BackgroundTasks,
271
274
  AppIntents,
@@ -96,7 +96,10 @@ export type {
96
96
  NetworkStateSubscription,
97
97
  NetworkStateType,
98
98
  } from './network'
99
+ export { Localization, useCalendars, useLocales } from './localization'
100
+ export type { Calendar, Locale, LocalizationApi } from './localization'
99
101
  export { SecureStore } from './secure-store'
102
+ export type { SecureStoreAccessibility, SecureStoreOptions } from './secure-store'
100
103
  export { Auth } from './auth'
101
104
  export type {
102
105
  AppleAuth,
@@ -1,9 +1,14 @@
1
1
  import { NitroModules } from 'react-native-nitro-modules'
2
2
  import type { OneHaptics } from '../specs/OneHaptics.nitro'
3
- import type { HapticImpact, HapticNotification, Haptics as HapticsApi } from './types'
4
- import { assertImpact, assertNotification } from './validation'
3
+ import type {
4
+ AndroidHaptic,
5
+ HapticImpact,
6
+ HapticNotification,
7
+ Haptics as HapticsApi,
8
+ } from './types'
9
+ import { assertAndroidHaptic, assertImpact, assertNotification } from './validation'
5
10
 
6
- export type { HapticImpact, HapticNotification, HapticsApi }
11
+ export type { AndroidHaptic, HapticImpact, HapticNotification, HapticsApi }
7
12
 
8
13
  // the OneHaptics nitro hybrid object, created on first use and cached. calls
9
14
  // are sync JSI, so a gesture handler firing at threshold rates never waits
@@ -31,4 +36,9 @@ export const Haptics: HapticsApi = Object.freeze({
31
36
  assertNotification(type)
32
37
  native().notification(type)
33
38
  },
39
+
40
+ performAndroidHaptics(type: AndroidHaptic) {
41
+ assertAndroidHaptic(type)
42
+ native().performAndroidHaptics(type)
43
+ },
34
44
  })
@@ -1,7 +1,12 @@
1
- import type { HapticImpact, HapticNotification, Haptics as HapticsApi } from './types'
2
- import { assertImpact, assertNotification } from './validation'
1
+ import type {
2
+ AndroidHaptic,
3
+ HapticImpact,
4
+ HapticNotification,
5
+ Haptics as HapticsApi,
6
+ } from './types'
7
+ import { assertAndroidHaptic, assertImpact, assertNotification } from './validation'
3
8
 
4
- export type { HapticImpact, HapticNotification, HapticsApi }
9
+ export type { AndroidHaptic, HapticImpact, HapticNotification, HapticsApi }
5
10
 
6
11
  // web entry. same shape as the native entry, including the JS-boundary
7
12
  // validation throws, but every verb is a no-op: navigator.vibrate() cannot
@@ -18,4 +23,8 @@ export const Haptics: HapticsApi = Object.freeze({
18
23
  notification(type: HapticNotification) {
19
24
  assertNotification(type)
20
25
  },
26
+
27
+ performAndroidHaptics(type: AndroidHaptic) {
28
+ assertAndroidHaptic(type)
29
+ },
21
30
  })
@@ -5,6 +5,29 @@
5
5
  export type HapticImpact = 'light' | 'medium' | 'heavy' | 'soft' | 'rigid'
6
6
  export type HapticNotification = 'success' | 'warning' | 'error'
7
7
 
8
+ // expo-haptics AndroidHaptics values: android.view.HapticFeedbackConstants
9
+ // names as lowercase strings. android only; a no-op elsewhere, as in expo.
10
+ export type AndroidHaptic =
11
+ | 'clock-tick'
12
+ | 'confirm'
13
+ | 'context-click'
14
+ | 'drag-start'
15
+ | 'gesture-end'
16
+ | 'gesture-start'
17
+ | 'keyboard-press'
18
+ | 'keyboard-release'
19
+ | 'keyboard-tap'
20
+ | 'long-press'
21
+ | 'no-haptics'
22
+ | 'reject'
23
+ | 'segment-frequent-tick'
24
+ | 'segment-tick'
25
+ | 'text-handle-move'
26
+ | 'toggle-off'
27
+ | 'toggle-on'
28
+ | 'virtual-key'
29
+ | 'virtual-key-release'
30
+
8
31
  export interface Haptics {
9
32
  /** picking among options, toggles, segments, mode switches */
10
33
  selection(): void
@@ -12,4 +35,6 @@ export interface Haptics {
12
35
  impact(style: HapticImpact): void
13
36
  /** completion and failure the user cares about */
14
37
  notification(type: HapticNotification): void
38
+ /** android HapticFeedbackConstants feedback; no-op on ios and web */
39
+ performAndroidHaptics(type: AndroidHaptic): void
15
40
  }
@@ -1,4 +1,4 @@
1
- import type { HapticImpact, HapticNotification } from './types'
1
+ import type { AndroidHaptic, HapticImpact, HapticNotification } from './types'
2
2
 
3
3
  // js-boundary validation shared by the web and native entries. unknown
4
4
  // style/type strings throw here so invalid calls never reach native, whose
@@ -16,6 +16,36 @@ export const NOTIFICATION_TYPES: readonly HapticNotification[] = [
16
16
  'error',
17
17
  ]
18
18
 
19
+ export const ANDROID_HAPTICS: readonly AndroidHaptic[] = [
20
+ 'clock-tick',
21
+ 'confirm',
22
+ 'context-click',
23
+ 'drag-start',
24
+ 'gesture-end',
25
+ 'gesture-start',
26
+ 'keyboard-press',
27
+ 'keyboard-release',
28
+ 'keyboard-tap',
29
+ 'long-press',
30
+ 'no-haptics',
31
+ 'reject',
32
+ 'segment-frequent-tick',
33
+ 'segment-tick',
34
+ 'text-handle-move',
35
+ 'toggle-off',
36
+ 'toggle-on',
37
+ 'virtual-key',
38
+ 'virtual-key-release',
39
+ ]
40
+
41
+ export function assertAndroidHaptic(type: AndroidHaptic): void {
42
+ if (!ANDROID_HAPTICS.includes(type)) {
43
+ throw new TypeError(
44
+ `One.Haptics.performAndroidHaptics: unknown type ${JSON.stringify(type)}. Expected one of: ${ANDROID_HAPTICS.join(', ')}.`
45
+ )
46
+ }
47
+ }
48
+
19
49
  export function assertImpact(style: HapticImpact): void {
20
50
  if (!IMPACT_STYLES.includes(style)) {
21
51
  throw new TypeError(
@@ -8,6 +8,7 @@ import type {
8
8
 
9
9
  export type {
10
10
  ImageCrop,
11
+ OneImageFlip as ImageFlip,
11
12
  OneImageFormat as ImageFormat,
12
13
  ImageResize,
13
14
  ImageTransformResult,
@@ -28,6 +29,8 @@ function transform(
28
29
  uri: string,
29
30
  options: ImageManipulatorOptions = {}
30
31
  ): Promise<ImageTransformResult> {
32
+ if (options.flip != null && options.flip !== 'horizontal' && options.flip !== 'vertical')
33
+ throw new Error("ImageManipulator.transform: flip must be 'horizontal' or 'vertical'")
31
34
  return native()
32
35
  .transform(uri, { ...options, format: options.format ?? 'jpeg' })
33
36
  .catch(rethrowNativeError)
@@ -5,6 +5,7 @@ import type {
5
5
  } from '../specs/OneImageManipulator.nitro'
6
6
  export type {
7
7
  ImageCrop,
8
+ OneImageFlip as ImageFlip,
8
9
  OneImageFormat as ImageFormat,
9
10
  ImageResize,
10
11
  ImageTransformResult,
@@ -31,15 +32,17 @@ async function transform(
31
32
  ): Promise<ImageTransformResult> {
32
33
  if (typeof window === 'undefined')
33
34
  throw missingNativeBuild('ImageManipulator.transform')
34
- const { crop, resize, rotate = 0, format = 'jpeg', quality } = options
35
- if (!['jpeg', 'png'].includes(format) || ![0, 90, 180, 270].includes(rotate))
35
+ const { crop, resize, rotate = 0, flip, format = 'jpeg', quality } = options
36
+ if (!['jpeg', 'png', 'webp'].includes(format) || ![0, 90, 180, 270].includes(rotate))
36
37
  throw new Error('ImageManipulator.transform: invalid format or rotation')
38
+ if (flip != null && flip !== 'horizontal' && flip !== 'vertical')
39
+ throw new Error("ImageManipulator.transform: flip must be 'horizontal' or 'vertical'")
37
40
  if (
38
41
  (format === 'png' && quality != null) ||
39
42
  (quality != null && (!Number.isFinite(quality) || quality < 0 || quality > 1))
40
43
  )
41
44
  throw new Error(
42
- 'ImageManipulator.transform: quality applies only to JPEG and must be between 0 and 1'
45
+ 'ImageManipulator.transform: quality applies only to JPEG or WebP and must be between 0 and 1'
43
46
  )
44
47
  const image = new window.Image()
45
48
  image.crossOrigin = 'anonymous'
@@ -65,7 +68,11 @@ async function transform(
65
68
  canvas.height = rotate === 90 || rotate === 270 ? width : height
66
69
  const context = canvas.getContext('2d')
67
70
  if (!context) throw new Error('ImageManipulator.transform: canvas is unavailable')
71
+ // canvas transforms apply to the drawn image last-first, so the flip goes
72
+ // before the rotation here to mirror the already rotated image, as native does.
68
73
  context.translate(canvas.width / 2, canvas.height / 2)
74
+ if (flip === 'horizontal') context.scale(-1, 1)
75
+ else if (flip === 'vertical') context.scale(1, -1)
69
76
  context.rotate((rotate * Math.PI) / 180)
70
77
  let source: CanvasImageSource = image
71
78
  if (crop) {