@onekeyfe/react-native-device-utils 1.1.20 → 1.1.22

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 (36) hide show
  1. package/android/build.gradle +4 -1
  2. package/android/src/main/java/com/margelo/nitro/reactnativedeviceutils/ReactNativeDeviceUtils.kt +138 -0
  3. package/ios/ReactNativeDeviceUtils.swift +105 -0
  4. package/lib/typescript/src/ReactNativeDeviceUtils.nitro.d.ts +22 -0
  5. package/lib/typescript/src/ReactNativeDeviceUtils.nitro.d.ts.map +1 -1
  6. package/nitrogen/generated/android/c++/JGooglePlayServicesStatus.hpp +61 -0
  7. package/nitrogen/generated/android/c++/JHybridReactNativeDeviceUtilsSpec.cpp +145 -0
  8. package/nitrogen/generated/android/c++/JHybridReactNativeDeviceUtilsSpec.hpp +9 -0
  9. package/nitrogen/generated/android/c++/JLaunchOptions.hpp +62 -0
  10. package/nitrogen/generated/android/c++/JWebViewPackageInfo.hpp +65 -0
  11. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/GooglePlayServicesStatus.kt +41 -0
  12. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/HybridReactNativeDeviceUtilsSpec.kt +36 -0
  13. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/LaunchOptions.kt +41 -0
  14. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/WebViewPackageInfo.kt +44 -0
  15. package/nitrogen/generated/ios/ReactNativeDeviceUtils-Swift-Cxx-Bridge.cpp +48 -0
  16. package/nitrogen/generated/ios/ReactNativeDeviceUtils-Swift-Cxx-Bridge.hpp +305 -0
  17. package/nitrogen/generated/ios/ReactNativeDeviceUtils-Swift-Cxx-Umbrella.hpp +11 -0
  18. package/nitrogen/generated/ios/c++/HybridReactNativeDeviceUtilsSpecSwift.hpp +81 -0
  19. package/nitrogen/generated/ios/swift/Func_void.swift +47 -0
  20. package/nitrogen/generated/ios/swift/Func_void_GooglePlayServicesStatus.swift +47 -0
  21. package/nitrogen/generated/ios/swift/Func_void_LaunchOptions.swift +47 -0
  22. package/nitrogen/generated/ios/swift/Func_void_WebViewPackageInfo.swift +47 -0
  23. package/nitrogen/generated/ios/swift/Func_void_double.swift +47 -0
  24. package/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
  25. package/nitrogen/generated/ios/swift/GooglePlayServicesStatus.swift +47 -0
  26. package/nitrogen/generated/ios/swift/HybridReactNativeDeviceUtilsSpec.swift +9 -0
  27. package/nitrogen/generated/ios/swift/HybridReactNativeDeviceUtilsSpec_cxx.swift +163 -0
  28. package/nitrogen/generated/ios/swift/LaunchOptions.swift +66 -0
  29. package/nitrogen/generated/ios/swift/WebViewPackageInfo.swift +58 -0
  30. package/nitrogen/generated/shared/c++/GooglePlayServicesStatus.hpp +79 -0
  31. package/nitrogen/generated/shared/c++/HybridReactNativeDeviceUtilsSpec.cpp +9 -0
  32. package/nitrogen/generated/shared/c++/HybridReactNativeDeviceUtilsSpec.hpp +19 -0
  33. package/nitrogen/generated/shared/c++/LaunchOptions.hpp +80 -0
  34. package/nitrogen/generated/shared/c++/WebViewPackageInfo.hpp +83 -0
  35. package/package.json +1 -1
  36. package/src/ReactNativeDeviceUtils.nitro.ts +31 -0
@@ -0,0 +1,65 @@
1
+ ///
2
+ /// JWebViewPackageInfo.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #include <fbjni/fbjni.h>
11
+ #include "WebViewPackageInfo.hpp"
12
+
13
+ #include <string>
14
+
15
+ namespace margelo::nitro::reactnativedeviceutils {
16
+
17
+ using namespace facebook;
18
+
19
+ /**
20
+ * The C++ JNI bridge between the C++ struct "WebViewPackageInfo" and the the Kotlin data class "WebViewPackageInfo".
21
+ */
22
+ struct JWebViewPackageInfo final: public jni::JavaClass<JWebViewPackageInfo> {
23
+ public:
24
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativedeviceutils/WebViewPackageInfo;";
25
+
26
+ public:
27
+ /**
28
+ * Convert this Java/Kotlin-based struct to the C++ struct WebViewPackageInfo by copying all values to C++.
29
+ */
30
+ [[maybe_unused]]
31
+ [[nodiscard]]
32
+ WebViewPackageInfo toCpp() const {
33
+ static const auto clazz = javaClassStatic();
34
+ static const auto fieldPackageName = clazz->getField<jni::JString>("packageName");
35
+ jni::local_ref<jni::JString> packageName = this->getFieldValue(fieldPackageName);
36
+ static const auto fieldVersionName = clazz->getField<jni::JString>("versionName");
37
+ jni::local_ref<jni::JString> versionName = this->getFieldValue(fieldVersionName);
38
+ static const auto fieldVersionCode = clazz->getField<double>("versionCode");
39
+ double versionCode = this->getFieldValue(fieldVersionCode);
40
+ return WebViewPackageInfo(
41
+ packageName->toStdString(),
42
+ versionName->toStdString(),
43
+ versionCode
44
+ );
45
+ }
46
+
47
+ public:
48
+ /**
49
+ * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
50
+ */
51
+ [[maybe_unused]]
52
+ static jni::local_ref<JWebViewPackageInfo::javaobject> fromCpp(const WebViewPackageInfo& value) {
53
+ using JSignature = JWebViewPackageInfo(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, double);
54
+ static const auto clazz = javaClassStatic();
55
+ static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
56
+ return create(
57
+ clazz,
58
+ jni::make_jstring(value.packageName),
59
+ jni::make_jstring(value.versionName),
60
+ value.versionCode
61
+ );
62
+ }
63
+ };
64
+
65
+ } // namespace margelo::nitro::reactnativedeviceutils
@@ -0,0 +1,41 @@
1
+ ///
2
+ /// GooglePlayServicesStatus.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.reactnativedeviceutils
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "GooglePlayServicesStatus".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class GooglePlayServicesStatus(
20
+ @DoNotStrip
21
+ @Keep
22
+ val status: Double,
23
+ @DoNotStrip
24
+ @Keep
25
+ val isAvailable: Boolean
26
+ ) {
27
+ /* primary constructor */
28
+
29
+ private companion object {
30
+ /**
31
+ * Constructor called from C++
32
+ */
33
+ @DoNotStrip
34
+ @Keep
35
+ @Suppress("unused")
36
+ @JvmStatic
37
+ private fun fromCpp(status: Double, isAvailable: Boolean): GooglePlayServicesStatus {
38
+ return GooglePlayServicesStatus(status, isAvailable)
39
+ }
40
+ }
41
+ }
@@ -86,6 +86,42 @@ abstract class HybridReactNativeDeviceUtilsSpec: HybridObject() {
86
86
  @DoNotStrip
87
87
  @Keep
88
88
  abstract fun setUserInterfaceStyle(style: UserInterfaceStyle): Unit
89
+
90
+ @DoNotStrip
91
+ @Keep
92
+ abstract fun getLaunchOptions(): Promise<LaunchOptions>
93
+
94
+ @DoNotStrip
95
+ @Keep
96
+ abstract fun clearLaunchOptions(): Promise<Boolean>
97
+
98
+ @DoNotStrip
99
+ @Keep
100
+ abstract fun getDeviceToken(): Promise<String>
101
+
102
+ @DoNotStrip
103
+ @Keep
104
+ abstract fun saveDeviceToken(token: String): Promise<Unit>
105
+
106
+ @DoNotStrip
107
+ @Keep
108
+ abstract fun registerDeviceToken(): Promise<Boolean>
109
+
110
+ @DoNotStrip
111
+ @Keep
112
+ abstract fun getStartupTime(): Promise<Double>
113
+
114
+ @DoNotStrip
115
+ @Keep
116
+ abstract fun exitApp(): Unit
117
+
118
+ @DoNotStrip
119
+ @Keep
120
+ abstract fun getCurrentWebViewPackageInfo(): Promise<WebViewPackageInfo>
121
+
122
+ @DoNotStrip
123
+ @Keep
124
+ abstract fun isGooglePlayServicesAvailable(): Promise<GooglePlayServicesStatus>
89
125
 
90
126
  private external fun initHybrid(): HybridData
91
127
 
@@ -0,0 +1,41 @@
1
+ ///
2
+ /// LaunchOptions.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.reactnativedeviceutils
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "LaunchOptions".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class LaunchOptions(
20
+ @DoNotStrip
21
+ @Keep
22
+ val launchType: String,
23
+ @DoNotStrip
24
+ @Keep
25
+ val deepLink: String?
26
+ ) {
27
+ /* primary constructor */
28
+
29
+ private companion object {
30
+ /**
31
+ * Constructor called from C++
32
+ */
33
+ @DoNotStrip
34
+ @Keep
35
+ @Suppress("unused")
36
+ @JvmStatic
37
+ private fun fromCpp(launchType: String, deepLink: String?): LaunchOptions {
38
+ return LaunchOptions(launchType, deepLink)
39
+ }
40
+ }
41
+ }
@@ -0,0 +1,44 @@
1
+ ///
2
+ /// WebViewPackageInfo.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.reactnativedeviceutils
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "WebViewPackageInfo".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class WebViewPackageInfo(
20
+ @DoNotStrip
21
+ @Keep
22
+ val packageName: String,
23
+ @DoNotStrip
24
+ @Keep
25
+ val versionName: String,
26
+ @DoNotStrip
27
+ @Keep
28
+ val versionCode: Double
29
+ ) {
30
+ /* primary constructor */
31
+
32
+ private companion object {
33
+ /**
34
+ * Constructor called from C++
35
+ */
36
+ @DoNotStrip
37
+ @Keep
38
+ @Suppress("unused")
39
+ @JvmStatic
40
+ private fun fromCpp(packageName: String, versionName: String, versionCode: Double): WebViewPackageInfo {
41
+ return WebViewPackageInfo(packageName, versionName, versionCode)
42
+ }
43
+ }
44
+ }
@@ -46,6 +46,54 @@ namespace margelo::nitro::reactnativedeviceutils::bridge::swift {
46
46
  };
47
47
  }
48
48
 
49
+ // pragma MARK: std::function<void(const LaunchOptions& /* result */)>
50
+ Func_void_LaunchOptions create_Func_void_LaunchOptions(void* NON_NULL swiftClosureWrapper) noexcept {
51
+ auto swiftClosure = ReactNativeDeviceUtils::Func_void_LaunchOptions::fromUnsafe(swiftClosureWrapper);
52
+ return [swiftClosure = std::move(swiftClosure)](const LaunchOptions& result) mutable -> void {
53
+ swiftClosure.call(result);
54
+ };
55
+ }
56
+
57
+ // pragma MARK: std::function<void(const std::string& /* result */)>
58
+ Func_void_std__string create_Func_void_std__string(void* NON_NULL swiftClosureWrapper) noexcept {
59
+ auto swiftClosure = ReactNativeDeviceUtils::Func_void_std__string::fromUnsafe(swiftClosureWrapper);
60
+ return [swiftClosure = std::move(swiftClosure)](const std::string& result) mutable -> void {
61
+ swiftClosure.call(result);
62
+ };
63
+ }
64
+
65
+ // pragma MARK: std::function<void()>
66
+ Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept {
67
+ auto swiftClosure = ReactNativeDeviceUtils::Func_void::fromUnsafe(swiftClosureWrapper);
68
+ return [swiftClosure = std::move(swiftClosure)]() mutable -> void {
69
+ swiftClosure.call();
70
+ };
71
+ }
72
+
73
+ // pragma MARK: std::function<void(double /* result */)>
74
+ Func_void_double create_Func_void_double(void* NON_NULL swiftClosureWrapper) noexcept {
75
+ auto swiftClosure = ReactNativeDeviceUtils::Func_void_double::fromUnsafe(swiftClosureWrapper);
76
+ return [swiftClosure = std::move(swiftClosure)](double result) mutable -> void {
77
+ swiftClosure.call(result);
78
+ };
79
+ }
80
+
81
+ // pragma MARK: std::function<void(const WebViewPackageInfo& /* result */)>
82
+ Func_void_WebViewPackageInfo create_Func_void_WebViewPackageInfo(void* NON_NULL swiftClosureWrapper) noexcept {
83
+ auto swiftClosure = ReactNativeDeviceUtils::Func_void_WebViewPackageInfo::fromUnsafe(swiftClosureWrapper);
84
+ return [swiftClosure = std::move(swiftClosure)](const WebViewPackageInfo& result) mutable -> void {
85
+ swiftClosure.call(result);
86
+ };
87
+ }
88
+
89
+ // pragma MARK: std::function<void(const GooglePlayServicesStatus& /* result */)>
90
+ Func_void_GooglePlayServicesStatus create_Func_void_GooglePlayServicesStatus(void* NON_NULL swiftClosureWrapper) noexcept {
91
+ auto swiftClosure = ReactNativeDeviceUtils::Func_void_GooglePlayServicesStatus::fromUnsafe(swiftClosureWrapper);
92
+ return [swiftClosure = std::move(swiftClosure)](const GooglePlayServicesStatus& result) mutable -> void {
93
+ swiftClosure.call(result);
94
+ };
95
+ }
96
+
49
97
  // pragma MARK: std::shared_ptr<HybridReactNativeDeviceUtilsSpec>
50
98
  std::shared_ptr<HybridReactNativeDeviceUtilsSpec> create_std__shared_ptr_HybridReactNativeDeviceUtilsSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
51
99
  ReactNativeDeviceUtils::HybridReactNativeDeviceUtilsSpec_cxx swiftPart = ReactNativeDeviceUtils::HybridReactNativeDeviceUtilsSpec_cxx::fromUnsafe(swiftUnsafePointer);
@@ -10,8 +10,14 @@
10
10
  // Forward declarations of C++ defined types
11
11
  // Forward declaration of `DualScreenInfoRect` to properly resolve imports.
12
12
  namespace margelo::nitro::reactnativedeviceutils { struct DualScreenInfoRect; }
13
+ // Forward declaration of `GooglePlayServicesStatus` to properly resolve imports.
14
+ namespace margelo::nitro::reactnativedeviceutils { struct GooglePlayServicesStatus; }
13
15
  // Forward declaration of `HybridReactNativeDeviceUtilsSpec` to properly resolve imports.
14
16
  namespace margelo::nitro::reactnativedeviceutils { class HybridReactNativeDeviceUtilsSpec; }
17
+ // Forward declaration of `LaunchOptions` to properly resolve imports.
18
+ namespace margelo::nitro::reactnativedeviceutils { struct LaunchOptions; }
19
+ // Forward declaration of `WebViewPackageInfo` to properly resolve imports.
20
+ namespace margelo::nitro::reactnativedeviceutils { struct WebViewPackageInfo; }
15
21
 
16
22
  // Forward declarations of Swift defined types
17
23
  // Forward declaration of `HybridReactNativeDeviceUtilsSpec_cxx` to properly resolve imports.
@@ -19,13 +25,18 @@ namespace ReactNativeDeviceUtils { class HybridReactNativeDeviceUtilsSpec_cxx; }
19
25
 
20
26
  // Include C++ defined types
21
27
  #include "DualScreenInfoRect.hpp"
28
+ #include "GooglePlayServicesStatus.hpp"
22
29
  #include "HybridReactNativeDeviceUtilsSpec.hpp"
30
+ #include "LaunchOptions.hpp"
31
+ #include "WebViewPackageInfo.hpp"
23
32
  #include <NitroModules/Promise.hpp>
24
33
  #include <NitroModules/PromiseHolder.hpp>
25
34
  #include <NitroModules/Result.hpp>
26
35
  #include <exception>
27
36
  #include <functional>
28
37
  #include <memory>
38
+ #include <optional>
39
+ #include <string>
29
40
  #include <vector>
30
41
 
31
42
  /**
@@ -157,6 +168,237 @@ namespace margelo::nitro::reactnativedeviceutils::bridge::swift {
157
168
  return Func_void_bool_Wrapper(std::move(value));
158
169
  }
159
170
 
171
+ // pragma MARK: std::optional<std::string>
172
+ /**
173
+ * Specialized version of `std::optional<std::string>`.
174
+ */
175
+ using std__optional_std__string_ = std::optional<std::string>;
176
+ inline std::optional<std::string> create_std__optional_std__string_(const std::string& value) noexcept {
177
+ return std::optional<std::string>(value);
178
+ }
179
+ inline bool has_value_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
180
+ return optional.has_value();
181
+ }
182
+ inline std::string get_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
183
+ return *optional;
184
+ }
185
+
186
+ // pragma MARK: std::shared_ptr<Promise<LaunchOptions>>
187
+ /**
188
+ * Specialized version of `std::shared_ptr<Promise<LaunchOptions>>`.
189
+ */
190
+ using std__shared_ptr_Promise_LaunchOptions__ = std::shared_ptr<Promise<LaunchOptions>>;
191
+ inline std::shared_ptr<Promise<LaunchOptions>> create_std__shared_ptr_Promise_LaunchOptions__() noexcept {
192
+ return Promise<LaunchOptions>::create();
193
+ }
194
+ inline PromiseHolder<LaunchOptions> wrap_std__shared_ptr_Promise_LaunchOptions__(std::shared_ptr<Promise<LaunchOptions>> promise) noexcept {
195
+ return PromiseHolder<LaunchOptions>(std::move(promise));
196
+ }
197
+
198
+ // pragma MARK: std::function<void(const LaunchOptions& /* result */)>
199
+ /**
200
+ * Specialized version of `std::function<void(const LaunchOptions&)>`.
201
+ */
202
+ using Func_void_LaunchOptions = std::function<void(const LaunchOptions& /* result */)>;
203
+ /**
204
+ * Wrapper class for a `std::function<void(const LaunchOptions& / * result * /)>`, this can be used from Swift.
205
+ */
206
+ class Func_void_LaunchOptions_Wrapper final {
207
+ public:
208
+ explicit Func_void_LaunchOptions_Wrapper(std::function<void(const LaunchOptions& /* result */)>&& func): _function(std::make_unique<std::function<void(const LaunchOptions& /* result */)>>(std::move(func))) {}
209
+ inline void call(LaunchOptions result) const noexcept {
210
+ _function->operator()(result);
211
+ }
212
+ private:
213
+ std::unique_ptr<std::function<void(const LaunchOptions& /* result */)>> _function;
214
+ } SWIFT_NONCOPYABLE;
215
+ Func_void_LaunchOptions create_Func_void_LaunchOptions(void* NON_NULL swiftClosureWrapper) noexcept;
216
+ inline Func_void_LaunchOptions_Wrapper wrap_Func_void_LaunchOptions(Func_void_LaunchOptions value) noexcept {
217
+ return Func_void_LaunchOptions_Wrapper(std::move(value));
218
+ }
219
+
220
+ // pragma MARK: std::shared_ptr<Promise<bool>>
221
+ /**
222
+ * Specialized version of `std::shared_ptr<Promise<bool>>`.
223
+ */
224
+ using std__shared_ptr_Promise_bool__ = std::shared_ptr<Promise<bool>>;
225
+ inline std::shared_ptr<Promise<bool>> create_std__shared_ptr_Promise_bool__() noexcept {
226
+ return Promise<bool>::create();
227
+ }
228
+ inline PromiseHolder<bool> wrap_std__shared_ptr_Promise_bool__(std::shared_ptr<Promise<bool>> promise) noexcept {
229
+ return PromiseHolder<bool>(std::move(promise));
230
+ }
231
+
232
+ // pragma MARK: std::shared_ptr<Promise<std::string>>
233
+ /**
234
+ * Specialized version of `std::shared_ptr<Promise<std::string>>`.
235
+ */
236
+ using std__shared_ptr_Promise_std__string__ = std::shared_ptr<Promise<std::string>>;
237
+ inline std::shared_ptr<Promise<std::string>> create_std__shared_ptr_Promise_std__string__() noexcept {
238
+ return Promise<std::string>::create();
239
+ }
240
+ inline PromiseHolder<std::string> wrap_std__shared_ptr_Promise_std__string__(std::shared_ptr<Promise<std::string>> promise) noexcept {
241
+ return PromiseHolder<std::string>(std::move(promise));
242
+ }
243
+
244
+ // pragma MARK: std::function<void(const std::string& /* result */)>
245
+ /**
246
+ * Specialized version of `std::function<void(const std::string&)>`.
247
+ */
248
+ using Func_void_std__string = std::function<void(const std::string& /* result */)>;
249
+ /**
250
+ * Wrapper class for a `std::function<void(const std::string& / * result * /)>`, this can be used from Swift.
251
+ */
252
+ class Func_void_std__string_Wrapper final {
253
+ public:
254
+ explicit Func_void_std__string_Wrapper(std::function<void(const std::string& /* result */)>&& func): _function(std::make_unique<std::function<void(const std::string& /* result */)>>(std::move(func))) {}
255
+ inline void call(std::string result) const noexcept {
256
+ _function->operator()(result);
257
+ }
258
+ private:
259
+ std::unique_ptr<std::function<void(const std::string& /* result */)>> _function;
260
+ } SWIFT_NONCOPYABLE;
261
+ Func_void_std__string create_Func_void_std__string(void* NON_NULL swiftClosureWrapper) noexcept;
262
+ inline Func_void_std__string_Wrapper wrap_Func_void_std__string(Func_void_std__string value) noexcept {
263
+ return Func_void_std__string_Wrapper(std::move(value));
264
+ }
265
+
266
+ // pragma MARK: std::shared_ptr<Promise<void>>
267
+ /**
268
+ * Specialized version of `std::shared_ptr<Promise<void>>`.
269
+ */
270
+ using std__shared_ptr_Promise_void__ = std::shared_ptr<Promise<void>>;
271
+ inline std::shared_ptr<Promise<void>> create_std__shared_ptr_Promise_void__() noexcept {
272
+ return Promise<void>::create();
273
+ }
274
+ inline PromiseHolder<void> wrap_std__shared_ptr_Promise_void__(std::shared_ptr<Promise<void>> promise) noexcept {
275
+ return PromiseHolder<void>(std::move(promise));
276
+ }
277
+
278
+ // pragma MARK: std::function<void()>
279
+ /**
280
+ * Specialized version of `std::function<void()>`.
281
+ */
282
+ using Func_void = std::function<void()>;
283
+ /**
284
+ * Wrapper class for a `std::function<void()>`, this can be used from Swift.
285
+ */
286
+ class Func_void_Wrapper final {
287
+ public:
288
+ explicit Func_void_Wrapper(std::function<void()>&& func): _function(std::make_unique<std::function<void()>>(std::move(func))) {}
289
+ inline void call() const noexcept {
290
+ _function->operator()();
291
+ }
292
+ private:
293
+ std::unique_ptr<std::function<void()>> _function;
294
+ } SWIFT_NONCOPYABLE;
295
+ Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept;
296
+ inline Func_void_Wrapper wrap_Func_void(Func_void value) noexcept {
297
+ return Func_void_Wrapper(std::move(value));
298
+ }
299
+
300
+ // pragma MARK: std::shared_ptr<Promise<double>>
301
+ /**
302
+ * Specialized version of `std::shared_ptr<Promise<double>>`.
303
+ */
304
+ using std__shared_ptr_Promise_double__ = std::shared_ptr<Promise<double>>;
305
+ inline std::shared_ptr<Promise<double>> create_std__shared_ptr_Promise_double__() noexcept {
306
+ return Promise<double>::create();
307
+ }
308
+ inline PromiseHolder<double> wrap_std__shared_ptr_Promise_double__(std::shared_ptr<Promise<double>> promise) noexcept {
309
+ return PromiseHolder<double>(std::move(promise));
310
+ }
311
+
312
+ // pragma MARK: std::function<void(double /* result */)>
313
+ /**
314
+ * Specialized version of `std::function<void(double)>`.
315
+ */
316
+ using Func_void_double = std::function<void(double /* result */)>;
317
+ /**
318
+ * Wrapper class for a `std::function<void(double / * result * /)>`, this can be used from Swift.
319
+ */
320
+ class Func_void_double_Wrapper final {
321
+ public:
322
+ explicit Func_void_double_Wrapper(std::function<void(double /* result */)>&& func): _function(std::make_unique<std::function<void(double /* result */)>>(std::move(func))) {}
323
+ inline void call(double result) const noexcept {
324
+ _function->operator()(result);
325
+ }
326
+ private:
327
+ std::unique_ptr<std::function<void(double /* result */)>> _function;
328
+ } SWIFT_NONCOPYABLE;
329
+ Func_void_double create_Func_void_double(void* NON_NULL swiftClosureWrapper) noexcept;
330
+ inline Func_void_double_Wrapper wrap_Func_void_double(Func_void_double value) noexcept {
331
+ return Func_void_double_Wrapper(std::move(value));
332
+ }
333
+
334
+ // pragma MARK: std::shared_ptr<Promise<WebViewPackageInfo>>
335
+ /**
336
+ * Specialized version of `std::shared_ptr<Promise<WebViewPackageInfo>>`.
337
+ */
338
+ using std__shared_ptr_Promise_WebViewPackageInfo__ = std::shared_ptr<Promise<WebViewPackageInfo>>;
339
+ inline std::shared_ptr<Promise<WebViewPackageInfo>> create_std__shared_ptr_Promise_WebViewPackageInfo__() noexcept {
340
+ return Promise<WebViewPackageInfo>::create();
341
+ }
342
+ inline PromiseHolder<WebViewPackageInfo> wrap_std__shared_ptr_Promise_WebViewPackageInfo__(std::shared_ptr<Promise<WebViewPackageInfo>> promise) noexcept {
343
+ return PromiseHolder<WebViewPackageInfo>(std::move(promise));
344
+ }
345
+
346
+ // pragma MARK: std::function<void(const WebViewPackageInfo& /* result */)>
347
+ /**
348
+ * Specialized version of `std::function<void(const WebViewPackageInfo&)>`.
349
+ */
350
+ using Func_void_WebViewPackageInfo = std::function<void(const WebViewPackageInfo& /* result */)>;
351
+ /**
352
+ * Wrapper class for a `std::function<void(const WebViewPackageInfo& / * result * /)>`, this can be used from Swift.
353
+ */
354
+ class Func_void_WebViewPackageInfo_Wrapper final {
355
+ public:
356
+ explicit Func_void_WebViewPackageInfo_Wrapper(std::function<void(const WebViewPackageInfo& /* result */)>&& func): _function(std::make_unique<std::function<void(const WebViewPackageInfo& /* result */)>>(std::move(func))) {}
357
+ inline void call(WebViewPackageInfo result) const noexcept {
358
+ _function->operator()(result);
359
+ }
360
+ private:
361
+ std::unique_ptr<std::function<void(const WebViewPackageInfo& /* result */)>> _function;
362
+ } SWIFT_NONCOPYABLE;
363
+ Func_void_WebViewPackageInfo create_Func_void_WebViewPackageInfo(void* NON_NULL swiftClosureWrapper) noexcept;
364
+ inline Func_void_WebViewPackageInfo_Wrapper wrap_Func_void_WebViewPackageInfo(Func_void_WebViewPackageInfo value) noexcept {
365
+ return Func_void_WebViewPackageInfo_Wrapper(std::move(value));
366
+ }
367
+
368
+ // pragma MARK: std::shared_ptr<Promise<GooglePlayServicesStatus>>
369
+ /**
370
+ * Specialized version of `std::shared_ptr<Promise<GooglePlayServicesStatus>>`.
371
+ */
372
+ using std__shared_ptr_Promise_GooglePlayServicesStatus__ = std::shared_ptr<Promise<GooglePlayServicesStatus>>;
373
+ inline std::shared_ptr<Promise<GooglePlayServicesStatus>> create_std__shared_ptr_Promise_GooglePlayServicesStatus__() noexcept {
374
+ return Promise<GooglePlayServicesStatus>::create();
375
+ }
376
+ inline PromiseHolder<GooglePlayServicesStatus> wrap_std__shared_ptr_Promise_GooglePlayServicesStatus__(std::shared_ptr<Promise<GooglePlayServicesStatus>> promise) noexcept {
377
+ return PromiseHolder<GooglePlayServicesStatus>(std::move(promise));
378
+ }
379
+
380
+ // pragma MARK: std::function<void(const GooglePlayServicesStatus& /* result */)>
381
+ /**
382
+ * Specialized version of `std::function<void(const GooglePlayServicesStatus&)>`.
383
+ */
384
+ using Func_void_GooglePlayServicesStatus = std::function<void(const GooglePlayServicesStatus& /* result */)>;
385
+ /**
386
+ * Wrapper class for a `std::function<void(const GooglePlayServicesStatus& / * result * /)>`, this can be used from Swift.
387
+ */
388
+ class Func_void_GooglePlayServicesStatus_Wrapper final {
389
+ public:
390
+ explicit Func_void_GooglePlayServicesStatus_Wrapper(std::function<void(const GooglePlayServicesStatus& /* result */)>&& func): _function(std::make_unique<std::function<void(const GooglePlayServicesStatus& /* result */)>>(std::move(func))) {}
391
+ inline void call(GooglePlayServicesStatus result) const noexcept {
392
+ _function->operator()(result);
393
+ }
394
+ private:
395
+ std::unique_ptr<std::function<void(const GooglePlayServicesStatus& /* result */)>> _function;
396
+ } SWIFT_NONCOPYABLE;
397
+ Func_void_GooglePlayServicesStatus create_Func_void_GooglePlayServicesStatus(void* NON_NULL swiftClosureWrapper) noexcept;
398
+ inline Func_void_GooglePlayServicesStatus_Wrapper wrap_Func_void_GooglePlayServicesStatus(Func_void_GooglePlayServicesStatus value) noexcept {
399
+ return Func_void_GooglePlayServicesStatus_Wrapper(std::move(value));
400
+ }
401
+
160
402
  // pragma MARK: std::shared_ptr<HybridReactNativeDeviceUtilsSpec>
161
403
  /**
162
404
  * Specialized version of `std::shared_ptr<HybridReactNativeDeviceUtilsSpec>`.
@@ -213,5 +455,68 @@ namespace margelo::nitro::reactnativedeviceutils::bridge::swift {
213
455
  inline Result_double_ create_Result_double_(const std::exception_ptr& error) noexcept {
214
456
  return Result<double>::withError(error);
215
457
  }
458
+
459
+ // pragma MARK: Result<std::shared_ptr<Promise<LaunchOptions>>>
460
+ using Result_std__shared_ptr_Promise_LaunchOptions___ = Result<std::shared_ptr<Promise<LaunchOptions>>>;
461
+ inline Result_std__shared_ptr_Promise_LaunchOptions___ create_Result_std__shared_ptr_Promise_LaunchOptions___(const std::shared_ptr<Promise<LaunchOptions>>& value) noexcept {
462
+ return Result<std::shared_ptr<Promise<LaunchOptions>>>::withValue(value);
463
+ }
464
+ inline Result_std__shared_ptr_Promise_LaunchOptions___ create_Result_std__shared_ptr_Promise_LaunchOptions___(const std::exception_ptr& error) noexcept {
465
+ return Result<std::shared_ptr<Promise<LaunchOptions>>>::withError(error);
466
+ }
467
+
468
+ // pragma MARK: Result<std::shared_ptr<Promise<bool>>>
469
+ using Result_std__shared_ptr_Promise_bool___ = Result<std::shared_ptr<Promise<bool>>>;
470
+ inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::shared_ptr<Promise<bool>>& value) noexcept {
471
+ return Result<std::shared_ptr<Promise<bool>>>::withValue(value);
472
+ }
473
+ inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::exception_ptr& error) noexcept {
474
+ return Result<std::shared_ptr<Promise<bool>>>::withError(error);
475
+ }
476
+
477
+ // pragma MARK: Result<std::shared_ptr<Promise<std::string>>>
478
+ using Result_std__shared_ptr_Promise_std__string___ = Result<std::shared_ptr<Promise<std::string>>>;
479
+ inline Result_std__shared_ptr_Promise_std__string___ create_Result_std__shared_ptr_Promise_std__string___(const std::shared_ptr<Promise<std::string>>& value) noexcept {
480
+ return Result<std::shared_ptr<Promise<std::string>>>::withValue(value);
481
+ }
482
+ inline Result_std__shared_ptr_Promise_std__string___ create_Result_std__shared_ptr_Promise_std__string___(const std::exception_ptr& error) noexcept {
483
+ return Result<std::shared_ptr<Promise<std::string>>>::withError(error);
484
+ }
485
+
486
+ // pragma MARK: Result<std::shared_ptr<Promise<void>>>
487
+ using Result_std__shared_ptr_Promise_void___ = Result<std::shared_ptr<Promise<void>>>;
488
+ inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::shared_ptr<Promise<void>>& value) noexcept {
489
+ return Result<std::shared_ptr<Promise<void>>>::withValue(value);
490
+ }
491
+ inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::exception_ptr& error) noexcept {
492
+ return Result<std::shared_ptr<Promise<void>>>::withError(error);
493
+ }
494
+
495
+ // pragma MARK: Result<std::shared_ptr<Promise<double>>>
496
+ using Result_std__shared_ptr_Promise_double___ = Result<std::shared_ptr<Promise<double>>>;
497
+ inline Result_std__shared_ptr_Promise_double___ create_Result_std__shared_ptr_Promise_double___(const std::shared_ptr<Promise<double>>& value) noexcept {
498
+ return Result<std::shared_ptr<Promise<double>>>::withValue(value);
499
+ }
500
+ inline Result_std__shared_ptr_Promise_double___ create_Result_std__shared_ptr_Promise_double___(const std::exception_ptr& error) noexcept {
501
+ return Result<std::shared_ptr<Promise<double>>>::withError(error);
502
+ }
503
+
504
+ // pragma MARK: Result<std::shared_ptr<Promise<WebViewPackageInfo>>>
505
+ using Result_std__shared_ptr_Promise_WebViewPackageInfo___ = Result<std::shared_ptr<Promise<WebViewPackageInfo>>>;
506
+ inline Result_std__shared_ptr_Promise_WebViewPackageInfo___ create_Result_std__shared_ptr_Promise_WebViewPackageInfo___(const std::shared_ptr<Promise<WebViewPackageInfo>>& value) noexcept {
507
+ return Result<std::shared_ptr<Promise<WebViewPackageInfo>>>::withValue(value);
508
+ }
509
+ inline Result_std__shared_ptr_Promise_WebViewPackageInfo___ create_Result_std__shared_ptr_Promise_WebViewPackageInfo___(const std::exception_ptr& error) noexcept {
510
+ return Result<std::shared_ptr<Promise<WebViewPackageInfo>>>::withError(error);
511
+ }
512
+
513
+ // pragma MARK: Result<std::shared_ptr<Promise<GooglePlayServicesStatus>>>
514
+ using Result_std__shared_ptr_Promise_GooglePlayServicesStatus___ = Result<std::shared_ptr<Promise<GooglePlayServicesStatus>>>;
515
+ inline Result_std__shared_ptr_Promise_GooglePlayServicesStatus___ create_Result_std__shared_ptr_Promise_GooglePlayServicesStatus___(const std::shared_ptr<Promise<GooglePlayServicesStatus>>& value) noexcept {
516
+ return Result<std::shared_ptr<Promise<GooglePlayServicesStatus>>>::withValue(value);
517
+ }
518
+ inline Result_std__shared_ptr_Promise_GooglePlayServicesStatus___ create_Result_std__shared_ptr_Promise_GooglePlayServicesStatus___(const std::exception_ptr& error) noexcept {
519
+ return Result<std::shared_ptr<Promise<GooglePlayServicesStatus>>>::withError(error);
520
+ }
216
521
 
217
522
  } // namespace margelo::nitro::reactnativedeviceutils::bridge::swift
@@ -10,20 +10,31 @@
10
10
  // Forward declarations of C++ defined types
11
11
  // Forward declaration of `DualScreenInfoRect` to properly resolve imports.
12
12
  namespace margelo::nitro::reactnativedeviceutils { struct DualScreenInfoRect; }
13
+ // Forward declaration of `GooglePlayServicesStatus` to properly resolve imports.
14
+ namespace margelo::nitro::reactnativedeviceutils { struct GooglePlayServicesStatus; }
13
15
  // Forward declaration of `HybridReactNativeDeviceUtilsSpec` to properly resolve imports.
14
16
  namespace margelo::nitro::reactnativedeviceutils { class HybridReactNativeDeviceUtilsSpec; }
17
+ // Forward declaration of `LaunchOptions` to properly resolve imports.
18
+ namespace margelo::nitro::reactnativedeviceutils { struct LaunchOptions; }
15
19
  // Forward declaration of `UserInterfaceStyle` to properly resolve imports.
16
20
  namespace margelo::nitro::reactnativedeviceutils { enum class UserInterfaceStyle; }
21
+ // Forward declaration of `WebViewPackageInfo` to properly resolve imports.
22
+ namespace margelo::nitro::reactnativedeviceutils { struct WebViewPackageInfo; }
17
23
 
18
24
  // Include C++ defined types
19
25
  #include "DualScreenInfoRect.hpp"
26
+ #include "GooglePlayServicesStatus.hpp"
20
27
  #include "HybridReactNativeDeviceUtilsSpec.hpp"
28
+ #include "LaunchOptions.hpp"
21
29
  #include "UserInterfaceStyle.hpp"
30
+ #include "WebViewPackageInfo.hpp"
22
31
  #include <NitroModules/Promise.hpp>
23
32
  #include <NitroModules/Result.hpp>
24
33
  #include <exception>
25
34
  #include <functional>
26
35
  #include <memory>
36
+ #include <optional>
37
+ #include <string>
27
38
  #include <vector>
28
39
 
29
40
  // C++ helpers for Swift