one 2.6.18 → 2.6.20
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.
- package/One.podspec +2 -0
- package/android/src/main/java/com/margelo/nitro/one/HybridOneDevice.kt +124 -0
- package/android/src/main/java/com/margelo/nitro/one/HybridOneHaptics.kt +31 -0
- package/android/src/main/java/com/margelo/nitro/one/HybridOneImageManipulator.kt +25 -5
- package/android/src/main/java/com/margelo/nitro/one/HybridOneKeepAwake.kt +34 -9
- package/android/src/main/java/com/margelo/nitro/one/HybridOneSecureStore.kt +269 -78
- package/dist/cjs/index.cjs +3 -0
- package/dist/cjs/index.native.cjs +3 -0
- package/dist/cjs/index.native.js +3 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/one.cjs +1 -0
- package/dist/cjs/one.native.cjs +1 -0
- package/dist/cjs/one.native.js +1 -0
- package/dist/cjs/one.native.js.map +1 -1
- package/dist/cjs/platform/extras.cjs +4 -0
- package/dist/cjs/platform/extras.native.cjs +4 -0
- package/dist/cjs/platform/extras.native.js +4 -0
- package/dist/cjs/platform/extras.native.js.map +1 -1
- package/dist/cjs/platform/haptics/index.cjs +3 -0
- package/dist/cjs/platform/haptics/index.native.cjs +4 -0
- package/dist/cjs/platform/haptics/index.native.js +4 -0
- package/dist/cjs/platform/haptics/index.native.js.map +1 -1
- package/dist/cjs/platform/haptics/validation.cjs +28 -0
- package/dist/cjs/platform/haptics/validation.native.cjs +28 -0
- package/dist/cjs/platform/haptics/validation.native.js +28 -0
- package/dist/cjs/platform/haptics/validation.native.js.map +1 -1
- package/dist/cjs/platform/image-manipulator/index.cjs +10 -3
- package/dist/cjs/platform/image-manipulator/index.native.cjs +1 -0
- package/dist/cjs/platform/image-manipulator/index.native.js +1 -0
- package/dist/cjs/platform/image-manipulator/index.native.js.map +1 -1
- package/dist/cjs/platform/index.cjs +1 -0
- package/dist/cjs/platform/index.native.cjs +1 -0
- package/dist/cjs/platform/index.native.js +1 -0
- package/dist/cjs/platform/index.native.js.map +1 -1
- package/dist/cjs/platform/keep-awake/index.cjs +53 -14
- package/dist/cjs/platform/keep-awake/index.native.cjs +29 -2
- package/dist/cjs/platform/keep-awake/index.native.js +29 -2
- package/dist/cjs/platform/keep-awake/index.native.js.map +1 -1
- package/dist/cjs/platform/keep-awake/unavailable.cjs +11 -1
- package/dist/cjs/platform/keep-awake/unavailable.native.cjs +11 -1
- package/dist/cjs/platform/keep-awake/unavailable.native.js +11 -1
- package/dist/cjs/platform/keep-awake/unavailable.native.js.map +1 -1
- package/dist/cjs/platform/keep-awake/validate.cjs +15 -1
- package/dist/cjs/platform/keep-awake/validate.native.cjs +15 -1
- package/dist/cjs/platform/keep-awake/validate.native.js +15 -1
- package/dist/cjs/platform/keep-awake/validate.native.js.map +1 -1
- package/dist/cjs/platform/localization/index.cjs +100 -0
- package/dist/cjs/platform/localization/index.native.cjs +71 -0
- package/dist/cjs/platform/localization/index.native.js +73 -0
- package/dist/cjs/platform/localization/index.native.js.map +1 -0
- package/dist/cjs/platform/localization/map.cjs +86 -0
- package/dist/cjs/platform/localization/map.native.cjs +90 -0
- package/dist/cjs/platform/localization/map.native.js +92 -0
- package/dist/cjs/platform/localization/map.native.js.map +1 -0
- package/dist/cjs/platform/localization/types.cjs +16 -0
- package/dist/cjs/platform/localization/types.native.cjs +18 -0
- package/dist/cjs/platform/localization/types.native.js +20 -0
- package/dist/cjs/platform/localization/types.native.js.map +1 -0
- package/dist/cjs/platform/secure-store/index.cjs +12 -6
- package/dist/cjs/platform/secure-store/index.native.cjs +18 -12
- package/dist/cjs/platform/secure-store/index.native.js +18 -12
- package/dist/cjs/platform/secure-store/index.native.js.map +1 -1
- package/dist/cjs/platform/secure-store/types.cjs +16 -0
- package/dist/cjs/platform/secure-store/types.native.cjs +18 -0
- package/dist/cjs/platform/secure-store/types.native.js +20 -0
- package/dist/cjs/platform/secure-store/types.native.js.map +1 -0
- package/dist/cjs/platform/secure-store/validate.cjs +34 -0
- package/dist/cjs/platform/secure-store/validate.native.cjs +34 -0
- package/dist/cjs/platform/secure-store/validate.native.js +34 -0
- package/dist/cjs/platform/secure-store/validate.native.js.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.mjs +2 -2
- package/dist/esm/index.native.js +2 -2
- package/dist/esm/one.mjs +2 -1
- package/dist/esm/one.mjs.map +1 -1
- package/dist/esm/one.native.js +2 -1
- package/dist/esm/one.native.js.map +1 -1
- package/dist/esm/platform/extras.mjs +2 -1
- package/dist/esm/platform/extras.native.js +2 -1
- package/dist/esm/platform/haptics/index.mjs +4 -1
- package/dist/esm/platform/haptics/index.mjs.map +1 -1
- package/dist/esm/platform/haptics/index.native.js +5 -1
- package/dist/esm/platform/haptics/index.native.js.map +1 -1
- package/dist/esm/platform/haptics/validation.mjs +27 -1
- package/dist/esm/platform/haptics/validation.mjs.map +1 -1
- package/dist/esm/platform/haptics/validation.native.js +27 -1
- package/dist/esm/platform/haptics/validation.native.js.map +1 -1
- package/dist/esm/platform/image-manipulator/index.mjs +10 -3
- package/dist/esm/platform/image-manipulator/index.mjs.map +1 -1
- package/dist/esm/platform/image-manipulator/index.native.js +1 -0
- package/dist/esm/platform/image-manipulator/index.native.js.map +1 -1
- package/dist/esm/platform/index.mjs +2 -2
- package/dist/esm/platform/index.mjs.map +1 -1
- package/dist/esm/platform/index.native.js +2 -2
- package/dist/esm/platform/index.native.js.map +1 -1
- package/dist/esm/platform/keep-awake/index.mjs +51 -15
- package/dist/esm/platform/keep-awake/index.mjs.map +1 -1
- package/dist/esm/platform/keep-awake/index.native.js +27 -3
- package/dist/esm/platform/keep-awake/index.native.js.map +1 -1
- package/dist/esm/platform/keep-awake/unavailable.mjs +12 -2
- package/dist/esm/platform/keep-awake/unavailable.mjs.map +1 -1
- package/dist/esm/platform/keep-awake/unavailable.native.js +12 -2
- package/dist/esm/platform/keep-awake/unavailable.native.js.map +1 -1
- package/dist/esm/platform/keep-awake/validate.mjs +10 -1
- package/dist/esm/platform/keep-awake/validate.mjs.map +1 -1
- package/dist/esm/platform/keep-awake/validate.native.js +10 -1
- package/dist/esm/platform/keep-awake/validate.native.js.map +1 -1
- package/dist/esm/platform/localization/index.mjs +77 -0
- package/dist/esm/platform/localization/index.mjs.map +1 -0
- package/dist/esm/platform/localization/index.native.js +46 -0
- package/dist/esm/platform/localization/index.native.js.map +1 -0
- package/dist/esm/platform/localization/map.mjs +59 -0
- package/dist/esm/platform/localization/map.mjs.map +1 -0
- package/dist/esm/platform/localization/map.native.js +61 -0
- package/dist/esm/platform/localization/map.native.js.map +1 -0
- package/dist/esm/platform/localization/types.mjs +0 -0
- package/dist/esm/platform/localization/types.native.js +0 -0
- package/dist/esm/platform/secure-store/index.mjs +13 -7
- package/dist/esm/platform/secure-store/index.mjs.map +1 -1
- package/dist/esm/platform/secure-store/index.native.js +19 -13
- package/dist/esm/platform/secure-store/index.native.js.map +1 -1
- package/dist/esm/platform/secure-store/types.mjs +0 -0
- package/dist/esm/platform/secure-store/types.native.js +0 -0
- package/dist/esm/platform/secure-store/validate.mjs +33 -1
- package/dist/esm/platform/secure-store/validate.mjs.map +1 -1
- package/dist/esm/platform/secure-store/validate.native.js +33 -1
- package/dist/esm/platform/secure-store/validate.native.js.map +1 -1
- package/ios/Nitro/HybridOneDevice.swift +117 -0
- package/ios/Nitro/HybridOneHaptics.swift +4 -0
- package/ios/Nitro/HybridOneImageManipulator.swift +25 -8
- package/ios/Nitro/HybridOneKeepAwake.swift +34 -2
- package/ios/Nitro/HybridOneSecureStore.swift +112 -46
- package/ios/Tests/ImageManipulator/Package.swift +12 -0
- package/ios/Tests/ImageManipulator/README.md +21 -0
- package/ios/Tests/ImageManipulator/Sources/NitroModules/Promise.swift +33 -0
- package/ios/Tests/ImageManipulator/Sources/OneImageManipulatorCore/Types.swift +41 -0
- package/ios/Tests/ImageManipulator/Sources/SDWebImageWebPCoder/SDImageWebPCoder.swift +23 -0
- package/nitrogen/generated/android/c++/JAndroidHaptic.hpp +109 -0
- package/nitrogen/generated/android/c++/JCalendarInfo.hpp +70 -0
- package/nitrogen/generated/android/c++/JHapticImpact.hpp +3 -3
- package/nitrogen/generated/android/c++/JHybridOneDeviceSpec.cpp +52 -0
- package/nitrogen/generated/android/c++/JHybridOneDeviceSpec.hpp +3 -0
- package/nitrogen/generated/android/c++/JHybridOneHapticsSpec.cpp +8 -0
- package/nitrogen/generated/android/c++/JHybridOneHapticsSpec.hpp +1 -0
- package/nitrogen/generated/android/c++/JHybridOneImageManipulatorSpec.cpp +5 -1
- package/nitrogen/generated/android/c++/JHybridOneKeepAwakeSpec.cpp +31 -0
- package/nitrogen/generated/android/c++/JHybridOneKeepAwakeSpec.hpp +2 -0
- package/nitrogen/generated/android/c++/JHybridOneSecureStoreSpec.cpp +26 -19
- package/nitrogen/generated/android/c++/JHybridOneSecureStoreSpec.hpp +6 -6
- package/nitrogen/generated/android/c++/JImageTransformOptions.hpp +7 -1
- package/nitrogen/generated/android/c++/JLocaleInfo.hpp +110 -0
- package/nitrogen/generated/android/c++/JOneImageFlip.hpp +58 -0
- package/nitrogen/generated/android/c++/JOneImageFormat.hpp +3 -0
- package/nitrogen/generated/android/c++/JSecureStoreAccessibility.hpp +73 -0
- package/nitrogen/generated/android/c++/JSecureStoreOptions.hpp +76 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/AndroidHaptic.kt +40 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/CalendarInfo.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/HapticImpact.kt +2 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/HybridOneDeviceSpec.kt +17 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/HybridOneHapticsSpec.kt +4 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/HybridOneKeepAwakeSpec.kt +8 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/HybridOneSecureStoreSpec.kt +6 -6
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/ImageTransformOptions.kt +7 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/LocaleInfo.kt +116 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/OneImageFlip.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/OneImageFormat.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/SecureStoreAccessibility.kt +28 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/SecureStoreOptions.kt +71 -0
- package/nitrogen/generated/ios/One-Swift-Cxx-Bridge.hpp +133 -51
- package/nitrogen/generated/ios/One-Swift-Cxx-Umbrella.hpp +19 -1
- package/nitrogen/generated/ios/c++/HybridOneDeviceSpecSwift.hpp +31 -0
- package/nitrogen/generated/ios/c++/HybridOneHapticsSpecSwift.hpp +9 -0
- package/nitrogen/generated/ios/c++/HybridOneImageManipulatorSpecSwift.hpp +4 -1
- package/nitrogen/generated/ios/c++/HybridOneKeepAwakeSpecSwift.hpp +18 -1
- package/nitrogen/generated/ios/c++/HybridOneSecureStoreSpecSwift.hpp +18 -13
- package/nitrogen/generated/ios/swift/AndroidHaptic.swift +108 -0
- package/nitrogen/generated/ios/swift/CalendarInfo.swift +96 -0
- package/nitrogen/generated/ios/swift/HapticImpact.swift +4 -4
- package/nitrogen/generated/ios/swift/HybridOneDeviceSpec.swift +3 -0
- package/nitrogen/generated/ios/swift/HybridOneDeviceSpec_cxx.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridOneHapticsSpec.swift +1 -0
- package/nitrogen/generated/ios/swift/HybridOneHapticsSpec_cxx.swift +11 -0
- package/nitrogen/generated/ios/swift/HybridOneKeepAwakeSpec.swift +3 -1
- package/nitrogen/generated/ios/swift/HybridOneKeepAwakeSpec_cxx.swift +41 -3
- package/nitrogen/generated/ios/swift/HybridOneSecureStoreSpec.swift +6 -6
- package/nitrogen/generated/ios/swift/HybridOneSecureStoreSpec_cxx.swift +12 -12
- package/nitrogen/generated/ios/swift/ImageTransformOptions.swift +16 -5
- package/nitrogen/generated/ios/swift/LocaleInfo.swift +250 -0
- package/nitrogen/generated/ios/swift/OneImageFlip.swift +40 -0
- package/nitrogen/generated/ios/swift/OneImageFormat.swift +4 -0
- package/nitrogen/generated/ios/swift/SecureStoreAccessibility.swift +60 -0
- package/nitrogen/generated/ios/swift/SecureStoreOptions.swift +107 -0
- package/nitrogen/generated/shared/c++/AndroidHaptic.hpp +144 -0
- package/nitrogen/generated/shared/c++/CalendarInfo.hpp +96 -0
- package/nitrogen/generated/shared/c++/HapticImpact.hpp +5 -5
- package/nitrogen/generated/shared/c++/HybridOneDeviceSpec.cpp +3 -0
- package/nitrogen/generated/shared/c++/HybridOneDeviceSpec.hpp +11 -0
- package/nitrogen/generated/shared/c++/HybridOneHapticsSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridOneHapticsSpec.hpp +4 -0
- package/nitrogen/generated/shared/c++/HybridOneKeepAwakeSpec.cpp +2 -0
- package/nitrogen/generated/shared/c++/HybridOneKeepAwakeSpec.hpp +4 -1
- package/nitrogen/generated/shared/c++/HybridOneSecureStoreSpec.hpp +9 -7
- package/nitrogen/generated/shared/c++/ImageTransformOptions.hpp +8 -1
- package/nitrogen/generated/shared/c++/LocaleInfo.hpp +136 -0
- package/nitrogen/generated/shared/c++/OneImageFlip.hpp +76 -0
- package/nitrogen/generated/shared/c++/OneImageFormat.hpp +4 -0
- package/nitrogen/generated/shared/c++/SecureStoreAccessibility.hpp +96 -0
- package/nitrogen/generated/shared/c++/SecureStoreOptions.hpp +102 -0
- package/package.json +15 -15
- package/src/index.ts +3 -0
- package/src/one.test.ts +2 -0
- package/src/one.ts +3 -0
- package/src/platform/extras.ts +3 -0
- package/src/platform/haptics/index.native.ts +13 -3
- package/src/platform/haptics/index.ts +12 -3
- package/src/platform/haptics/types.ts +25 -0
- package/src/platform/haptics/validation.ts +31 -1
- package/src/platform/image-manipulator/index.native.ts +3 -0
- package/src/platform/image-manipulator/index.ts +10 -3
- package/src/platform/index.native.ts +3 -2
- package/src/platform/index.ts +3 -2
- package/src/platform/keep-awake/index.native.ts +31 -2
- package/src/platform/keep-awake/index.ts +66 -17
- package/src/platform/keep-awake/unavailable.ts +12 -2
- package/src/platform/keep-awake/validate.ts +16 -0
- package/src/platform/localization/index.native.ts +47 -0
- package/src/platform/localization/index.ts +90 -0
- package/src/platform/localization/map.ts +77 -0
- package/src/platform/localization/types.ts +36 -0
- package/src/platform/secure-store/index.native.ts +26 -13
- package/src/platform/secure-store/index.ts +20 -7
- package/src/platform/secure-store/types.ts +33 -0
- package/src/platform/secure-store/validate.ts +48 -0
- package/src/platform/specs/OneDevice.nitro.ts +34 -0
- package/src/platform/specs/OneHaptics.nitro.ts +4 -1
- package/src/platform/specs/OneImageManipulator.nitro.ts +4 -1
- package/src/platform/specs/OneKeepAwake.nitro.ts +2 -0
- package/src/platform/specs/OneSecureStore.nitro.ts +12 -8
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/types/one.d.ts +2 -1
- package/types/one.d.ts.map +1 -1
- package/types/platform/extras.d.ts +3 -0
- package/types/platform/extras.d.ts.map +1 -1
- package/types/platform/haptics/index.d.ts +2 -2
- package/types/platform/haptics/index.d.ts.map +1 -1
- package/types/platform/haptics/index.native.d.ts +2 -2
- package/types/platform/haptics/index.native.d.ts.map +1 -1
- package/types/platform/haptics/types.d.ts +3 -0
- package/types/platform/haptics/types.d.ts.map +1 -1
- package/types/platform/haptics/validation.d.ts +3 -1
- package/types/platform/haptics/validation.d.ts.map +1 -1
- package/types/platform/image-manipulator/index.d.ts +1 -1
- package/types/platform/image-manipulator/index.d.ts.map +1 -1
- package/types/platform/image-manipulator/index.native.d.ts +1 -1
- package/types/platform/image-manipulator/index.native.d.ts.map +1 -1
- package/types/platform/index.d.ts +3 -3
- package/types/platform/index.d.ts.map +1 -1
- package/types/platform/index.native.d.ts +3 -3
- package/types/platform/index.native.d.ts.map +1 -1
- package/types/platform/keep-awake/index.d.ts +3 -0
- package/types/platform/keep-awake/index.d.ts.map +1 -1
- package/types/platform/keep-awake/index.native.d.ts +5 -0
- package/types/platform/keep-awake/index.native.d.ts.map +1 -1
- package/types/platform/keep-awake/unavailable.d.ts +4 -0
- package/types/platform/keep-awake/unavailable.d.ts.map +1 -1
- package/types/platform/keep-awake/validate.d.ts +3 -0
- package/types/platform/keep-awake/validate.d.ts.map +1 -1
- package/types/platform/localization/index.d.ts +7 -0
- package/types/platform/localization/index.d.ts.map +1 -0
- package/types/platform/localization/index.native.d.ts +7 -0
- package/types/platform/localization/index.native.d.ts.map +1 -0
- package/types/platform/localization/map.d.ts +9 -0
- package/types/platform/localization/map.d.ts.map +1 -0
- package/types/platform/localization/types.d.ts +31 -0
- package/types/platform/localization/types.d.ts.map +1 -0
- package/types/platform/secure-store/index.d.ts +8 -7
- package/types/platform/secure-store/index.d.ts.map +1 -1
- package/types/platform/secure-store/index.native.d.ts +8 -7
- package/types/platform/secure-store/index.native.d.ts.map +1 -1
- package/types/platform/secure-store/types.d.ts +24 -0
- package/types/platform/secure-store/types.d.ts.map +1 -0
- package/types/platform/secure-store/validate.d.ts +3 -0
- package/types/platform/secure-store/validate.d.ts.map +1 -1
- package/types/platform/specs/OneDevice.nitro.d.ts +25 -0
- package/types/platform/specs/OneDevice.nitro.d.ts.map +1 -1
- package/types/platform/specs/OneHaptics.nitro.d.ts +2 -1
- package/types/platform/specs/OneHaptics.nitro.d.ts.map +1 -1
- package/types/platform/specs/OneImageManipulator.nitro.d.ts +3 -1
- package/types/platform/specs/OneImageManipulator.nitro.d.ts.map +1 -1
- package/types/platform/specs/OneKeepAwake.nitro.d.ts +2 -0
- package/types/platform/specs/OneKeepAwake.nitro.d.ts.map +1 -1
- package/types/platform/specs/OneSecureStore.nitro.d.ts +8 -6
- package/types/platform/specs/OneSecureStore.nitro.d.ts.map +1 -1
|
@@ -15,6 +15,8 @@ namespace margelo::nitro::one { struct ImageTransformOptions; }
|
|
|
15
15
|
namespace margelo::nitro::one { struct ImageCrop; }
|
|
16
16
|
// Forward declaration of `ImageResize` to properly resolve imports.
|
|
17
17
|
namespace margelo::nitro::one { struct ImageResize; }
|
|
18
|
+
// Forward declaration of `OneImageFlip` to properly resolve imports.
|
|
19
|
+
namespace margelo::nitro::one { enum class OneImageFlip; }
|
|
18
20
|
// Forward declaration of `OneImageFormat` to properly resolve imports.
|
|
19
21
|
namespace margelo::nitro::one { enum class OneImageFormat; }
|
|
20
22
|
|
|
@@ -30,6 +32,8 @@ namespace margelo::nitro::one { enum class OneImageFormat; }
|
|
|
30
32
|
#include "JImageCrop.hpp"
|
|
31
33
|
#include "ImageResize.hpp"
|
|
32
34
|
#include "JImageResize.hpp"
|
|
35
|
+
#include "OneImageFlip.hpp"
|
|
36
|
+
#include "JOneImageFlip.hpp"
|
|
33
37
|
#include "OneImageFormat.hpp"
|
|
34
38
|
#include "JOneImageFormat.hpp"
|
|
35
39
|
|
|
@@ -63,7 +67,7 @@ namespace margelo::nitro::one {
|
|
|
63
67
|
}
|
|
64
68
|
|
|
65
69
|
// Properties
|
|
66
|
-
|
|
70
|
+
|
|
67
71
|
|
|
68
72
|
// Methods
|
|
69
73
|
std::shared_ptr<Promise<ImageTransformResult>> JHybridOneImageManipulatorSpec::transform(const std::string& uri, const ImageTransformOptions& options) {
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
#include <NitroModules/Promise.hpp>
|
|
13
13
|
#include <NitroModules/JPromise.hpp>
|
|
14
14
|
#include <NitroModules/JUnit.hpp>
|
|
15
|
+
#include <string>
|
|
15
16
|
|
|
16
17
|
namespace margelo::nitro::one {
|
|
17
18
|
|
|
@@ -77,5 +78,35 @@ namespace margelo::nitro::one {
|
|
|
77
78
|
return __promise;
|
|
78
79
|
}();
|
|
79
80
|
}
|
|
81
|
+
std::shared_ptr<Promise<void>> JHybridOneKeepAwakeSpec::activate(const std::string& tag) {
|
|
82
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<jni::JString> /* tag */)>("activate");
|
|
83
|
+
auto __result = method(_javaPart, jni::make_jstring(tag));
|
|
84
|
+
return [&]() {
|
|
85
|
+
auto __promise = Promise<void>::create();
|
|
86
|
+
__result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& /* unit */) {
|
|
87
|
+
__promise->resolve();
|
|
88
|
+
});
|
|
89
|
+
__result->cthis()->addOnRejectedListener([=](const jni::alias_ref<jni::JThrowable>& __throwable) {
|
|
90
|
+
jni::JniException __jniError(__throwable);
|
|
91
|
+
__promise->reject(std::make_exception_ptr(__jniError));
|
|
92
|
+
});
|
|
93
|
+
return __promise;
|
|
94
|
+
}();
|
|
95
|
+
}
|
|
96
|
+
std::shared_ptr<Promise<void>> JHybridOneKeepAwakeSpec::deactivate(const std::string& tag) {
|
|
97
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<jni::JString> /* tag */)>("deactivate");
|
|
98
|
+
auto __result = method(_javaPart, jni::make_jstring(tag));
|
|
99
|
+
return [&]() {
|
|
100
|
+
auto __promise = Promise<void>::create();
|
|
101
|
+
__result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& /* unit */) {
|
|
102
|
+
__promise->resolve();
|
|
103
|
+
});
|
|
104
|
+
__result->cthis()->addOnRejectedListener([=](const jni::alias_ref<jni::JThrowable>& __throwable) {
|
|
105
|
+
jni::JniException __jniError(__throwable);
|
|
106
|
+
__promise->reject(std::make_exception_ptr(__jniError));
|
|
107
|
+
});
|
|
108
|
+
return __promise;
|
|
109
|
+
}();
|
|
110
|
+
}
|
|
80
111
|
|
|
81
112
|
} // namespace margelo::nitro::one
|
|
@@ -56,6 +56,8 @@ namespace margelo::nitro::one {
|
|
|
56
56
|
// Methods
|
|
57
57
|
std::shared_ptr<Promise<bool>> isEnabled() override;
|
|
58
58
|
std::shared_ptr<Promise<void>> setEnabled(bool enabled) override;
|
|
59
|
+
std::shared_ptr<Promise<void>> activate(const std::string& tag) override;
|
|
60
|
+
std::shared_ptr<Promise<void>> deactivate(const std::string& tag) override;
|
|
59
61
|
|
|
60
62
|
private:
|
|
61
63
|
jni::global_ref<JHybridOneKeepAwakeSpec::JavaPart> _javaPart;
|
|
@@ -7,13 +7,20 @@
|
|
|
7
7
|
|
|
8
8
|
#include "JHybridOneSecureStoreSpec.hpp"
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// Forward declaration of `SecureStoreOptions` to properly resolve imports.
|
|
11
|
+
namespace margelo::nitro::one { struct SecureStoreOptions; }
|
|
12
|
+
// Forward declaration of `SecureStoreAccessibility` to properly resolve imports.
|
|
13
|
+
namespace margelo::nitro::one { enum class SecureStoreAccessibility; }
|
|
11
14
|
|
|
12
15
|
#include <string>
|
|
13
16
|
#include <optional>
|
|
14
17
|
#include <NitroModules/Promise.hpp>
|
|
15
18
|
#include <NitroModules/JPromise.hpp>
|
|
16
19
|
#include <NitroModules/JUnit.hpp>
|
|
20
|
+
#include "SecureStoreOptions.hpp"
|
|
21
|
+
#include "JSecureStoreOptions.hpp"
|
|
22
|
+
#include "SecureStoreAccessibility.hpp"
|
|
23
|
+
#include "JSecureStoreAccessibility.hpp"
|
|
17
24
|
|
|
18
25
|
namespace margelo::nitro::one {
|
|
19
26
|
|
|
@@ -48,9 +55,9 @@ namespace margelo::nitro::one {
|
|
|
48
55
|
|
|
49
56
|
|
|
50
57
|
// Methods
|
|
51
|
-
std::shared_ptr<Promise<std::optional<std::string>>> JHybridOneSecureStoreSpec::getItem(const std::string& key) {
|
|
52
|
-
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<jni::JString> /* key */)>("getItem");
|
|
53
|
-
auto __result = method(_javaPart, jni::make_jstring(key));
|
|
58
|
+
std::shared_ptr<Promise<std::optional<std::string>>> JHybridOneSecureStoreSpec::getItem(const std::string& key, const SecureStoreOptions& options) {
|
|
59
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<jni::JString> /* key */, jni::alias_ref<JSecureStoreOptions> /* options */)>("getItem");
|
|
60
|
+
auto __result = method(_javaPart, jni::make_jstring(key), JSecureStoreOptions::fromCpp(options));
|
|
54
61
|
return [&]() {
|
|
55
62
|
auto __promise = Promise<std::optional<std::string>>::create();
|
|
56
63
|
__result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& __boxedResult) {
|
|
@@ -64,9 +71,9 @@ namespace margelo::nitro::one {
|
|
|
64
71
|
return __promise;
|
|
65
72
|
}();
|
|
66
73
|
}
|
|
67
|
-
std::shared_ptr<Promise<void>> JHybridOneSecureStoreSpec::setItem(const std::string& key, const std::string& value) {
|
|
68
|
-
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<jni::JString> /* key */, jni::alias_ref<jni::JString> /* value */)>("setItem");
|
|
69
|
-
auto __result = method(_javaPart, jni::make_jstring(key), jni::make_jstring(value));
|
|
74
|
+
std::shared_ptr<Promise<void>> JHybridOneSecureStoreSpec::setItem(const std::string& key, const std::string& value, const SecureStoreOptions& options) {
|
|
75
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<jni::JString> /* key */, jni::alias_ref<jni::JString> /* value */, jni::alias_ref<JSecureStoreOptions> /* options */)>("setItem");
|
|
76
|
+
auto __result = method(_javaPart, jni::make_jstring(key), jni::make_jstring(value), JSecureStoreOptions::fromCpp(options));
|
|
70
77
|
return [&]() {
|
|
71
78
|
auto __promise = Promise<void>::create();
|
|
72
79
|
__result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& /* unit */) {
|
|
@@ -79,9 +86,9 @@ namespace margelo::nitro::one {
|
|
|
79
86
|
return __promise;
|
|
80
87
|
}();
|
|
81
88
|
}
|
|
82
|
-
std::shared_ptr<Promise<void>> JHybridOneSecureStoreSpec::deleteItem(const std::string& key) {
|
|
83
|
-
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<jni::JString> /* key */)>("deleteItem");
|
|
84
|
-
auto __result = method(_javaPart, jni::make_jstring(key));
|
|
89
|
+
std::shared_ptr<Promise<void>> JHybridOneSecureStoreSpec::deleteItem(const std::string& key, const SecureStoreOptions& options) {
|
|
90
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<jni::JString> /* key */, jni::alias_ref<JSecureStoreOptions> /* options */)>("deleteItem");
|
|
91
|
+
auto __result = method(_javaPart, jni::make_jstring(key), JSecureStoreOptions::fromCpp(options));
|
|
85
92
|
return [&]() {
|
|
86
93
|
auto __promise = Promise<void>::create();
|
|
87
94
|
__result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& /* unit */) {
|
|
@@ -94,18 +101,18 @@ namespace margelo::nitro::one {
|
|
|
94
101
|
return __promise;
|
|
95
102
|
}();
|
|
96
103
|
}
|
|
97
|
-
std::optional<std::string> JHybridOneSecureStoreSpec::getItemSync(const std::string& key) {
|
|
98
|
-
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JString>(jni::alias_ref<jni::JString> /* key */)>("getItemSync");
|
|
99
|
-
auto __result = method(_javaPart, jni::make_jstring(key));
|
|
104
|
+
std::optional<std::string> JHybridOneSecureStoreSpec::getItemSync(const std::string& key, const SecureStoreOptions& options) {
|
|
105
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JString>(jni::alias_ref<jni::JString> /* key */, jni::alias_ref<JSecureStoreOptions> /* options */)>("getItemSync");
|
|
106
|
+
auto __result = method(_javaPart, jni::make_jstring(key), JSecureStoreOptions::fromCpp(options));
|
|
100
107
|
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
|
|
101
108
|
}
|
|
102
|
-
void JHybridOneSecureStoreSpec::setItemSync(const std::string& key, const std::string& value) {
|
|
103
|
-
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* key */, jni::alias_ref<jni::JString> /* value */)>("setItemSync");
|
|
104
|
-
method(_javaPart, jni::make_jstring(key), jni::make_jstring(value));
|
|
109
|
+
void JHybridOneSecureStoreSpec::setItemSync(const std::string& key, const std::string& value, const SecureStoreOptions& options) {
|
|
110
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* key */, jni::alias_ref<jni::JString> /* value */, jni::alias_ref<JSecureStoreOptions> /* options */)>("setItemSync");
|
|
111
|
+
method(_javaPart, jni::make_jstring(key), jni::make_jstring(value), JSecureStoreOptions::fromCpp(options));
|
|
105
112
|
}
|
|
106
|
-
void JHybridOneSecureStoreSpec::deleteItemSync(const std::string& key) {
|
|
107
|
-
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* key */)>("deleteItemSync");
|
|
108
|
-
method(_javaPart, jni::make_jstring(key));
|
|
113
|
+
void JHybridOneSecureStoreSpec::deleteItemSync(const std::string& key, const SecureStoreOptions& options) {
|
|
114
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* key */, jni::alias_ref<JSecureStoreOptions> /* options */)>("deleteItemSync");
|
|
115
|
+
method(_javaPart, jni::make_jstring(key), JSecureStoreOptions::fromCpp(options));
|
|
109
116
|
}
|
|
110
117
|
|
|
111
118
|
} // namespace margelo::nitro::one
|
|
@@ -54,12 +54,12 @@ namespace margelo::nitro::one {
|
|
|
54
54
|
|
|
55
55
|
public:
|
|
56
56
|
// Methods
|
|
57
|
-
std::shared_ptr<Promise<std::optional<std::string>>> getItem(const std::string& key) override;
|
|
58
|
-
std::shared_ptr<Promise<void>> setItem(const std::string& key, const std::string& value) override;
|
|
59
|
-
std::shared_ptr<Promise<void>> deleteItem(const std::string& key) override;
|
|
60
|
-
std::optional<std::string> getItemSync(const std::string& key) override;
|
|
61
|
-
void setItemSync(const std::string& key, const std::string& value) override;
|
|
62
|
-
void deleteItemSync(const std::string& key) override;
|
|
57
|
+
std::shared_ptr<Promise<std::optional<std::string>>> getItem(const std::string& key, const SecureStoreOptions& options) override;
|
|
58
|
+
std::shared_ptr<Promise<void>> setItem(const std::string& key, const std::string& value, const SecureStoreOptions& options) override;
|
|
59
|
+
std::shared_ptr<Promise<void>> deleteItem(const std::string& key, const SecureStoreOptions& options) override;
|
|
60
|
+
std::optional<std::string> getItemSync(const std::string& key, const SecureStoreOptions& options) override;
|
|
61
|
+
void setItemSync(const std::string& key, const std::string& value, const SecureStoreOptions& options) override;
|
|
62
|
+
void deleteItemSync(const std::string& key, const SecureStoreOptions& options) override;
|
|
63
63
|
|
|
64
64
|
private:
|
|
65
65
|
jni::global_ref<JHybridOneSecureStoreSpec::JavaPart> _javaPart;
|
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
#include "ImageResize.hpp"
|
|
15
15
|
#include "JImageCrop.hpp"
|
|
16
16
|
#include "JImageResize.hpp"
|
|
17
|
+
#include "JOneImageFlip.hpp"
|
|
17
18
|
#include "JOneImageFormat.hpp"
|
|
19
|
+
#include "OneImageFlip.hpp"
|
|
18
20
|
#include "OneImageFormat.hpp"
|
|
19
21
|
#include <optional>
|
|
20
22
|
|
|
@@ -43,6 +45,8 @@ namespace margelo::nitro::one {
|
|
|
43
45
|
jni::local_ref<JImageResize> resize = this->getFieldValue(fieldResize);
|
|
44
46
|
static const auto fieldRotate = clazz->getField<jni::JDouble>("rotate");
|
|
45
47
|
jni::local_ref<jni::JDouble> rotate = this->getFieldValue(fieldRotate);
|
|
48
|
+
static const auto fieldFlip = clazz->getField<JOneImageFlip>("flip");
|
|
49
|
+
jni::local_ref<JOneImageFlip> flip = this->getFieldValue(fieldFlip);
|
|
46
50
|
static const auto fieldFormat = clazz->getField<JOneImageFormat>("format");
|
|
47
51
|
jni::local_ref<JOneImageFormat> format = this->getFieldValue(fieldFormat);
|
|
48
52
|
static const auto fieldQuality = clazz->getField<jni::JDouble>("quality");
|
|
@@ -51,6 +55,7 @@ namespace margelo::nitro::one {
|
|
|
51
55
|
crop != nullptr ? std::make_optional(crop->toCpp()) : std::nullopt,
|
|
52
56
|
resize != nullptr ? std::make_optional(resize->toCpp()) : std::nullopt,
|
|
53
57
|
rotate != nullptr ? std::make_optional(rotate->value()) : std::nullopt,
|
|
58
|
+
flip != nullptr ? std::make_optional(flip->toCpp()) : std::nullopt,
|
|
54
59
|
format->toCpp(),
|
|
55
60
|
quality != nullptr ? std::make_optional(quality->value()) : std::nullopt
|
|
56
61
|
);
|
|
@@ -62,7 +67,7 @@ namespace margelo::nitro::one {
|
|
|
62
67
|
*/
|
|
63
68
|
[[maybe_unused]]
|
|
64
69
|
static jni::local_ref<JImageTransformOptions::javaobject> fromCpp(const ImageTransformOptions& value) {
|
|
65
|
-
using JSignature = JImageTransformOptions(jni::alias_ref<JImageCrop>, jni::alias_ref<JImageResize>, jni::alias_ref<jni::JDouble>, jni::alias_ref<JOneImageFormat>, jni::alias_ref<jni::JDouble>);
|
|
70
|
+
using JSignature = JImageTransformOptions(jni::alias_ref<JImageCrop>, jni::alias_ref<JImageResize>, jni::alias_ref<jni::JDouble>, jni::alias_ref<JOneImageFlip>, jni::alias_ref<JOneImageFormat>, jni::alias_ref<jni::JDouble>);
|
|
66
71
|
static const auto clazz = javaClassStatic();
|
|
67
72
|
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
68
73
|
return create(
|
|
@@ -70,6 +75,7 @@ namespace margelo::nitro::one {
|
|
|
70
75
|
value.crop.has_value() ? JImageCrop::fromCpp(value.crop.value()) : nullptr,
|
|
71
76
|
value.resize.has_value() ? JImageResize::fromCpp(value.resize.value()) : nullptr,
|
|
72
77
|
value.rotate.has_value() ? jni::JDouble::valueOf(value.rotate.value()) : nullptr,
|
|
78
|
+
value.flip.has_value() ? JOneImageFlip::fromCpp(value.flip.value()) : nullptr,
|
|
73
79
|
JOneImageFormat::fromCpp(value.format),
|
|
74
80
|
value.quality.has_value() ? jni::JDouble::valueOf(value.quality.value()) : nullptr
|
|
75
81
|
);
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JLocaleInfo.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
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "LocaleInfo.hpp"
|
|
12
|
+
|
|
13
|
+
#include <optional>
|
|
14
|
+
#include <string>
|
|
15
|
+
|
|
16
|
+
namespace margelo::nitro::one {
|
|
17
|
+
|
|
18
|
+
using namespace facebook;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The C++ JNI bridge between the C++ struct "LocaleInfo" and the Kotlin data class "LocaleInfo".
|
|
22
|
+
*/
|
|
23
|
+
struct JLocaleInfo final: public jni::JavaClass<JLocaleInfo> {
|
|
24
|
+
public:
|
|
25
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/one/LocaleInfo;";
|
|
26
|
+
|
|
27
|
+
public:
|
|
28
|
+
/**
|
|
29
|
+
* Convert this Java/Kotlin-based struct to the C++ struct LocaleInfo by copying all values to C++.
|
|
30
|
+
*/
|
|
31
|
+
[[maybe_unused]]
|
|
32
|
+
[[nodiscard]]
|
|
33
|
+
LocaleInfo toCpp() const {
|
|
34
|
+
static const auto clazz = javaClassStatic();
|
|
35
|
+
static const auto fieldLanguageTag = clazz->getField<jni::JString>("languageTag");
|
|
36
|
+
jni::local_ref<jni::JString> languageTag = this->getFieldValue(fieldLanguageTag);
|
|
37
|
+
static const auto fieldLanguageCode = clazz->getField<jni::JString>("languageCode");
|
|
38
|
+
jni::local_ref<jni::JString> languageCode = this->getFieldValue(fieldLanguageCode);
|
|
39
|
+
static const auto fieldLanguageScriptCode = clazz->getField<jni::JString>("languageScriptCode");
|
|
40
|
+
jni::local_ref<jni::JString> languageScriptCode = this->getFieldValue(fieldLanguageScriptCode);
|
|
41
|
+
static const auto fieldRegionCode = clazz->getField<jni::JString>("regionCode");
|
|
42
|
+
jni::local_ref<jni::JString> regionCode = this->getFieldValue(fieldRegionCode);
|
|
43
|
+
static const auto fieldLanguageRegionCode = clazz->getField<jni::JString>("languageRegionCode");
|
|
44
|
+
jni::local_ref<jni::JString> languageRegionCode = this->getFieldValue(fieldLanguageRegionCode);
|
|
45
|
+
static const auto fieldCurrencyCode = clazz->getField<jni::JString>("currencyCode");
|
|
46
|
+
jni::local_ref<jni::JString> currencyCode = this->getFieldValue(fieldCurrencyCode);
|
|
47
|
+
static const auto fieldCurrencySymbol = clazz->getField<jni::JString>("currencySymbol");
|
|
48
|
+
jni::local_ref<jni::JString> currencySymbol = this->getFieldValue(fieldCurrencySymbol);
|
|
49
|
+
static const auto fieldLanguageCurrencyCode = clazz->getField<jni::JString>("languageCurrencyCode");
|
|
50
|
+
jni::local_ref<jni::JString> languageCurrencyCode = this->getFieldValue(fieldLanguageCurrencyCode);
|
|
51
|
+
static const auto fieldLanguageCurrencySymbol = clazz->getField<jni::JString>("languageCurrencySymbol");
|
|
52
|
+
jni::local_ref<jni::JString> languageCurrencySymbol = this->getFieldValue(fieldLanguageCurrencySymbol);
|
|
53
|
+
static const auto fieldDecimalSeparator = clazz->getField<jni::JString>("decimalSeparator");
|
|
54
|
+
jni::local_ref<jni::JString> decimalSeparator = this->getFieldValue(fieldDecimalSeparator);
|
|
55
|
+
static const auto fieldDigitGroupingSeparator = clazz->getField<jni::JString>("digitGroupingSeparator");
|
|
56
|
+
jni::local_ref<jni::JString> digitGroupingSeparator = this->getFieldValue(fieldDigitGroupingSeparator);
|
|
57
|
+
static const auto fieldTextDirection = clazz->getField<jni::JString>("textDirection");
|
|
58
|
+
jni::local_ref<jni::JString> textDirection = this->getFieldValue(fieldTextDirection);
|
|
59
|
+
static const auto fieldMeasurementSystem = clazz->getField<jni::JString>("measurementSystem");
|
|
60
|
+
jni::local_ref<jni::JString> measurementSystem = this->getFieldValue(fieldMeasurementSystem);
|
|
61
|
+
static const auto fieldTemperatureUnit = clazz->getField<jni::JString>("temperatureUnit");
|
|
62
|
+
jni::local_ref<jni::JString> temperatureUnit = this->getFieldValue(fieldTemperatureUnit);
|
|
63
|
+
return LocaleInfo(
|
|
64
|
+
languageTag->toStdString(),
|
|
65
|
+
languageCode != nullptr ? std::make_optional(languageCode->toStdString()) : std::nullopt,
|
|
66
|
+
languageScriptCode != nullptr ? std::make_optional(languageScriptCode->toStdString()) : std::nullopt,
|
|
67
|
+
regionCode != nullptr ? std::make_optional(regionCode->toStdString()) : std::nullopt,
|
|
68
|
+
languageRegionCode != nullptr ? std::make_optional(languageRegionCode->toStdString()) : std::nullopt,
|
|
69
|
+
currencyCode != nullptr ? std::make_optional(currencyCode->toStdString()) : std::nullopt,
|
|
70
|
+
currencySymbol != nullptr ? std::make_optional(currencySymbol->toStdString()) : std::nullopt,
|
|
71
|
+
languageCurrencyCode != nullptr ? std::make_optional(languageCurrencyCode->toStdString()) : std::nullopt,
|
|
72
|
+
languageCurrencySymbol != nullptr ? std::make_optional(languageCurrencySymbol->toStdString()) : std::nullopt,
|
|
73
|
+
decimalSeparator != nullptr ? std::make_optional(decimalSeparator->toStdString()) : std::nullopt,
|
|
74
|
+
digitGroupingSeparator != nullptr ? std::make_optional(digitGroupingSeparator->toStdString()) : std::nullopt,
|
|
75
|
+
textDirection->toStdString(),
|
|
76
|
+
measurementSystem != nullptr ? std::make_optional(measurementSystem->toStdString()) : std::nullopt,
|
|
77
|
+
temperatureUnit != nullptr ? std::make_optional(temperatureUnit->toStdString()) : std::nullopt
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
public:
|
|
82
|
+
/**
|
|
83
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
84
|
+
*/
|
|
85
|
+
[[maybe_unused]]
|
|
86
|
+
static jni::local_ref<JLocaleInfo::javaobject> fromCpp(const LocaleInfo& value) {
|
|
87
|
+
using JSignature = JLocaleInfo(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>);
|
|
88
|
+
static const auto clazz = javaClassStatic();
|
|
89
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
90
|
+
return create(
|
|
91
|
+
clazz,
|
|
92
|
+
jni::make_jstring(value.languageTag),
|
|
93
|
+
value.languageCode.has_value() ? jni::make_jstring(value.languageCode.value()) : nullptr,
|
|
94
|
+
value.languageScriptCode.has_value() ? jni::make_jstring(value.languageScriptCode.value()) : nullptr,
|
|
95
|
+
value.regionCode.has_value() ? jni::make_jstring(value.regionCode.value()) : nullptr,
|
|
96
|
+
value.languageRegionCode.has_value() ? jni::make_jstring(value.languageRegionCode.value()) : nullptr,
|
|
97
|
+
value.currencyCode.has_value() ? jni::make_jstring(value.currencyCode.value()) : nullptr,
|
|
98
|
+
value.currencySymbol.has_value() ? jni::make_jstring(value.currencySymbol.value()) : nullptr,
|
|
99
|
+
value.languageCurrencyCode.has_value() ? jni::make_jstring(value.languageCurrencyCode.value()) : nullptr,
|
|
100
|
+
value.languageCurrencySymbol.has_value() ? jni::make_jstring(value.languageCurrencySymbol.value()) : nullptr,
|
|
101
|
+
value.decimalSeparator.has_value() ? jni::make_jstring(value.decimalSeparator.value()) : nullptr,
|
|
102
|
+
value.digitGroupingSeparator.has_value() ? jni::make_jstring(value.digitGroupingSeparator.value()) : nullptr,
|
|
103
|
+
jni::make_jstring(value.textDirection),
|
|
104
|
+
value.measurementSystem.has_value() ? jni::make_jstring(value.measurementSystem.value()) : nullptr,
|
|
105
|
+
value.temperatureUnit.has_value() ? jni::make_jstring(value.temperatureUnit.value()) : nullptr
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
} // namespace margelo::nitro::one
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JOneImageFlip.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
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "OneImageFlip.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::one {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "OneImageFlip" and the Kotlin enum "OneImageFlip".
|
|
19
|
+
*/
|
|
20
|
+
struct JOneImageFlip final: public jni::JavaClass<JOneImageFlip> {
|
|
21
|
+
public:
|
|
22
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/one/OneImageFlip;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum OneImageFlip.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
OneImageFlip toCpp() const {
|
|
31
|
+
static const auto clazz = javaClassStatic();
|
|
32
|
+
static const auto fieldOrdinal = clazz->getField<int>("value");
|
|
33
|
+
int ordinal = this->getFieldValue(fieldOrdinal);
|
|
34
|
+
return static_cast<OneImageFlip>(ordinal);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
/**
|
|
39
|
+
* Create a Java/Kotlin-based enum with the given C++ enum's value.
|
|
40
|
+
*/
|
|
41
|
+
[[maybe_unused]]
|
|
42
|
+
static jni::alias_ref<JOneImageFlip> fromCpp(OneImageFlip value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case OneImageFlip::HORIZONTAL:
|
|
46
|
+
static const auto fieldHORIZONTAL = clazz->getStaticField<JOneImageFlip>("HORIZONTAL");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldHORIZONTAL);
|
|
48
|
+
case OneImageFlip::VERTICAL:
|
|
49
|
+
static const auto fieldVERTICAL = clazz->getStaticField<JOneImageFlip>("VERTICAL");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldVERTICAL);
|
|
51
|
+
default:
|
|
52
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
53
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
} // namespace margelo::nitro::one
|
|
@@ -48,6 +48,9 @@ namespace margelo::nitro::one {
|
|
|
48
48
|
case OneImageFormat::PNG:
|
|
49
49
|
static const auto fieldPNG = clazz->getStaticField<JOneImageFormat>("PNG");
|
|
50
50
|
return clazz->getStaticFieldValue(fieldPNG);
|
|
51
|
+
case OneImageFormat::WEBP:
|
|
52
|
+
static const auto fieldWEBP = clazz->getStaticField<JOneImageFormat>("WEBP");
|
|
53
|
+
return clazz->getStaticFieldValue(fieldWEBP);
|
|
51
54
|
default:
|
|
52
55
|
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
53
56
|
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JSecureStoreAccessibility.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
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "SecureStoreAccessibility.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::one {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "SecureStoreAccessibility" and the Kotlin enum "SecureStoreAccessibility".
|
|
19
|
+
*/
|
|
20
|
+
struct JSecureStoreAccessibility final: public jni::JavaClass<JSecureStoreAccessibility> {
|
|
21
|
+
public:
|
|
22
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/one/SecureStoreAccessibility;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum SecureStoreAccessibility.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
SecureStoreAccessibility toCpp() const {
|
|
31
|
+
static const auto clazz = javaClassStatic();
|
|
32
|
+
static const auto fieldOrdinal = clazz->getField<int>("value");
|
|
33
|
+
int ordinal = this->getFieldValue(fieldOrdinal);
|
|
34
|
+
return static_cast<SecureStoreAccessibility>(ordinal);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
/**
|
|
39
|
+
* Create a Java/Kotlin-based enum with the given C++ enum's value.
|
|
40
|
+
*/
|
|
41
|
+
[[maybe_unused]]
|
|
42
|
+
static jni::alias_ref<JSecureStoreAccessibility> fromCpp(SecureStoreAccessibility value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case SecureStoreAccessibility::ALWAYS:
|
|
46
|
+
static const auto fieldALWAYS = clazz->getStaticField<JSecureStoreAccessibility>("ALWAYS");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldALWAYS);
|
|
48
|
+
case SecureStoreAccessibility::AFTERFIRSTUNLOCK:
|
|
49
|
+
static const auto fieldAFTERFIRSTUNLOCK = clazz->getStaticField<JSecureStoreAccessibility>("AFTERFIRSTUNLOCK");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldAFTERFIRSTUNLOCK);
|
|
51
|
+
case SecureStoreAccessibility::AFTERFIRSTUNLOCKTHISDEVICEONLY:
|
|
52
|
+
static const auto fieldAFTERFIRSTUNLOCKTHISDEVICEONLY = clazz->getStaticField<JSecureStoreAccessibility>("AFTERFIRSTUNLOCKTHISDEVICEONLY");
|
|
53
|
+
return clazz->getStaticFieldValue(fieldAFTERFIRSTUNLOCKTHISDEVICEONLY);
|
|
54
|
+
case SecureStoreAccessibility::ALWAYSTHISDEVICEONLY:
|
|
55
|
+
static const auto fieldALWAYSTHISDEVICEONLY = clazz->getStaticField<JSecureStoreAccessibility>("ALWAYSTHISDEVICEONLY");
|
|
56
|
+
return clazz->getStaticFieldValue(fieldALWAYSTHISDEVICEONLY);
|
|
57
|
+
case SecureStoreAccessibility::WHENPASSCODESETTHISDEVICEONLY:
|
|
58
|
+
static const auto fieldWHENPASSCODESETTHISDEVICEONLY = clazz->getStaticField<JSecureStoreAccessibility>("WHENPASSCODESETTHISDEVICEONLY");
|
|
59
|
+
return clazz->getStaticFieldValue(fieldWHENPASSCODESETTHISDEVICEONLY);
|
|
60
|
+
case SecureStoreAccessibility::WHENUNLOCKED:
|
|
61
|
+
static const auto fieldWHENUNLOCKED = clazz->getStaticField<JSecureStoreAccessibility>("WHENUNLOCKED");
|
|
62
|
+
return clazz->getStaticFieldValue(fieldWHENUNLOCKED);
|
|
63
|
+
case SecureStoreAccessibility::WHENUNLOCKEDTHISDEVICEONLY:
|
|
64
|
+
static const auto fieldWHENUNLOCKEDTHISDEVICEONLY = clazz->getStaticField<JSecureStoreAccessibility>("WHENUNLOCKEDTHISDEVICEONLY");
|
|
65
|
+
return clazz->getStaticFieldValue(fieldWHENUNLOCKEDTHISDEVICEONLY);
|
|
66
|
+
default:
|
|
67
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
68
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
} // namespace margelo::nitro::one
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JSecureStoreOptions.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
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "SecureStoreOptions.hpp"
|
|
12
|
+
|
|
13
|
+
#include "JSecureStoreAccessibility.hpp"
|
|
14
|
+
#include "SecureStoreAccessibility.hpp"
|
|
15
|
+
#include <optional>
|
|
16
|
+
#include <string>
|
|
17
|
+
|
|
18
|
+
namespace margelo::nitro::one {
|
|
19
|
+
|
|
20
|
+
using namespace facebook;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The C++ JNI bridge between the C++ struct "SecureStoreOptions" and the Kotlin data class "SecureStoreOptions".
|
|
24
|
+
*/
|
|
25
|
+
struct JSecureStoreOptions final: public jni::JavaClass<JSecureStoreOptions> {
|
|
26
|
+
public:
|
|
27
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/one/SecureStoreOptions;";
|
|
28
|
+
|
|
29
|
+
public:
|
|
30
|
+
/**
|
|
31
|
+
* Convert this Java/Kotlin-based struct to the C++ struct SecureStoreOptions by copying all values to C++.
|
|
32
|
+
*/
|
|
33
|
+
[[maybe_unused]]
|
|
34
|
+
[[nodiscard]]
|
|
35
|
+
SecureStoreOptions toCpp() const {
|
|
36
|
+
static const auto clazz = javaClassStatic();
|
|
37
|
+
static const auto fieldKeychainService = clazz->getField<jni::JString>("keychainService");
|
|
38
|
+
jni::local_ref<jni::JString> keychainService = this->getFieldValue(fieldKeychainService);
|
|
39
|
+
static const auto fieldKeychainAccessible = clazz->getField<JSecureStoreAccessibility>("keychainAccessible");
|
|
40
|
+
jni::local_ref<JSecureStoreAccessibility> keychainAccessible = this->getFieldValue(fieldKeychainAccessible);
|
|
41
|
+
static const auto fieldRequireAuthentication = clazz->getField<jni::JBoolean>("requireAuthentication");
|
|
42
|
+
jni::local_ref<jni::JBoolean> requireAuthentication = this->getFieldValue(fieldRequireAuthentication);
|
|
43
|
+
static const auto fieldAuthenticationPrompt = clazz->getField<jni::JString>("authenticationPrompt");
|
|
44
|
+
jni::local_ref<jni::JString> authenticationPrompt = this->getFieldValue(fieldAuthenticationPrompt);
|
|
45
|
+
static const auto fieldAccessGroup = clazz->getField<jni::JString>("accessGroup");
|
|
46
|
+
jni::local_ref<jni::JString> accessGroup = this->getFieldValue(fieldAccessGroup);
|
|
47
|
+
return SecureStoreOptions(
|
|
48
|
+
keychainService != nullptr ? std::make_optional(keychainService->toStdString()) : std::nullopt,
|
|
49
|
+
keychainAccessible != nullptr ? std::make_optional(keychainAccessible->toCpp()) : std::nullopt,
|
|
50
|
+
requireAuthentication != nullptr ? std::make_optional(static_cast<bool>(requireAuthentication->value())) : std::nullopt,
|
|
51
|
+
authenticationPrompt != nullptr ? std::make_optional(authenticationPrompt->toStdString()) : std::nullopt,
|
|
52
|
+
accessGroup != nullptr ? std::make_optional(accessGroup->toStdString()) : std::nullopt
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
public:
|
|
57
|
+
/**
|
|
58
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
59
|
+
*/
|
|
60
|
+
[[maybe_unused]]
|
|
61
|
+
static jni::local_ref<JSecureStoreOptions::javaobject> fromCpp(const SecureStoreOptions& value) {
|
|
62
|
+
using JSignature = JSecureStoreOptions(jni::alias_ref<jni::JString>, jni::alias_ref<JSecureStoreAccessibility>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>);
|
|
63
|
+
static const auto clazz = javaClassStatic();
|
|
64
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
65
|
+
return create(
|
|
66
|
+
clazz,
|
|
67
|
+
value.keychainService.has_value() ? jni::make_jstring(value.keychainService.value()) : nullptr,
|
|
68
|
+
value.keychainAccessible.has_value() ? JSecureStoreAccessibility::fromCpp(value.keychainAccessible.value()) : nullptr,
|
|
69
|
+
value.requireAuthentication.has_value() ? jni::JBoolean::valueOf(value.requireAuthentication.value()) : nullptr,
|
|
70
|
+
value.authenticationPrompt.has_value() ? jni::make_jstring(value.authenticationPrompt.value()) : nullptr,
|
|
71
|
+
value.accessGroup.has_value() ? jni::make_jstring(value.accessGroup.value()) : nullptr
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
} // namespace margelo::nitro::one
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// AndroidHaptic.kt
|
|
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
|
+
package com.margelo.nitro.one
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the JavaScript enum/union "AndroidHaptic".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class AndroidHaptic(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
CLOCK_TICK(0),
|
|
20
|
+
CONFIRM(1),
|
|
21
|
+
CONTEXT_CLICK(2),
|
|
22
|
+
DRAG_START(3),
|
|
23
|
+
GESTURE_END(4),
|
|
24
|
+
GESTURE_START(5),
|
|
25
|
+
KEYBOARD_PRESS(6),
|
|
26
|
+
KEYBOARD_RELEASE(7),
|
|
27
|
+
KEYBOARD_TAP(8),
|
|
28
|
+
LONG_PRESS(9),
|
|
29
|
+
NO_HAPTICS(10),
|
|
30
|
+
REJECT(11),
|
|
31
|
+
SEGMENT_FREQUENT_TICK(12),
|
|
32
|
+
SEGMENT_TICK(13),
|
|
33
|
+
TEXT_HANDLE_MOVE(14),
|
|
34
|
+
TOGGLE_OFF(15),
|
|
35
|
+
TOGGLE_ON(16),
|
|
36
|
+
VIRTUAL_KEY(17),
|
|
37
|
+
VIRTUAL_KEY_RELEASE(18);
|
|
38
|
+
|
|
39
|
+
companion object
|
|
40
|
+
}
|