@onekeyfe/react-native-keychain-module 1.1.6
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/KeychainModule.podspec +29 -0
- package/LICENSE +20 -0
- package/README.md +39 -0
- package/android/CMakeLists.txt +24 -0
- package/android/build.gradle +128 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/cpp-adapter.cpp +6 -0
- package/android/src/main/java/com/margelo/nitro/keychainmodule/KeychainModule.kt +28 -0
- package/android/src/main/java/com/margelo/nitro/keychainmodule/KeychainModulePackage.kt +22 -0
- package/ios/KeychainModule.swift +81 -0
- package/ios/KeychainModuleCore.swift +174 -0
- package/lib/module/KeychainModule.nitro.js +4 -0
- package/lib/module/KeychainModule.nitro.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/KeychainModule.nitro.d.ts +32 -0
- package/lib/typescript/src/KeychainModule.nitro.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +4 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/nitro.json +17 -0
- package/nitrogen/generated/android/c++/JGetItemParams.hpp +57 -0
- package/nitrogen/generated/android/c++/JGetItemResult.hpp +61 -0
- package/nitrogen/generated/android/c++/JHasItemParams.hpp +57 -0
- package/nitrogen/generated/android/c++/JHybridKeychainModuleSpec.cpp +153 -0
- package/nitrogen/generated/android/c++/JHybridKeychainModuleSpec.hpp +69 -0
- package/nitrogen/generated/android/c++/JRemoveItemParams.hpp +57 -0
- package/nitrogen/generated/android/c++/JSetItemParams.hpp +74 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_GetItemResult.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_GetItemResult.hpp +72 -0
- package/nitrogen/generated/android/keychainmodule+autolinking.cmake +82 -0
- package/nitrogen/generated/android/keychainmodule+autolinking.gradle +27 -0
- package/nitrogen/generated/android/keychainmoduleOnLoad.cpp +44 -0
- package/nitrogen/generated/android/keychainmoduleOnLoad.hpp +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/GetItemParams.kt +38 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/GetItemResult.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/HasItemParams.kt +38 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/HybridKeychainModuleSpec.kt +75 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/RemoveItemParams.kt +38 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/SetItemParams.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/Variant_NullType_GetItemResult.kt +59 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/keychainmoduleOnLoad.kt +35 -0
- package/nitrogen/generated/ios/KeychainModule+autolinking.rb +60 -0
- package/nitrogen/generated/ios/KeychainModule-Swift-Cxx-Bridge.cpp +57 -0
- package/nitrogen/generated/ios/KeychainModule-Swift-Cxx-Bridge.hpp +219 -0
- package/nitrogen/generated/ios/KeychainModule-Swift-Cxx-Umbrella.hpp +63 -0
- package/nitrogen/generated/ios/KeychainModuleAutolinking.mm +33 -0
- package/nitrogen/generated/ios/KeychainModuleAutolinking.swift +25 -0
- package/nitrogen/generated/ios/c++/HybridKeychainModuleSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridKeychainModuleSpecSwift.hpp +126 -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__GetItemResult_.swift +59 -0
- package/nitrogen/generated/ios/swift/GetItemParams.swift +36 -0
- package/nitrogen/generated/ios/swift/GetItemResult.swift +47 -0
- package/nitrogen/generated/ios/swift/HasItemParams.swift +36 -0
- package/nitrogen/generated/ios/swift/HybridKeychainModuleSpec.swift +60 -0
- package/nitrogen/generated/ios/swift/HybridKeychainModuleSpec_cxx.swift +221 -0
- package/nitrogen/generated/ios/swift/RemoveItemParams.swift +36 -0
- package/nitrogen/generated/ios/swift/SetItemParams.swift +137 -0
- package/nitrogen/generated/ios/swift/Variant_NullType_GetItemResult.swift +18 -0
- package/nitrogen/generated/shared/c++/GetItemParams.hpp +75 -0
- package/nitrogen/generated/shared/c++/GetItemResult.hpp +79 -0
- package/nitrogen/generated/shared/c++/HasItemParams.hpp +75 -0
- package/nitrogen/generated/shared/c++/HybridKeychainModuleSpec.cpp +25 -0
- package/nitrogen/generated/shared/c++/HybridKeychainModuleSpec.hpp +82 -0
- package/nitrogen/generated/shared/c++/RemoveItemParams.hpp +75 -0
- package/nitrogen/generated/shared/c++/SetItemParams.hpp +92 -0
- package/package.json +174 -0
- package/src/KeychainModule.nitro.ts +35 -0
- package/src/index.tsx +8 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// KeychainModule-Swift-Cxx-Bridge.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `GetItemResult` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::keychainmodule { struct GetItemResult; }
|
|
13
|
+
// Forward declaration of `HybridKeychainModuleSpec` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::keychainmodule { class HybridKeychainModuleSpec; }
|
|
15
|
+
|
|
16
|
+
// Forward declarations of Swift defined types
|
|
17
|
+
// Forward declaration of `HybridKeychainModuleSpec_cxx` to properly resolve imports.
|
|
18
|
+
namespace KeychainModule { class HybridKeychainModuleSpec_cxx; }
|
|
19
|
+
|
|
20
|
+
// Include C++ defined types
|
|
21
|
+
#include "GetItemResult.hpp"
|
|
22
|
+
#include "HybridKeychainModuleSpec.hpp"
|
|
23
|
+
#include <NitroModules/Null.hpp>
|
|
24
|
+
#include <NitroModules/Promise.hpp>
|
|
25
|
+
#include <NitroModules/PromiseHolder.hpp>
|
|
26
|
+
#include <NitroModules/Result.hpp>
|
|
27
|
+
#include <exception>
|
|
28
|
+
#include <functional>
|
|
29
|
+
#include <memory>
|
|
30
|
+
#include <optional>
|
|
31
|
+
#include <string>
|
|
32
|
+
#include <variant>
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Contains specialized versions of C++ templated types so they can be accessed from Swift,
|
|
36
|
+
* as well as helper functions to interact with those C++ types from Swift.
|
|
37
|
+
*/
|
|
38
|
+
namespace margelo::nitro::keychainmodule::bridge::swift {
|
|
39
|
+
|
|
40
|
+
// pragma MARK: std::shared_ptr<Promise<bool>>
|
|
41
|
+
/**
|
|
42
|
+
* Specialized version of `std::shared_ptr<Promise<bool>>`.
|
|
43
|
+
*/
|
|
44
|
+
using std__shared_ptr_Promise_bool__ = std::shared_ptr<Promise<bool>>;
|
|
45
|
+
inline std::shared_ptr<Promise<bool>> create_std__shared_ptr_Promise_bool__() noexcept {
|
|
46
|
+
return Promise<bool>::create();
|
|
47
|
+
}
|
|
48
|
+
inline PromiseHolder<bool> wrap_std__shared_ptr_Promise_bool__(std::shared_ptr<Promise<bool>> promise) noexcept {
|
|
49
|
+
return PromiseHolder<bool>(std::move(promise));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// pragma MARK: std::function<void(bool /* result */)>
|
|
53
|
+
/**
|
|
54
|
+
* Specialized version of `std::function<void(bool)>`.
|
|
55
|
+
*/
|
|
56
|
+
using Func_void_bool = std::function<void(bool /* result */)>;
|
|
57
|
+
/**
|
|
58
|
+
* Wrapper class for a `std::function<void(bool / * result * /)>`, this can be used from Swift.
|
|
59
|
+
*/
|
|
60
|
+
class Func_void_bool_Wrapper final {
|
|
61
|
+
public:
|
|
62
|
+
explicit Func_void_bool_Wrapper(std::function<void(bool /* result */)>&& func): _function(std::make_unique<std::function<void(bool /* result */)>>(std::move(func))) {}
|
|
63
|
+
inline void call(bool result) const noexcept {
|
|
64
|
+
_function->operator()(result);
|
|
65
|
+
}
|
|
66
|
+
private:
|
|
67
|
+
std::unique_ptr<std::function<void(bool /* result */)>> _function;
|
|
68
|
+
} SWIFT_NONCOPYABLE;
|
|
69
|
+
Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
70
|
+
inline Func_void_bool_Wrapper wrap_Func_void_bool(Func_void_bool value) noexcept {
|
|
71
|
+
return Func_void_bool_Wrapper(std::move(value));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
|
|
75
|
+
/**
|
|
76
|
+
* Specialized version of `std::function<void(const std::exception_ptr&)>`.
|
|
77
|
+
*/
|
|
78
|
+
using Func_void_std__exception_ptr = std::function<void(const std::exception_ptr& /* error */)>;
|
|
79
|
+
/**
|
|
80
|
+
* Wrapper class for a `std::function<void(const std::exception_ptr& / * error * /)>`, this can be used from Swift.
|
|
81
|
+
*/
|
|
82
|
+
class Func_void_std__exception_ptr_Wrapper final {
|
|
83
|
+
public:
|
|
84
|
+
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))) {}
|
|
85
|
+
inline void call(std::exception_ptr error) const noexcept {
|
|
86
|
+
_function->operator()(error);
|
|
87
|
+
}
|
|
88
|
+
private:
|
|
89
|
+
std::unique_ptr<std::function<void(const std::exception_ptr& /* error */)>> _function;
|
|
90
|
+
} SWIFT_NONCOPYABLE;
|
|
91
|
+
Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
92
|
+
inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept {
|
|
93
|
+
return Func_void_std__exception_ptr_Wrapper(std::move(value));
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// pragma MARK: std::optional<bool>
|
|
97
|
+
/**
|
|
98
|
+
* Specialized version of `std::optional<bool>`.
|
|
99
|
+
*/
|
|
100
|
+
using std__optional_bool_ = std::optional<bool>;
|
|
101
|
+
inline std::optional<bool> create_std__optional_bool_(const bool& value) noexcept {
|
|
102
|
+
return std::optional<bool>(value);
|
|
103
|
+
}
|
|
104
|
+
inline bool has_value_std__optional_bool_(const std::optional<bool>& optional) noexcept {
|
|
105
|
+
return optional.has_value();
|
|
106
|
+
}
|
|
107
|
+
inline bool get_std__optional_bool_(const std::optional<bool>& optional) noexcept {
|
|
108
|
+
return *optional;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// pragma MARK: std::optional<std::string>
|
|
112
|
+
/**
|
|
113
|
+
* Specialized version of `std::optional<std::string>`.
|
|
114
|
+
*/
|
|
115
|
+
using std__optional_std__string_ = std::optional<std::string>;
|
|
116
|
+
inline std::optional<std::string> create_std__optional_std__string_(const std::string& value) noexcept {
|
|
117
|
+
return std::optional<std::string>(value);
|
|
118
|
+
}
|
|
119
|
+
inline bool has_value_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
|
|
120
|
+
return optional.has_value();
|
|
121
|
+
}
|
|
122
|
+
inline std::string get_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
|
|
123
|
+
return *optional;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// pragma MARK: std::variant<nitro::NullType, GetItemResult>
|
|
127
|
+
/**
|
|
128
|
+
* Wrapper struct for `std::variant<nitro::NullType, GetItemResult>`.
|
|
129
|
+
* std::variant cannot be used in Swift because of a Swift bug.
|
|
130
|
+
* Not even specializing it works. So we create a wrapper struct.
|
|
131
|
+
*/
|
|
132
|
+
struct std__variant_nitro__NullType__GetItemResult_ {
|
|
133
|
+
std::variant<nitro::NullType, GetItemResult> variant;
|
|
134
|
+
std__variant_nitro__NullType__GetItemResult_(std::variant<nitro::NullType, GetItemResult> variant): variant(variant) { }
|
|
135
|
+
operator std::variant<nitro::NullType, GetItemResult>() const noexcept {
|
|
136
|
+
return variant;
|
|
137
|
+
}
|
|
138
|
+
inline size_t index() const noexcept {
|
|
139
|
+
return variant.index();
|
|
140
|
+
}
|
|
141
|
+
inline nitro::NullType get_0() const noexcept {
|
|
142
|
+
return std::get<0>(variant);
|
|
143
|
+
}
|
|
144
|
+
inline GetItemResult get_1() const noexcept {
|
|
145
|
+
return std::get<1>(variant);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
inline std__variant_nitro__NullType__GetItemResult_ create_std__variant_nitro__NullType__GetItemResult_(nitro::NullType value) noexcept {
|
|
149
|
+
return std__variant_nitro__NullType__GetItemResult_(value);
|
|
150
|
+
}
|
|
151
|
+
inline std__variant_nitro__NullType__GetItemResult_ create_std__variant_nitro__NullType__GetItemResult_(const GetItemResult& value) noexcept {
|
|
152
|
+
return std__variant_nitro__NullType__GetItemResult_(value);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// pragma MARK: std::shared_ptr<Promise<std::variant<nitro::NullType, GetItemResult>>>
|
|
156
|
+
/**
|
|
157
|
+
* Specialized version of `std::shared_ptr<Promise<std::variant<nitro::NullType, GetItemResult>>>`.
|
|
158
|
+
*/
|
|
159
|
+
using std__shared_ptr_Promise_std__variant_nitro__NullType__GetItemResult___ = std::shared_ptr<Promise<std::variant<nitro::NullType, GetItemResult>>>;
|
|
160
|
+
inline std::shared_ptr<Promise<std::variant<nitro::NullType, GetItemResult>>> create_std__shared_ptr_Promise_std__variant_nitro__NullType__GetItemResult___() noexcept {
|
|
161
|
+
return Promise<std::variant<nitro::NullType, GetItemResult>>::create();
|
|
162
|
+
}
|
|
163
|
+
inline PromiseHolder<std::variant<nitro::NullType, GetItemResult>> wrap_std__shared_ptr_Promise_std__variant_nitro__NullType__GetItemResult___(std::shared_ptr<Promise<std::variant<nitro::NullType, GetItemResult>>> promise) noexcept {
|
|
164
|
+
return PromiseHolder<std::variant<nitro::NullType, GetItemResult>>(std::move(promise));
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// pragma MARK: std::function<void(const std::variant<nitro::NullType, GetItemResult>& /* result */)>
|
|
168
|
+
/**
|
|
169
|
+
* Specialized version of `std::function<void(const std::variant<nitro::NullType, GetItemResult>&)>`.
|
|
170
|
+
*/
|
|
171
|
+
using Func_void_std__variant_nitro__NullType__GetItemResult_ = std::function<void(const std::variant<nitro::NullType, GetItemResult>& /* result */)>;
|
|
172
|
+
/**
|
|
173
|
+
* Wrapper class for a `std::function<void(const std::variant<nitro::NullType, GetItemResult>& / * result * /)>`, this can be used from Swift.
|
|
174
|
+
*/
|
|
175
|
+
class Func_void_std__variant_nitro__NullType__GetItemResult__Wrapper final {
|
|
176
|
+
public:
|
|
177
|
+
explicit Func_void_std__variant_nitro__NullType__GetItemResult__Wrapper(std::function<void(const std::variant<nitro::NullType, GetItemResult>& /* result */)>&& func): _function(std::make_unique<std::function<void(const std::variant<nitro::NullType, GetItemResult>& /* result */)>>(std::move(func))) {}
|
|
178
|
+
inline void call(std::variant<nitro::NullType, GetItemResult> result) const noexcept {
|
|
179
|
+
_function->operator()(result);
|
|
180
|
+
}
|
|
181
|
+
private:
|
|
182
|
+
std::unique_ptr<std::function<void(const std::variant<nitro::NullType, GetItemResult>& /* result */)>> _function;
|
|
183
|
+
} SWIFT_NONCOPYABLE;
|
|
184
|
+
Func_void_std__variant_nitro__NullType__GetItemResult_ create_Func_void_std__variant_nitro__NullType__GetItemResult_(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
185
|
+
inline Func_void_std__variant_nitro__NullType__GetItemResult__Wrapper wrap_Func_void_std__variant_nitro__NullType__GetItemResult_(Func_void_std__variant_nitro__NullType__GetItemResult_ value) noexcept {
|
|
186
|
+
return Func_void_std__variant_nitro__NullType__GetItemResult__Wrapper(std::move(value));
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// pragma MARK: std::shared_ptr<HybridKeychainModuleSpec>
|
|
190
|
+
/**
|
|
191
|
+
* Specialized version of `std::shared_ptr<HybridKeychainModuleSpec>`.
|
|
192
|
+
*/
|
|
193
|
+
using std__shared_ptr_HybridKeychainModuleSpec_ = std::shared_ptr<HybridKeychainModuleSpec>;
|
|
194
|
+
std::shared_ptr<HybridKeychainModuleSpec> create_std__shared_ptr_HybridKeychainModuleSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
|
|
195
|
+
void* NON_NULL get_std__shared_ptr_HybridKeychainModuleSpec_(std__shared_ptr_HybridKeychainModuleSpec_ cppType);
|
|
196
|
+
|
|
197
|
+
// pragma MARK: std::weak_ptr<HybridKeychainModuleSpec>
|
|
198
|
+
using std__weak_ptr_HybridKeychainModuleSpec_ = std::weak_ptr<HybridKeychainModuleSpec>;
|
|
199
|
+
inline std__weak_ptr_HybridKeychainModuleSpec_ weakify_std__shared_ptr_HybridKeychainModuleSpec_(const std::shared_ptr<HybridKeychainModuleSpec>& strong) noexcept { return strong; }
|
|
200
|
+
|
|
201
|
+
// pragma MARK: Result<std::shared_ptr<Promise<bool>>>
|
|
202
|
+
using Result_std__shared_ptr_Promise_bool___ = Result<std::shared_ptr<Promise<bool>>>;
|
|
203
|
+
inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::shared_ptr<Promise<bool>>& value) noexcept {
|
|
204
|
+
return Result<std::shared_ptr<Promise<bool>>>::withValue(value);
|
|
205
|
+
}
|
|
206
|
+
inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::exception_ptr& error) noexcept {
|
|
207
|
+
return Result<std::shared_ptr<Promise<bool>>>::withError(error);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// pragma MARK: Result<std::shared_ptr<Promise<std::variant<nitro::NullType, GetItemResult>>>>
|
|
211
|
+
using Result_std__shared_ptr_Promise_std__variant_nitro__NullType__GetItemResult____ = Result<std::shared_ptr<Promise<std::variant<nitro::NullType, GetItemResult>>>>;
|
|
212
|
+
inline Result_std__shared_ptr_Promise_std__variant_nitro__NullType__GetItemResult____ create_Result_std__shared_ptr_Promise_std__variant_nitro__NullType__GetItemResult____(const std::shared_ptr<Promise<std::variant<nitro::NullType, GetItemResult>>>& value) noexcept {
|
|
213
|
+
return Result<std::shared_ptr<Promise<std::variant<nitro::NullType, GetItemResult>>>>::withValue(value);
|
|
214
|
+
}
|
|
215
|
+
inline Result_std__shared_ptr_Promise_std__variant_nitro__NullType__GetItemResult____ create_Result_std__shared_ptr_Promise_std__variant_nitro__NullType__GetItemResult____(const std::exception_ptr& error) noexcept {
|
|
216
|
+
return Result<std::shared_ptr<Promise<std::variant<nitro::NullType, GetItemResult>>>>::withError(error);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
} // namespace margelo::nitro::keychainmodule::bridge::swift
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// KeychainModule-Swift-Cxx-Umbrella.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `GetItemParams` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::keychainmodule { struct GetItemParams; }
|
|
13
|
+
// Forward declaration of `GetItemResult` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::keychainmodule { struct GetItemResult; }
|
|
15
|
+
// Forward declaration of `HasItemParams` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::keychainmodule { struct HasItemParams; }
|
|
17
|
+
// Forward declaration of `HybridKeychainModuleSpec` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::keychainmodule { class HybridKeychainModuleSpec; }
|
|
19
|
+
// Forward declaration of `RemoveItemParams` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::keychainmodule { struct RemoveItemParams; }
|
|
21
|
+
// Forward declaration of `SetItemParams` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::keychainmodule { struct SetItemParams; }
|
|
23
|
+
|
|
24
|
+
// Include C++ defined types
|
|
25
|
+
#include "GetItemParams.hpp"
|
|
26
|
+
#include "GetItemResult.hpp"
|
|
27
|
+
#include "HasItemParams.hpp"
|
|
28
|
+
#include "HybridKeychainModuleSpec.hpp"
|
|
29
|
+
#include "RemoveItemParams.hpp"
|
|
30
|
+
#include "SetItemParams.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
|
+
|
|
40
|
+
// C++ helpers for Swift
|
|
41
|
+
#include "KeychainModule-Swift-Cxx-Bridge.hpp"
|
|
42
|
+
|
|
43
|
+
// Common C++ types used in Swift
|
|
44
|
+
#include <NitroModules/ArrayBufferHolder.hpp>
|
|
45
|
+
#include <NitroModules/AnyMapUtils.hpp>
|
|
46
|
+
#include <NitroModules/RuntimeError.hpp>
|
|
47
|
+
#include <NitroModules/DateToChronoDate.hpp>
|
|
48
|
+
|
|
49
|
+
// Forward declarations of Swift defined types
|
|
50
|
+
// Forward declaration of `HybridKeychainModuleSpec_cxx` to properly resolve imports.
|
|
51
|
+
namespace KeychainModule { class HybridKeychainModuleSpec_cxx; }
|
|
52
|
+
|
|
53
|
+
// Include Swift defined types
|
|
54
|
+
#if __has_include("KeychainModule-Swift.h")
|
|
55
|
+
// This header is generated by Xcode/Swift on every app build.
|
|
56
|
+
// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "KeychainModule".
|
|
57
|
+
#include "KeychainModule-Swift.h"
|
|
58
|
+
// Same as above, but used when building with frameworks (`use_frameworks`)
|
|
59
|
+
#elif __has_include(<KeychainModule/KeychainModule-Swift.h>)
|
|
60
|
+
#include <KeychainModule/KeychainModule-Swift.h>
|
|
61
|
+
#else
|
|
62
|
+
#error KeychainModule's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "KeychainModule", and try building the app first.
|
|
63
|
+
#endif
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// KeychainModuleAutolinking.mm
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <NitroModules/HybridObjectRegistry.hpp>
|
|
10
|
+
#import "KeychainModule-Swift-Cxx-Umbrella.hpp"
|
|
11
|
+
#import <type_traits>
|
|
12
|
+
|
|
13
|
+
#include "HybridKeychainModuleSpecSwift.hpp"
|
|
14
|
+
|
|
15
|
+
@interface KeychainModuleAutolinking : NSObject
|
|
16
|
+
@end
|
|
17
|
+
|
|
18
|
+
@implementation KeychainModuleAutolinking
|
|
19
|
+
|
|
20
|
+
+ (void) load {
|
|
21
|
+
using namespace margelo::nitro;
|
|
22
|
+
using namespace margelo::nitro::keychainmodule;
|
|
23
|
+
|
|
24
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
25
|
+
"KeychainModule",
|
|
26
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
27
|
+
std::shared_ptr<HybridKeychainModuleSpec> hybridObject = KeychainModule::KeychainModuleAutolinking::createKeychainModule();
|
|
28
|
+
return hybridObject;
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// KeychainModuleAutolinking.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
public final class KeychainModuleAutolinking {
|
|
9
|
+
public typealias bridge = margelo.nitro.keychainmodule.bridge.swift
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Creates an instance of a Swift class that implements `HybridKeychainModuleSpec`,
|
|
13
|
+
* and wraps it in a Swift class that can directly interop with C++ (`HybridKeychainModuleSpec_cxx`)
|
|
14
|
+
*
|
|
15
|
+
* This is generated by Nitrogen and will initialize the class specified
|
|
16
|
+
* in the `"autolinking"` property of `nitro.json` (in this case, `KeychainModule`).
|
|
17
|
+
*/
|
|
18
|
+
public static func createKeychainModule() -> bridge.std__shared_ptr_HybridKeychainModuleSpec_ {
|
|
19
|
+
let hybridObject = KeychainModule()
|
|
20
|
+
return { () -> bridge.std__shared_ptr_HybridKeychainModuleSpec_ in
|
|
21
|
+
let __cxxWrapped = hybridObject.getCxxWrapper()
|
|
22
|
+
return __cxxWrapped.getCxxPart()
|
|
23
|
+
}()
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridKeychainModuleSpecSwift.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridKeychainModuleSpecSwift.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::keychainmodule {
|
|
11
|
+
} // namespace margelo::nitro::keychainmodule
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridKeychainModuleSpecSwift.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "HybridKeychainModuleSpec.hpp"
|
|
11
|
+
|
|
12
|
+
// Forward declaration of `HybridKeychainModuleSpec_cxx` to properly resolve imports.
|
|
13
|
+
namespace KeychainModule { class HybridKeychainModuleSpec_cxx; }
|
|
14
|
+
|
|
15
|
+
// Forward declaration of `SetItemParams` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::keychainmodule { struct SetItemParams; }
|
|
17
|
+
// Forward declaration of `GetItemResult` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::keychainmodule { struct GetItemResult; }
|
|
19
|
+
// Forward declaration of `GetItemParams` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::keychainmodule { struct GetItemParams; }
|
|
21
|
+
// Forward declaration of `RemoveItemParams` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::keychainmodule { struct RemoveItemParams; }
|
|
23
|
+
// Forward declaration of `HasItemParams` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::keychainmodule { struct HasItemParams; }
|
|
25
|
+
|
|
26
|
+
#include <NitroModules/Promise.hpp>
|
|
27
|
+
#include "SetItemParams.hpp"
|
|
28
|
+
#include <string>
|
|
29
|
+
#include <optional>
|
|
30
|
+
#include <NitroModules/Null.hpp>
|
|
31
|
+
#include "GetItemResult.hpp"
|
|
32
|
+
#include <variant>
|
|
33
|
+
#include "GetItemParams.hpp"
|
|
34
|
+
#include "RemoveItemParams.hpp"
|
|
35
|
+
#include "HasItemParams.hpp"
|
|
36
|
+
|
|
37
|
+
#include "KeychainModule-Swift-Cxx-Umbrella.hpp"
|
|
38
|
+
|
|
39
|
+
namespace margelo::nitro::keychainmodule {
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The C++ part of HybridKeychainModuleSpec_cxx.swift.
|
|
43
|
+
*
|
|
44
|
+
* HybridKeychainModuleSpecSwift (C++) accesses HybridKeychainModuleSpec_cxx (Swift), and might
|
|
45
|
+
* contain some additional bridging code for C++ <> Swift interop.
|
|
46
|
+
*
|
|
47
|
+
* Since this obviously introduces an overhead, I hope at some point in
|
|
48
|
+
* the future, HybridKeychainModuleSpec_cxx can directly inherit from the C++ class HybridKeychainModuleSpec
|
|
49
|
+
* to simplify the whole structure and memory management.
|
|
50
|
+
*/
|
|
51
|
+
class HybridKeychainModuleSpecSwift: public virtual HybridKeychainModuleSpec {
|
|
52
|
+
public:
|
|
53
|
+
// Constructor from a Swift instance
|
|
54
|
+
explicit HybridKeychainModuleSpecSwift(const KeychainModule::HybridKeychainModuleSpec_cxx& swiftPart):
|
|
55
|
+
HybridObject(HybridKeychainModuleSpec::TAG),
|
|
56
|
+
_swiftPart(swiftPart) { }
|
|
57
|
+
|
|
58
|
+
public:
|
|
59
|
+
// Get the Swift part
|
|
60
|
+
inline KeychainModule::HybridKeychainModuleSpec_cxx& getSwiftPart() noexcept {
|
|
61
|
+
return _swiftPart;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
public:
|
|
65
|
+
inline size_t getExternalMemorySize() noexcept override {
|
|
66
|
+
return _swiftPart.getMemorySize();
|
|
67
|
+
}
|
|
68
|
+
void dispose() noexcept override {
|
|
69
|
+
_swiftPart.dispose();
|
|
70
|
+
}
|
|
71
|
+
std::string toString() override {
|
|
72
|
+
return _swiftPart.toString();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
public:
|
|
76
|
+
// Properties
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
public:
|
|
80
|
+
// Methods
|
|
81
|
+
inline std::shared_ptr<Promise<bool>> setItem(const SetItemParams& params) override {
|
|
82
|
+
auto __result = _swiftPart.setItem(std::forward<decltype(params)>(params));
|
|
83
|
+
if (__result.hasError()) [[unlikely]] {
|
|
84
|
+
std::rethrow_exception(__result.error());
|
|
85
|
+
}
|
|
86
|
+
auto __value = std::move(__result.value());
|
|
87
|
+
return __value;
|
|
88
|
+
}
|
|
89
|
+
inline std::shared_ptr<Promise<std::variant<nitro::NullType, GetItemResult>>> getItem(const GetItemParams& params) override {
|
|
90
|
+
auto __result = _swiftPart.getItem(std::forward<decltype(params)>(params));
|
|
91
|
+
if (__result.hasError()) [[unlikely]] {
|
|
92
|
+
std::rethrow_exception(__result.error());
|
|
93
|
+
}
|
|
94
|
+
auto __value = std::move(__result.value());
|
|
95
|
+
return __value;
|
|
96
|
+
}
|
|
97
|
+
inline std::shared_ptr<Promise<bool>> removeItem(const RemoveItemParams& params) override {
|
|
98
|
+
auto __result = _swiftPart.removeItem(std::forward<decltype(params)>(params));
|
|
99
|
+
if (__result.hasError()) [[unlikely]] {
|
|
100
|
+
std::rethrow_exception(__result.error());
|
|
101
|
+
}
|
|
102
|
+
auto __value = std::move(__result.value());
|
|
103
|
+
return __value;
|
|
104
|
+
}
|
|
105
|
+
inline std::shared_ptr<Promise<bool>> hasItem(const HasItemParams& params) override {
|
|
106
|
+
auto __result = _swiftPart.hasItem(std::forward<decltype(params)>(params));
|
|
107
|
+
if (__result.hasError()) [[unlikely]] {
|
|
108
|
+
std::rethrow_exception(__result.error());
|
|
109
|
+
}
|
|
110
|
+
auto __value = std::move(__result.value());
|
|
111
|
+
return __value;
|
|
112
|
+
}
|
|
113
|
+
inline std::shared_ptr<Promise<bool>> isICloudSyncEnabled() override {
|
|
114
|
+
auto __result = _swiftPart.isICloudSyncEnabled();
|
|
115
|
+
if (__result.hasError()) [[unlikely]] {
|
|
116
|
+
std::rethrow_exception(__result.error());
|
|
117
|
+
}
|
|
118
|
+
auto __value = std::move(__result.value());
|
|
119
|
+
return __value;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
private:
|
|
123
|
+
KeychainModule::HybridKeychainModuleSpec_cxx _swiftPart;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
} // namespace margelo::nitro::keychainmodule
|
|
@@ -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 © 2025 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.keychainmodule.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 © 2025 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.keychainmodule.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__GetItemResult_.swift
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_std__variant_nitro__NullType__GetItemResult_.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Wraps a Swift `(_ value: Variant_NullType_GetItemResult) -> 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__GetItemResult_ {
|
|
16
|
+
public typealias bridge = margelo.nitro.keychainmodule.bridge.swift
|
|
17
|
+
|
|
18
|
+
private let closure: (_ value: Variant_NullType_GetItemResult) -> Void
|
|
19
|
+
|
|
20
|
+
public init(_ closure: @escaping (_ value: Variant_NullType_GetItemResult) -> Void) {
|
|
21
|
+
self.closure = closure
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@inline(__always)
|
|
25
|
+
public func call(value: bridge.std__variant_nitro__NullType__GetItemResult_) -> Void {
|
|
26
|
+
self.closure({ () -> Variant_NullType_GetItemResult 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__GetItemResult_`.
|
|
52
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_std__variant_nitro__NullType__GetItemResult_>`.
|
|
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__GetItemResult_ {
|
|
57
|
+
return Unmanaged<Func_void_std__variant_nitro__NullType__GetItemResult_>.fromOpaque(pointer).takeRetainedValue()
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// GetItemParams.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Represents an instance of `GetItemParams`, backed by a C++ struct.
|
|
13
|
+
*/
|
|
14
|
+
public typealias GetItemParams = margelo.nitro.keychainmodule.GetItemParams
|
|
15
|
+
|
|
16
|
+
public extension GetItemParams {
|
|
17
|
+
private typealias bridge = margelo.nitro.keychainmodule.bridge.swift
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Create a new instance of `GetItemParams`.
|
|
21
|
+
*/
|
|
22
|
+
init(key: String) {
|
|
23
|
+
self.init(std.string(key))
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var key: String {
|
|
27
|
+
@inline(__always)
|
|
28
|
+
get {
|
|
29
|
+
return String(self.__key)
|
|
30
|
+
}
|
|
31
|
+
@inline(__always)
|
|
32
|
+
set {
|
|
33
|
+
self.__key = std.string(newValue)
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|