@dawidzawada/bonjour-zeroconf 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/README.md +30 -0
  2. package/android/src/main/java/com/margelo/nitro/dawidzawada/bonjourzeroconf/BonjourZeroconf+AddressResolver.kt +14 -0
  3. package/android/src/main/java/com/margelo/nitro/dawidzawada/bonjourzeroconf/BonjourZeroconf.kt +25 -1
  4. package/ios/AddressResolverError.swift +13 -10
  5. package/ios/BonjourZeroconf+AddressResolver.swift +58 -21
  6. package/ios/BonjourZeroconf.swift +21 -0
  7. package/ios/LocalNetworkAuthorization.swift +0 -1
  8. package/lib/typescript/src/specs/BonjourZeroconf.nitro.d.ts +1 -0
  9. package/lib/typescript/src/specs/BonjourZeroconf.nitro.d.ts.map +1 -1
  10. package/nitrogen/generated/android/c++/JBonjourFail.hpp +1 -1
  11. package/nitrogen/generated/android/c++/JBonjourListener.hpp +1 -1
  12. package/nitrogen/generated/android/c++/JFunc_void.hpp +1 -1
  13. package/nitrogen/generated/android/c++/JFunc_void_BonjourFail.hpp +1 -1
  14. package/nitrogen/generated/android/c++/JFunc_void_bool.hpp +1 -1
  15. package/nitrogen/generated/android/c++/JFunc_void_std__vector_ScanResult_.hpp +1 -1
  16. package/nitrogen/generated/android/c++/JHybridBonjourZeroconfSpec.cpp +35 -8
  17. package/nitrogen/generated/android/c++/JHybridBonjourZeroconfSpec.hpp +2 -1
  18. package/nitrogen/generated/android/c++/JScanOptions.hpp +1 -1
  19. package/nitrogen/generated/android/c++/JScanResult.hpp +1 -1
  20. package/nitrogen/generated/android/dawidzawada_bonjourzeroconf+autolinking.cmake +1 -1
  21. package/nitrogen/generated/android/dawidzawada_bonjourzeroconf+autolinking.gradle +1 -1
  22. package/nitrogen/generated/android/dawidzawada_bonjourzeroconfOnLoad.cpp +1 -1
  23. package/nitrogen/generated/android/dawidzawada_bonjourzeroconfOnLoad.hpp +1 -1
  24. package/nitrogen/generated/android/kotlin/com/margelo/nitro/dawidzawada/bonjourzeroconf/BonjourFail.kt +1 -1
  25. package/nitrogen/generated/android/kotlin/com/margelo/nitro/dawidzawada/bonjourzeroconf/BonjourListener.kt +1 -1
  26. package/nitrogen/generated/android/kotlin/com/margelo/nitro/dawidzawada/bonjourzeroconf/Func_void.kt +1 -1
  27. package/nitrogen/generated/android/kotlin/com/margelo/nitro/dawidzawada/bonjourzeroconf/Func_void_BonjourFail.kt +1 -1
  28. package/nitrogen/generated/android/kotlin/com/margelo/nitro/dawidzawada/bonjourzeroconf/Func_void_bool.kt +1 -1
  29. package/nitrogen/generated/android/kotlin/com/margelo/nitro/dawidzawada/bonjourzeroconf/Func_void_std__vector_ScanResult_.kt +1 -1
  30. package/nitrogen/generated/android/kotlin/com/margelo/nitro/dawidzawada/bonjourzeroconf/HybridBonjourZeroconfSpec.kt +6 -1
  31. package/nitrogen/generated/android/kotlin/com/margelo/nitro/dawidzawada/bonjourzeroconf/ScanOptions.kt +1 -1
  32. package/nitrogen/generated/android/kotlin/com/margelo/nitro/dawidzawada/bonjourzeroconf/ScanResult.kt +1 -1
  33. package/nitrogen/generated/android/kotlin/com/margelo/nitro/dawidzawada/bonjourzeroconf/dawidzawada_bonjourzeroconfOnLoad.kt +1 -1
  34. package/nitrogen/generated/ios/BonjourZeroconf+autolinking.rb +1 -1
  35. package/nitrogen/generated/ios/BonjourZeroconf-Swift-Cxx-Bridge.cpp +17 -17
  36. package/nitrogen/generated/ios/BonjourZeroconf-Swift-Cxx-Bridge.hpp +73 -52
  37. package/nitrogen/generated/ios/BonjourZeroconf-Swift-Cxx-Umbrella.hpp +1 -1
  38. package/nitrogen/generated/ios/BonjourZeroconfAutolinking.mm +1 -1
  39. package/nitrogen/generated/ios/BonjourZeroconfAutolinking.swift +1 -1
  40. package/nitrogen/generated/ios/c++/HybridBonjourZeroconfSpecSwift.cpp +1 -1
  41. package/nitrogen/generated/ios/c++/HybridBonjourZeroconfSpecSwift.hpp +14 -5
  42. package/nitrogen/generated/ios/c++/HybridLocalNetworkPermissionSpecSwift.cpp +1 -1
  43. package/nitrogen/generated/ios/c++/HybridLocalNetworkPermissionSpecSwift.hpp +1 -1
  44. package/nitrogen/generated/ios/swift/BonjourFail.swift +1 -1
  45. package/nitrogen/generated/ios/swift/BonjourListener.swift +1 -1
  46. package/nitrogen/generated/ios/swift/Func_void.swift +1 -1
  47. package/nitrogen/generated/ios/swift/Func_void_BonjourFail.swift +1 -1
  48. package/nitrogen/generated/ios/swift/Func_void_bool.swift +1 -1
  49. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +1 -1
  50. package/nitrogen/generated/ios/swift/Func_void_std__vector_ScanResult_.swift +6 -6
  51. package/nitrogen/generated/ios/swift/HybridBonjourZeroconfSpec.swift +2 -1
  52. package/nitrogen/generated/ios/swift/HybridBonjourZeroconfSpec_cxx.swift +26 -1
  53. package/nitrogen/generated/ios/swift/HybridLocalNetworkPermissionSpec.swift +1 -1
  54. package/nitrogen/generated/ios/swift/HybridLocalNetworkPermissionSpec_cxx.swift +1 -1
  55. package/nitrogen/generated/ios/swift/ScanOptions.swift +1 -1
  56. package/nitrogen/generated/ios/swift/ScanResult.swift +1 -1
  57. package/nitrogen/generated/shared/c++/BonjourFail.hpp +1 -1
  58. package/nitrogen/generated/shared/c++/BonjourListener.hpp +1 -1
  59. package/nitrogen/generated/shared/c++/HybridBonjourZeroconfSpec.cpp +2 -1
  60. package/nitrogen/generated/shared/c++/HybridBonjourZeroconfSpec.hpp +6 -4
  61. package/nitrogen/generated/shared/c++/HybridLocalNetworkPermissionSpec.cpp +1 -1
  62. package/nitrogen/generated/shared/c++/HybridLocalNetworkPermissionSpec.hpp +1 -1
  63. package/nitrogen/generated/shared/c++/ScanOptions.hpp +1 -1
  64. package/nitrogen/generated/shared/c++/ScanResult.hpp +1 -1
  65. package/package.json +1 -1
  66. package/src/specs/BonjourZeroconf.nitro.ts +7 -0
@@ -2,7 +2,7 @@
2
2
  /// HybridBonjourZeroconfSpec.kt
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  package com.margelo.nitro.dawidzawada.bonjourzeroconf
@@ -10,6 +10,7 @@ package com.margelo.nitro.dawidzawada.bonjourzeroconf
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.jni.HybridData
12
12
  import com.facebook.proguard.annotations.DoNotStrip
13
+ import com.margelo.nitro.core.Promise
13
14
  import com.margelo.nitro.core.HybridObject
14
15
 
15
16
  /**
@@ -51,6 +52,10 @@ abstract class HybridBonjourZeroconfSpec: HybridObject() {
51
52
  @Keep
52
53
  abstract fun scan(type: String, domain: String, options: ScanOptions?): Unit
53
54
 
55
+ @DoNotStrip
56
+ @Keep
57
+ abstract fun scanFor(time: Double, type: String, domain: String, options: ScanOptions?): Promise<Array<ScanResult>>
58
+
54
59
  @DoNotStrip
55
60
  @Keep
56
61
  abstract fun stop(): Unit
@@ -2,7 +2,7 @@
2
2
  /// ScanOptions.kt
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  package com.margelo.nitro.dawidzawada.bonjourzeroconf
@@ -2,7 +2,7 @@
2
2
  /// ScanResult.kt
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  package com.margelo.nitro.dawidzawada.bonjourzeroconf
@@ -2,7 +2,7 @@
2
2
  /// dawidzawada_bonjourzeroconfOnLoad.kt
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  package com.margelo.nitro.dawidzawada.bonjourzeroconf
@@ -2,7 +2,7 @@
2
2
  # BonjourZeroconf+autolinking.rb
3
3
  # This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  # https://github.com/mrousavy/nitro
5
- # Copyright © 2025 Marc Rousavy @ Margelo
5
+ # Copyright © 2026 Marc Rousavy @ Margelo
6
6
  #
7
7
 
8
8
  # This is a Ruby script that adds all files generated by Nitrogen
@@ -2,7 +2,7 @@
2
2
  /// BonjourZeroconf-Swift-Cxx-Bridge.cpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #include "BonjourZeroconf-Swift-Cxx-Bridge.hpp"
@@ -15,6 +15,22 @@
15
15
 
16
16
  namespace margelo::nitro::dawidzawada_bonjourzeroconf::bridge::swift {
17
17
 
18
+ // pragma MARK: std::function<void(const std::vector<ScanResult>& /* result */)>
19
+ Func_void_std__vector_ScanResult_ create_Func_void_std__vector_ScanResult_(void* NON_NULL swiftClosureWrapper) noexcept {
20
+ auto swiftClosure = BonjourZeroconf::Func_void_std__vector_ScanResult_::fromUnsafe(swiftClosureWrapper);
21
+ return [swiftClosure = std::move(swiftClosure)](const std::vector<ScanResult>& result) mutable -> void {
22
+ swiftClosure.call(result);
23
+ };
24
+ }
25
+
26
+ // pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
27
+ Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept {
28
+ auto swiftClosure = BonjourZeroconf::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper);
29
+ return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void {
30
+ swiftClosure.call(error);
31
+ };
32
+ }
33
+
18
34
  // pragma MARK: std::function<void()>
19
35
  Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept {
20
36
  auto swiftClosure = BonjourZeroconf::Func_void::fromUnsafe(swiftClosureWrapper);
@@ -23,14 +39,6 @@ namespace margelo::nitro::dawidzawada_bonjourzeroconf::bridge::swift {
23
39
  };
24
40
  }
25
41
 
26
- // pragma MARK: std::function<void(const std::vector<ScanResult>& /* results */)>
27
- Func_void_std__vector_ScanResult_ create_Func_void_std__vector_ScanResult_(void* NON_NULL swiftClosureWrapper) noexcept {
28
- auto swiftClosure = BonjourZeroconf::Func_void_std__vector_ScanResult_::fromUnsafe(swiftClosureWrapper);
29
- return [swiftClosure = std::move(swiftClosure)](const std::vector<ScanResult>& results) mutable -> void {
30
- swiftClosure.call(results);
31
- };
32
- }
33
-
34
42
  // pragma MARK: std::function<void(bool /* isScanning */)>
35
43
  Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept {
36
44
  auto swiftClosure = BonjourZeroconf::Func_void_bool::fromUnsafe(swiftClosureWrapper);
@@ -63,14 +71,6 @@ namespace margelo::nitro::dawidzawada_bonjourzeroconf::bridge::swift {
63
71
  return swiftPart.toUnsafe();
64
72
  }
65
73
 
66
- // pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
67
- Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept {
68
- auto swiftClosure = BonjourZeroconf::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper);
69
- return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void {
70
- swiftClosure.call(error);
71
- };
72
- }
73
-
74
74
  // pragma MARK: std::shared_ptr<HybridLocalNetworkPermissionSpec>
75
75
  std::shared_ptr<HybridLocalNetworkPermissionSpec> create_std__shared_ptr_HybridLocalNetworkPermissionSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
76
76
  BonjourZeroconf::HybridLocalNetworkPermissionSpec_cxx swiftPart = BonjourZeroconf::HybridLocalNetworkPermissionSpec_cxx::fromUnsafe(swiftUnsafePointer);
@@ -2,7 +2,7 @@
2
2
  /// BonjourZeroconf-Swift-Cxx-Bridge.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -80,28 +80,6 @@ namespace margelo::nitro::dawidzawada_bonjourzeroconf::bridge::swift {
80
80
  return *optional;
81
81
  }
82
82
 
83
- // pragma MARK: std::function<void()>
84
- /**
85
- * Specialized version of `std::function<void()>`.
86
- */
87
- using Func_void = std::function<void()>;
88
- /**
89
- * Wrapper class for a `std::function<void()>`, this can be used from Swift.
90
- */
91
- class Func_void_Wrapper final {
92
- public:
93
- explicit Func_void_Wrapper(std::function<void()>&& func): _function(std::make_unique<std::function<void()>>(std::move(func))) {}
94
- inline void call() const noexcept {
95
- _function->operator()();
96
- }
97
- private:
98
- std::unique_ptr<std::function<void()>> _function;
99
- } SWIFT_NONCOPYABLE;
100
- Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept;
101
- inline Func_void_Wrapper wrap_Func_void(Func_void value) noexcept {
102
- return Func_void_Wrapper(std::move(value));
103
- }
104
-
105
83
  // pragma MARK: std::optional<std::string>
106
84
  /**
107
85
  * Specialized version of `std::optional<std::string>`.
@@ -128,28 +106,84 @@ namespace margelo::nitro::dawidzawada_bonjourzeroconf::bridge::swift {
128
106
  return vector;
129
107
  }
130
108
 
131
- // pragma MARK: std::function<void(const std::vector<ScanResult>& /* results */)>
109
+ // pragma MARK: std::shared_ptr<Promise<std::vector<ScanResult>>>
110
+ /**
111
+ * Specialized version of `std::shared_ptr<Promise<std::vector<ScanResult>>>`.
112
+ */
113
+ using std__shared_ptr_Promise_std__vector_ScanResult___ = std::shared_ptr<Promise<std::vector<ScanResult>>>;
114
+ inline std::shared_ptr<Promise<std::vector<ScanResult>>> create_std__shared_ptr_Promise_std__vector_ScanResult___() noexcept {
115
+ return Promise<std::vector<ScanResult>>::create();
116
+ }
117
+ inline PromiseHolder<std::vector<ScanResult>> wrap_std__shared_ptr_Promise_std__vector_ScanResult___(std::shared_ptr<Promise<std::vector<ScanResult>>> promise) noexcept {
118
+ return PromiseHolder<std::vector<ScanResult>>(std::move(promise));
119
+ }
120
+
121
+ // pragma MARK: std::function<void(const std::vector<ScanResult>& /* result */)>
132
122
  /**
133
123
  * Specialized version of `std::function<void(const std::vector<ScanResult>&)>`.
134
124
  */
135
- using Func_void_std__vector_ScanResult_ = std::function<void(const std::vector<ScanResult>& /* results */)>;
125
+ using Func_void_std__vector_ScanResult_ = std::function<void(const std::vector<ScanResult>& /* result */)>;
136
126
  /**
137
- * Wrapper class for a `std::function<void(const std::vector<ScanResult>& / * results * /)>`, this can be used from Swift.
127
+ * Wrapper class for a `std::function<void(const std::vector<ScanResult>& / * result * /)>`, this can be used from Swift.
138
128
  */
139
129
  class Func_void_std__vector_ScanResult__Wrapper final {
140
130
  public:
141
- explicit Func_void_std__vector_ScanResult__Wrapper(std::function<void(const std::vector<ScanResult>& /* results */)>&& func): _function(std::make_unique<std::function<void(const std::vector<ScanResult>& /* results */)>>(std::move(func))) {}
142
- inline void call(std::vector<ScanResult> results) const noexcept {
143
- _function->operator()(results);
131
+ explicit Func_void_std__vector_ScanResult__Wrapper(std::function<void(const std::vector<ScanResult>& /* result */)>&& func): _function(std::make_unique<std::function<void(const std::vector<ScanResult>& /* result */)>>(std::move(func))) {}
132
+ inline void call(std::vector<ScanResult> result) const noexcept {
133
+ _function->operator()(result);
144
134
  }
145
135
  private:
146
- std::unique_ptr<std::function<void(const std::vector<ScanResult>& /* results */)>> _function;
136
+ std::unique_ptr<std::function<void(const std::vector<ScanResult>& /* result */)>> _function;
147
137
  } SWIFT_NONCOPYABLE;
148
138
  Func_void_std__vector_ScanResult_ create_Func_void_std__vector_ScanResult_(void* NON_NULL swiftClosureWrapper) noexcept;
149
139
  inline Func_void_std__vector_ScanResult__Wrapper wrap_Func_void_std__vector_ScanResult_(Func_void_std__vector_ScanResult_ value) noexcept {
150
140
  return Func_void_std__vector_ScanResult__Wrapper(std::move(value));
151
141
  }
152
142
 
143
+ // pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
144
+ /**
145
+ * Specialized version of `std::function<void(const std::exception_ptr&)>`.
146
+ */
147
+ using Func_void_std__exception_ptr = std::function<void(const std::exception_ptr& /* error */)>;
148
+ /**
149
+ * Wrapper class for a `std::function<void(const std::exception_ptr& / * error * /)>`, this can be used from Swift.
150
+ */
151
+ class Func_void_std__exception_ptr_Wrapper final {
152
+ public:
153
+ 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))) {}
154
+ inline void call(std::exception_ptr error) const noexcept {
155
+ _function->operator()(error);
156
+ }
157
+ private:
158
+ std::unique_ptr<std::function<void(const std::exception_ptr& /* error */)>> _function;
159
+ } SWIFT_NONCOPYABLE;
160
+ Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept;
161
+ inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept {
162
+ return Func_void_std__exception_ptr_Wrapper(std::move(value));
163
+ }
164
+
165
+ // pragma MARK: std::function<void()>
166
+ /**
167
+ * Specialized version of `std::function<void()>`.
168
+ */
169
+ using Func_void = std::function<void()>;
170
+ /**
171
+ * Wrapper class for a `std::function<void()>`, this can be used from Swift.
172
+ */
173
+ class Func_void_Wrapper final {
174
+ public:
175
+ explicit Func_void_Wrapper(std::function<void()>&& func): _function(std::make_unique<std::function<void()>>(std::move(func))) {}
176
+ inline void call() const noexcept {
177
+ _function->operator()();
178
+ }
179
+ private:
180
+ std::unique_ptr<std::function<void()>> _function;
181
+ } SWIFT_NONCOPYABLE;
182
+ Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept;
183
+ inline Func_void_Wrapper wrap_Func_void(Func_void value) noexcept {
184
+ return Func_void_Wrapper(std::move(value));
185
+ }
186
+
153
187
  // pragma MARK: std::function<void(bool /* isScanning */)>
154
188
  /**
155
189
  * Specialized version of `std::function<void(bool)>`.
@@ -215,6 +249,15 @@ namespace margelo::nitro::dawidzawada_bonjourzeroconf::bridge::swift {
215
249
  return Result<void>::withError(error);
216
250
  }
217
251
 
252
+ // pragma MARK: Result<std::shared_ptr<Promise<std::vector<ScanResult>>>>
253
+ using Result_std__shared_ptr_Promise_std__vector_ScanResult____ = Result<std::shared_ptr<Promise<std::vector<ScanResult>>>>;
254
+ inline Result_std__shared_ptr_Promise_std__vector_ScanResult____ create_Result_std__shared_ptr_Promise_std__vector_ScanResult____(const std::shared_ptr<Promise<std::vector<ScanResult>>>& value) noexcept {
255
+ return Result<std::shared_ptr<Promise<std::vector<ScanResult>>>>::withValue(value);
256
+ }
257
+ inline Result_std__shared_ptr_Promise_std__vector_ScanResult____ create_Result_std__shared_ptr_Promise_std__vector_ScanResult____(const std::exception_ptr& error) noexcept {
258
+ return Result<std::shared_ptr<Promise<std::vector<ScanResult>>>>::withError(error);
259
+ }
260
+
218
261
  // pragma MARK: Result<BonjourListener>
219
262
  using Result_BonjourListener_ = Result<BonjourListener>;
220
263
  inline Result_BonjourListener_ create_Result_BonjourListener_(const BonjourListener& value) noexcept {
@@ -236,28 +279,6 @@ namespace margelo::nitro::dawidzawada_bonjourzeroconf::bridge::swift {
236
279
  return PromiseHolder<bool>(std::move(promise));
237
280
  }
238
281
 
239
- // pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
240
- /**
241
- * Specialized version of `std::function<void(const std::exception_ptr&)>`.
242
- */
243
- using Func_void_std__exception_ptr = std::function<void(const std::exception_ptr& /* error */)>;
244
- /**
245
- * Wrapper class for a `std::function<void(const std::exception_ptr& / * error * /)>`, this can be used from Swift.
246
- */
247
- class Func_void_std__exception_ptr_Wrapper final {
248
- public:
249
- 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))) {}
250
- inline void call(std::exception_ptr error) const noexcept {
251
- _function->operator()(error);
252
- }
253
- private:
254
- std::unique_ptr<std::function<void(const std::exception_ptr& /* error */)>> _function;
255
- } SWIFT_NONCOPYABLE;
256
- Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept;
257
- inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept {
258
- return Func_void_std__exception_ptr_Wrapper(std::move(value));
259
- }
260
-
261
282
  // pragma MARK: std::shared_ptr<HybridLocalNetworkPermissionSpec>
262
283
  /**
263
284
  * Specialized version of `std::shared_ptr<HybridLocalNetworkPermissionSpec>`.
@@ -2,7 +2,7 @@
2
2
  /// BonjourZeroconf-Swift-Cxx-Umbrella.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -2,7 +2,7 @@
2
2
  /// BonjourZeroconfAutolinking.mm
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #import <Foundation/Foundation.h>
@@ -2,7 +2,7 @@
2
2
  /// BonjourZeroconfAutolinking.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  public final class BonjourZeroconfAutolinking {
@@ -2,7 +2,7 @@
2
2
  /// HybridBonjourZeroconfSpecSwift.cpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #include "HybridBonjourZeroconfSpecSwift.hpp"
@@ -2,7 +2,7 @@
2
2
  /// HybridBonjourZeroconfSpecSwift.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -14,20 +14,21 @@ namespace BonjourZeroconf { class HybridBonjourZeroconfSpec_cxx; }
14
14
 
15
15
  // Forward declaration of `ScanOptions` to properly resolve imports.
16
16
  namespace margelo::nitro::dawidzawada_bonjourzeroconf { struct ScanOptions; }
17
- // Forward declaration of `BonjourListener` to properly resolve imports.
18
- namespace margelo::nitro::dawidzawada_bonjourzeroconf { struct BonjourListener; }
19
17
  // Forward declaration of `ScanResult` to properly resolve imports.
20
18
  namespace margelo::nitro::dawidzawada_bonjourzeroconf { struct ScanResult; }
19
+ // Forward declaration of `BonjourListener` to properly resolve imports.
20
+ namespace margelo::nitro::dawidzawada_bonjourzeroconf { struct BonjourListener; }
21
21
  // Forward declaration of `BonjourFail` to properly resolve imports.
22
22
  namespace margelo::nitro::dawidzawada_bonjourzeroconf { enum class BonjourFail; }
23
23
 
24
24
  #include <string>
25
25
  #include "ScanOptions.hpp"
26
26
  #include <optional>
27
- #include "BonjourListener.hpp"
28
- #include <functional>
29
27
  #include "ScanResult.hpp"
30
28
  #include <vector>
29
+ #include <NitroModules/Promise.hpp>
30
+ #include "BonjourListener.hpp"
31
+ #include <functional>
31
32
  #include "BonjourFail.hpp"
32
33
 
33
34
  #include "BonjourZeroconf-Swift-Cxx-Umbrella.hpp"
@@ -82,6 +83,14 @@ namespace margelo::nitro::dawidzawada_bonjourzeroconf {
82
83
  std::rethrow_exception(__result.error());
83
84
  }
84
85
  }
86
+ inline std::shared_ptr<Promise<std::vector<ScanResult>>> scanFor(double time, const std::string& type, const std::string& domain, const std::optional<ScanOptions>& options) override {
87
+ auto __result = _swiftPart.scanFor(std::forward<decltype(time)>(time), type, domain, options);
88
+ if (__result.hasError()) [[unlikely]] {
89
+ std::rethrow_exception(__result.error());
90
+ }
91
+ auto __value = std::move(__result.value());
92
+ return __value;
93
+ }
85
94
  inline void stop() override {
86
95
  auto __result = _swiftPart.stop();
87
96
  if (__result.hasError()) [[unlikely]] {
@@ -2,7 +2,7 @@
2
2
  /// HybridLocalNetworkPermissionSpecSwift.cpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #include "HybridLocalNetworkPermissionSpecSwift.hpp"
@@ -2,7 +2,7 @@
2
2
  /// HybridLocalNetworkPermissionSpecSwift.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -2,7 +2,7 @@
2
2
  /// BonjourFail.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  /**
@@ -2,7 +2,7 @@
2
2
  /// BonjourListener.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  import Foundation
@@ -2,7 +2,7 @@
2
2
  /// Func_void.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  import Foundation
@@ -2,7 +2,7 @@
2
2
  /// Func_void_BonjourFail.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  import Foundation
@@ -2,7 +2,7 @@
2
2
  /// Func_void_bool.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  import Foundation
@@ -2,7 +2,7 @@
2
2
  /// Func_void_std__exception_ptr.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  import Foundation
@@ -2,28 +2,28 @@
2
2
  /// Func_void_std__vector_ScanResult_.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  import Foundation
9
9
  import NitroModules
10
10
 
11
11
  /**
12
- * Wraps a Swift `(_ results: [ScanResult]) -> Void` as a class.
12
+ * Wraps a Swift `(_ value: [ScanResult]) -> Void` as a class.
13
13
  * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
14
14
  */
15
15
  public final class Func_void_std__vector_ScanResult_ {
16
16
  public typealias bridge = margelo.nitro.dawidzawada_bonjourzeroconf.bridge.swift
17
17
 
18
- private let closure: (_ results: [ScanResult]) -> Void
18
+ private let closure: (_ value: [ScanResult]) -> Void
19
19
 
20
- public init(_ closure: @escaping (_ results: [ScanResult]) -> Void) {
20
+ public init(_ closure: @escaping (_ value: [ScanResult]) -> Void) {
21
21
  self.closure = closure
22
22
  }
23
23
 
24
24
  @inline(__always)
25
- public func call(results: bridge.std__vector_ScanResult_) -> Void {
26
- self.closure(results.map({ __item in __item }))
25
+ public func call(value: bridge.std__vector_ScanResult_) -> Void {
26
+ self.closure(value.map({ __item in __item }))
27
27
  }
28
28
 
29
29
  /**
@@ -2,7 +2,7 @@
2
2
  /// HybridBonjourZeroconfSpec.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  import Foundation
@@ -15,6 +15,7 @@ public protocol HybridBonjourZeroconfSpec_protocol: HybridObject {
15
15
 
16
16
  // Methods
17
17
  func scan(type: String, domain: String, options: ScanOptions?) throws -> Void
18
+ func scanFor(time: Double, type: String, domain: String, options: ScanOptions?) throws -> Promise<[ScanResult]>
18
19
  func stop() throws -> Void
19
20
  func listenForScanResults(onResult: @escaping (_ results: [ScanResult]) -> Void) throws -> BonjourListener
20
21
  func listenForScanState(onChange: @escaping (_ isScanning: Bool) -> Void) throws -> BonjourListener
@@ -2,7 +2,7 @@
2
2
  /// HybridBonjourZeroconfSpec_cxx.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  import Foundation
@@ -133,6 +133,31 @@ open class HybridBonjourZeroconfSpec_cxx {
133
133
  }
134
134
  }
135
135
 
136
+ @inline(__always)
137
+ public final func scanFor(time: Double, type: std.string, domain: std.string, options: bridge.std__optional_ScanOptions_) -> bridge.Result_std__shared_ptr_Promise_std__vector_ScanResult____ {
138
+ do {
139
+ let __result = try self.__implementation.scanFor(time: time, type: String(type), domain: String(domain), options: options.value)
140
+ let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__vector_ScanResult___ in
141
+ let __promise = bridge.create_std__shared_ptr_Promise_std__vector_ScanResult___()
142
+ let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__vector_ScanResult___(__promise)
143
+ __result
144
+ .then({ __result in __promiseHolder.resolve({ () -> bridge.std__vector_ScanResult_ in
145
+ var __vector = bridge.create_std__vector_ScanResult_(__result.count)
146
+ for __item in __result {
147
+ __vector.push_back(__item)
148
+ }
149
+ return __vector
150
+ }()) })
151
+ .catch({ __error in __promiseHolder.reject(__error.toCpp()) })
152
+ return __promise
153
+ }()
154
+ return bridge.create_Result_std__shared_ptr_Promise_std__vector_ScanResult____(__resultCpp)
155
+ } catch (let __error) {
156
+ let __exceptionPtr = __error.toCpp()
157
+ return bridge.create_Result_std__shared_ptr_Promise_std__vector_ScanResult____(__exceptionPtr)
158
+ }
159
+ }
160
+
136
161
  @inline(__always)
137
162
  public final func stop() -> bridge.Result_void_ {
138
163
  do {
@@ -2,7 +2,7 @@
2
2
  /// HybridLocalNetworkPermissionSpec.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  import Foundation
@@ -2,7 +2,7 @@
2
2
  /// HybridLocalNetworkPermissionSpec_cxx.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  import Foundation
@@ -2,7 +2,7 @@
2
2
  /// ScanOptions.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  import Foundation
@@ -2,7 +2,7 @@
2
2
  /// ScanResult.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  import Foundation
@@ -2,7 +2,7 @@
2
2
  /// BonjourFail.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -2,7 +2,7 @@
2
2
  /// BonjourListener.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once