react-native-acoustic-connect-beta 19.0.36 → 19.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/README.md +42 -12
- package/android/build.gradle +15 -61
- package/android/src/main/assets/ConnectBasicConfig.properties +4 -4
- package/android/src/main/java/com/acousticconnectrn/HybridAcousticConnectRN.kt +47 -47
- package/ios/AcousticConnectRNConfig.json +9 -16
- package/ios/HybridAcousticConnectRN.swift +5 -5
- package/nitrogen/generated/android/AcousticConnectRN+autolinking.cmake +1 -1
- package/nitrogen/generated/android/c++/JHybridAcousticConnectRNSpec.cpp +7 -7
- package/nitrogen/generated/android/c++/JHybridAcousticConnectRNSpec.hpp +2 -2
- package/nitrogen/generated/android/c++/JPushErrorInfo.hpp +1 -1
- package/nitrogen/generated/android/c++/JPushPermissionResult.hpp +1 -1
- package/nitrogen/generated/android/c++/JVariant_Boolean_NullType.cpp +26 -0
- package/nitrogen/generated/android/c++/{JVariant_NullType_Boolean.hpp → JVariant_Boolean_NullType.hpp} +22 -22
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/acousticconnectrn/HybridAcousticConnectRNSpec.kt +4 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/acousticconnectrn/{Variant_NullType_Boolean.kt → Variant_Boolean_NullType.kt} +10 -10
- package/nitrogen/generated/ios/AcousticConnectRN-Swift-Cxx-Bridge.cpp +4 -4
- package/nitrogen/generated/ios/AcousticConnectRN-Swift-Cxx-Bridge.hpp +43 -43
- package/nitrogen/generated/ios/c++/HybridAcousticConnectRNSpecSwift.hpp +2 -2
- package/nitrogen/generated/ios/swift/{Func_void_std__variant_nitro__NullType__bool_.swift → Func_void_std__variant_bool__nitro__NullType_.swift} +13 -13
- package/nitrogen/generated/ios/swift/HybridAcousticConnectRNSpec.swift +2 -2
- package/nitrogen/generated/ios/swift/HybridAcousticConnectRNSpec_cxx.swift +17 -17
- package/nitrogen/generated/ios/swift/{Variant_NullType_Bool.swift → Variant_Bool_NullType.swift} +6 -6
- package/nitrogen/generated/shared/c++/HybridAcousticConnectRNSpec.hpp +2 -2
- package/package.json +11 -10
- package/scripts/gradleParser.js +7 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_Boolean.cpp +0 -26
|
@@ -22,7 +22,7 @@ namespace margelo::nitro::acousticconnectrn { struct PushErrorInfo; }
|
|
|
22
22
|
#include <NitroModules/JPromise.hpp>
|
|
23
23
|
#include "PushPermissionResult.hpp"
|
|
24
24
|
#include "JPushPermissionResult.hpp"
|
|
25
|
-
#include "
|
|
25
|
+
#include "JVariant_Boolean_NullType.hpp"
|
|
26
26
|
#include "JVariant_Boolean_String_Double.hpp"
|
|
27
27
|
#include <unordered_map>
|
|
28
28
|
#include <NitroModules/AnyMap.hpp>
|
|
@@ -295,9 +295,9 @@ namespace margelo::nitro::acousticconnectrn {
|
|
|
295
295
|
return __promise;
|
|
296
296
|
}();
|
|
297
297
|
}
|
|
298
|
-
std::shared_ptr<Promise<bool>> JHybridAcousticConnectRNSpec::pushDidReceiveAuthorization(const std::optional<std::variant<nitro::NullType
|
|
299
|
-
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<
|
|
300
|
-
auto __result = method(_javaPart, granted.has_value() ?
|
|
298
|
+
std::shared_ptr<Promise<bool>> JHybridAcousticConnectRNSpec::pushDidReceiveAuthorization(const std::optional<std::variant<bool, nitro::NullType>>& granted, const std::optional<PushErrorInfo>& error) {
|
|
299
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<JVariant_Boolean_NullType> /* granted */, jni::alias_ref<JPushErrorInfo> /* error */)>("pushDidReceiveAuthorization");
|
|
300
|
+
auto __result = method(_javaPart, granted.has_value() ? JVariant_Boolean_NullType::fromCpp(granted.value()) : nullptr, error.has_value() ? JPushErrorInfo::fromCpp(error.value()) : nullptr);
|
|
301
301
|
return [&]() {
|
|
302
302
|
auto __promise = Promise<bool>::create();
|
|
303
303
|
__result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& __boxedResult) {
|
|
@@ -327,13 +327,13 @@ namespace margelo::nitro::acousticconnectrn {
|
|
|
327
327
|
return __promise;
|
|
328
328
|
}();
|
|
329
329
|
}
|
|
330
|
-
std::shared_ptr<Promise<std::variant<nitro::NullType
|
|
330
|
+
std::shared_ptr<Promise<std::variant<bool, nitro::NullType>>> JHybridAcousticConnectRNSpec::pushGetPermissionState() {
|
|
331
331
|
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("pushGetPermissionState");
|
|
332
332
|
auto __result = method(_javaPart);
|
|
333
333
|
return [&]() {
|
|
334
|
-
auto __promise = Promise<std::variant<nitro::NullType
|
|
334
|
+
auto __promise = Promise<std::variant<bool, nitro::NullType>>::create();
|
|
335
335
|
__result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& __boxedResult) {
|
|
336
|
-
auto __result = jni::static_ref_cast<
|
|
336
|
+
auto __result = jni::static_ref_cast<JVariant_Boolean_NullType>(__boxedResult);
|
|
337
337
|
__promise->resolve(__result->toCpp());
|
|
338
338
|
});
|
|
339
339
|
__result->cthis()->addOnRejectedListener([=](const jni::alias_ref<jni::JThrowable>& __throwable) {
|
|
@@ -83,9 +83,9 @@ namespace margelo::nitro::acousticconnectrn {
|
|
|
83
83
|
std::shared_ptr<Promise<bool>> pushDidFailToRegister(const PushErrorInfo& error) override;
|
|
84
84
|
std::shared_ptr<Promise<bool>> pushDidReceiveNotification(const std::unordered_map<std::string, std::variant<bool, std::string, double>>& userInfo) override;
|
|
85
85
|
std::shared_ptr<Promise<bool>> pushDidReceiveResponse(const std::string& actionIdentifier, const std::unordered_map<std::string, std::variant<bool, std::string, double>>& userInfo) override;
|
|
86
|
-
std::shared_ptr<Promise<bool>> pushDidReceiveAuthorization(const std::optional<std::variant<nitro::NullType
|
|
86
|
+
std::shared_ptr<Promise<bool>> pushDidReceiveAuthorization(const std::optional<std::variant<bool, nitro::NullType>>& granted, const std::optional<PushErrorInfo>& error) override;
|
|
87
87
|
std::shared_ptr<Promise<PushPermissionResult>> pushRequestPermission() override;
|
|
88
|
-
std::shared_ptr<Promise<std::variant<nitro::NullType
|
|
88
|
+
std::shared_ptr<Promise<std::variant<bool, nitro::NullType>>> pushGetPermissionState() override;
|
|
89
89
|
|
|
90
90
|
private:
|
|
91
91
|
jni::global_ref<JHybridAcousticConnectRNSpec::JavaPart> _javaPart;
|
|
@@ -18,7 +18,7 @@ namespace margelo::nitro::acousticconnectrn {
|
|
|
18
18
|
using namespace facebook;
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* The C++ JNI bridge between the C++ struct "PushErrorInfo" and the
|
|
21
|
+
* The C++ JNI bridge between the C++ struct "PushErrorInfo" and the Kotlin data class "PushErrorInfo".
|
|
22
22
|
*/
|
|
23
23
|
struct JPushErrorInfo final: public jni::JavaClass<JPushErrorInfo> {
|
|
24
24
|
public:
|
|
@@ -22,7 +22,7 @@ namespace margelo::nitro::acousticconnectrn {
|
|
|
22
22
|
using namespace facebook;
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
* The C++ JNI bridge between the C++ struct "PushPermissionResult" and the
|
|
25
|
+
* The C++ JNI bridge between the C++ struct "PushPermissionResult" and the Kotlin data class "PushPermissionResult".
|
|
26
26
|
*/
|
|
27
27
|
struct JPushPermissionResult final: public jni::JavaClass<JPushPermissionResult> {
|
|
28
28
|
public:
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JVariant_Boolean_NullType.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "JVariant_Boolean_NullType.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::acousticconnectrn {
|
|
11
|
+
/**
|
|
12
|
+
* Converts JVariant_Boolean_NullType to std::variant<bool, nitro::NullType>
|
|
13
|
+
*/
|
|
14
|
+
std::variant<bool, nitro::NullType> JVariant_Boolean_NullType::toCpp() const {
|
|
15
|
+
if (isInstanceOf(JVariant_Boolean_NullType_impl::First::javaClassStatic())) {
|
|
16
|
+
// It's a `bool`
|
|
17
|
+
auto jniValue = static_cast<const JVariant_Boolean_NullType_impl::First*>(this)->getValue();
|
|
18
|
+
return static_cast<bool>(jniValue);
|
|
19
|
+
} else if (isInstanceOf(JVariant_Boolean_NullType_impl::Second::javaClassStatic())) {
|
|
20
|
+
// It's a `nitro::NullType`
|
|
21
|
+
auto jniValue = static_cast<const JVariant_Boolean_NullType_impl::Second*>(this)->getValue();
|
|
22
|
+
return nitro::null;
|
|
23
|
+
}
|
|
24
|
+
throw std::invalid_argument("Variant is unknown Kotlin instance!");
|
|
25
|
+
}
|
|
26
|
+
} // namespace margelo::nitro::acousticconnectrn
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// JVariant_Boolean_NullType.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © Marc Rousavy @ Margelo
|
|
@@ -19,51 +19,51 @@ namespace margelo::nitro::acousticconnectrn {
|
|
|
19
19
|
using namespace facebook;
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
* The C++ JNI bridge between the C++ std::variant and the Java class "
|
|
22
|
+
* The C++ JNI bridge between the C++ std::variant and the Java class "Variant_Boolean_NullType".
|
|
23
23
|
*/
|
|
24
|
-
class
|
|
24
|
+
class JVariant_Boolean_NullType: public jni::JavaClass<JVariant_Boolean_NullType> {
|
|
25
25
|
public:
|
|
26
|
-
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/acousticconnectrn/
|
|
26
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/acousticconnectrn/Variant_Boolean_NullType;";
|
|
27
27
|
|
|
28
|
-
static jni::local_ref<
|
|
29
|
-
static const auto method = javaClassStatic()->getStaticMethod<
|
|
28
|
+
static jni::local_ref<JVariant_Boolean_NullType> create_0(jboolean value) {
|
|
29
|
+
static const auto method = javaClassStatic()->getStaticMethod<JVariant_Boolean_NullType(jboolean)>("create");
|
|
30
30
|
return method(javaClassStatic(), value);
|
|
31
31
|
}
|
|
32
|
-
static jni::local_ref<
|
|
33
|
-
static const auto method = javaClassStatic()->getStaticMethod<
|
|
32
|
+
static jni::local_ref<JVariant_Boolean_NullType> create_1(jni::alias_ref<JNull> value) {
|
|
33
|
+
static const auto method = javaClassStatic()->getStaticMethod<JVariant_Boolean_NullType(jni::alias_ref<JNull>)>("create");
|
|
34
34
|
return method(javaClassStatic(), value);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
static jni::local_ref<
|
|
37
|
+
static jni::local_ref<JVariant_Boolean_NullType> fromCpp(const std::variant<bool, nitro::NullType>& variant) {
|
|
38
38
|
switch (variant.index()) {
|
|
39
|
-
case 0: return create_0(
|
|
40
|
-
case 1: return create_1(
|
|
39
|
+
case 0: return create_0(std::get<0>(variant));
|
|
40
|
+
case 1: return create_1(JNull::null());
|
|
41
41
|
default: throw std::invalid_argument("Variant holds unknown index! (" + std::to_string(variant.index()) + ")");
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
[[nodiscard]] std::variant<nitro::NullType
|
|
45
|
+
[[nodiscard]] std::variant<bool, nitro::NullType> toCpp() const;
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
namespace
|
|
49
|
-
class First final: public jni::JavaClass<First,
|
|
48
|
+
namespace JVariant_Boolean_NullType_impl {
|
|
49
|
+
class First final: public jni::JavaClass<First, JVariant_Boolean_NullType> {
|
|
50
50
|
public:
|
|
51
|
-
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/acousticconnectrn/
|
|
51
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/acousticconnectrn/Variant_Boolean_NullType$First;";
|
|
52
52
|
|
|
53
|
-
[[nodiscard]]
|
|
54
|
-
static const auto field = javaClassStatic()->getField<
|
|
53
|
+
[[nodiscard]] jboolean getValue() const {
|
|
54
|
+
static const auto field = javaClassStatic()->getField<jboolean>("value");
|
|
55
55
|
return getFieldValue(field);
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
-
class Second final: public jni::JavaClass<Second,
|
|
59
|
+
class Second final: public jni::JavaClass<Second, JVariant_Boolean_NullType> {
|
|
60
60
|
public:
|
|
61
|
-
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/acousticconnectrn/
|
|
61
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/acousticconnectrn/Variant_Boolean_NullType$Second;";
|
|
62
62
|
|
|
63
|
-
[[nodiscard]]
|
|
64
|
-
static const auto field = javaClassStatic()->getField<
|
|
63
|
+
[[nodiscard]] jni::local_ref<JNull> getValue() const {
|
|
64
|
+
static const auto field = javaClassStatic()->getField<JNull>("value");
|
|
65
65
|
return getFieldValue(field);
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
|
-
} // namespace
|
|
68
|
+
} // namespace JVariant_Boolean_NullType_impl
|
|
69
69
|
} // namespace margelo::nitro::acousticconnectrn
|
|
@@ -10,6 +10,7 @@ package com.margelo.nitro.acousticconnectrn
|
|
|
10
10
|
import androidx.annotation.Keep
|
|
11
11
|
import com.facebook.jni.HybridData
|
|
12
12
|
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import dalvik.annotation.optimization.FastNative
|
|
13
14
|
import com.margelo.nitro.core.NullType
|
|
14
15
|
import com.margelo.nitro.core.AnyMap
|
|
15
16
|
import com.margelo.nitro.core.Promise
|
|
@@ -150,7 +151,7 @@ abstract class HybridAcousticConnectRNSpec: HybridObject() {
|
|
|
150
151
|
|
|
151
152
|
@DoNotStrip
|
|
152
153
|
@Keep
|
|
153
|
-
abstract fun pushDidReceiveAuthorization(granted:
|
|
154
|
+
abstract fun pushDidReceiveAuthorization(granted: Variant_Boolean_NullType?, error: PushErrorInfo?): Promise<Boolean>
|
|
154
155
|
|
|
155
156
|
@DoNotStrip
|
|
156
157
|
@Keep
|
|
@@ -158,7 +159,7 @@ abstract class HybridAcousticConnectRNSpec: HybridObject() {
|
|
|
158
159
|
|
|
159
160
|
@DoNotStrip
|
|
160
161
|
@Keep
|
|
161
|
-
abstract fun pushGetPermissionState(): Promise<
|
|
162
|
+
abstract fun pushGetPermissionState(): Promise<Variant_Boolean_NullType>
|
|
162
163
|
|
|
163
164
|
// Default implementation of `HybridObject.toString()`
|
|
164
165
|
override fun toString(): String {
|
|
@@ -170,6 +171,7 @@ abstract class HybridAcousticConnectRNSpec: HybridObject() {
|
|
|
170
171
|
@Keep
|
|
171
172
|
protected open class CxxPart(javaPart: HybridAcousticConnectRNSpec): HybridObject.CxxPart(javaPart) {
|
|
172
173
|
// C++ JHybridAcousticConnectRNSpec::CxxPart::initHybrid(...)
|
|
174
|
+
@FastNative
|
|
173
175
|
external override fun initHybrid(): HybridData
|
|
174
176
|
}
|
|
175
177
|
override fun createCxxPart(): CxxPart {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// Variant_Boolean_NullType.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © Marc Rousavy @ Margelo
|
|
@@ -11,15 +11,15 @@ import com.facebook.proguard.annotations.DoNotStrip
|
|
|
11
11
|
import com.margelo.nitro.core.NullType
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Represents the TypeScript variant "
|
|
14
|
+
* Represents the TypeScript variant "Boolean | NullType".
|
|
15
15
|
*/
|
|
16
16
|
@Suppress("ClassName")
|
|
17
17
|
@DoNotStrip
|
|
18
|
-
sealed class
|
|
18
|
+
sealed class Variant_Boolean_NullType {
|
|
19
19
|
@DoNotStrip
|
|
20
|
-
data class First(@DoNotStrip val value:
|
|
20
|
+
data class First(@DoNotStrip val value: Boolean): Variant_Boolean_NullType()
|
|
21
21
|
@DoNotStrip
|
|
22
|
-
data class Second(@DoNotStrip val value:
|
|
22
|
+
data class Second(@DoNotStrip val value: NullType): Variant_Boolean_NullType()
|
|
23
23
|
|
|
24
24
|
inline fun <reified T> asType(): T? {
|
|
25
25
|
return when (this) {
|
|
@@ -30,7 +30,7 @@ sealed class Variant_NullType_Boolean {
|
|
|
30
30
|
inline fun <reified T> isType(): Boolean {
|
|
31
31
|
return asType<T>() != null
|
|
32
32
|
}
|
|
33
|
-
inline fun <R> match(first: (
|
|
33
|
+
inline fun <R> match(first: (Boolean) -> R, second: (NullType) -> R): R {
|
|
34
34
|
return when (this) {
|
|
35
35
|
is First -> first(value)
|
|
36
36
|
is Second -> second(value)
|
|
@@ -42,11 +42,11 @@ sealed class Variant_NullType_Boolean {
|
|
|
42
42
|
val isSecond: Boolean
|
|
43
43
|
get() = this is Second
|
|
44
44
|
|
|
45
|
-
fun asFirstOrNull():
|
|
45
|
+
fun asFirstOrNull(): Boolean? {
|
|
46
46
|
val value = (this as? First)?.value ?: return null
|
|
47
47
|
return value
|
|
48
48
|
}
|
|
49
|
-
fun asSecondOrNull():
|
|
49
|
+
fun asSecondOrNull(): NullType? {
|
|
50
50
|
val value = (this as? Second)?.value ?: return null
|
|
51
51
|
return value
|
|
52
52
|
}
|
|
@@ -54,9 +54,9 @@ sealed class Variant_NullType_Boolean {
|
|
|
54
54
|
companion object {
|
|
55
55
|
@JvmStatic
|
|
56
56
|
@DoNotStrip
|
|
57
|
-
fun create(value:
|
|
57
|
+
fun create(value: Boolean): Variant_Boolean_NullType = First(value)
|
|
58
58
|
@JvmStatic
|
|
59
59
|
@DoNotStrip
|
|
60
|
-
fun create(value:
|
|
60
|
+
fun create(value: NullType): Variant_Boolean_NullType = Second(value)
|
|
61
61
|
}
|
|
62
62
|
}
|
|
@@ -38,10 +38,10 @@ namespace margelo::nitro::acousticconnectrn::bridge::swift {
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
// pragma MARK: std::function<void(const std::variant<nitro::NullType
|
|
42
|
-
|
|
43
|
-
auto swiftClosure = AcousticConnectRN::
|
|
44
|
-
return [swiftClosure = std::move(swiftClosure)](const std::variant<nitro::NullType
|
|
41
|
+
// pragma MARK: std::function<void(const std::variant<bool, nitro::NullType>& /* result */)>
|
|
42
|
+
Func_void_std__variant_bool__nitro__NullType_ create_Func_void_std__variant_bool__nitro__NullType_(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
43
|
+
auto swiftClosure = AcousticConnectRN::Func_void_std__variant_bool__nitro__NullType_::fromUnsafe(swiftClosureWrapper);
|
|
44
|
+
return [swiftClosure = std::move(swiftClosure)](const std::variant<bool, nitro::NullType>& result) mutable -> void {
|
|
45
45
|
swiftClosure.call(result);
|
|
46
46
|
};
|
|
47
47
|
}
|
|
@@ -271,47 +271,47 @@ namespace margelo::nitro::acousticconnectrn::bridge::swift {
|
|
|
271
271
|
return optional.value();
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
-
// pragma MARK: std::variant<nitro::NullType
|
|
274
|
+
// pragma MARK: std::variant<bool, nitro::NullType>
|
|
275
275
|
/**
|
|
276
|
-
* Wrapper struct for `std::variant<nitro::NullType
|
|
276
|
+
* Wrapper struct for `std::variant<bool, nitro::NullType>`.
|
|
277
277
|
* std::variant cannot be used in Swift because of a Swift bug.
|
|
278
278
|
* Not even specializing it works. So we create a wrapper struct.
|
|
279
279
|
*/
|
|
280
|
-
struct
|
|
281
|
-
std::variant<nitro::NullType
|
|
282
|
-
|
|
283
|
-
operator std::variant<nitro::NullType
|
|
280
|
+
struct std__variant_bool__nitro__NullType_ final {
|
|
281
|
+
std::variant<bool, nitro::NullType> variant;
|
|
282
|
+
std__variant_bool__nitro__NullType_(std::variant<bool, nitro::NullType> variant): variant(variant) { }
|
|
283
|
+
operator std::variant<bool, nitro::NullType>() const noexcept {
|
|
284
284
|
return variant;
|
|
285
285
|
}
|
|
286
286
|
inline size_t index() const noexcept {
|
|
287
287
|
return variant.index();
|
|
288
288
|
}
|
|
289
|
-
inline
|
|
289
|
+
inline bool get_0() const noexcept {
|
|
290
290
|
return std::get<0>(variant);
|
|
291
291
|
}
|
|
292
|
-
inline
|
|
292
|
+
inline nitro::NullType get_1() const noexcept {
|
|
293
293
|
return std::get<1>(variant);
|
|
294
294
|
}
|
|
295
295
|
};
|
|
296
|
-
inline
|
|
297
|
-
return
|
|
296
|
+
inline std__variant_bool__nitro__NullType_ create_std__variant_bool__nitro__NullType_(bool value) noexcept {
|
|
297
|
+
return std__variant_bool__nitro__NullType_(value);
|
|
298
298
|
}
|
|
299
|
-
inline
|
|
300
|
-
return
|
|
299
|
+
inline std__variant_bool__nitro__NullType_ create_std__variant_bool__nitro__NullType_(nitro::NullType value) noexcept {
|
|
300
|
+
return std__variant_bool__nitro__NullType_(value);
|
|
301
301
|
}
|
|
302
302
|
|
|
303
|
-
// pragma MARK: std::optional<std::variant<nitro::NullType
|
|
303
|
+
// pragma MARK: std::optional<std::variant<bool, nitro::NullType>>
|
|
304
304
|
/**
|
|
305
|
-
* Specialized version of `std::optional<std::variant<nitro::NullType
|
|
305
|
+
* Specialized version of `std::optional<std::variant<bool, nitro::NullType>>`.
|
|
306
306
|
*/
|
|
307
|
-
using
|
|
308
|
-
inline std::optional<std::variant<nitro::NullType
|
|
309
|
-
return std::optional<std::variant<nitro::NullType
|
|
307
|
+
using std__optional_std__variant_bool__nitro__NullType__ = std::optional<std::variant<bool, nitro::NullType>>;
|
|
308
|
+
inline std::optional<std::variant<bool, nitro::NullType>> create_std__optional_std__variant_bool__nitro__NullType__(const std::variant<bool, nitro::NullType>& value) noexcept {
|
|
309
|
+
return std::optional<std::variant<bool, nitro::NullType>>(value);
|
|
310
310
|
}
|
|
311
|
-
inline bool
|
|
311
|
+
inline bool has_value_std__optional_std__variant_bool__nitro__NullType__(const std::optional<std::variant<bool, nitro::NullType>>& optional) noexcept {
|
|
312
312
|
return optional.has_value();
|
|
313
313
|
}
|
|
314
|
-
inline std::variant<nitro::NullType
|
|
314
|
+
inline std::variant<bool, nitro::NullType> get_std__optional_std__variant_bool__nitro__NullType__(const std::optional<std::variant<bool, nitro::NullType>>& optional) noexcept {
|
|
315
315
|
return optional.value();
|
|
316
316
|
}
|
|
317
317
|
|
|
@@ -364,38 +364,38 @@ namespace margelo::nitro::acousticconnectrn::bridge::swift {
|
|
|
364
364
|
return Func_void_PushPermissionResult_Wrapper(std::move(value));
|
|
365
365
|
}
|
|
366
366
|
|
|
367
|
-
// pragma MARK: std::shared_ptr<Promise<std::variant<nitro::NullType
|
|
367
|
+
// pragma MARK: std::shared_ptr<Promise<std::variant<bool, nitro::NullType>>>
|
|
368
368
|
/**
|
|
369
|
-
* Specialized version of `std::shared_ptr<Promise<std::variant<nitro::NullType
|
|
369
|
+
* Specialized version of `std::shared_ptr<Promise<std::variant<bool, nitro::NullType>>>`.
|
|
370
370
|
*/
|
|
371
|
-
using
|
|
372
|
-
inline std::shared_ptr<Promise<std::variant<nitro::NullType
|
|
373
|
-
return Promise<std::variant<nitro::NullType
|
|
371
|
+
using std__shared_ptr_Promise_std__variant_bool__nitro__NullType___ = std::shared_ptr<Promise<std::variant<bool, nitro::NullType>>>;
|
|
372
|
+
inline std::shared_ptr<Promise<std::variant<bool, nitro::NullType>>> create_std__shared_ptr_Promise_std__variant_bool__nitro__NullType___() noexcept {
|
|
373
|
+
return Promise<std::variant<bool, nitro::NullType>>::create();
|
|
374
374
|
}
|
|
375
|
-
inline PromiseHolder<std::variant<nitro::NullType
|
|
376
|
-
return PromiseHolder<std::variant<nitro::NullType
|
|
375
|
+
inline PromiseHolder<std::variant<bool, nitro::NullType>> wrap_std__shared_ptr_Promise_std__variant_bool__nitro__NullType___(std::shared_ptr<Promise<std::variant<bool, nitro::NullType>>> promise) noexcept {
|
|
376
|
+
return PromiseHolder<std::variant<bool, nitro::NullType>>(std::move(promise));
|
|
377
377
|
}
|
|
378
378
|
|
|
379
|
-
// pragma MARK: std::function<void(const std::variant<nitro::NullType
|
|
379
|
+
// pragma MARK: std::function<void(const std::variant<bool, nitro::NullType>& /* result */)>
|
|
380
380
|
/**
|
|
381
|
-
* Specialized version of `std::function<void(const std::variant<nitro::NullType
|
|
381
|
+
* Specialized version of `std::function<void(const std::variant<bool, nitro::NullType>&)>`.
|
|
382
382
|
*/
|
|
383
|
-
using
|
|
383
|
+
using Func_void_std__variant_bool__nitro__NullType_ = std::function<void(const std::variant<bool, nitro::NullType>& /* result */)>;
|
|
384
384
|
/**
|
|
385
|
-
* Wrapper class for a `std::function<void(const std::variant<nitro::NullType
|
|
385
|
+
* Wrapper class for a `std::function<void(const std::variant<bool, nitro::NullType>& / * result * /)>`, this can be used from Swift.
|
|
386
386
|
*/
|
|
387
|
-
class
|
|
387
|
+
class Func_void_std__variant_bool__nitro__NullType__Wrapper final {
|
|
388
388
|
public:
|
|
389
|
-
explicit
|
|
390
|
-
inline void call(std::variant<nitro::NullType
|
|
389
|
+
explicit Func_void_std__variant_bool__nitro__NullType__Wrapper(std::function<void(const std::variant<bool, nitro::NullType>& /* result */)>&& func): _function(std::make_unique<std::function<void(const std::variant<bool, nitro::NullType>& /* result */)>>(std::move(func))) {}
|
|
390
|
+
inline void call(std::variant<bool, nitro::NullType> result) const noexcept {
|
|
391
391
|
_function->operator()(result);
|
|
392
392
|
}
|
|
393
393
|
private:
|
|
394
|
-
std::unique_ptr<std::function<void(const std::variant<nitro::NullType
|
|
394
|
+
std::unique_ptr<std::function<void(const std::variant<bool, nitro::NullType>& /* result */)>> _function;
|
|
395
395
|
} SWIFT_NONCOPYABLE;
|
|
396
|
-
|
|
397
|
-
inline
|
|
398
|
-
return
|
|
396
|
+
Func_void_std__variant_bool__nitro__NullType_ create_Func_void_std__variant_bool__nitro__NullType_(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
397
|
+
inline Func_void_std__variant_bool__nitro__NullType__Wrapper wrap_Func_void_std__variant_bool__nitro__NullType_(Func_void_std__variant_bool__nitro__NullType_ value) noexcept {
|
|
398
|
+
return Func_void_std__variant_bool__nitro__NullType__Wrapper(std::move(value));
|
|
399
399
|
}
|
|
400
400
|
|
|
401
401
|
// pragma MARK: std::shared_ptr<HybridAcousticConnectRNSpec>
|
|
@@ -455,13 +455,13 @@ namespace margelo::nitro::acousticconnectrn::bridge::swift {
|
|
|
455
455
|
return Result<std::shared_ptr<Promise<PushPermissionResult>>>::withError(error);
|
|
456
456
|
}
|
|
457
457
|
|
|
458
|
-
// pragma MARK: Result<std::shared_ptr<Promise<std::variant<nitro::NullType
|
|
459
|
-
using
|
|
460
|
-
inline
|
|
461
|
-
return Result<std::shared_ptr<Promise<std::variant<nitro::NullType
|
|
458
|
+
// pragma MARK: Result<std::shared_ptr<Promise<std::variant<bool, nitro::NullType>>>>
|
|
459
|
+
using Result_std__shared_ptr_Promise_std__variant_bool__nitro__NullType____ = Result<std::shared_ptr<Promise<std::variant<bool, nitro::NullType>>>>;
|
|
460
|
+
inline Result_std__shared_ptr_Promise_std__variant_bool__nitro__NullType____ create_Result_std__shared_ptr_Promise_std__variant_bool__nitro__NullType____(const std::shared_ptr<Promise<std::variant<bool, nitro::NullType>>>& value) noexcept {
|
|
461
|
+
return Result<std::shared_ptr<Promise<std::variant<bool, nitro::NullType>>>>::withValue(value);
|
|
462
462
|
}
|
|
463
|
-
inline
|
|
464
|
-
return Result<std::shared_ptr<Promise<std::variant<nitro::NullType
|
|
463
|
+
inline Result_std__shared_ptr_Promise_std__variant_bool__nitro__NullType____ create_Result_std__shared_ptr_Promise_std__variant_bool__nitro__NullType____(const std::exception_ptr& error) noexcept {
|
|
464
|
+
return Result<std::shared_ptr<Promise<std::variant<bool, nitro::NullType>>>>::withError(error);
|
|
465
465
|
}
|
|
466
466
|
|
|
467
467
|
} // namespace margelo::nitro::acousticconnectrn::bridge::swift
|
|
@@ -313,7 +313,7 @@ namespace margelo::nitro::acousticconnectrn {
|
|
|
313
313
|
auto __value = std::move(__result.value());
|
|
314
314
|
return __value;
|
|
315
315
|
}
|
|
316
|
-
inline std::shared_ptr<Promise<bool>> pushDidReceiveAuthorization(const std::optional<std::variant<nitro::NullType
|
|
316
|
+
inline std::shared_ptr<Promise<bool>> pushDidReceiveAuthorization(const std::optional<std::variant<bool, nitro::NullType>>& granted, const std::optional<PushErrorInfo>& error) override {
|
|
317
317
|
auto __result = _swiftPart.pushDidReceiveAuthorization(granted, error);
|
|
318
318
|
if (__result.hasError()) [[unlikely]] {
|
|
319
319
|
std::rethrow_exception(__result.error());
|
|
@@ -329,7 +329,7 @@ namespace margelo::nitro::acousticconnectrn {
|
|
|
329
329
|
auto __value = std::move(__result.value());
|
|
330
330
|
return __value;
|
|
331
331
|
}
|
|
332
|
-
inline std::shared_ptr<Promise<std::variant<nitro::NullType
|
|
332
|
+
inline std::shared_ptr<Promise<std::variant<bool, nitro::NullType>>> pushGetPermissionState() override {
|
|
333
333
|
auto __result = _swiftPart.pushGetPermissionState();
|
|
334
334
|
if (__result.hasError()) [[unlikely]] {
|
|
335
335
|
std::rethrow_exception(__result.error());
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// Func_void_std__variant_bool__nitro__NullType_.swift
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © Marc Rousavy @ Margelo
|
|
@@ -8,29 +8,29 @@
|
|
|
8
8
|
import NitroModules
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* Wraps a Swift `(_ value:
|
|
11
|
+
* Wraps a Swift `(_ value: Variant_Bool_NullType) -> Void` as a class.
|
|
12
12
|
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
13
13
|
*/
|
|
14
|
-
public final class
|
|
14
|
+
public final class Func_void_std__variant_bool__nitro__NullType_ {
|
|
15
15
|
public typealias bridge = margelo.nitro.acousticconnectrn.bridge.swift
|
|
16
16
|
|
|
17
|
-
private let closure: (_ value:
|
|
17
|
+
private let closure: (_ value: Variant_Bool_NullType) -> Void
|
|
18
18
|
|
|
19
|
-
public init(_ closure: @escaping (_ value:
|
|
19
|
+
public init(_ closure: @escaping (_ value: Variant_Bool_NullType) -> Void) {
|
|
20
20
|
self.closure = closure
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
@inline(__always)
|
|
24
|
-
public func call(value: bridge.
|
|
25
|
-
self.closure({ () ->
|
|
24
|
+
public func call(value: bridge.std__variant_bool__nitro__NullType_) -> Void {
|
|
25
|
+
self.closure({ () -> Variant_Bool_NullType in
|
|
26
26
|
let __variant = value
|
|
27
27
|
switch __variant.index() {
|
|
28
28
|
case 0:
|
|
29
29
|
let __actual = __variant.get_0()
|
|
30
|
-
return .first(
|
|
30
|
+
return .first(__actual)
|
|
31
31
|
case 1:
|
|
32
32
|
let __actual = __variant.get_1()
|
|
33
|
-
return .second(
|
|
33
|
+
return .second(NullType.null)
|
|
34
34
|
default:
|
|
35
35
|
fatalError("Variant can never have index \(__variant.index())!")
|
|
36
36
|
}
|
|
@@ -47,12 +47,12 @@ public final class Func_void_std__variant_nitro__NullType__bool_ {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
|
-
* Casts an unsafe pointer to a `
|
|
51
|
-
* The pointer has to be a retained opaque `Unmanaged<
|
|
50
|
+
* Casts an unsafe pointer to a `Func_void_std__variant_bool__nitro__NullType_`.
|
|
51
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_std__variant_bool__nitro__NullType_>`.
|
|
52
52
|
* This removes one strong reference from the object!
|
|
53
53
|
*/
|
|
54
54
|
@inline(__always)
|
|
55
|
-
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) ->
|
|
56
|
-
return Unmanaged<
|
|
55
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__variant_bool__nitro__NullType_ {
|
|
56
|
+
return Unmanaged<Func_void_std__variant_bool__nitro__NullType_>.fromOpaque(pointer).takeRetainedValue()
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -42,9 +42,9 @@ public protocol HybridAcousticConnectRNSpec_protocol: HybridObject {
|
|
|
42
42
|
func pushDidFailToRegister(error: PushErrorInfo) throws -> Promise<Bool>
|
|
43
43
|
func pushDidReceiveNotification(userInfo: Dictionary<String, Variant_Bool_String_Double>) throws -> Promise<Bool>
|
|
44
44
|
func pushDidReceiveResponse(actionIdentifier: String, userInfo: Dictionary<String, Variant_Bool_String_Double>) throws -> Promise<Bool>
|
|
45
|
-
func pushDidReceiveAuthorization(granted:
|
|
45
|
+
func pushDidReceiveAuthorization(granted: Variant_Bool_NullType?, error: PushErrorInfo?) throws -> Promise<Bool>
|
|
46
46
|
func pushRequestPermission() throws -> Promise<PushPermissionResult>
|
|
47
|
-
func pushGetPermissionState() throws -> Promise<
|
|
47
|
+
func pushGetPermissionState() throws -> Promise<Variant_Bool_NullType>
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
public extension HybridAcousticConnectRNSpec_protocol {
|
|
@@ -745,20 +745,20 @@ open class HybridAcousticConnectRNSpec_cxx {
|
|
|
745
745
|
}
|
|
746
746
|
|
|
747
747
|
@inline(__always)
|
|
748
|
-
public final func pushDidReceiveAuthorization(granted: bridge.
|
|
748
|
+
public final func pushDidReceiveAuthorization(granted: bridge.std__optional_std__variant_bool__nitro__NullType__, error: bridge.std__optional_PushErrorInfo_) -> bridge.Result_std__shared_ptr_Promise_bool___ {
|
|
749
749
|
do {
|
|
750
|
-
let __result = try self.__implementation.pushDidReceiveAuthorization(granted: { () ->
|
|
751
|
-
if bridge.
|
|
752
|
-
let __unwrapped = bridge.
|
|
753
|
-
return { () ->
|
|
754
|
-
let __variant = bridge.
|
|
750
|
+
let __result = try self.__implementation.pushDidReceiveAuthorization(granted: { () -> Variant_Bool_NullType? in
|
|
751
|
+
if bridge.has_value_std__optional_std__variant_bool__nitro__NullType__(granted) {
|
|
752
|
+
let __unwrapped = bridge.get_std__optional_std__variant_bool__nitro__NullType__(granted)
|
|
753
|
+
return { () -> Variant_Bool_NullType in
|
|
754
|
+
let __variant = bridge.std__variant_bool__nitro__NullType_(__unwrapped)
|
|
755
755
|
switch __variant.index() {
|
|
756
756
|
case 0:
|
|
757
757
|
let __actual = __variant.get_0()
|
|
758
|
-
return .first(
|
|
758
|
+
return .first(__actual)
|
|
759
759
|
case 1:
|
|
760
760
|
let __actual = __variant.get_1()
|
|
761
|
-
return .second(
|
|
761
|
+
return .second(NullType.null)
|
|
762
762
|
default:
|
|
763
763
|
fatalError("Variant can never have index \(__variant.index())!")
|
|
764
764
|
}
|
|
@@ -802,28 +802,28 @@ open class HybridAcousticConnectRNSpec_cxx {
|
|
|
802
802
|
}
|
|
803
803
|
|
|
804
804
|
@inline(__always)
|
|
805
|
-
public final func pushGetPermissionState() -> bridge.
|
|
805
|
+
public final func pushGetPermissionState() -> bridge.Result_std__shared_ptr_Promise_std__variant_bool__nitro__NullType____ {
|
|
806
806
|
do {
|
|
807
807
|
let __result = try self.__implementation.pushGetPermissionState()
|
|
808
|
-
let __resultCpp = { () -> bridge.
|
|
809
|
-
let __promise = bridge.
|
|
810
|
-
let __promiseHolder = bridge.
|
|
808
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__variant_bool__nitro__NullType___ in
|
|
809
|
+
let __promise = bridge.create_std__shared_ptr_Promise_std__variant_bool__nitro__NullType___()
|
|
810
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__variant_bool__nitro__NullType___(__promise)
|
|
811
811
|
__result
|
|
812
|
-
.then({ __result in __promiseHolder.resolve({ () -> bridge.
|
|
812
|
+
.then({ __result in __promiseHolder.resolve({ () -> bridge.std__variant_bool__nitro__NullType_ in
|
|
813
813
|
switch __result {
|
|
814
814
|
case .first(let __value):
|
|
815
|
-
return bridge.
|
|
815
|
+
return bridge.create_std__variant_bool__nitro__NullType_(__value)
|
|
816
816
|
case .second(let __value):
|
|
817
|
-
return bridge.
|
|
817
|
+
return bridge.create_std__variant_bool__nitro__NullType_(margelo.nitro.NullType.null)
|
|
818
818
|
}
|
|
819
819
|
}().variant) })
|
|
820
820
|
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
821
821
|
return __promise
|
|
822
822
|
}()
|
|
823
|
-
return bridge.
|
|
823
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__variant_bool__nitro__NullType____(__resultCpp)
|
|
824
824
|
} catch (let __error) {
|
|
825
825
|
let __exceptionPtr = __error.toCpp()
|
|
826
|
-
return bridge.
|
|
826
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__variant_bool__nitro__NullType____(__exceptionPtr)
|
|
827
827
|
}
|
|
828
828
|
}
|
|
829
829
|
}
|