munim-wifi 0.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 (96) hide show
  1. package/LICENSE +21 -0
  2. package/MunimWifi.podspec +31 -0
  3. package/README.md +591 -0
  4. package/android/CMakeLists.txt +32 -0
  5. package/android/build.gradle +148 -0
  6. package/android/fix-prefab.gradle +51 -0
  7. package/android/gradle.properties +5 -0
  8. package/android/src/main/AndroidManifest.xml +6 -0
  9. package/android/src/main/cpp/cpp-adapter.cpp +6 -0
  10. package/android/src/main/java/com/munimwifi/HybridMunimWifi.kt +283 -0
  11. package/android/src/main/java/com/munimwifi/MunimWifiPackage.kt +20 -0
  12. package/ios/Bridge.h +8 -0
  13. package/ios/HybridMunimWifi.swift +222 -0
  14. package/lib/commonjs/index.js +216 -0
  15. package/lib/commonjs/index.js.map +1 -0
  16. package/lib/commonjs/package.json +1 -0
  17. package/lib/commonjs/specs/munim-wifi.nitro.js +6 -0
  18. package/lib/commonjs/specs/munim-wifi.nitro.js.map +1 -0
  19. package/lib/module/index.js +198 -0
  20. package/lib/module/index.js.map +1 -0
  21. package/lib/module/specs/munim-wifi.nitro.js +4 -0
  22. package/lib/module/specs/munim-wifi.nitro.js.map +1 -0
  23. package/lib/typescript/src/index.d.ts +120 -0
  24. package/lib/typescript/src/index.d.ts.map +1 -0
  25. package/lib/typescript/src/specs/munim-wifi.nitro.d.ts +118 -0
  26. package/lib/typescript/src/specs/munim-wifi.nitro.d.ts.map +1 -0
  27. package/nitro.json +24 -0
  28. package/nitrogen/generated/.gitattributes +1 -0
  29. package/nitrogen/generated/android/MunimWifi+autolinking.cmake +85 -0
  30. package/nitrogen/generated/android/MunimWifi+autolinking.gradle +27 -0
  31. package/nitrogen/generated/android/MunimWifiOnLoad.cpp +44 -0
  32. package/nitrogen/generated/android/MunimWifiOnLoad.hpp +25 -0
  33. package/nitrogen/generated/android/c++/JChannelInfo.hpp +61 -0
  34. package/nitrogen/generated/android/c++/JHybridMunimWifiSpec.cpp +262 -0
  35. package/nitrogen/generated/android/c++/JHybridMunimWifiSpec.hpp +78 -0
  36. package/nitrogen/generated/android/c++/JLocation.hpp +61 -0
  37. package/nitrogen/generated/android/c++/JScanOptions.hpp +61 -0
  38. package/nitrogen/generated/android/c++/JVariant_NullType_ChannelInfo.cpp +26 -0
  39. package/nitrogen/generated/android/c++/JVariant_NullType_ChannelInfo.hpp +71 -0
  40. package/nitrogen/generated/android/c++/JVariant_NullType_Double.cpp +26 -0
  41. package/nitrogen/generated/android/c++/JVariant_NullType_Double.hpp +69 -0
  42. package/nitrogen/generated/android/c++/JVariant_NullType_String.cpp +26 -0
  43. package/nitrogen/generated/android/c++/JVariant_NullType_String.hpp +70 -0
  44. package/nitrogen/generated/android/c++/JVariant_NullType_WifiNetwork.cpp +26 -0
  45. package/nitrogen/generated/android/c++/JVariant_NullType_WifiNetwork.hpp +73 -0
  46. package/nitrogen/generated/android/c++/JWifiFingerprint.hpp +89 -0
  47. package/nitrogen/generated/android/c++/JWifiNetwork.hpp +86 -0
  48. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimwifi/ChannelInfo.kt +41 -0
  49. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimwifi/HybridMunimWifiSpec.kt +107 -0
  50. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimwifi/Location.kt +41 -0
  51. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimwifi/MunimWifiOnLoad.kt +35 -0
  52. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimwifi/ScanOptions.kt +41 -0
  53. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimwifi/Variant_NullType_ChannelInfo.kt +59 -0
  54. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimwifi/Variant_NullType_Double.kt +59 -0
  55. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimwifi/Variant_NullType_String.kt +59 -0
  56. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimwifi/Variant_NullType_WifiNetwork.kt +59 -0
  57. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimwifi/WifiFingerprint.kt +44 -0
  58. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimwifi/WifiNetwork.kt +59 -0
  59. package/nitrogen/generated/ios/MunimWifi+autolinking.rb +60 -0
  60. package/nitrogen/generated/ios/MunimWifi-Swift-Cxx-Bridge.cpp +105 -0
  61. package/nitrogen/generated/ios/MunimWifi-Swift-Cxx-Bridge.hpp +653 -0
  62. package/nitrogen/generated/ios/MunimWifi-Swift-Cxx-Umbrella.hpp +64 -0
  63. package/nitrogen/generated/ios/MunimWifiAutolinking.mm +33 -0
  64. package/nitrogen/generated/ios/MunimWifiAutolinking.swift +26 -0
  65. package/nitrogen/generated/ios/c++/HybridMunimWifiSpecSwift.cpp +11 -0
  66. package/nitrogen/generated/ios/c++/HybridMunimWifiSpecSwift.hpp +189 -0
  67. package/nitrogen/generated/ios/swift/ChannelInfo.swift +35 -0
  68. package/nitrogen/generated/ios/swift/Func_void_WifiFingerprint.swift +47 -0
  69. package/nitrogen/generated/ios/swift/Func_void_bool.swift +47 -0
  70. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +47 -0
  71. package/nitrogen/generated/ios/swift/Func_void_std__variant_nitro__NullType__ChannelInfo_.swift +59 -0
  72. package/nitrogen/generated/ios/swift/Func_void_std__variant_nitro__NullType__WifiNetwork_.swift +59 -0
  73. package/nitrogen/generated/ios/swift/Func_void_std__variant_nitro__NullType__double_.swift +59 -0
  74. package/nitrogen/generated/ios/swift/Func_void_std__variant_nitro__NullType__std__string_.swift +59 -0
  75. package/nitrogen/generated/ios/swift/Func_void_std__vector_WifiNetwork_.swift +47 -0
  76. package/nitrogen/generated/ios/swift/Func_void_std__vector_std__string_.swift +47 -0
  77. package/nitrogen/generated/ios/swift/HybridMunimWifiSpec.swift +68 -0
  78. package/nitrogen/generated/ios/swift/HybridMunimWifiSpec_cxx.swift +382 -0
  79. package/nitrogen/generated/ios/swift/Location.swift +47 -0
  80. package/nitrogen/generated/ios/swift/ScanOptions.swift +47 -0
  81. package/nitrogen/generated/ios/swift/Variant_NullType_ChannelInfo.swift +18 -0
  82. package/nitrogen/generated/ios/swift/Variant_NullType_Double.swift +18 -0
  83. package/nitrogen/generated/ios/swift/Variant_NullType_String.swift +18 -0
  84. package/nitrogen/generated/ios/swift/Variant_NullType_WifiNetwork.swift +18 -0
  85. package/nitrogen/generated/ios/swift/WifiFingerprint.swift +52 -0
  86. package/nitrogen/generated/ios/swift/WifiNetwork.swift +103 -0
  87. package/nitrogen/generated/shared/c++/ChannelInfo.hpp +87 -0
  88. package/nitrogen/generated/shared/c++/HybridMunimWifiSpec.cpp +33 -0
  89. package/nitrogen/generated/shared/c++/HybridMunimWifiSpec.hpp +90 -0
  90. package/nitrogen/generated/shared/c++/Location.hpp +87 -0
  91. package/nitrogen/generated/shared/c++/ScanOptions.hpp +87 -0
  92. package/nitrogen/generated/shared/c++/WifiFingerprint.hpp +97 -0
  93. package/nitrogen/generated/shared/c++/WifiNetwork.hpp +112 -0
  94. package/package.json +122 -0
  95. package/src/index.ts +221 -0
  96. package/src/specs/munim-wifi.nitro.ts +140 -0
@@ -0,0 +1,59 @@
1
+ ///
2
+ /// Variant_NullType_ChannelInfo.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.munimwifi
9
+
10
+ import com.facebook.proguard.annotations.DoNotStrip
11
+ import com.margelo.nitro.core.NullType
12
+
13
+ /**
14
+ * Represents the TypeScript variant "NullType | ChannelInfo".
15
+ */
16
+ @Suppress("ClassName")
17
+ @DoNotStrip
18
+ sealed class Variant_NullType_ChannelInfo {
19
+ @DoNotStrip
20
+ data class First(@DoNotStrip val value: NullType): Variant_NullType_ChannelInfo()
21
+ @DoNotStrip
22
+ data class Second(@DoNotStrip val value: ChannelInfo): Variant_NullType_ChannelInfo()
23
+
24
+ @Deprecated("getAs() is not type-safe. Use fold/asFirstOrNull/asSecondOrNull instead.", level = DeprecationLevel.ERROR)
25
+ inline fun <reified T> getAs(): T? = when (this) {
26
+ is First -> value as? T
27
+ is Second -> value as? T
28
+ }
29
+
30
+ val isFirst: Boolean
31
+ get() = this is First
32
+ val isSecond: Boolean
33
+ get() = this is Second
34
+
35
+ fun asFirstOrNull(): NullType? {
36
+ val value = (this as? First)?.value ?: return null
37
+ return value
38
+ }
39
+ fun asSecondOrNull(): ChannelInfo? {
40
+ val value = (this as? Second)?.value ?: return null
41
+ return value
42
+ }
43
+
44
+ inline fun <R> match(first: (NullType) -> R, second: (ChannelInfo) -> R): R {
45
+ return when (this) {
46
+ is First -> first(value)
47
+ is Second -> second(value)
48
+ }
49
+ }
50
+
51
+ companion object {
52
+ @JvmStatic
53
+ @DoNotStrip
54
+ fun create(value: NullType): Variant_NullType_ChannelInfo = First(value)
55
+ @JvmStatic
56
+ @DoNotStrip
57
+ fun create(value: ChannelInfo): Variant_NullType_ChannelInfo = Second(value)
58
+ }
59
+ }
@@ -0,0 +1,59 @@
1
+ ///
2
+ /// Variant_NullType_Double.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.munimwifi
9
+
10
+ import com.facebook.proguard.annotations.DoNotStrip
11
+ import com.margelo.nitro.core.NullType
12
+
13
+ /**
14
+ * Represents the TypeScript variant "NullType | Double".
15
+ */
16
+ @Suppress("ClassName")
17
+ @DoNotStrip
18
+ sealed class Variant_NullType_Double {
19
+ @DoNotStrip
20
+ data class First(@DoNotStrip val value: NullType): Variant_NullType_Double()
21
+ @DoNotStrip
22
+ data class Second(@DoNotStrip val value: Double): Variant_NullType_Double()
23
+
24
+ @Deprecated("getAs() is not type-safe. Use fold/asFirstOrNull/asSecondOrNull instead.", level = DeprecationLevel.ERROR)
25
+ inline fun <reified T> getAs(): T? = when (this) {
26
+ is First -> value as? T
27
+ is Second -> value as? T
28
+ }
29
+
30
+ val isFirst: Boolean
31
+ get() = this is First
32
+ val isSecond: Boolean
33
+ get() = this is Second
34
+
35
+ fun asFirstOrNull(): NullType? {
36
+ val value = (this as? First)?.value ?: return null
37
+ return value
38
+ }
39
+ fun asSecondOrNull(): Double? {
40
+ val value = (this as? Second)?.value ?: return null
41
+ return value
42
+ }
43
+
44
+ inline fun <R> match(first: (NullType) -> R, second: (Double) -> R): R {
45
+ return when (this) {
46
+ is First -> first(value)
47
+ is Second -> second(value)
48
+ }
49
+ }
50
+
51
+ companion object {
52
+ @JvmStatic
53
+ @DoNotStrip
54
+ fun create(value: NullType): Variant_NullType_Double = First(value)
55
+ @JvmStatic
56
+ @DoNotStrip
57
+ fun create(value: Double): Variant_NullType_Double = Second(value)
58
+ }
59
+ }
@@ -0,0 +1,59 @@
1
+ ///
2
+ /// Variant_NullType_String.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.munimwifi
9
+
10
+ import com.facebook.proguard.annotations.DoNotStrip
11
+ import com.margelo.nitro.core.NullType
12
+
13
+ /**
14
+ * Represents the TypeScript variant "NullType | String".
15
+ */
16
+ @Suppress("ClassName")
17
+ @DoNotStrip
18
+ sealed class Variant_NullType_String {
19
+ @DoNotStrip
20
+ data class First(@DoNotStrip val value: NullType): Variant_NullType_String()
21
+ @DoNotStrip
22
+ data class Second(@DoNotStrip val value: String): Variant_NullType_String()
23
+
24
+ @Deprecated("getAs() is not type-safe. Use fold/asFirstOrNull/asSecondOrNull instead.", level = DeprecationLevel.ERROR)
25
+ inline fun <reified T> getAs(): T? = when (this) {
26
+ is First -> value as? T
27
+ is Second -> value as? T
28
+ }
29
+
30
+ val isFirst: Boolean
31
+ get() = this is First
32
+ val isSecond: Boolean
33
+ get() = this is Second
34
+
35
+ fun asFirstOrNull(): NullType? {
36
+ val value = (this as? First)?.value ?: return null
37
+ return value
38
+ }
39
+ fun asSecondOrNull(): String? {
40
+ val value = (this as? Second)?.value ?: return null
41
+ return value
42
+ }
43
+
44
+ inline fun <R> match(first: (NullType) -> R, second: (String) -> R): R {
45
+ return when (this) {
46
+ is First -> first(value)
47
+ is Second -> second(value)
48
+ }
49
+ }
50
+
51
+ companion object {
52
+ @JvmStatic
53
+ @DoNotStrip
54
+ fun create(value: NullType): Variant_NullType_String = First(value)
55
+ @JvmStatic
56
+ @DoNotStrip
57
+ fun create(value: String): Variant_NullType_String = Second(value)
58
+ }
59
+ }
@@ -0,0 +1,59 @@
1
+ ///
2
+ /// Variant_NullType_WifiNetwork.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.munimwifi
9
+
10
+ import com.facebook.proguard.annotations.DoNotStrip
11
+ import com.margelo.nitro.core.NullType
12
+
13
+ /**
14
+ * Represents the TypeScript variant "NullType | WifiNetwork".
15
+ */
16
+ @Suppress("ClassName")
17
+ @DoNotStrip
18
+ sealed class Variant_NullType_WifiNetwork {
19
+ @DoNotStrip
20
+ data class First(@DoNotStrip val value: NullType): Variant_NullType_WifiNetwork()
21
+ @DoNotStrip
22
+ data class Second(@DoNotStrip val value: WifiNetwork): Variant_NullType_WifiNetwork()
23
+
24
+ @Deprecated("getAs() is not type-safe. Use fold/asFirstOrNull/asSecondOrNull instead.", level = DeprecationLevel.ERROR)
25
+ inline fun <reified T> getAs(): T? = when (this) {
26
+ is First -> value as? T
27
+ is Second -> value as? T
28
+ }
29
+
30
+ val isFirst: Boolean
31
+ get() = this is First
32
+ val isSecond: Boolean
33
+ get() = this is Second
34
+
35
+ fun asFirstOrNull(): NullType? {
36
+ val value = (this as? First)?.value ?: return null
37
+ return value
38
+ }
39
+ fun asSecondOrNull(): WifiNetwork? {
40
+ val value = (this as? Second)?.value ?: return null
41
+ return value
42
+ }
43
+
44
+ inline fun <R> match(first: (NullType) -> R, second: (WifiNetwork) -> R): R {
45
+ return when (this) {
46
+ is First -> first(value)
47
+ is Second -> second(value)
48
+ }
49
+ }
50
+
51
+ companion object {
52
+ @JvmStatic
53
+ @DoNotStrip
54
+ fun create(value: NullType): Variant_NullType_WifiNetwork = First(value)
55
+ @JvmStatic
56
+ @DoNotStrip
57
+ fun create(value: WifiNetwork): Variant_NullType_WifiNetwork = Second(value)
58
+ }
59
+ }
@@ -0,0 +1,44 @@
1
+ ///
2
+ /// WifiFingerprint.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.munimwifi
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "WifiFingerprint".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class WifiFingerprint(
20
+ @DoNotStrip
21
+ @Keep
22
+ val networks: Array<WifiNetwork>,
23
+ @DoNotStrip
24
+ @Keep
25
+ val timestamp: Double,
26
+ @DoNotStrip
27
+ @Keep
28
+ val location: Location?
29
+ ) {
30
+ /* primary constructor */
31
+
32
+ companion object {
33
+ /**
34
+ * Constructor called from C++
35
+ */
36
+ @DoNotStrip
37
+ @Keep
38
+ @Suppress("unused")
39
+ @JvmStatic
40
+ private fun fromCpp(networks: Array<WifiNetwork>, timestamp: Double, location: Location?): WifiFingerprint {
41
+ return WifiFingerprint(networks, timestamp, location)
42
+ }
43
+ }
44
+ }
@@ -0,0 +1,59 @@
1
+ ///
2
+ /// WifiNetwork.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.munimwifi
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "WifiNetwork".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class WifiNetwork(
20
+ @DoNotStrip
21
+ @Keep
22
+ val ssid: String,
23
+ @DoNotStrip
24
+ @Keep
25
+ val bssid: String,
26
+ @DoNotStrip
27
+ @Keep
28
+ val rssi: Double,
29
+ @DoNotStrip
30
+ @Keep
31
+ val frequency: Double,
32
+ @DoNotStrip
33
+ @Keep
34
+ val channel: Double?,
35
+ @DoNotStrip
36
+ @Keep
37
+ val capabilities: String?,
38
+ @DoNotStrip
39
+ @Keep
40
+ val isSecure: Boolean?,
41
+ @DoNotStrip
42
+ @Keep
43
+ val timestamp: Double?
44
+ ) {
45
+ /* primary constructor */
46
+
47
+ companion object {
48
+ /**
49
+ * Constructor called from C++
50
+ */
51
+ @DoNotStrip
52
+ @Keep
53
+ @Suppress("unused")
54
+ @JvmStatic
55
+ private fun fromCpp(ssid: String, bssid: String, rssi: Double, frequency: Double, channel: Double?, capabilities: String?, isSecure: Boolean?, timestamp: Double?): WifiNetwork {
56
+ return WifiNetwork(ssid, bssid, rssi, frequency, channel, capabilities, isSecure, timestamp)
57
+ }
58
+ }
59
+ }
@@ -0,0 +1,60 @@
1
+ #
2
+ # MunimWifi+autolinking.rb
3
+ # This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ # https://github.com/mrousavy/nitro
5
+ # Copyright © Marc Rousavy @ Margelo
6
+ #
7
+
8
+ # This is a Ruby script that adds all files generated by Nitrogen
9
+ # to the given podspec.
10
+ #
11
+ # To use it, add this to your .podspec:
12
+ # ```ruby
13
+ # Pod::Spec.new do |spec|
14
+ # # ...
15
+ #
16
+ # # Add all files generated by Nitrogen
17
+ # load 'nitrogen/generated/ios/MunimWifi+autolinking.rb'
18
+ # add_nitrogen_files(spec)
19
+ # end
20
+ # ```
21
+
22
+ def add_nitrogen_files(spec)
23
+ Pod::UI.puts "[NitroModules] 🔥 MunimWifi is boosted by nitro!"
24
+
25
+ spec.dependency "NitroModules"
26
+
27
+ current_source_files = Array(spec.attributes_hash['source_files'])
28
+ spec.source_files = current_source_files + [
29
+ # Generated cross-platform specs
30
+ "nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}",
31
+ # Generated bridges for the cross-platform specs
32
+ "nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}",
33
+ ]
34
+
35
+ current_public_header_files = Array(spec.attributes_hash['public_header_files'])
36
+ spec.public_header_files = current_public_header_files + [
37
+ # Generated specs
38
+ "nitrogen/generated/shared/**/*.{h,hpp}",
39
+ # Swift to C++ bridging helpers
40
+ "nitrogen/generated/ios/MunimWifi-Swift-Cxx-Bridge.hpp"
41
+ ]
42
+
43
+ current_private_header_files = Array(spec.attributes_hash['private_header_files'])
44
+ spec.private_header_files = current_private_header_files + [
45
+ # iOS specific specs
46
+ "nitrogen/generated/ios/c++/**/*.{h,hpp}",
47
+ # Views are framework-specific and should be private
48
+ "nitrogen/generated/shared/**/views/**/*"
49
+ ]
50
+
51
+ current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {}
52
+ spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({
53
+ # Use C++ 20
54
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
55
+ # Enables C++ <-> Swift interop (by default it's only ObjC)
56
+ "SWIFT_OBJC_INTEROP_MODE" => "objcxx",
57
+ # Enables stricter modular headers
58
+ "DEFINES_MODULE" => "YES",
59
+ })
60
+ end
@@ -0,0 +1,105 @@
1
+ ///
2
+ /// MunimWifi-Swift-Cxx-Bridge.cpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #include "MunimWifi-Swift-Cxx-Bridge.hpp"
9
+
10
+ // Include C++ implementation defined types
11
+ #include "HybridMunimWifiSpecSwift.hpp"
12
+ #include "MunimWifi-Swift-Cxx-Umbrella.hpp"
13
+ #include <NitroModules/NitroDefines.hpp>
14
+
15
+ namespace margelo::nitro::munimwifi::bridge::swift {
16
+
17
+ // pragma MARK: std::function<void(bool /* result */)>
18
+ Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept {
19
+ auto swiftClosure = MunimWifi::Func_void_bool::fromUnsafe(swiftClosureWrapper);
20
+ return [swiftClosure = std::move(swiftClosure)](bool result) mutable -> void {
21
+ swiftClosure.call(result);
22
+ };
23
+ }
24
+
25
+ // pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
26
+ Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept {
27
+ auto swiftClosure = MunimWifi::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper);
28
+ return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void {
29
+ swiftClosure.call(error);
30
+ };
31
+ }
32
+
33
+ // pragma MARK: std::function<void(const std::vector<WifiNetwork>& /* result */)>
34
+ Func_void_std__vector_WifiNetwork_ create_Func_void_std__vector_WifiNetwork_(void* NON_NULL swiftClosureWrapper) noexcept {
35
+ auto swiftClosure = MunimWifi::Func_void_std__vector_WifiNetwork_::fromUnsafe(swiftClosureWrapper);
36
+ return [swiftClosure = std::move(swiftClosure)](const std::vector<WifiNetwork>& result) mutable -> void {
37
+ swiftClosure.call(result);
38
+ };
39
+ }
40
+
41
+ // pragma MARK: std::function<void(const std::vector<std::string>& /* result */)>
42
+ Func_void_std__vector_std__string_ create_Func_void_std__vector_std__string_(void* NON_NULL swiftClosureWrapper) noexcept {
43
+ auto swiftClosure = MunimWifi::Func_void_std__vector_std__string_::fromUnsafe(swiftClosureWrapper);
44
+ return [swiftClosure = std::move(swiftClosure)](const std::vector<std::string>& result) mutable -> void {
45
+ swiftClosure.call(result);
46
+ };
47
+ }
48
+
49
+ // pragma MARK: std::function<void(const WifiFingerprint& /* result */)>
50
+ Func_void_WifiFingerprint create_Func_void_WifiFingerprint(void* NON_NULL swiftClosureWrapper) noexcept {
51
+ auto swiftClosure = MunimWifi::Func_void_WifiFingerprint::fromUnsafe(swiftClosureWrapper);
52
+ return [swiftClosure = std::move(swiftClosure)](const WifiFingerprint& result) mutable -> void {
53
+ swiftClosure.call(result);
54
+ };
55
+ }
56
+
57
+ // pragma MARK: std::function<void(const std::variant<nitro::NullType, double>& /* result */)>
58
+ Func_void_std__variant_nitro__NullType__double_ create_Func_void_std__variant_nitro__NullType__double_(void* NON_NULL swiftClosureWrapper) noexcept {
59
+ auto swiftClosure = MunimWifi::Func_void_std__variant_nitro__NullType__double_::fromUnsafe(swiftClosureWrapper);
60
+ return [swiftClosure = std::move(swiftClosure)](const std::variant<nitro::NullType, double>& result) mutable -> void {
61
+ swiftClosure.call(result);
62
+ };
63
+ }
64
+
65
+ // pragma MARK: std::function<void(const std::variant<nitro::NullType, std::string>& /* result */)>
66
+ Func_void_std__variant_nitro__NullType__std__string_ create_Func_void_std__variant_nitro__NullType__std__string_(void* NON_NULL swiftClosureWrapper) noexcept {
67
+ auto swiftClosure = MunimWifi::Func_void_std__variant_nitro__NullType__std__string_::fromUnsafe(swiftClosureWrapper);
68
+ return [swiftClosure = std::move(swiftClosure)](const std::variant<nitro::NullType, std::string>& result) mutable -> void {
69
+ swiftClosure.call(result);
70
+ };
71
+ }
72
+
73
+ // pragma MARK: std::function<void(const std::variant<nitro::NullType, ChannelInfo>& /* result */)>
74
+ Func_void_std__variant_nitro__NullType__ChannelInfo_ create_Func_void_std__variant_nitro__NullType__ChannelInfo_(void* NON_NULL swiftClosureWrapper) noexcept {
75
+ auto swiftClosure = MunimWifi::Func_void_std__variant_nitro__NullType__ChannelInfo_::fromUnsafe(swiftClosureWrapper);
76
+ return [swiftClosure = std::move(swiftClosure)](const std::variant<nitro::NullType, ChannelInfo>& result) mutable -> void {
77
+ swiftClosure.call(result);
78
+ };
79
+ }
80
+
81
+ // pragma MARK: std::function<void(const std::variant<nitro::NullType, WifiNetwork>& /* result */)>
82
+ Func_void_std__variant_nitro__NullType__WifiNetwork_ create_Func_void_std__variant_nitro__NullType__WifiNetwork_(void* NON_NULL swiftClosureWrapper) noexcept {
83
+ auto swiftClosure = MunimWifi::Func_void_std__variant_nitro__NullType__WifiNetwork_::fromUnsafe(swiftClosureWrapper);
84
+ return [swiftClosure = std::move(swiftClosure)](const std::variant<nitro::NullType, WifiNetwork>& result) mutable -> void {
85
+ swiftClosure.call(result);
86
+ };
87
+ }
88
+
89
+ // pragma MARK: std::shared_ptr<HybridMunimWifiSpec>
90
+ std::shared_ptr<HybridMunimWifiSpec> create_std__shared_ptr_HybridMunimWifiSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
91
+ MunimWifi::HybridMunimWifiSpec_cxx swiftPart = MunimWifi::HybridMunimWifiSpec_cxx::fromUnsafe(swiftUnsafePointer);
92
+ return std::make_shared<margelo::nitro::munimwifi::HybridMunimWifiSpecSwift>(swiftPart);
93
+ }
94
+ void* NON_NULL get_std__shared_ptr_HybridMunimWifiSpec_(std__shared_ptr_HybridMunimWifiSpec_ cppType) {
95
+ std::shared_ptr<margelo::nitro::munimwifi::HybridMunimWifiSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::munimwifi::HybridMunimWifiSpecSwift>(cppType);
96
+ #ifdef NITRO_DEBUG
97
+ if (swiftWrapper == nullptr) [[unlikely]] {
98
+ throw std::runtime_error("Class \"HybridMunimWifiSpec\" is not implemented in Swift!");
99
+ }
100
+ #endif
101
+ MunimWifi::HybridMunimWifiSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
102
+ return swiftPart.toUnsafe();
103
+ }
104
+
105
+ } // namespace margelo::nitro::munimwifi::bridge::swift