react-native-ble-nitro 1.7.0 → 1.7.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/README.md CHANGED
@@ -78,7 +78,7 @@ const ble = BleNitro.instance();
78
78
  // It is recommended to create this instance in an extra file seperated from other BLE business logic for better fast-refresh support
79
79
  const ble = new BleNitroManager({
80
80
  restoreStateIdentifier: 'my-unique-identifier',
81
- onRestoreState: (peripherals) => {
81
+ onRestoredState: (peripherals) => {
82
82
  console.log('Restored peripherals:', peripherals);
83
83
  },
84
84
  });
@@ -383,7 +383,7 @@ import { BleNitroManager, BLEDevice } from 'react-native-ble-nitro';
383
383
 
384
384
  const customBleInstance = new BleNitroManager({
385
385
  restoreStateIdentifier: 'my-unique-identifier', // unique identifier for state restoration
386
- onRestoreState: (peripherals: BLEDevice[]) => {
386
+ onRestoredState: (peripherals: BLEDevice[]) => {
387
387
  console.log('Restored peripherals:', peripherals);
388
388
  // Handle restored peripherals
389
389
  }
@@ -396,7 +396,7 @@ const customBleInstance = new BleNitroManager({
396
396
  ```typescript
397
397
  // Enable state restoration in BleNitro singleton
398
398
  const ble = BleNitro.instance();
399
- ble.onRestoreState((peripherals) => {
399
+ ble.onRestoredState((peripherals) => {
400
400
  console.log('Restored peripherals:', peripherals);
401
401
  });
402
402
  ```
@@ -13,6 +13,12 @@
13
13
  # include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/BleNitro+autolinking.cmake)
14
14
  # ```
15
15
 
16
+ # Define a flag to check if we are building properly
17
+ add_definitions(-DBUILDING_BLENITRO_WITH_GENERATED_CMAKE_PROJECT)
18
+
19
+ # Enable Raw Props parsing in react-native (for Nitro Views)
20
+ add_definitions(-DRN_SERIALIZABLE_STATE)
21
+
16
22
  # Add all headers that were generated by Nitrogen
17
23
  include_directories(
18
24
  "../nitrogen/generated/shared/c++"
@@ -34,12 +40,9 @@ target_sources(
34
40
  ../nitrogen/generated/android/c++/JHybridNativeBleNitroFactorySpec.cpp
35
41
  )
36
42
 
37
- # Define a flag to check if we are building properly
38
- add_definitions(-DBUILDING_BLENITRO_WITH_GENERATED_CMAKE_PROJECT)
39
-
40
43
  # From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake
41
44
  # Used in node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake
42
- target_compile_definitions(
45
+ target_compile_definitions(
43
46
  BleNitro PRIVATE
44
47
  -DFOLLY_NO_CONFIG=1
45
48
  -DFOLLY_HAVE_CLOCK_GETTIME=1
@@ -55,8 +55,7 @@ int initialize(JavaVM* vm) {
55
55
  []() -> std::shared_ptr<HybridObject> {
56
56
  static DefaultConstructableObject<JHybridNativeBleNitroSpec::javaobject> object("com/margelo/nitro/co/zyke/ble/BleNitroBleManager");
57
57
  auto instance = object.create();
58
- auto globalRef = jni::make_global(instance);
59
- return globalRef->cthis()->shared();
58
+ return instance->cthis()->shared();
60
59
  }
61
60
  );
62
61
  HybridObjectRegistry::registerHybridObjectConstructor(
@@ -64,8 +63,7 @@ int initialize(JavaVM* vm) {
64
63
  []() -> std::shared_ptr<HybridObject> {
65
64
  static DefaultConstructableObject<JHybridNativeBleNitroFactorySpec::javaobject> object("com/margelo/nitro/co/zyke/ble/BleNitroBleManagerFactory");
66
65
  auto instance = object.create();
67
- auto globalRef = jni::make_global(instance);
68
- return globalRef->cthis()->shared();
66
+ return instance->cthis()->shared();
69
67
  }
70
68
  );
71
69
  });
@@ -15,7 +15,7 @@
15
15
  namespace margelo::nitro::co::zyke::ble::bridge::swift {
16
16
 
17
17
  // pragma MARK: std::function<void(const std::vector<BLEDevice>& /* restoredPeripherals */)>
18
- Func_void_std__vector_BLEDevice_ create_Func_void_std__vector_BLEDevice_(void* _Nonnull swiftClosureWrapper) {
18
+ Func_void_std__vector_BLEDevice_ create_Func_void_std__vector_BLEDevice_(void* NON_NULL swiftClosureWrapper) noexcept {
19
19
  auto swiftClosure = BleNitro::Func_void_std__vector_BLEDevice_::fromUnsafe(swiftClosureWrapper);
20
20
  return [swiftClosure = std::move(swiftClosure)](const std::vector<BLEDevice>& restoredPeripherals) mutable -> void {
21
21
  swiftClosure.call(restoredPeripherals);
@@ -23,7 +23,7 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
23
23
  }
24
24
 
25
25
  // pragma MARK: std::function<void(const std::optional<BLEDevice>& /* device */, const std::optional<std::string>& /* error */)>
26
- Func_void_std__optional_BLEDevice__std__optional_std__string_ create_Func_void_std__optional_BLEDevice__std__optional_std__string_(void* _Nonnull swiftClosureWrapper) {
26
+ Func_void_std__optional_BLEDevice__std__optional_std__string_ create_Func_void_std__optional_BLEDevice__std__optional_std__string_(void* NON_NULL swiftClosureWrapper) noexcept {
27
27
  auto swiftClosure = BleNitro::Func_void_std__optional_BLEDevice__std__optional_std__string_::fromUnsafe(swiftClosureWrapper);
28
28
  return [swiftClosure = std::move(swiftClosure)](const std::optional<BLEDevice>& device, const std::optional<std::string>& error) mutable -> void {
29
29
  swiftClosure.call(device, error);
@@ -31,7 +31,7 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
31
31
  }
32
32
 
33
33
  // pragma MARK: std::function<void(bool /* success */, const std::string& /* deviceId */, const std::string& /* error */)>
34
- Func_void_bool_std__string_std__string create_Func_void_bool_std__string_std__string(void* _Nonnull swiftClosureWrapper) {
34
+ Func_void_bool_std__string_std__string create_Func_void_bool_std__string_std__string(void* NON_NULL swiftClosureWrapper) noexcept {
35
35
  auto swiftClosure = BleNitro::Func_void_bool_std__string_std__string::fromUnsafe(swiftClosureWrapper);
36
36
  return [swiftClosure = std::move(swiftClosure)](bool success, const std::string& deviceId, const std::string& error) mutable -> void {
37
37
  swiftClosure.call(success, deviceId, error);
@@ -39,7 +39,7 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
39
39
  }
40
40
 
41
41
  // pragma MARK: std::function<void(const std::string& /* deviceId */, bool /* interrupted */, const std::string& /* error */)>
42
- Func_void_std__string_bool_std__string create_Func_void_std__string_bool_std__string(void* _Nonnull swiftClosureWrapper) {
42
+ Func_void_std__string_bool_std__string create_Func_void_std__string_bool_std__string(void* NON_NULL swiftClosureWrapper) noexcept {
43
43
  auto swiftClosure = BleNitro::Func_void_std__string_bool_std__string::fromUnsafe(swiftClosureWrapper);
44
44
  return [swiftClosure = std::move(swiftClosure)](const std::string& deviceId, bool interrupted, const std::string& error) mutable -> void {
45
45
  swiftClosure.call(deviceId, interrupted, error);
@@ -47,7 +47,7 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
47
47
  }
48
48
 
49
49
  // pragma MARK: std::function<void(bool /* success */, const std::string& /* error */)>
50
- Func_void_bool_std__string create_Func_void_bool_std__string(void* _Nonnull swiftClosureWrapper) {
50
+ Func_void_bool_std__string create_Func_void_bool_std__string(void* NON_NULL swiftClosureWrapper) noexcept {
51
51
  auto swiftClosure = BleNitro::Func_void_bool_std__string::fromUnsafe(swiftClosureWrapper);
52
52
  return [swiftClosure = std::move(swiftClosure)](bool success, const std::string& error) mutable -> void {
53
53
  swiftClosure.call(success, error);
@@ -55,7 +55,7 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
55
55
  }
56
56
 
57
57
  // pragma MARK: std::function<void(bool /* success */, double /* rssi */, const std::string& /* error */)>
58
- Func_void_bool_double_std__string create_Func_void_bool_double_std__string(void* _Nonnull swiftClosureWrapper) {
58
+ Func_void_bool_double_std__string create_Func_void_bool_double_std__string(void* NON_NULL swiftClosureWrapper) noexcept {
59
59
  auto swiftClosure = BleNitro::Func_void_bool_double_std__string::fromUnsafe(swiftClosureWrapper);
60
60
  return [swiftClosure = std::move(swiftClosure)](bool success, double rssi, const std::string& error) mutable -> void {
61
61
  swiftClosure.call(success, rssi, error);
@@ -63,7 +63,7 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
63
63
  }
64
64
 
65
65
  // pragma MARK: std::function<void(bool /* success */, const std::shared_ptr<ArrayBuffer>& /* data */, const std::string& /* error */)>
66
- Func_void_bool_std__shared_ptr_ArrayBuffer__std__string create_Func_void_bool_std__shared_ptr_ArrayBuffer__std__string(void* _Nonnull swiftClosureWrapper) {
66
+ Func_void_bool_std__shared_ptr_ArrayBuffer__std__string create_Func_void_bool_std__shared_ptr_ArrayBuffer__std__string(void* NON_NULL swiftClosureWrapper) noexcept {
67
67
  auto swiftClosure = BleNitro::Func_void_bool_std__shared_ptr_ArrayBuffer__std__string::fromUnsafe(swiftClosureWrapper);
68
68
  return [swiftClosure = std::move(swiftClosure)](bool success, const std::shared_ptr<ArrayBuffer>& data, const std::string& error) mutable -> void {
69
69
  swiftClosure.call(success, ArrayBufferHolder(data), error);
@@ -71,7 +71,7 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
71
71
  }
72
72
 
73
73
  // pragma MARK: std::function<void(const std::string& /* characteristicId */, const std::shared_ptr<ArrayBuffer>& /* data */)>
74
- Func_void_std__string_std__shared_ptr_ArrayBuffer_ create_Func_void_std__string_std__shared_ptr_ArrayBuffer_(void* _Nonnull swiftClosureWrapper) {
74
+ Func_void_std__string_std__shared_ptr_ArrayBuffer_ create_Func_void_std__string_std__shared_ptr_ArrayBuffer_(void* NON_NULL swiftClosureWrapper) noexcept {
75
75
  auto swiftClosure = BleNitro::Func_void_std__string_std__shared_ptr_ArrayBuffer_::fromUnsafe(swiftClosureWrapper);
76
76
  return [swiftClosure = std::move(swiftClosure)](const std::string& characteristicId, const std::shared_ptr<ArrayBuffer>& data) mutable -> void {
77
77
  swiftClosure.call(characteristicId, ArrayBufferHolder(data));
@@ -79,7 +79,7 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
79
79
  }
80
80
 
81
81
  // pragma MARK: std::function<void(BLEState /* state */)>
82
- Func_void_BLEState create_Func_void_BLEState(void* _Nonnull swiftClosureWrapper) {
82
+ Func_void_BLEState create_Func_void_BLEState(void* NON_NULL swiftClosureWrapper) noexcept {
83
83
  auto swiftClosure = BleNitro::Func_void_BLEState::fromUnsafe(swiftClosureWrapper);
84
84
  return [swiftClosure = std::move(swiftClosure)](BLEState state) mutable -> void {
85
85
  swiftClosure.call(static_cast<int>(state));
@@ -87,7 +87,7 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
87
87
  }
88
88
 
89
89
  // pragma MARK: std::function<void()>
90
- Func_void create_Func_void(void* _Nonnull swiftClosureWrapper) {
90
+ Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept {
91
91
  auto swiftClosure = BleNitro::Func_void::fromUnsafe(swiftClosureWrapper);
92
92
  return [swiftClosure = std::move(swiftClosure)]() mutable -> void {
93
93
  swiftClosure.call();
@@ -95,7 +95,7 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
95
95
  }
96
96
 
97
97
  // pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
98
- Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* _Nonnull swiftClosureWrapper) {
98
+ Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept {
99
99
  auto swiftClosure = BleNitro::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper);
100
100
  return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void {
101
101
  swiftClosure.call(error);
@@ -103,11 +103,11 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
103
103
  }
104
104
 
105
105
  // pragma MARK: std::shared_ptr<HybridNativeBleNitroSpec>
106
- std::shared_ptr<HybridNativeBleNitroSpec> create_std__shared_ptr_HybridNativeBleNitroSpec_(void* _Nonnull swiftUnsafePointer) {
106
+ std::shared_ptr<HybridNativeBleNitroSpec> create_std__shared_ptr_HybridNativeBleNitroSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
107
107
  BleNitro::HybridNativeBleNitroSpec_cxx swiftPart = BleNitro::HybridNativeBleNitroSpec_cxx::fromUnsafe(swiftUnsafePointer);
108
108
  return std::make_shared<margelo::nitro::co::zyke::ble::HybridNativeBleNitroSpecSwift>(swiftPart);
109
109
  }
110
- void* _Nonnull get_std__shared_ptr_HybridNativeBleNitroSpec_(std__shared_ptr_HybridNativeBleNitroSpec_ cppType) {
110
+ void* NON_NULL get_std__shared_ptr_HybridNativeBleNitroSpec_(std__shared_ptr_HybridNativeBleNitroSpec_ cppType) {
111
111
  std::shared_ptr<margelo::nitro::co::zyke::ble::HybridNativeBleNitroSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::co::zyke::ble::HybridNativeBleNitroSpecSwift>(cppType);
112
112
  #ifdef NITRO_DEBUG
113
113
  if (swiftWrapper == nullptr) [[unlikely]] {
@@ -119,11 +119,11 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
119
119
  }
120
120
 
121
121
  // pragma MARK: std::shared_ptr<HybridNativeBleNitroFactorySpec>
122
- std::shared_ptr<HybridNativeBleNitroFactorySpec> create_std__shared_ptr_HybridNativeBleNitroFactorySpec_(void* _Nonnull swiftUnsafePointer) {
122
+ std::shared_ptr<HybridNativeBleNitroFactorySpec> create_std__shared_ptr_HybridNativeBleNitroFactorySpec_(void* NON_NULL swiftUnsafePointer) noexcept {
123
123
  BleNitro::HybridNativeBleNitroFactorySpec_cxx swiftPart = BleNitro::HybridNativeBleNitroFactorySpec_cxx::fromUnsafe(swiftUnsafePointer);
124
124
  return std::make_shared<margelo::nitro::co::zyke::ble::HybridNativeBleNitroFactorySpecSwift>(swiftPart);
125
125
  }
126
- void* _Nonnull get_std__shared_ptr_HybridNativeBleNitroFactorySpec_(std__shared_ptr_HybridNativeBleNitroFactorySpec_ cppType) {
126
+ void* NON_NULL get_std__shared_ptr_HybridNativeBleNitroFactorySpec_(std__shared_ptr_HybridNativeBleNitroFactorySpec_ cppType) {
127
127
  std::shared_ptr<margelo::nitro::co::zyke::ble::HybridNativeBleNitroFactorySpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::co::zyke::ble::HybridNativeBleNitroFactorySpecSwift>(cppType);
128
128
  #ifdef NITRO_DEBUG
129
129
  if (swiftWrapper == nullptr) [[unlikely]] {
@@ -43,6 +43,7 @@ namespace BleNitro { class HybridNativeBleNitroSpec_cxx; }
43
43
  #include "OperationResult.hpp"
44
44
  #include <NitroModules/ArrayBuffer.hpp>
45
45
  #include <NitroModules/ArrayBufferHolder.hpp>
46
+ #include <NitroModules/FastVectorCopy.hpp>
46
47
  #include <NitroModules/Promise.hpp>
47
48
  #include <NitroModules/PromiseHolder.hpp>
48
49
  #include <NitroModules/Result.hpp>
@@ -64,16 +65,22 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
64
65
  * Specialized version of `std::optional<std::string>`.
65
66
  */
66
67
  using std__optional_std__string_ = std::optional<std::string>;
67
- inline std::optional<std::string> create_std__optional_std__string_(const std::string& value) {
68
+ inline std::optional<std::string> create_std__optional_std__string_(const std::string& value) noexcept {
68
69
  return std::optional<std::string>(value);
69
70
  }
71
+ inline bool has_value_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
72
+ return optional.has_value();
73
+ }
74
+ inline std::string get_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
75
+ return *optional;
76
+ }
70
77
 
71
78
  // pragma MARK: std::vector<ManufacturerDataEntry>
72
79
  /**
73
80
  * Specialized version of `std::vector<ManufacturerDataEntry>`.
74
81
  */
75
82
  using std__vector_ManufacturerDataEntry_ = std::vector<ManufacturerDataEntry>;
76
- inline std::vector<ManufacturerDataEntry> create_std__vector_ManufacturerDataEntry_(size_t size) {
83
+ inline std::vector<ManufacturerDataEntry> create_std__vector_ManufacturerDataEntry_(size_t size) noexcept {
77
84
  std::vector<ManufacturerDataEntry> vector;
78
85
  vector.reserve(size);
79
86
  return vector;
@@ -84,7 +91,7 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
84
91
  * Specialized version of `std::vector<std::string>`.
85
92
  */
86
93
  using std__vector_std__string_ = std::vector<std::string>;
87
- inline std::vector<std::string> create_std__vector_std__string_(size_t size) {
94
+ inline std::vector<std::string> create_std__vector_std__string_(size_t size) noexcept {
88
95
  std::vector<std::string> vector;
89
96
  vector.reserve(size);
90
97
  return vector;
@@ -95,7 +102,7 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
95
102
  * Specialized version of `std::vector<BLEDevice>`.
96
103
  */
97
104
  using std__vector_BLEDevice_ = std::vector<BLEDevice>;
98
- inline std::vector<BLEDevice> create_std__vector_BLEDevice_(size_t size) {
105
+ inline std::vector<BLEDevice> create_std__vector_BLEDevice_(size_t size) noexcept {
99
106
  std::vector<BLEDevice> vector;
100
107
  vector.reserve(size);
101
108
  return vector;
@@ -112,14 +119,14 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
112
119
  class Func_void_std__vector_BLEDevice__Wrapper final {
113
120
  public:
114
121
  explicit Func_void_std__vector_BLEDevice__Wrapper(std::function<void(const std::vector<BLEDevice>& /* restoredPeripherals */)>&& func): _function(std::make_unique<std::function<void(const std::vector<BLEDevice>& /* restoredPeripherals */)>>(std::move(func))) {}
115
- inline void call(std::vector<BLEDevice> restoredPeripherals) const {
122
+ inline void call(std::vector<BLEDevice> restoredPeripherals) const noexcept {
116
123
  _function->operator()(restoredPeripherals);
117
124
  }
118
125
  private:
119
126
  std::unique_ptr<std::function<void(const std::vector<BLEDevice>& /* restoredPeripherals */)>> _function;
120
127
  } SWIFT_NONCOPYABLE;
121
- Func_void_std__vector_BLEDevice_ create_Func_void_std__vector_BLEDevice_(void* _Nonnull swiftClosureWrapper);
122
- inline Func_void_std__vector_BLEDevice__Wrapper wrap_Func_void_std__vector_BLEDevice_(Func_void_std__vector_BLEDevice_ value) {
128
+ Func_void_std__vector_BLEDevice_ create_Func_void_std__vector_BLEDevice_(void* NON_NULL swiftClosureWrapper) noexcept;
129
+ inline Func_void_std__vector_BLEDevice__Wrapper wrap_Func_void_std__vector_BLEDevice_(Func_void_std__vector_BLEDevice_ value) noexcept {
123
130
  return Func_void_std__vector_BLEDevice__Wrapper(std::move(value));
124
131
  }
125
132
 
@@ -128,9 +135,15 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
128
135
  * Specialized version of `std::optional<BLEDevice>`.
129
136
  */
130
137
  using std__optional_BLEDevice_ = std::optional<BLEDevice>;
131
- inline std::optional<BLEDevice> create_std__optional_BLEDevice_(const BLEDevice& value) {
138
+ inline std::optional<BLEDevice> create_std__optional_BLEDevice_(const BLEDevice& value) noexcept {
132
139
  return std::optional<BLEDevice>(value);
133
140
  }
141
+ inline bool has_value_std__optional_BLEDevice_(const std::optional<BLEDevice>& optional) noexcept {
142
+ return optional.has_value();
143
+ }
144
+ inline BLEDevice get_std__optional_BLEDevice_(const std::optional<BLEDevice>& optional) noexcept {
145
+ return *optional;
146
+ }
134
147
 
135
148
  // pragma MARK: std::function<void(const std::optional<BLEDevice>& /* device */, const std::optional<std::string>& /* error */)>
136
149
  /**
@@ -143,14 +156,14 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
143
156
  class Func_void_std__optional_BLEDevice__std__optional_std__string__Wrapper final {
144
157
  public:
145
158
  explicit Func_void_std__optional_BLEDevice__std__optional_std__string__Wrapper(std::function<void(const std::optional<BLEDevice>& /* device */, const std::optional<std::string>& /* error */)>&& func): _function(std::make_unique<std::function<void(const std::optional<BLEDevice>& /* device */, const std::optional<std::string>& /* error */)>>(std::move(func))) {}
146
- inline void call(std::optional<BLEDevice> device, std::optional<std::string> error) const {
159
+ inline void call(std::optional<BLEDevice> device, std::optional<std::string> error) const noexcept {
147
160
  _function->operator()(device, error);
148
161
  }
149
162
  private:
150
163
  std::unique_ptr<std::function<void(const std::optional<BLEDevice>& /* device */, const std::optional<std::string>& /* error */)>> _function;
151
164
  } SWIFT_NONCOPYABLE;
152
- Func_void_std__optional_BLEDevice__std__optional_std__string_ create_Func_void_std__optional_BLEDevice__std__optional_std__string_(void* _Nonnull swiftClosureWrapper);
153
- inline Func_void_std__optional_BLEDevice__std__optional_std__string__Wrapper wrap_Func_void_std__optional_BLEDevice__std__optional_std__string_(Func_void_std__optional_BLEDevice__std__optional_std__string_ value) {
165
+ Func_void_std__optional_BLEDevice__std__optional_std__string_ create_Func_void_std__optional_BLEDevice__std__optional_std__string_(void* NON_NULL swiftClosureWrapper) noexcept;
166
+ inline Func_void_std__optional_BLEDevice__std__optional_std__string__Wrapper wrap_Func_void_std__optional_BLEDevice__std__optional_std__string_(Func_void_std__optional_BLEDevice__std__optional_std__string_ value) noexcept {
154
167
  return Func_void_std__optional_BLEDevice__std__optional_std__string__Wrapper(std::move(value));
155
168
  }
156
169
 
@@ -165,14 +178,14 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
165
178
  class Func_void_bool_std__string_std__string_Wrapper final {
166
179
  public:
167
180
  explicit Func_void_bool_std__string_std__string_Wrapper(std::function<void(bool /* success */, const std::string& /* deviceId */, const std::string& /* error */)>&& func): _function(std::make_unique<std::function<void(bool /* success */, const std::string& /* deviceId */, const std::string& /* error */)>>(std::move(func))) {}
168
- inline void call(bool success, std::string deviceId, std::string error) const {
181
+ inline void call(bool success, std::string deviceId, std::string error) const noexcept {
169
182
  _function->operator()(success, deviceId, error);
170
183
  }
171
184
  private:
172
185
  std::unique_ptr<std::function<void(bool /* success */, const std::string& /* deviceId */, const std::string& /* error */)>> _function;
173
186
  } SWIFT_NONCOPYABLE;
174
- Func_void_bool_std__string_std__string create_Func_void_bool_std__string_std__string(void* _Nonnull swiftClosureWrapper);
175
- inline Func_void_bool_std__string_std__string_Wrapper wrap_Func_void_bool_std__string_std__string(Func_void_bool_std__string_std__string value) {
187
+ Func_void_bool_std__string_std__string create_Func_void_bool_std__string_std__string(void* NON_NULL swiftClosureWrapper) noexcept;
188
+ inline Func_void_bool_std__string_std__string_Wrapper wrap_Func_void_bool_std__string_std__string(Func_void_bool_std__string_std__string value) noexcept {
176
189
  return Func_void_bool_std__string_std__string_Wrapper(std::move(value));
177
190
  }
178
191
 
@@ -187,14 +200,14 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
187
200
  class Func_void_std__string_bool_std__string_Wrapper final {
188
201
  public:
189
202
  explicit Func_void_std__string_bool_std__string_Wrapper(std::function<void(const std::string& /* deviceId */, bool /* interrupted */, const std::string& /* error */)>&& func): _function(std::make_unique<std::function<void(const std::string& /* deviceId */, bool /* interrupted */, const std::string& /* error */)>>(std::move(func))) {}
190
- inline void call(std::string deviceId, bool interrupted, std::string error) const {
203
+ inline void call(std::string deviceId, bool interrupted, std::string error) const noexcept {
191
204
  _function->operator()(deviceId, interrupted, error);
192
205
  }
193
206
  private:
194
207
  std::unique_ptr<std::function<void(const std::string& /* deviceId */, bool /* interrupted */, const std::string& /* error */)>> _function;
195
208
  } SWIFT_NONCOPYABLE;
196
- Func_void_std__string_bool_std__string create_Func_void_std__string_bool_std__string(void* _Nonnull swiftClosureWrapper);
197
- inline Func_void_std__string_bool_std__string_Wrapper wrap_Func_void_std__string_bool_std__string(Func_void_std__string_bool_std__string value) {
209
+ Func_void_std__string_bool_std__string create_Func_void_std__string_bool_std__string(void* NON_NULL swiftClosureWrapper) noexcept;
210
+ inline Func_void_std__string_bool_std__string_Wrapper wrap_Func_void_std__string_bool_std__string(Func_void_std__string_bool_std__string value) noexcept {
198
211
  return Func_void_std__string_bool_std__string_Wrapper(std::move(value));
199
212
  }
200
213
 
@@ -203,18 +216,30 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
203
216
  * Specialized version of `std::optional<std::function<void(const std::string& / * deviceId * /, bool / * interrupted * /, const std::string& / * error * /)>>`.
204
217
  */
205
218
  using std__optional_std__function_void_const_std__string_____deviceId_____bool____interrupted_____const_std__string_____error______ = std::optional<std::function<void(const std::string& /* deviceId */, bool /* interrupted */, const std::string& /* error */)>>;
206
- inline std::optional<std::function<void(const std::string& /* deviceId */, bool /* interrupted */, const std::string& /* error */)>> create_std__optional_std__function_void_const_std__string_____deviceId_____bool____interrupted_____const_std__string_____error______(const std::function<void(const std::string& /* deviceId */, bool /* interrupted */, const std::string& /* error */)>& value) {
219
+ inline std::optional<std::function<void(const std::string& /* deviceId */, bool /* interrupted */, const std::string& /* error */)>> create_std__optional_std__function_void_const_std__string_____deviceId_____bool____interrupted_____const_std__string_____error______(const std::function<void(const std::string& /* deviceId */, bool /* interrupted */, const std::string& /* error */)>& value) noexcept {
207
220
  return std::optional<std::function<void(const std::string& /* deviceId */, bool /* interrupted */, const std::string& /* error */)>>(value);
208
221
  }
222
+ inline bool has_value_std__optional_std__function_void_const_std__string_____deviceId_____bool____interrupted_____const_std__string_____error______(const std::optional<std::function<void(const std::string& /* deviceId */, bool /* interrupted */, const std::string& /* error */)>>& optional) noexcept {
223
+ return optional.has_value();
224
+ }
225
+ inline std::function<void(const std::string& /* deviceId */, bool /* interrupted */, const std::string& /* error */)> get_std__optional_std__function_void_const_std__string_____deviceId_____bool____interrupted_____const_std__string_____error______(const std::optional<std::function<void(const std::string& /* deviceId */, bool /* interrupted */, const std::string& /* error */)>>& optional) noexcept {
226
+ return *optional;
227
+ }
209
228
 
210
229
  // pragma MARK: std::optional<bool>
211
230
  /**
212
231
  * Specialized version of `std::optional<bool>`.
213
232
  */
214
233
  using std__optional_bool_ = std::optional<bool>;
215
- inline std::optional<bool> create_std__optional_bool_(const bool& value) {
234
+ inline std::optional<bool> create_std__optional_bool_(const bool& value) noexcept {
216
235
  return std::optional<bool>(value);
217
236
  }
237
+ inline bool has_value_std__optional_bool_(const std::optional<bool>& optional) noexcept {
238
+ return optional.has_value();
239
+ }
240
+ inline bool get_std__optional_bool_(const std::optional<bool>& optional) noexcept {
241
+ return *optional;
242
+ }
218
243
 
219
244
  // pragma MARK: std::function<void(bool /* success */, const std::string& /* error */)>
220
245
  /**
@@ -227,14 +252,14 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
227
252
  class Func_void_bool_std__string_Wrapper final {
228
253
  public:
229
254
  explicit Func_void_bool_std__string_Wrapper(std::function<void(bool /* success */, const std::string& /* error */)>&& func): _function(std::make_unique<std::function<void(bool /* success */, const std::string& /* error */)>>(std::move(func))) {}
230
- inline void call(bool success, std::string error) const {
255
+ inline void call(bool success, std::string error) const noexcept {
231
256
  _function->operator()(success, error);
232
257
  }
233
258
  private:
234
259
  std::unique_ptr<std::function<void(bool /* success */, const std::string& /* error */)>> _function;
235
260
  } SWIFT_NONCOPYABLE;
236
- Func_void_bool_std__string create_Func_void_bool_std__string(void* _Nonnull swiftClosureWrapper);
237
- inline Func_void_bool_std__string_Wrapper wrap_Func_void_bool_std__string(Func_void_bool_std__string value) {
261
+ Func_void_bool_std__string create_Func_void_bool_std__string(void* NON_NULL swiftClosureWrapper) noexcept;
262
+ inline Func_void_bool_std__string_Wrapper wrap_Func_void_bool_std__string(Func_void_bool_std__string value) noexcept {
238
263
  return Func_void_bool_std__string_Wrapper(std::move(value));
239
264
  }
240
265
 
@@ -249,14 +274,14 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
249
274
  class Func_void_bool_double_std__string_Wrapper final {
250
275
  public:
251
276
  explicit Func_void_bool_double_std__string_Wrapper(std::function<void(bool /* success */, double /* rssi */, const std::string& /* error */)>&& func): _function(std::make_unique<std::function<void(bool /* success */, double /* rssi */, const std::string& /* error */)>>(std::move(func))) {}
252
- inline void call(bool success, double rssi, std::string error) const {
277
+ inline void call(bool success, double rssi, std::string error) const noexcept {
253
278
  _function->operator()(success, rssi, error);
254
279
  }
255
280
  private:
256
281
  std::unique_ptr<std::function<void(bool /* success */, double /* rssi */, const std::string& /* error */)>> _function;
257
282
  } SWIFT_NONCOPYABLE;
258
- Func_void_bool_double_std__string create_Func_void_bool_double_std__string(void* _Nonnull swiftClosureWrapper);
259
- inline Func_void_bool_double_std__string_Wrapper wrap_Func_void_bool_double_std__string(Func_void_bool_double_std__string value) {
283
+ Func_void_bool_double_std__string create_Func_void_bool_double_std__string(void* NON_NULL swiftClosureWrapper) noexcept;
284
+ inline Func_void_bool_double_std__string_Wrapper wrap_Func_void_bool_double_std__string(Func_void_bool_double_std__string value) noexcept {
260
285
  return Func_void_bool_double_std__string_Wrapper(std::move(value));
261
286
  }
262
287
 
@@ -271,14 +296,14 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
271
296
  class Func_void_bool_std__shared_ptr_ArrayBuffer__std__string_Wrapper final {
272
297
  public:
273
298
  explicit Func_void_bool_std__shared_ptr_ArrayBuffer__std__string_Wrapper(std::function<void(bool /* success */, const std::shared_ptr<ArrayBuffer>& /* data */, const std::string& /* error */)>&& func): _function(std::make_unique<std::function<void(bool /* success */, const std::shared_ptr<ArrayBuffer>& /* data */, const std::string& /* error */)>>(std::move(func))) {}
274
- inline void call(bool success, ArrayBufferHolder data, std::string error) const {
299
+ inline void call(bool success, ArrayBufferHolder data, std::string error) const noexcept {
275
300
  _function->operator()(success, data.getArrayBuffer(), error);
276
301
  }
277
302
  private:
278
303
  std::unique_ptr<std::function<void(bool /* success */, const std::shared_ptr<ArrayBuffer>& /* data */, const std::string& /* error */)>> _function;
279
304
  } SWIFT_NONCOPYABLE;
280
- Func_void_bool_std__shared_ptr_ArrayBuffer__std__string create_Func_void_bool_std__shared_ptr_ArrayBuffer__std__string(void* _Nonnull swiftClosureWrapper);
281
- inline Func_void_bool_std__shared_ptr_ArrayBuffer__std__string_Wrapper wrap_Func_void_bool_std__shared_ptr_ArrayBuffer__std__string(Func_void_bool_std__shared_ptr_ArrayBuffer__std__string value) {
305
+ Func_void_bool_std__shared_ptr_ArrayBuffer__std__string create_Func_void_bool_std__shared_ptr_ArrayBuffer__std__string(void* NON_NULL swiftClosureWrapper) noexcept;
306
+ inline Func_void_bool_std__shared_ptr_ArrayBuffer__std__string_Wrapper wrap_Func_void_bool_std__shared_ptr_ArrayBuffer__std__string(Func_void_bool_std__shared_ptr_ArrayBuffer__std__string value) noexcept {
282
307
  return Func_void_bool_std__shared_ptr_ArrayBuffer__std__string_Wrapper(std::move(value));
283
308
  }
284
309
 
@@ -293,14 +318,14 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
293
318
  class Func_void_std__string_std__shared_ptr_ArrayBuffer__Wrapper final {
294
319
  public:
295
320
  explicit Func_void_std__string_std__shared_ptr_ArrayBuffer__Wrapper(std::function<void(const std::string& /* characteristicId */, const std::shared_ptr<ArrayBuffer>& /* data */)>&& func): _function(std::make_unique<std::function<void(const std::string& /* characteristicId */, const std::shared_ptr<ArrayBuffer>& /* data */)>>(std::move(func))) {}
296
- inline void call(std::string characteristicId, ArrayBufferHolder data) const {
321
+ inline void call(std::string characteristicId, ArrayBufferHolder data) const noexcept {
297
322
  _function->operator()(characteristicId, data.getArrayBuffer());
298
323
  }
299
324
  private:
300
325
  std::unique_ptr<std::function<void(const std::string& /* characteristicId */, const std::shared_ptr<ArrayBuffer>& /* data */)>> _function;
301
326
  } SWIFT_NONCOPYABLE;
302
- Func_void_std__string_std__shared_ptr_ArrayBuffer_ create_Func_void_std__string_std__shared_ptr_ArrayBuffer_(void* _Nonnull swiftClosureWrapper);
303
- inline Func_void_std__string_std__shared_ptr_ArrayBuffer__Wrapper wrap_Func_void_std__string_std__shared_ptr_ArrayBuffer_(Func_void_std__string_std__shared_ptr_ArrayBuffer_ value) {
327
+ Func_void_std__string_std__shared_ptr_ArrayBuffer_ create_Func_void_std__string_std__shared_ptr_ArrayBuffer_(void* NON_NULL swiftClosureWrapper) noexcept;
328
+ inline Func_void_std__string_std__shared_ptr_ArrayBuffer__Wrapper wrap_Func_void_std__string_std__shared_ptr_ArrayBuffer_(Func_void_std__string_std__shared_ptr_ArrayBuffer_ value) noexcept {
304
329
  return Func_void_std__string_std__shared_ptr_ArrayBuffer__Wrapper(std::move(value));
305
330
  }
306
331
 
@@ -315,14 +340,14 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
315
340
  class Func_void_BLEState_Wrapper final {
316
341
  public:
317
342
  explicit Func_void_BLEState_Wrapper(std::function<void(BLEState /* state */)>&& func): _function(std::make_unique<std::function<void(BLEState /* state */)>>(std::move(func))) {}
318
- inline void call(int state) const {
343
+ inline void call(int state) const noexcept {
319
344
  _function->operator()(static_cast<BLEState>(state));
320
345
  }
321
346
  private:
322
347
  std::unique_ptr<std::function<void(BLEState /* state */)>> _function;
323
348
  } SWIFT_NONCOPYABLE;
324
- Func_void_BLEState create_Func_void_BLEState(void* _Nonnull swiftClosureWrapper);
325
- inline Func_void_BLEState_Wrapper wrap_Func_void_BLEState(Func_void_BLEState value) {
349
+ Func_void_BLEState create_Func_void_BLEState(void* NON_NULL swiftClosureWrapper) noexcept;
350
+ inline Func_void_BLEState_Wrapper wrap_Func_void_BLEState(Func_void_BLEState value) noexcept {
326
351
  return Func_void_BLEState_Wrapper(std::move(value));
327
352
  }
328
353
 
@@ -331,10 +356,10 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
331
356
  * Specialized version of `std::shared_ptr<Promise<void>>`.
332
357
  */
333
358
  using std__shared_ptr_Promise_void__ = std::shared_ptr<Promise<void>>;
334
- inline std::shared_ptr<Promise<void>> create_std__shared_ptr_Promise_void__() {
359
+ inline std::shared_ptr<Promise<void>> create_std__shared_ptr_Promise_void__() noexcept {
335
360
  return Promise<void>::create();
336
361
  }
337
- inline PromiseHolder<void> wrap_std__shared_ptr_Promise_void__(std::shared_ptr<Promise<void>> promise) {
362
+ inline PromiseHolder<void> wrap_std__shared_ptr_Promise_void__(std::shared_ptr<Promise<void>> promise) noexcept {
338
363
  return PromiseHolder<void>(std::move(promise));
339
364
  }
340
365
 
@@ -349,14 +374,14 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
349
374
  class Func_void_Wrapper final {
350
375
  public:
351
376
  explicit Func_void_Wrapper(std::function<void()>&& func): _function(std::make_unique<std::function<void()>>(std::move(func))) {}
352
- inline void call() const {
377
+ inline void call() const noexcept {
353
378
  _function->operator()();
354
379
  }
355
380
  private:
356
381
  std::unique_ptr<std::function<void()>> _function;
357
382
  } SWIFT_NONCOPYABLE;
358
- Func_void create_Func_void(void* _Nonnull swiftClosureWrapper);
359
- inline Func_void_Wrapper wrap_Func_void(Func_void value) {
383
+ Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept;
384
+ inline Func_void_Wrapper wrap_Func_void(Func_void value) noexcept {
360
385
  return Func_void_Wrapper(std::move(value));
361
386
  }
362
387
 
@@ -371,14 +396,14 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
371
396
  class Func_void_std__exception_ptr_Wrapper final {
372
397
  public:
373
398
  explicit Func_void_std__exception_ptr_Wrapper(std::function<void(const std::exception_ptr& /* error */)>&& func): _function(std::make_unique<std::function<void(const std::exception_ptr& /* error */)>>(std::move(func))) {}
374
- inline void call(std::exception_ptr error) const {
399
+ inline void call(std::exception_ptr error) const noexcept {
375
400
  _function->operator()(error);
376
401
  }
377
402
  private:
378
403
  std::unique_ptr<std::function<void(const std::exception_ptr& /* error */)>> _function;
379
404
  } SWIFT_NONCOPYABLE;
380
- Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* _Nonnull swiftClosureWrapper);
381
- inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) {
405
+ Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept;
406
+ inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept {
382
407
  return Func_void_std__exception_ptr_Wrapper(std::move(value));
383
408
  }
384
409
 
@@ -387,82 +412,82 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
387
412
  * Specialized version of `std::shared_ptr<HybridNativeBleNitroSpec>`.
388
413
  */
389
414
  using std__shared_ptr_HybridNativeBleNitroSpec_ = std::shared_ptr<HybridNativeBleNitroSpec>;
390
- std::shared_ptr<HybridNativeBleNitroSpec> create_std__shared_ptr_HybridNativeBleNitroSpec_(void* _Nonnull swiftUnsafePointer);
391
- void* _Nonnull get_std__shared_ptr_HybridNativeBleNitroSpec_(std__shared_ptr_HybridNativeBleNitroSpec_ cppType);
415
+ std::shared_ptr<HybridNativeBleNitroSpec> create_std__shared_ptr_HybridNativeBleNitroSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
416
+ void* NON_NULL get_std__shared_ptr_HybridNativeBleNitroSpec_(std__shared_ptr_HybridNativeBleNitroSpec_ cppType);
392
417
 
393
418
  // pragma MARK: std::weak_ptr<HybridNativeBleNitroSpec>
394
419
  using std__weak_ptr_HybridNativeBleNitroSpec_ = std::weak_ptr<HybridNativeBleNitroSpec>;
395
- inline std__weak_ptr_HybridNativeBleNitroSpec_ weakify_std__shared_ptr_HybridNativeBleNitroSpec_(const std::shared_ptr<HybridNativeBleNitroSpec>& strong) { return strong; }
420
+ inline std__weak_ptr_HybridNativeBleNitroSpec_ weakify_std__shared_ptr_HybridNativeBleNitroSpec_(const std::shared_ptr<HybridNativeBleNitroSpec>& strong) noexcept { return strong; }
396
421
 
397
422
  // pragma MARK: Result<void>
398
423
  using Result_void_ = Result<void>;
399
- inline Result_void_ create_Result_void_() {
424
+ inline Result_void_ create_Result_void_() noexcept {
400
425
  return Result<void>::withValue();
401
426
  }
402
- inline Result_void_ create_Result_void_(const std::exception_ptr& error) {
427
+ inline Result_void_ create_Result_void_(const std::exception_ptr& error) noexcept {
403
428
  return Result<void>::withError(error);
404
429
  }
405
430
 
406
431
  // pragma MARK: Result<bool>
407
432
  using Result_bool_ = Result<bool>;
408
- inline Result_bool_ create_Result_bool_(bool value) {
433
+ inline Result_bool_ create_Result_bool_(bool value) noexcept {
409
434
  return Result<bool>::withValue(std::move(value));
410
435
  }
411
- inline Result_bool_ create_Result_bool_(const std::exception_ptr& error) {
436
+ inline Result_bool_ create_Result_bool_(const std::exception_ptr& error) noexcept {
412
437
  return Result<bool>::withError(error);
413
438
  }
414
439
 
415
440
  // pragma MARK: Result<std::vector<BLEDevice>>
416
441
  using Result_std__vector_BLEDevice__ = Result<std::vector<BLEDevice>>;
417
- inline Result_std__vector_BLEDevice__ create_Result_std__vector_BLEDevice__(const std::vector<BLEDevice>& value) {
442
+ inline Result_std__vector_BLEDevice__ create_Result_std__vector_BLEDevice__(const std::vector<BLEDevice>& value) noexcept {
418
443
  return Result<std::vector<BLEDevice>>::withValue(value);
419
444
  }
420
- inline Result_std__vector_BLEDevice__ create_Result_std__vector_BLEDevice__(const std::exception_ptr& error) {
445
+ inline Result_std__vector_BLEDevice__ create_Result_std__vector_BLEDevice__(const std::exception_ptr& error) noexcept {
421
446
  return Result<std::vector<BLEDevice>>::withError(error);
422
447
  }
423
448
 
424
449
  // pragma MARK: Result<double>
425
450
  using Result_double_ = Result<double>;
426
- inline Result_double_ create_Result_double_(double value) {
451
+ inline Result_double_ create_Result_double_(double value) noexcept {
427
452
  return Result<double>::withValue(std::move(value));
428
453
  }
429
- inline Result_double_ create_Result_double_(const std::exception_ptr& error) {
454
+ inline Result_double_ create_Result_double_(const std::exception_ptr& error) noexcept {
430
455
  return Result<double>::withError(error);
431
456
  }
432
457
 
433
458
  // pragma MARK: Result<std::vector<std::string>>
434
459
  using Result_std__vector_std__string__ = Result<std::vector<std::string>>;
435
- inline Result_std__vector_std__string__ create_Result_std__vector_std__string__(const std::vector<std::string>& value) {
460
+ inline Result_std__vector_std__string__ create_Result_std__vector_std__string__(const std::vector<std::string>& value) noexcept {
436
461
  return Result<std::vector<std::string>>::withValue(value);
437
462
  }
438
- inline Result_std__vector_std__string__ create_Result_std__vector_std__string__(const std::exception_ptr& error) {
463
+ inline Result_std__vector_std__string__ create_Result_std__vector_std__string__(const std::exception_ptr& error) noexcept {
439
464
  return Result<std::vector<std::string>>::withError(error);
440
465
  }
441
466
 
442
467
  // pragma MARK: Result<BLEState>
443
468
  using Result_BLEState_ = Result<BLEState>;
444
- inline Result_BLEState_ create_Result_BLEState_(BLEState value) {
469
+ inline Result_BLEState_ create_Result_BLEState_(BLEState value) noexcept {
445
470
  return Result<BLEState>::withValue(std::move(value));
446
471
  }
447
- inline Result_BLEState_ create_Result_BLEState_(const std::exception_ptr& error) {
472
+ inline Result_BLEState_ create_Result_BLEState_(const std::exception_ptr& error) noexcept {
448
473
  return Result<BLEState>::withError(error);
449
474
  }
450
475
 
451
476
  // pragma MARK: Result<OperationResult>
452
477
  using Result_OperationResult_ = Result<OperationResult>;
453
- inline Result_OperationResult_ create_Result_OperationResult_(const OperationResult& value) {
478
+ inline Result_OperationResult_ create_Result_OperationResult_(const OperationResult& value) noexcept {
454
479
  return Result<OperationResult>::withValue(value);
455
480
  }
456
- inline Result_OperationResult_ create_Result_OperationResult_(const std::exception_ptr& error) {
481
+ inline Result_OperationResult_ create_Result_OperationResult_(const std::exception_ptr& error) noexcept {
457
482
  return Result<OperationResult>::withError(error);
458
483
  }
459
484
 
460
485
  // pragma MARK: Result<std::shared_ptr<Promise<void>>>
461
486
  using Result_std__shared_ptr_Promise_void___ = Result<std::shared_ptr<Promise<void>>>;
462
- inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::shared_ptr<Promise<void>>& value) {
487
+ inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::shared_ptr<Promise<void>>& value) noexcept {
463
488
  return Result<std::shared_ptr<Promise<void>>>::withValue(value);
464
489
  }
465
- inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::exception_ptr& error) {
490
+ inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::exception_ptr& error) noexcept {
466
491
  return Result<std::shared_ptr<Promise<void>>>::withError(error);
467
492
  }
468
493
 
@@ -471,28 +496,34 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
471
496
  * Specialized version of `std::optional<std::function<void(const std::vector<BLEDevice>& / * peripherals * /)>>`.
472
497
  */
473
498
  using std__optional_std__function_void_const_std__vector_BLEDevice______peripherals______ = std::optional<std::function<void(const std::vector<BLEDevice>& /* peripherals */)>>;
474
- inline std::optional<std::function<void(const std::vector<BLEDevice>& /* peripherals */)>> create_std__optional_std__function_void_const_std__vector_BLEDevice______peripherals______(const std::function<void(const std::vector<BLEDevice>& /* peripherals */)>& value) {
499
+ inline std::optional<std::function<void(const std::vector<BLEDevice>& /* peripherals */)>> create_std__optional_std__function_void_const_std__vector_BLEDevice______peripherals______(const std::function<void(const std::vector<BLEDevice>& /* peripherals */)>& value) noexcept {
475
500
  return std::optional<std::function<void(const std::vector<BLEDevice>& /* peripherals */)>>(value);
476
501
  }
502
+ inline bool has_value_std__optional_std__function_void_const_std__vector_BLEDevice______peripherals______(const std::optional<std::function<void(const std::vector<BLEDevice>& /* peripherals */)>>& optional) noexcept {
503
+ return optional.has_value();
504
+ }
505
+ inline std::function<void(const std::vector<BLEDevice>& /* peripherals */)> get_std__optional_std__function_void_const_std__vector_BLEDevice______peripherals______(const std::optional<std::function<void(const std::vector<BLEDevice>& /* peripherals */)>>& optional) noexcept {
506
+ return *optional;
507
+ }
477
508
 
478
509
  // pragma MARK: std::shared_ptr<HybridNativeBleNitroFactorySpec>
479
510
  /**
480
511
  * Specialized version of `std::shared_ptr<HybridNativeBleNitroFactorySpec>`.
481
512
  */
482
513
  using std__shared_ptr_HybridNativeBleNitroFactorySpec_ = std::shared_ptr<HybridNativeBleNitroFactorySpec>;
483
- std::shared_ptr<HybridNativeBleNitroFactorySpec> create_std__shared_ptr_HybridNativeBleNitroFactorySpec_(void* _Nonnull swiftUnsafePointer);
484
- void* _Nonnull get_std__shared_ptr_HybridNativeBleNitroFactorySpec_(std__shared_ptr_HybridNativeBleNitroFactorySpec_ cppType);
514
+ std::shared_ptr<HybridNativeBleNitroFactorySpec> create_std__shared_ptr_HybridNativeBleNitroFactorySpec_(void* NON_NULL swiftUnsafePointer) noexcept;
515
+ void* NON_NULL get_std__shared_ptr_HybridNativeBleNitroFactorySpec_(std__shared_ptr_HybridNativeBleNitroFactorySpec_ cppType);
485
516
 
486
517
  // pragma MARK: std::weak_ptr<HybridNativeBleNitroFactorySpec>
487
518
  using std__weak_ptr_HybridNativeBleNitroFactorySpec_ = std::weak_ptr<HybridNativeBleNitroFactorySpec>;
488
- inline std__weak_ptr_HybridNativeBleNitroFactorySpec_ weakify_std__shared_ptr_HybridNativeBleNitroFactorySpec_(const std::shared_ptr<HybridNativeBleNitroFactorySpec>& strong) { return strong; }
519
+ inline std__weak_ptr_HybridNativeBleNitroFactorySpec_ weakify_std__shared_ptr_HybridNativeBleNitroFactorySpec_(const std::shared_ptr<HybridNativeBleNitroFactorySpec>& strong) noexcept { return strong; }
489
520
 
490
521
  // pragma MARK: Result<std::shared_ptr<HybridNativeBleNitroSpec>>
491
522
  using Result_std__shared_ptr_HybridNativeBleNitroSpec__ = Result<std::shared_ptr<HybridNativeBleNitroSpec>>;
492
- inline Result_std__shared_ptr_HybridNativeBleNitroSpec__ create_Result_std__shared_ptr_HybridNativeBleNitroSpec__(const std::shared_ptr<HybridNativeBleNitroSpec>& value) {
523
+ inline Result_std__shared_ptr_HybridNativeBleNitroSpec__ create_Result_std__shared_ptr_HybridNativeBleNitroSpec__(const std::shared_ptr<HybridNativeBleNitroSpec>& value) noexcept {
493
524
  return Result<std::shared_ptr<HybridNativeBleNitroSpec>>::withValue(value);
494
525
  }
495
- inline Result_std__shared_ptr_HybridNativeBleNitroSpec__ create_Result_std__shared_ptr_HybridNativeBleNitroSpec__(const std::exception_ptr& error) {
526
+ inline Result_std__shared_ptr_HybridNativeBleNitroSpec__ create_Result_std__shared_ptr_HybridNativeBleNitroSpec__(const std::exception_ptr& error) noexcept {
496
527
  return Result<std::shared_ptr<HybridNativeBleNitroSpec>>::withError(error);
497
528
  }
498
529
 
@@ -100,7 +100,7 @@ namespace margelo::nitro::co::zyke::ble {
100
100
  }
101
101
  }
102
102
  inline void startScan(const ScanFilter& filter, const std::function<void(const std::optional<BLEDevice>& /* device */, const std::optional<std::string>& /* error */)>& callback) override {
103
- auto __result = _swiftPart.startScan(filter, callback);
103
+ auto __result = _swiftPart.startScan(std::forward<decltype(filter)>(filter), callback);
104
104
  if (__result.hasError()) [[unlikely]] {
105
105
  std::rethrow_exception(__result.error());
106
106
  }
@@ -23,14 +23,9 @@ public final class Func_void_std__optional_BLEDevice__std__optional_std__string_
23
23
 
24
24
  @inline(__always)
25
25
  public func call(device: bridge.std__optional_BLEDevice_, error: bridge.std__optional_std__string_) -> Void {
26
- self.closure({ () -> BLEDevice? in
27
- if let __unwrapped = device.value {
28
- return __unwrapped
29
- } else {
30
- return nil
31
- }
32
- }(), { () -> String? in
33
- if let __unwrapped = error.value {
26
+ self.closure(device.value, { () -> String? in
27
+ if bridge.has_value_std__optional_std__string_(error) {
28
+ let __unwrapped = bridge.get_std__optional_std__string_(error)
34
29
  return String(__unwrapped)
35
30
  } else {
36
31
  return nil
@@ -113,13 +113,15 @@ open class HybridNativeBleNitroFactorySpec_cxx {
113
113
  public final func create(nativeRestoreStateIdentifier: bridge.std__optional_std__string_, restoreStateCallback: bridge.std__optional_std__function_void_const_std__vector_BLEDevice______peripherals______) -> bridge.Result_std__shared_ptr_HybridNativeBleNitroSpec__ {
114
114
  do {
115
115
  let __result = try self.__implementation.create(nativeRestoreStateIdentifier: { () -> String? in
116
- if let __unwrapped = nativeRestoreStateIdentifier.value {
116
+ if bridge.has_value_std__optional_std__string_(nativeRestoreStateIdentifier) {
117
+ let __unwrapped = bridge.get_std__optional_std__string_(nativeRestoreStateIdentifier)
117
118
  return String(__unwrapped)
118
119
  } else {
119
120
  return nil
120
121
  }
121
122
  }(), restoreStateCallback: { () -> ((_ peripherals: [BLEDevice]) -> Void)? in
122
- if let __unwrapped = restoreStateCallback.value {
123
+ if bridge.has_value_std__optional_std__function_void_const_std__vector_BLEDevice______peripherals______(restoreStateCallback) {
124
+ let __unwrapped = bridge.get_std__optional_std__function_void_const_std__vector_BLEDevice______peripherals______(restoreStateCallback)
123
125
  return { () -> ([BLEDevice]) -> Void in
124
126
  let __wrappedFunction = bridge.wrap_Func_void_std__vector_BLEDevice_(__unwrapped)
125
127
  return { (__peripherals: [BLEDevice]) -> Void in
@@ -120,7 +120,8 @@ open class HybridNativeBleNitroSpec_cxx {
120
120
  @inline(__always)
121
121
  set {
122
122
  self.__implementation.restoreStateIdentifier = { () -> String? in
123
- if let __unwrapped = newValue.value {
123
+ if bridge.has_value_std__optional_std__string_(newValue) {
124
+ let __unwrapped = bridge.get_std__optional_std__string_(newValue)
124
125
  return String(__unwrapped)
125
126
  } else {
126
127
  return nil
@@ -231,7 +232,8 @@ open class HybridNativeBleNitroSpec_cxx {
231
232
  __wrappedFunction.call(__success, std.string(__deviceId), std.string(__error))
232
233
  }
233
234
  }(), disconnectCallback: { () -> ((_ deviceId: String, _ interrupted: Bool, _ error: String) -> Void)? in
234
- if let __unwrapped = disconnectCallback.value {
235
+ if bridge.has_value_std__optional_std__function_void_const_std__string_____deviceId_____bool____interrupted_____const_std__string_____error______(disconnectCallback) {
236
+ let __unwrapped = bridge.get_std__optional_std__function_void_const_std__string_____deviceId_____bool____interrupted_____const_std__string_____error______(disconnectCallback)
235
237
  return { () -> (String, Bool, String) -> Void in
236
238
  let __wrappedFunction = bridge.wrap_Func_void_std__string_bool_std__string(__unwrapped)
237
239
  return { (__deviceId: String, __interrupted: Bool, __error: String) -> Void in
@@ -43,7 +43,8 @@ public extension OperationResult {
43
43
  @inline(__always)
44
44
  get {
45
45
  return { () -> String? in
46
- if let __unwrapped = self.__error.value {
46
+ if bridge.has_value_std__optional_std__string_(self.__error) {
47
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__error)
47
48
  return String(__unwrapped)
48
49
  } else {
49
50
  return nil
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `ManufacturerData` to properly resolve imports.
22
27
  namespace margelo::nitro::co::zyke::ble { struct ManufacturerData; }
@@ -80,6 +85,9 @@ namespace margelo::nitro {
80
85
  return false;
81
86
  }
82
87
  jsi::Object obj = value.getObject(runtime);
88
+ if (!nitro::isPlainObject(runtime, obj)) {
89
+ return false;
90
+ }
83
91
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "id"))) return false;
84
92
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "name"))) return false;
85
93
  if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "rssi"))) return false;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `ManufacturerDataEntry` to properly resolve imports.
22
27
  namespace margelo::nitro::co::zyke::ble { struct ManufacturerDataEntry; }
@@ -61,6 +66,9 @@ namespace margelo::nitro {
61
66
  return false;
62
67
  }
63
68
  jsi::Object obj = value.getObject(runtime);
69
+ if (!nitro::isPlainObject(runtime, obj)) {
70
+ return false;
71
+ }
64
72
  if (!JSIConverter<std::vector<margelo::nitro::co::zyke::ble::ManufacturerDataEntry>>::canConvert(runtime, obj.getProperty(runtime, "companyIdentifiers"))) return false;
65
73
  return true;
66
74
  }
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `ArrayBuffer` to properly resolve imports.
22
27
  namespace NitroModules { class ArrayBuffer; }
@@ -64,6 +69,9 @@ namespace margelo::nitro {
64
69
  return false;
65
70
  }
66
71
  jsi::Object obj = value.getObject(runtime);
72
+ if (!nitro::isPlainObject(runtime, obj)) {
73
+ return false;
74
+ }
67
75
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "id"))) return false;
68
76
  if (!JSIConverter<std::shared_ptr<ArrayBuffer>>::canConvert(runtime, obj.getProperty(runtime, "data"))) return false;
69
77
  return true;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
 
22
27
 
@@ -63,6 +68,9 @@ namespace margelo::nitro {
63
68
  return false;
64
69
  }
65
70
  jsi::Object obj = value.getObject(runtime);
71
+ if (!nitro::isPlainObject(runtime, obj)) {
72
+ return false;
73
+ }
66
74
  if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "success"))) return false;
67
75
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "error"))) return false;
68
76
  return true;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `AndroidScanMode` to properly resolve imports.
22
27
  namespace margelo::nitro::co::zyke::ble { enum class AndroidScanMode; }
@@ -71,6 +76,9 @@ namespace margelo::nitro {
71
76
  return false;
72
77
  }
73
78
  jsi::Object obj = value.getObject(runtime);
79
+ if (!nitro::isPlainObject(runtime, obj)) {
80
+ return false;
81
+ }
74
82
  if (!JSIConverter<std::vector<std::string>>::canConvert(runtime, obj.getProperty(runtime, "serviceUUIDs"))) return false;
75
83
  if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "rssiThreshold"))) return false;
76
84
  if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "allowDuplicates"))) return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-ble-nitro",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "High-performance React Native BLE library built on Nitro Modules",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -46,7 +46,7 @@
46
46
  "build:commonjs": "tsc --project tsconfig.commonjs.json",
47
47
  "build:plugin": "tsc --project plugin/tsconfig.json",
48
48
  "prepublishOnly": "npm run build && npm run test",
49
- "nitro-codegen": "nitro-codegen src",
49
+ "nitro-codegen": "nitrogen src",
50
50
  "clean": "rimraf lib && rimraf plugin/build && rimraf nitrogen/generated",
51
51
  "test": "jest",
52
52
  "lint": "eslint src/ --ext .ts,.tsx",
@@ -84,21 +84,21 @@
84
84
  "react-native-nitro-modules": "*"
85
85
  },
86
86
  "devDependencies": {
87
- "@expo/config-plugins": "^10.1.2",
87
+ "@expo/config-plugins": "^54.0.2",
88
88
  "@types/jest": "^29.5.0",
89
- "@types/node": "^20.0.0",
90
- "@types/react": "^19.1.0",
89
+ "@types/node": "^20.19.21",
90
+ "@types/react": "^19.2.2",
91
91
  "@typescript-eslint/eslint-plugin": "^6.21.0",
92
92
  "@typescript-eslint/parser": "^6.21.0",
93
93
  "eslint": "^8.0.0",
94
- "expo-module-scripts": "^4.1.9",
94
+ "expo-module-scripts": "^5.0.7",
95
95
  "jest": "^29.0.0",
96
- "nitro-codegen": "^0.28.0",
97
- "react-native": "^0.81.0",
98
- "react-native-nitro-modules": "^0.28.0",
96
+ "nitrogen": "^0.30.0",
97
+ "react-native": "^0.81.4",
98
+ "react-native-nitro-modules": "^0.30.0",
99
99
  "rimraf": "^6.0.1",
100
- "ts-jest": "^29.4.0",
101
- "typescript": "^5.8.3"
100
+ "ts-jest": "^29.4.5",
101
+ "typescript": "^5.9.3"
102
102
  },
103
103
  "files": [
104
104
  "lib/",