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.
- package/LICENSE +21 -0
- package/MunimWifi.podspec +31 -0
- package/README.md +591 -0
- package/android/CMakeLists.txt +32 -0
- package/android/build.gradle +148 -0
- package/android/fix-prefab.gradle +51 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +6 -0
- package/android/src/main/cpp/cpp-adapter.cpp +6 -0
- package/android/src/main/java/com/munimwifi/HybridMunimWifi.kt +283 -0
- package/android/src/main/java/com/munimwifi/MunimWifiPackage.kt +20 -0
- package/ios/Bridge.h +8 -0
- package/ios/HybridMunimWifi.swift +222 -0
- package/lib/commonjs/index.js +216 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/specs/munim-wifi.nitro.js +6 -0
- package/lib/commonjs/specs/munim-wifi.nitro.js.map +1 -0
- package/lib/module/index.js +198 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/specs/munim-wifi.nitro.js +4 -0
- package/lib/module/specs/munim-wifi.nitro.js.map +1 -0
- package/lib/typescript/src/index.d.ts +120 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/specs/munim-wifi.nitro.d.ts +118 -0
- package/lib/typescript/src/specs/munim-wifi.nitro.d.ts.map +1 -0
- package/nitro.json +24 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/MunimWifi+autolinking.cmake +85 -0
- package/nitrogen/generated/android/MunimWifi+autolinking.gradle +27 -0
- package/nitrogen/generated/android/MunimWifiOnLoad.cpp +44 -0
- package/nitrogen/generated/android/MunimWifiOnLoad.hpp +25 -0
- package/nitrogen/generated/android/c++/JChannelInfo.hpp +61 -0
- package/nitrogen/generated/android/c++/JHybridMunimWifiSpec.cpp +262 -0
- package/nitrogen/generated/android/c++/JHybridMunimWifiSpec.hpp +78 -0
- package/nitrogen/generated/android/c++/JLocation.hpp +61 -0
- package/nitrogen/generated/android/c++/JScanOptions.hpp +61 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_ChannelInfo.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_ChannelInfo.hpp +71 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_Double.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_Double.hpp +69 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_String.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_String.hpp +70 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_WifiNetwork.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_WifiNetwork.hpp +73 -0
- package/nitrogen/generated/android/c++/JWifiFingerprint.hpp +89 -0
- package/nitrogen/generated/android/c++/JWifiNetwork.hpp +86 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimwifi/ChannelInfo.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimwifi/HybridMunimWifiSpec.kt +107 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimwifi/Location.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimwifi/MunimWifiOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimwifi/ScanOptions.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimwifi/Variant_NullType_ChannelInfo.kt +59 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimwifi/Variant_NullType_Double.kt +59 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimwifi/Variant_NullType_String.kt +59 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimwifi/Variant_NullType_WifiNetwork.kt +59 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimwifi/WifiFingerprint.kt +44 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimwifi/WifiNetwork.kt +59 -0
- package/nitrogen/generated/ios/MunimWifi+autolinking.rb +60 -0
- package/nitrogen/generated/ios/MunimWifi-Swift-Cxx-Bridge.cpp +105 -0
- package/nitrogen/generated/ios/MunimWifi-Swift-Cxx-Bridge.hpp +653 -0
- package/nitrogen/generated/ios/MunimWifi-Swift-Cxx-Umbrella.hpp +64 -0
- package/nitrogen/generated/ios/MunimWifiAutolinking.mm +33 -0
- package/nitrogen/generated/ios/MunimWifiAutolinking.swift +26 -0
- package/nitrogen/generated/ios/c++/HybridMunimWifiSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridMunimWifiSpecSwift.hpp +189 -0
- package/nitrogen/generated/ios/swift/ChannelInfo.swift +35 -0
- package/nitrogen/generated/ios/swift/Func_void_WifiFingerprint.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__variant_nitro__NullType__ChannelInfo_.swift +59 -0
- package/nitrogen/generated/ios/swift/Func_void_std__variant_nitro__NullType__WifiNetwork_.swift +59 -0
- package/nitrogen/generated/ios/swift/Func_void_std__variant_nitro__NullType__double_.swift +59 -0
- package/nitrogen/generated/ios/swift/Func_void_std__variant_nitro__NullType__std__string_.swift +59 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_WifiNetwork_.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_std__string_.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridMunimWifiSpec.swift +68 -0
- package/nitrogen/generated/ios/swift/HybridMunimWifiSpec_cxx.swift +382 -0
- package/nitrogen/generated/ios/swift/Location.swift +47 -0
- package/nitrogen/generated/ios/swift/ScanOptions.swift +47 -0
- package/nitrogen/generated/ios/swift/Variant_NullType_ChannelInfo.swift +18 -0
- package/nitrogen/generated/ios/swift/Variant_NullType_Double.swift +18 -0
- package/nitrogen/generated/ios/swift/Variant_NullType_String.swift +18 -0
- package/nitrogen/generated/ios/swift/Variant_NullType_WifiNetwork.swift +18 -0
- package/nitrogen/generated/ios/swift/WifiFingerprint.swift +52 -0
- package/nitrogen/generated/ios/swift/WifiNetwork.swift +103 -0
- package/nitrogen/generated/shared/c++/ChannelInfo.hpp +87 -0
- package/nitrogen/generated/shared/c++/HybridMunimWifiSpec.cpp +33 -0
- package/nitrogen/generated/shared/c++/HybridMunimWifiSpec.hpp +90 -0
- package/nitrogen/generated/shared/c++/Location.hpp +87 -0
- package/nitrogen/generated/shared/c++/ScanOptions.hpp +87 -0
- package/nitrogen/generated/shared/c++/WifiFingerprint.hpp +97 -0
- package/nitrogen/generated/shared/c++/WifiNetwork.hpp +112 -0
- package/package.json +122 -0
- package/src/index.ts +221 -0
- package/src/specs/munim-wifi.nitro.ts +140 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// MunimWifi-Swift-Cxx-Umbrella.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `ChannelInfo` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::munimwifi { struct ChannelInfo; }
|
|
13
|
+
// Forward declaration of `HybridMunimWifiSpec` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::munimwifi { class HybridMunimWifiSpec; }
|
|
15
|
+
// Forward declaration of `Location` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::munimwifi { struct Location; }
|
|
17
|
+
// Forward declaration of `ScanOptions` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::munimwifi { struct ScanOptions; }
|
|
19
|
+
// Forward declaration of `WifiFingerprint` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::munimwifi { struct WifiFingerprint; }
|
|
21
|
+
// Forward declaration of `WifiNetwork` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::munimwifi { struct WifiNetwork; }
|
|
23
|
+
|
|
24
|
+
// Include C++ defined types
|
|
25
|
+
#include "ChannelInfo.hpp"
|
|
26
|
+
#include "HybridMunimWifiSpec.hpp"
|
|
27
|
+
#include "Location.hpp"
|
|
28
|
+
#include "ScanOptions.hpp"
|
|
29
|
+
#include "WifiFingerprint.hpp"
|
|
30
|
+
#include "WifiNetwork.hpp"
|
|
31
|
+
#include <NitroModules/Null.hpp>
|
|
32
|
+
#include <NitroModules/Promise.hpp>
|
|
33
|
+
#include <NitroModules/Result.hpp>
|
|
34
|
+
#include <exception>
|
|
35
|
+
#include <memory>
|
|
36
|
+
#include <optional>
|
|
37
|
+
#include <string>
|
|
38
|
+
#include <variant>
|
|
39
|
+
#include <vector>
|
|
40
|
+
|
|
41
|
+
// C++ helpers for Swift
|
|
42
|
+
#include "MunimWifi-Swift-Cxx-Bridge.hpp"
|
|
43
|
+
|
|
44
|
+
// Common C++ types used in Swift
|
|
45
|
+
#include <NitroModules/ArrayBufferHolder.hpp>
|
|
46
|
+
#include <NitroModules/AnyMapUtils.hpp>
|
|
47
|
+
#include <NitroModules/RuntimeError.hpp>
|
|
48
|
+
#include <NitroModules/DateToChronoDate.hpp>
|
|
49
|
+
|
|
50
|
+
// Forward declarations of Swift defined types
|
|
51
|
+
// Forward declaration of `HybridMunimWifiSpec_cxx` to properly resolve imports.
|
|
52
|
+
namespace MunimWifi { class HybridMunimWifiSpec_cxx; }
|
|
53
|
+
|
|
54
|
+
// Include Swift defined types
|
|
55
|
+
#if __has_include("MunimWifi-Swift.h")
|
|
56
|
+
// This header is generated by Xcode/Swift on every app build.
|
|
57
|
+
// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "MunimWifi".
|
|
58
|
+
#include "MunimWifi-Swift.h"
|
|
59
|
+
// Same as above, but used when building with frameworks (`use_frameworks`)
|
|
60
|
+
#elif __has_include(<MunimWifi/MunimWifi-Swift.h>)
|
|
61
|
+
#include <MunimWifi/MunimWifi-Swift.h>
|
|
62
|
+
#else
|
|
63
|
+
#error MunimWifi's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "MunimWifi", and try building the app first.
|
|
64
|
+
#endif
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// MunimWifiAutolinking.mm
|
|
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
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <NitroModules/HybridObjectRegistry.hpp>
|
|
10
|
+
#import "MunimWifi-Swift-Cxx-Umbrella.hpp"
|
|
11
|
+
#import <type_traits>
|
|
12
|
+
|
|
13
|
+
#include "HybridMunimWifiSpecSwift.hpp"
|
|
14
|
+
|
|
15
|
+
@interface MunimWifiAutolinking : NSObject
|
|
16
|
+
@end
|
|
17
|
+
|
|
18
|
+
@implementation MunimWifiAutolinking
|
|
19
|
+
|
|
20
|
+
+ (void) load {
|
|
21
|
+
using namespace margelo::nitro;
|
|
22
|
+
using namespace margelo::nitro::munimwifi;
|
|
23
|
+
|
|
24
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
25
|
+
"MunimWifi",
|
|
26
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
27
|
+
std::shared_ptr<HybridMunimWifiSpec> hybridObject = MunimWifi::MunimWifiAutolinking::createMunimWifi();
|
|
28
|
+
return hybridObject;
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// MunimWifiAutolinking.swift
|
|
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
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
// TODO: Use empty enums once Swift supports exporting them as namespaces
|
|
11
|
+
// See: https://github.com/swiftlang/swift/pull/83616
|
|
12
|
+
public final class MunimWifiAutolinking {
|
|
13
|
+
public typealias bridge = margelo.nitro.munimwifi.bridge.swift
|
|
14
|
+
|
|
15
|
+
public static func createMunimWifi() -> bridge.std__shared_ptr_HybridMunimWifiSpec_ {
|
|
16
|
+
let hybridObject = HybridMunimWifi()
|
|
17
|
+
return { () -> bridge.std__shared_ptr_HybridMunimWifiSpec_ in
|
|
18
|
+
let __cxxWrapped = hybridObject.getCxxWrapper()
|
|
19
|
+
return __cxxWrapped.getCxxPart()
|
|
20
|
+
}()
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public static func isMunimWifiRecyclable() -> Bool {
|
|
24
|
+
return HybridMunimWifi.self is any RecyclableView.Type
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridMunimWifiSpecSwift.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 "HybridMunimWifiSpecSwift.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::munimwifi {
|
|
11
|
+
} // namespace margelo::nitro::munimwifi
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridMunimWifiSpecSwift.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "HybridMunimWifiSpec.hpp"
|
|
11
|
+
|
|
12
|
+
// Forward declaration of `HybridMunimWifiSpec_cxx` to properly resolve imports.
|
|
13
|
+
namespace MunimWifi { class HybridMunimWifiSpec_cxx; }
|
|
14
|
+
|
|
15
|
+
// Forward declaration of `WifiNetwork` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::munimwifi { struct WifiNetwork; }
|
|
17
|
+
// Forward declaration of `ScanOptions` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::munimwifi { struct ScanOptions; }
|
|
19
|
+
// Forward declaration of `WifiFingerprint` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::munimwifi { struct WifiFingerprint; }
|
|
21
|
+
// Forward declaration of `Location` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::munimwifi { struct Location; }
|
|
23
|
+
// Forward declaration of `ChannelInfo` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::munimwifi { struct ChannelInfo; }
|
|
25
|
+
|
|
26
|
+
#include <NitroModules/Promise.hpp>
|
|
27
|
+
#include "WifiNetwork.hpp"
|
|
28
|
+
#include <vector>
|
|
29
|
+
#include <string>
|
|
30
|
+
#include <optional>
|
|
31
|
+
#include "ScanOptions.hpp"
|
|
32
|
+
#include "WifiFingerprint.hpp"
|
|
33
|
+
#include "Location.hpp"
|
|
34
|
+
#include <NitroModules/Null.hpp>
|
|
35
|
+
#include <variant>
|
|
36
|
+
#include "ChannelInfo.hpp"
|
|
37
|
+
|
|
38
|
+
#include "MunimWifi-Swift-Cxx-Umbrella.hpp"
|
|
39
|
+
|
|
40
|
+
namespace margelo::nitro::munimwifi {
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The C++ part of HybridMunimWifiSpec_cxx.swift.
|
|
44
|
+
*
|
|
45
|
+
* HybridMunimWifiSpecSwift (C++) accesses HybridMunimWifiSpec_cxx (Swift), and might
|
|
46
|
+
* contain some additional bridging code for C++ <> Swift interop.
|
|
47
|
+
*
|
|
48
|
+
* Since this obviously introduces an overhead, I hope at some point in
|
|
49
|
+
* the future, HybridMunimWifiSpec_cxx can directly inherit from the C++ class HybridMunimWifiSpec
|
|
50
|
+
* to simplify the whole structure and memory management.
|
|
51
|
+
*/
|
|
52
|
+
class HybridMunimWifiSpecSwift: public virtual HybridMunimWifiSpec {
|
|
53
|
+
public:
|
|
54
|
+
// Constructor from a Swift instance
|
|
55
|
+
explicit HybridMunimWifiSpecSwift(const MunimWifi::HybridMunimWifiSpec_cxx& swiftPart):
|
|
56
|
+
HybridObject(HybridMunimWifiSpec::TAG),
|
|
57
|
+
_swiftPart(swiftPart) { }
|
|
58
|
+
|
|
59
|
+
public:
|
|
60
|
+
// Get the Swift part
|
|
61
|
+
inline MunimWifi::HybridMunimWifiSpec_cxx& getSwiftPart() noexcept {
|
|
62
|
+
return _swiftPart;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
public:
|
|
66
|
+
inline size_t getExternalMemorySize() noexcept override {
|
|
67
|
+
return _swiftPart.getMemorySize();
|
|
68
|
+
}
|
|
69
|
+
bool equals(const std::shared_ptr<HybridObject>& other) override {
|
|
70
|
+
if (auto otherCast = std::dynamic_pointer_cast<HybridMunimWifiSpecSwift>(other)) {
|
|
71
|
+
return _swiftPart.equals(otherCast->_swiftPart);
|
|
72
|
+
}
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
void dispose() noexcept override {
|
|
76
|
+
_swiftPart.dispose();
|
|
77
|
+
}
|
|
78
|
+
std::string toString() override {
|
|
79
|
+
return _swiftPart.toString();
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
public:
|
|
83
|
+
// Properties
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
public:
|
|
87
|
+
// Methods
|
|
88
|
+
inline std::shared_ptr<Promise<bool>> isWifiEnabled() override {
|
|
89
|
+
auto __result = _swiftPart.isWifiEnabled();
|
|
90
|
+
if (__result.hasError()) [[unlikely]] {
|
|
91
|
+
std::rethrow_exception(__result.error());
|
|
92
|
+
}
|
|
93
|
+
auto __value = std::move(__result.value());
|
|
94
|
+
return __value;
|
|
95
|
+
}
|
|
96
|
+
inline std::shared_ptr<Promise<bool>> requestWifiPermission() override {
|
|
97
|
+
auto __result = _swiftPart.requestWifiPermission();
|
|
98
|
+
if (__result.hasError()) [[unlikely]] {
|
|
99
|
+
std::rethrow_exception(__result.error());
|
|
100
|
+
}
|
|
101
|
+
auto __value = std::move(__result.value());
|
|
102
|
+
return __value;
|
|
103
|
+
}
|
|
104
|
+
inline std::shared_ptr<Promise<std::vector<WifiNetwork>>> scanNetworks(const std::optional<ScanOptions>& options) override {
|
|
105
|
+
auto __result = _swiftPart.scanNetworks(options);
|
|
106
|
+
if (__result.hasError()) [[unlikely]] {
|
|
107
|
+
std::rethrow_exception(__result.error());
|
|
108
|
+
}
|
|
109
|
+
auto __value = std::move(__result.value());
|
|
110
|
+
return __value;
|
|
111
|
+
}
|
|
112
|
+
inline void startScan(const std::optional<ScanOptions>& options) override {
|
|
113
|
+
auto __result = _swiftPart.startScan(options);
|
|
114
|
+
if (__result.hasError()) [[unlikely]] {
|
|
115
|
+
std::rethrow_exception(__result.error());
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
inline void stopScan() override {
|
|
119
|
+
auto __result = _swiftPart.stopScan();
|
|
120
|
+
if (__result.hasError()) [[unlikely]] {
|
|
121
|
+
std::rethrow_exception(__result.error());
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
inline std::shared_ptr<Promise<std::vector<std::string>>> getSSIDs() override {
|
|
125
|
+
auto __result = _swiftPart.getSSIDs();
|
|
126
|
+
if (__result.hasError()) [[unlikely]] {
|
|
127
|
+
std::rethrow_exception(__result.error());
|
|
128
|
+
}
|
|
129
|
+
auto __value = std::move(__result.value());
|
|
130
|
+
return __value;
|
|
131
|
+
}
|
|
132
|
+
inline std::shared_ptr<Promise<WifiFingerprint>> getWifiFingerprint() override {
|
|
133
|
+
auto __result = _swiftPart.getWifiFingerprint();
|
|
134
|
+
if (__result.hasError()) [[unlikely]] {
|
|
135
|
+
std::rethrow_exception(__result.error());
|
|
136
|
+
}
|
|
137
|
+
auto __value = std::move(__result.value());
|
|
138
|
+
return __value;
|
|
139
|
+
}
|
|
140
|
+
inline std::shared_ptr<Promise<std::variant<nitro::NullType, double>>> getRSSI(const std::string& ssid) override {
|
|
141
|
+
auto __result = _swiftPart.getRSSI(ssid);
|
|
142
|
+
if (__result.hasError()) [[unlikely]] {
|
|
143
|
+
std::rethrow_exception(__result.error());
|
|
144
|
+
}
|
|
145
|
+
auto __value = std::move(__result.value());
|
|
146
|
+
return __value;
|
|
147
|
+
}
|
|
148
|
+
inline std::shared_ptr<Promise<std::variant<nitro::NullType, std::string>>> getBSSID(const std::string& ssid) override {
|
|
149
|
+
auto __result = _swiftPart.getBSSID(ssid);
|
|
150
|
+
if (__result.hasError()) [[unlikely]] {
|
|
151
|
+
std::rethrow_exception(__result.error());
|
|
152
|
+
}
|
|
153
|
+
auto __value = std::move(__result.value());
|
|
154
|
+
return __value;
|
|
155
|
+
}
|
|
156
|
+
inline std::shared_ptr<Promise<std::variant<nitro::NullType, ChannelInfo>>> getChannelInfo(const std::string& ssid) override {
|
|
157
|
+
auto __result = _swiftPart.getChannelInfo(ssid);
|
|
158
|
+
if (__result.hasError()) [[unlikely]] {
|
|
159
|
+
std::rethrow_exception(__result.error());
|
|
160
|
+
}
|
|
161
|
+
auto __value = std::move(__result.value());
|
|
162
|
+
return __value;
|
|
163
|
+
}
|
|
164
|
+
inline std::shared_ptr<Promise<std::variant<nitro::NullType, WifiNetwork>>> getNetworkInfo(const std::string& ssid) override {
|
|
165
|
+
auto __result = _swiftPart.getNetworkInfo(ssid);
|
|
166
|
+
if (__result.hasError()) [[unlikely]] {
|
|
167
|
+
std::rethrow_exception(__result.error());
|
|
168
|
+
}
|
|
169
|
+
auto __value = std::move(__result.value());
|
|
170
|
+
return __value;
|
|
171
|
+
}
|
|
172
|
+
inline void addListener(const std::string& eventName) override {
|
|
173
|
+
auto __result = _swiftPart.addListener(eventName);
|
|
174
|
+
if (__result.hasError()) [[unlikely]] {
|
|
175
|
+
std::rethrow_exception(__result.error());
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
inline void removeListeners(double count) override {
|
|
179
|
+
auto __result = _swiftPart.removeListeners(std::forward<decltype(count)>(count));
|
|
180
|
+
if (__result.hasError()) [[unlikely]] {
|
|
181
|
+
std::rethrow_exception(__result.error());
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
private:
|
|
186
|
+
MunimWifi::HybridMunimWifiSpec_cxx _swiftPart;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
} // namespace margelo::nitro::munimwifi
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ChannelInfo.swift
|
|
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
|
+
import Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Represents an instance of `ChannelInfo`, backed by a C++ struct.
|
|
13
|
+
*/
|
|
14
|
+
public typealias ChannelInfo = margelo.nitro.munimwifi.ChannelInfo
|
|
15
|
+
|
|
16
|
+
public extension ChannelInfo {
|
|
17
|
+
private typealias bridge = margelo.nitro.munimwifi.bridge.swift
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Create a new instance of `ChannelInfo`.
|
|
21
|
+
*/
|
|
22
|
+
init(channel: Double, frequency: Double) {
|
|
23
|
+
self.init(channel, frequency)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@inline(__always)
|
|
27
|
+
var channel: Double {
|
|
28
|
+
return self.__channel
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@inline(__always)
|
|
32
|
+
var frequency: Double {
|
|
33
|
+
return self.__frequency
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_WifiFingerprint.swift
|
|
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
|
+
import Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Wraps a Swift `(_ value: WifiFingerprint) -> Void` as a class.
|
|
13
|
+
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
14
|
+
*/
|
|
15
|
+
public final class Func_void_WifiFingerprint {
|
|
16
|
+
public typealias bridge = margelo.nitro.munimwifi.bridge.swift
|
|
17
|
+
|
|
18
|
+
private let closure: (_ value: WifiFingerprint) -> Void
|
|
19
|
+
|
|
20
|
+
public init(_ closure: @escaping (_ value: WifiFingerprint) -> Void) {
|
|
21
|
+
self.closure = closure
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@inline(__always)
|
|
25
|
+
public func call(value: WifiFingerprint) -> Void {
|
|
26
|
+
self.closure(value)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
31
|
+
* This acquires one additional strong reference on the object!
|
|
32
|
+
*/
|
|
33
|
+
@inline(__always)
|
|
34
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
35
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Casts an unsafe pointer to a `Func_void_WifiFingerprint`.
|
|
40
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_WifiFingerprint>`.
|
|
41
|
+
* This removes one strong reference from the object!
|
|
42
|
+
*/
|
|
43
|
+
@inline(__always)
|
|
44
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_WifiFingerprint {
|
|
45
|
+
return Unmanaged<Func_void_WifiFingerprint>.fromOpaque(pointer).takeRetainedValue()
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_bool.swift
|
|
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
|
+
import Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Wraps a Swift `(_ value: Bool) -> Void` as a class.
|
|
13
|
+
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
14
|
+
*/
|
|
15
|
+
public final class Func_void_bool {
|
|
16
|
+
public typealias bridge = margelo.nitro.munimwifi.bridge.swift
|
|
17
|
+
|
|
18
|
+
private let closure: (_ value: Bool) -> Void
|
|
19
|
+
|
|
20
|
+
public init(_ closure: @escaping (_ value: Bool) -> Void) {
|
|
21
|
+
self.closure = closure
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@inline(__always)
|
|
25
|
+
public func call(value: Bool) -> Void {
|
|
26
|
+
self.closure(value)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
31
|
+
* This acquires one additional strong reference on the object!
|
|
32
|
+
*/
|
|
33
|
+
@inline(__always)
|
|
34
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
35
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Casts an unsafe pointer to a `Func_void_bool`.
|
|
40
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_bool>`.
|
|
41
|
+
* This removes one strong reference from the object!
|
|
42
|
+
*/
|
|
43
|
+
@inline(__always)
|
|
44
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_bool {
|
|
45
|
+
return Unmanaged<Func_void_bool>.fromOpaque(pointer).takeRetainedValue()
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_std__exception_ptr.swift
|
|
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
|
+
import Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Wraps a Swift `(_ error: Error) -> Void` as a class.
|
|
13
|
+
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
14
|
+
*/
|
|
15
|
+
public final class Func_void_std__exception_ptr {
|
|
16
|
+
public typealias bridge = margelo.nitro.munimwifi.bridge.swift
|
|
17
|
+
|
|
18
|
+
private let closure: (_ error: Error) -> Void
|
|
19
|
+
|
|
20
|
+
public init(_ closure: @escaping (_ error: Error) -> Void) {
|
|
21
|
+
self.closure = closure
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@inline(__always)
|
|
25
|
+
public func call(error: std.exception_ptr) -> Void {
|
|
26
|
+
self.closure(RuntimeError.from(cppError: error))
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
31
|
+
* This acquires one additional strong reference on the object!
|
|
32
|
+
*/
|
|
33
|
+
@inline(__always)
|
|
34
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
35
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Casts an unsafe pointer to a `Func_void_std__exception_ptr`.
|
|
40
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_std__exception_ptr>`.
|
|
41
|
+
* This removes one strong reference from the object!
|
|
42
|
+
*/
|
|
43
|
+
@inline(__always)
|
|
44
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__exception_ptr {
|
|
45
|
+
return Unmanaged<Func_void_std__exception_ptr>.fromOpaque(pointer).takeRetainedValue()
|
|
46
|
+
}
|
|
47
|
+
}
|
package/nitrogen/generated/ios/swift/Func_void_std__variant_nitro__NullType__ChannelInfo_.swift
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_std__variant_nitro__NullType__ChannelInfo_.swift
|
|
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
|
+
import Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Wraps a Swift `(_ value: Variant_NullType_ChannelInfo) -> Void` as a class.
|
|
13
|
+
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
14
|
+
*/
|
|
15
|
+
public final class Func_void_std__variant_nitro__NullType__ChannelInfo_ {
|
|
16
|
+
public typealias bridge = margelo.nitro.munimwifi.bridge.swift
|
|
17
|
+
|
|
18
|
+
private let closure: (_ value: Variant_NullType_ChannelInfo) -> Void
|
|
19
|
+
|
|
20
|
+
public init(_ closure: @escaping (_ value: Variant_NullType_ChannelInfo) -> Void) {
|
|
21
|
+
self.closure = closure
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@inline(__always)
|
|
25
|
+
public func call(value: bridge.std__variant_nitro__NullType__ChannelInfo_) -> Void {
|
|
26
|
+
self.closure({ () -> Variant_NullType_ChannelInfo in
|
|
27
|
+
let __variant = value
|
|
28
|
+
switch __variant.index() {
|
|
29
|
+
case 0:
|
|
30
|
+
let __actual = __variant.get_0()
|
|
31
|
+
return .first(NullType.null)
|
|
32
|
+
case 1:
|
|
33
|
+
let __actual = __variant.get_1()
|
|
34
|
+
return .second(__actual)
|
|
35
|
+
default:
|
|
36
|
+
fatalError("Variant can never have index \(__variant.index())!")
|
|
37
|
+
}
|
|
38
|
+
}())
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
43
|
+
* This acquires one additional strong reference on the object!
|
|
44
|
+
*/
|
|
45
|
+
@inline(__always)
|
|
46
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
47
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Casts an unsafe pointer to a `Func_void_std__variant_nitro__NullType__ChannelInfo_`.
|
|
52
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_std__variant_nitro__NullType__ChannelInfo_>`.
|
|
53
|
+
* This removes one strong reference from the object!
|
|
54
|
+
*/
|
|
55
|
+
@inline(__always)
|
|
56
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__variant_nitro__NullType__ChannelInfo_ {
|
|
57
|
+
return Unmanaged<Func_void_std__variant_nitro__NullType__ChannelInfo_>.fromOpaque(pointer).takeRetainedValue()
|
|
58
|
+
}
|
|
59
|
+
}
|
package/nitrogen/generated/ios/swift/Func_void_std__variant_nitro__NullType__WifiNetwork_.swift
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_std__variant_nitro__NullType__WifiNetwork_.swift
|
|
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
|
+
import Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Wraps a Swift `(_ value: Variant_NullType_WifiNetwork) -> Void` as a class.
|
|
13
|
+
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
14
|
+
*/
|
|
15
|
+
public final class Func_void_std__variant_nitro__NullType__WifiNetwork_ {
|
|
16
|
+
public typealias bridge = margelo.nitro.munimwifi.bridge.swift
|
|
17
|
+
|
|
18
|
+
private let closure: (_ value: Variant_NullType_WifiNetwork) -> Void
|
|
19
|
+
|
|
20
|
+
public init(_ closure: @escaping (_ value: Variant_NullType_WifiNetwork) -> Void) {
|
|
21
|
+
self.closure = closure
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@inline(__always)
|
|
25
|
+
public func call(value: bridge.std__variant_nitro__NullType__WifiNetwork_) -> Void {
|
|
26
|
+
self.closure({ () -> Variant_NullType_WifiNetwork in
|
|
27
|
+
let __variant = value
|
|
28
|
+
switch __variant.index() {
|
|
29
|
+
case 0:
|
|
30
|
+
let __actual = __variant.get_0()
|
|
31
|
+
return .first(NullType.null)
|
|
32
|
+
case 1:
|
|
33
|
+
let __actual = __variant.get_1()
|
|
34
|
+
return .second(__actual)
|
|
35
|
+
default:
|
|
36
|
+
fatalError("Variant can never have index \(__variant.index())!")
|
|
37
|
+
}
|
|
38
|
+
}())
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
43
|
+
* This acquires one additional strong reference on the object!
|
|
44
|
+
*/
|
|
45
|
+
@inline(__always)
|
|
46
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
47
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Casts an unsafe pointer to a `Func_void_std__variant_nitro__NullType__WifiNetwork_`.
|
|
52
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_std__variant_nitro__NullType__WifiNetwork_>`.
|
|
53
|
+
* This removes one strong reference from the object!
|
|
54
|
+
*/
|
|
55
|
+
@inline(__always)
|
|
56
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__variant_nitro__NullType__WifiNetwork_ {
|
|
57
|
+
return Unmanaged<Func_void_std__variant_nitro__NullType__WifiNetwork_>.fromOpaque(pointer).takeRetainedValue()
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_std__variant_nitro__NullType__double_.swift
|
|
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
|
+
import Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Wraps a Swift `(_ value: Variant_NullType_Double) -> Void` as a class.
|
|
13
|
+
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
14
|
+
*/
|
|
15
|
+
public final class Func_void_std__variant_nitro__NullType__double_ {
|
|
16
|
+
public typealias bridge = margelo.nitro.munimwifi.bridge.swift
|
|
17
|
+
|
|
18
|
+
private let closure: (_ value: Variant_NullType_Double) -> Void
|
|
19
|
+
|
|
20
|
+
public init(_ closure: @escaping (_ value: Variant_NullType_Double) -> Void) {
|
|
21
|
+
self.closure = closure
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@inline(__always)
|
|
25
|
+
public func call(value: bridge.std__variant_nitro__NullType__double_) -> Void {
|
|
26
|
+
self.closure({ () -> Variant_NullType_Double in
|
|
27
|
+
let __variant = value
|
|
28
|
+
switch __variant.index() {
|
|
29
|
+
case 0:
|
|
30
|
+
let __actual = __variant.get_0()
|
|
31
|
+
return .first(NullType.null)
|
|
32
|
+
case 1:
|
|
33
|
+
let __actual = __variant.get_1()
|
|
34
|
+
return .second(__actual)
|
|
35
|
+
default:
|
|
36
|
+
fatalError("Variant can never have index \(__variant.index())!")
|
|
37
|
+
}
|
|
38
|
+
}())
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
43
|
+
* This acquires one additional strong reference on the object!
|
|
44
|
+
*/
|
|
45
|
+
@inline(__always)
|
|
46
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
47
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Casts an unsafe pointer to a `Func_void_std__variant_nitro__NullType__double_`.
|
|
52
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_std__variant_nitro__NullType__double_>`.
|
|
53
|
+
* This removes one strong reference from the object!
|
|
54
|
+
*/
|
|
55
|
+
@inline(__always)
|
|
56
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__variant_nitro__NullType__double_ {
|
|
57
|
+
return Unmanaged<Func_void_std__variant_nitro__NullType__double_>.fromOpaque(pointer).takeRetainedValue()
|
|
58
|
+
}
|
|
59
|
+
}
|