@zulfio/react-native-alarm-kit 1.0.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/Alarmkit.podspec +35 -0
- package/LICENSE +20 -0
- package/README.md +163 -0
- package/android/CMakeLists.txt +24 -0
- package/android/build.gradle +129 -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/alarmkit/AlarmkitPackage.kt +22 -0
- package/android/src/main/java/com/margelo/nitro/alarmkit/Alarmkit.kt +7 -0
- package/ios/AlarmKit.swift +296 -0
- package/lib/module/AlarmKit.nitro.js +4 -0
- package/lib/module/AlarmKit.nitro.js.map +1 -0
- package/lib/module/index.js +40 -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/AlarmKit.nitro.d.ts +24 -0
- package/lib/typescript/src/AlarmKit.nitro.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +11 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/nitro.json +17 -0
- package/nitrogen/generated/android/alarmkit+autolinking.cmake +78 -0
- package/nitrogen/generated/android/alarmkit+autolinking.gradle +27 -0
- package/nitrogen/generated/android/alarmkitOnLoad.cpp +46 -0
- package/nitrogen/generated/android/alarmkitOnLoad.hpp +25 -0
- package/nitrogen/generated/android/c++/JAlarmCountdown.hpp +57 -0
- package/nitrogen/generated/android/c++/JAlarmWeekday.hpp +74 -0
- package/nitrogen/generated/android/c++/JCustomizableAlarmButton.hpp +61 -0
- package/nitrogen/generated/android/c++/JHybridAlarmKitSpec.cpp +180 -0
- package/nitrogen/generated/android/c++/JHybridAlarmKitSpec.hpp +68 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/alarmkit/AlarmCountdown.kt +27 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/alarmkit/AlarmWeekday.kt +30 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/alarmkit/CustomizableAlarmButton.kt +28 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/alarmkit/HybridAlarmKitSpec.kt +76 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/alarmkit/alarmkitOnLoad.kt +35 -0
- package/nitrogen/generated/ios/AlarmKit+autolinking.rb +60 -0
- package/nitrogen/generated/ios/AlarmKit-Swift-Cxx-Bridge.cpp +72 -0
- package/nitrogen/generated/ios/AlarmKit-Swift-Cxx-Bridge.hpp +309 -0
- package/nitrogen/generated/ios/AlarmKit-Swift-Cxx-Umbrella.hpp +56 -0
- package/nitrogen/generated/ios/AlarmKitAutolinking.mm +33 -0
- package/nitrogen/generated/ios/AlarmKitAutolinking.swift +25 -0
- package/nitrogen/generated/ios/c++/HybridAlarmKitSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridAlarmKitSpecSwift.hpp +130 -0
- package/nitrogen/generated/ios/swift/AlarmCountdown.swift +70 -0
- package/nitrogen/generated/ios/swift/AlarmWeekday.swift +60 -0
- package/nitrogen/generated/ios/swift/CustomizableAlarmButton.swift +57 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_std__string_.swift +52 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_std__string_.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridAlarmKitSpec.swift +54 -0
- package/nitrogen/generated/ios/swift/HybridAlarmKitSpec_cxx.swift +271 -0
- package/nitrogen/generated/shared/c++/AlarmCountdown.hpp +73 -0
- package/nitrogen/generated/shared/c++/AlarmWeekday.hpp +98 -0
- package/nitrogen/generated/shared/c++/CustomizableAlarmButton.hpp +77 -0
- package/nitrogen/generated/shared/c++/HybridAlarmKitSpec.cpp +27 -0
- package/nitrogen/generated/shared/c++/HybridAlarmKitSpec.hpp +79 -0
- package/package.json +168 -0
- package/src/AlarmKit.nitro.ts +48 -0
- package/src/index.tsx +96 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// AlarmKit-Swift-Cxx-Bridge.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "AlarmKit-Swift-Cxx-Bridge.hpp"
|
|
9
|
+
|
|
10
|
+
// Include C++ implementation defined types
|
|
11
|
+
#include "AlarmKit-Swift-Cxx-Umbrella.hpp"
|
|
12
|
+
#include "HybridAlarmKitSpecSwift.hpp"
|
|
13
|
+
|
|
14
|
+
namespace margelo::nitro::alarmkit::bridge::swift {
|
|
15
|
+
|
|
16
|
+
// pragma MARK: std::function<void(bool /* result */)>
|
|
17
|
+
Func_void_bool create_Func_void_bool(void* _Nonnull swiftClosureWrapper) {
|
|
18
|
+
auto swiftClosure = AlarmKit::Func_void_bool::fromUnsafe(swiftClosureWrapper);
|
|
19
|
+
return [swiftClosure = std::move(swiftClosure)](bool result) mutable -> void {
|
|
20
|
+
swiftClosure.call(result);
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
|
|
25
|
+
Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* _Nonnull swiftClosureWrapper) {
|
|
26
|
+
auto swiftClosure = AlarmKit::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper);
|
|
27
|
+
return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void {
|
|
28
|
+
swiftClosure.call(error);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// pragma MARK: std::function<void(const std::string& /* result */)>
|
|
33
|
+
Func_void_std__string create_Func_void_std__string(void* _Nonnull swiftClosureWrapper) {
|
|
34
|
+
auto swiftClosure = AlarmKit::Func_void_std__string::fromUnsafe(swiftClosureWrapper);
|
|
35
|
+
return [swiftClosure = std::move(swiftClosure)](const std::string& result) mutable -> void {
|
|
36
|
+
swiftClosure.call(result);
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// pragma MARK: std::function<void(const std::optional<std::string>& /* result */)>
|
|
41
|
+
Func_void_std__optional_std__string_ create_Func_void_std__optional_std__string_(void* _Nonnull swiftClosureWrapper) {
|
|
42
|
+
auto swiftClosure = AlarmKit::Func_void_std__optional_std__string_::fromUnsafe(swiftClosureWrapper);
|
|
43
|
+
return [swiftClosure = std::move(swiftClosure)](const std::optional<std::string>& result) mutable -> void {
|
|
44
|
+
swiftClosure.call(result);
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// pragma MARK: std::function<void(const std::vector<std::string>& /* result */)>
|
|
49
|
+
Func_void_std__vector_std__string_ create_Func_void_std__vector_std__string_(void* _Nonnull swiftClosureWrapper) {
|
|
50
|
+
auto swiftClosure = AlarmKit::Func_void_std__vector_std__string_::fromUnsafe(swiftClosureWrapper);
|
|
51
|
+
return [swiftClosure = std::move(swiftClosure)](const std::vector<std::string>& result) mutable -> void {
|
|
52
|
+
swiftClosure.call(result);
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// pragma MARK: std::shared_ptr<margelo::nitro::alarmkit::HybridAlarmKitSpec>
|
|
57
|
+
std::shared_ptr<margelo::nitro::alarmkit::HybridAlarmKitSpec> create_std__shared_ptr_margelo__nitro__alarmkit__HybridAlarmKitSpec_(void* _Nonnull swiftUnsafePointer) {
|
|
58
|
+
AlarmKit::HybridAlarmKitSpec_cxx swiftPart = AlarmKit::HybridAlarmKitSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
59
|
+
return std::make_shared<margelo::nitro::alarmkit::HybridAlarmKitSpecSwift>(swiftPart);
|
|
60
|
+
}
|
|
61
|
+
void* _Nonnull get_std__shared_ptr_margelo__nitro__alarmkit__HybridAlarmKitSpec_(std__shared_ptr_margelo__nitro__alarmkit__HybridAlarmKitSpec_ cppType) {
|
|
62
|
+
std::shared_ptr<margelo::nitro::alarmkit::HybridAlarmKitSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::alarmkit::HybridAlarmKitSpecSwift>(cppType);
|
|
63
|
+
#ifdef NITRO_DEBUG
|
|
64
|
+
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
65
|
+
throw std::runtime_error("Class \"HybridAlarmKitSpec\" is not implemented in Swift!");
|
|
66
|
+
}
|
|
67
|
+
#endif
|
|
68
|
+
AlarmKit::HybridAlarmKitSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
|
|
69
|
+
return swiftPart.toUnsafe();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
} // namespace margelo::nitro::alarmkit::bridge::swift
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// AlarmKit-Swift-Cxx-Bridge.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `AlarmCountdown` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::alarmkit { struct AlarmCountdown; }
|
|
13
|
+
// Forward declaration of `AlarmWeekday` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::alarmkit { enum class AlarmWeekday; }
|
|
15
|
+
// Forward declaration of `CustomizableAlarmButton` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::alarmkit { struct CustomizableAlarmButton; }
|
|
17
|
+
// Forward declaration of `HybridAlarmKitSpec` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::alarmkit { class HybridAlarmKitSpec; }
|
|
19
|
+
|
|
20
|
+
// Forward declarations of Swift defined types
|
|
21
|
+
// Forward declaration of `HybridAlarmKitSpec_cxx` to properly resolve imports.
|
|
22
|
+
namespace AlarmKit { class HybridAlarmKitSpec_cxx; }
|
|
23
|
+
|
|
24
|
+
// Include C++ defined types
|
|
25
|
+
#include "AlarmCountdown.hpp"
|
|
26
|
+
#include "AlarmWeekday.hpp"
|
|
27
|
+
#include "CustomizableAlarmButton.hpp"
|
|
28
|
+
#include "HybridAlarmKitSpec.hpp"
|
|
29
|
+
#include <NitroModules/Promise.hpp>
|
|
30
|
+
#include <NitroModules/PromiseHolder.hpp>
|
|
31
|
+
#include <NitroModules/Result.hpp>
|
|
32
|
+
#include <exception>
|
|
33
|
+
#include <functional>
|
|
34
|
+
#include <memory>
|
|
35
|
+
#include <optional>
|
|
36
|
+
#include <string>
|
|
37
|
+
#include <vector>
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Contains specialized versions of C++ templated types so they can be accessed from Swift,
|
|
41
|
+
* as well as helper functions to interact with those C++ types from Swift.
|
|
42
|
+
*/
|
|
43
|
+
namespace margelo::nitro::alarmkit::bridge::swift {
|
|
44
|
+
|
|
45
|
+
// pragma MARK: std::shared_ptr<Promise<bool>>
|
|
46
|
+
/**
|
|
47
|
+
* Specialized version of `std::shared_ptr<Promise<bool>>`.
|
|
48
|
+
*/
|
|
49
|
+
using std__shared_ptr_Promise_bool__ = std::shared_ptr<Promise<bool>>;
|
|
50
|
+
inline std::shared_ptr<Promise<bool>> create_std__shared_ptr_Promise_bool__() {
|
|
51
|
+
return Promise<bool>::create();
|
|
52
|
+
}
|
|
53
|
+
inline PromiseHolder<bool> wrap_std__shared_ptr_Promise_bool__(std::shared_ptr<Promise<bool>> promise) {
|
|
54
|
+
return PromiseHolder<bool>(std::move(promise));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// pragma MARK: std::function<void(bool /* result */)>
|
|
58
|
+
/**
|
|
59
|
+
* Specialized version of `std::function<void(bool)>`.
|
|
60
|
+
*/
|
|
61
|
+
using Func_void_bool = std::function<void(bool /* result */)>;
|
|
62
|
+
/**
|
|
63
|
+
* Wrapper class for a `std::function<void(bool / * result * /)>`, this can be used from Swift.
|
|
64
|
+
*/
|
|
65
|
+
class Func_void_bool_Wrapper final {
|
|
66
|
+
public:
|
|
67
|
+
explicit Func_void_bool_Wrapper(std::function<void(bool /* result */)>&& func): _function(std::make_shared<std::function<void(bool /* result */)>>(std::move(func))) {}
|
|
68
|
+
inline void call(bool result) const {
|
|
69
|
+
_function->operator()(result);
|
|
70
|
+
}
|
|
71
|
+
private:
|
|
72
|
+
std::shared_ptr<std::function<void(bool /* result */)>> _function;
|
|
73
|
+
};
|
|
74
|
+
Func_void_bool create_Func_void_bool(void* _Nonnull swiftClosureWrapper);
|
|
75
|
+
inline Func_void_bool_Wrapper wrap_Func_void_bool(Func_void_bool value) {
|
|
76
|
+
return Func_void_bool_Wrapper(std::move(value));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
|
|
80
|
+
/**
|
|
81
|
+
* Specialized version of `std::function<void(const std::exception_ptr&)>`.
|
|
82
|
+
*/
|
|
83
|
+
using Func_void_std__exception_ptr = std::function<void(const std::exception_ptr& /* error */)>;
|
|
84
|
+
/**
|
|
85
|
+
* Wrapper class for a `std::function<void(const std::exception_ptr& / * error * /)>`, this can be used from Swift.
|
|
86
|
+
*/
|
|
87
|
+
class Func_void_std__exception_ptr_Wrapper final {
|
|
88
|
+
public:
|
|
89
|
+
explicit Func_void_std__exception_ptr_Wrapper(std::function<void(const std::exception_ptr& /* error */)>&& func): _function(std::make_shared<std::function<void(const std::exception_ptr& /* error */)>>(std::move(func))) {}
|
|
90
|
+
inline void call(std::exception_ptr error) const {
|
|
91
|
+
_function->operator()(error);
|
|
92
|
+
}
|
|
93
|
+
private:
|
|
94
|
+
std::shared_ptr<std::function<void(const std::exception_ptr& /* error */)>> _function;
|
|
95
|
+
};
|
|
96
|
+
Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* _Nonnull swiftClosureWrapper);
|
|
97
|
+
inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) {
|
|
98
|
+
return Func_void_std__exception_ptr_Wrapper(std::move(value));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// pragma MARK: std::shared_ptr<Promise<std::string>>
|
|
102
|
+
/**
|
|
103
|
+
* Specialized version of `std::shared_ptr<Promise<std::string>>`.
|
|
104
|
+
*/
|
|
105
|
+
using std__shared_ptr_Promise_std__string__ = std::shared_ptr<Promise<std::string>>;
|
|
106
|
+
inline std::shared_ptr<Promise<std::string>> create_std__shared_ptr_Promise_std__string__() {
|
|
107
|
+
return Promise<std::string>::create();
|
|
108
|
+
}
|
|
109
|
+
inline PromiseHolder<std::string> wrap_std__shared_ptr_Promise_std__string__(std::shared_ptr<Promise<std::string>> promise) {
|
|
110
|
+
return PromiseHolder<std::string>(std::move(promise));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// pragma MARK: std::function<void(const std::string& /* result */)>
|
|
114
|
+
/**
|
|
115
|
+
* Specialized version of `std::function<void(const std::string&)>`.
|
|
116
|
+
*/
|
|
117
|
+
using Func_void_std__string = std::function<void(const std::string& /* result */)>;
|
|
118
|
+
/**
|
|
119
|
+
* Wrapper class for a `std::function<void(const std::string& / * result * /)>`, this can be used from Swift.
|
|
120
|
+
*/
|
|
121
|
+
class Func_void_std__string_Wrapper final {
|
|
122
|
+
public:
|
|
123
|
+
explicit Func_void_std__string_Wrapper(std::function<void(const std::string& /* result */)>&& func): _function(std::make_shared<std::function<void(const std::string& /* result */)>>(std::move(func))) {}
|
|
124
|
+
inline void call(std::string result) const {
|
|
125
|
+
_function->operator()(result);
|
|
126
|
+
}
|
|
127
|
+
private:
|
|
128
|
+
std::shared_ptr<std::function<void(const std::string& /* result */)>> _function;
|
|
129
|
+
};
|
|
130
|
+
Func_void_std__string create_Func_void_std__string(void* _Nonnull swiftClosureWrapper);
|
|
131
|
+
inline Func_void_std__string_Wrapper wrap_Func_void_std__string(Func_void_std__string value) {
|
|
132
|
+
return Func_void_std__string_Wrapper(std::move(value));
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// pragma MARK: std::optional<CustomizableAlarmButton>
|
|
136
|
+
/**
|
|
137
|
+
* Specialized version of `std::optional<CustomizableAlarmButton>`.
|
|
138
|
+
*/
|
|
139
|
+
using std__optional_CustomizableAlarmButton_ = std::optional<CustomizableAlarmButton>;
|
|
140
|
+
inline std::optional<CustomizableAlarmButton> create_std__optional_CustomizableAlarmButton_(const CustomizableAlarmButton& value) {
|
|
141
|
+
return std::optional<CustomizableAlarmButton>(value);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// pragma MARK: std::optional<double>
|
|
145
|
+
/**
|
|
146
|
+
* Specialized version of `std::optional<double>`.
|
|
147
|
+
*/
|
|
148
|
+
using std__optional_double_ = std::optional<double>;
|
|
149
|
+
inline std::optional<double> create_std__optional_double_(const double& value) {
|
|
150
|
+
return std::optional<double>(value);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// pragma MARK: std::optional<AlarmCountdown>
|
|
154
|
+
/**
|
|
155
|
+
* Specialized version of `std::optional<AlarmCountdown>`.
|
|
156
|
+
*/
|
|
157
|
+
using std__optional_AlarmCountdown_ = std::optional<AlarmCountdown>;
|
|
158
|
+
inline std::optional<AlarmCountdown> create_std__optional_AlarmCountdown_(const AlarmCountdown& value) {
|
|
159
|
+
return std::optional<AlarmCountdown>(value);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// pragma MARK: std::vector<AlarmWeekday>
|
|
163
|
+
/**
|
|
164
|
+
* Specialized version of `std::vector<AlarmWeekday>`.
|
|
165
|
+
*/
|
|
166
|
+
using std__vector_AlarmWeekday_ = std::vector<AlarmWeekday>;
|
|
167
|
+
inline std::vector<AlarmWeekday> create_std__vector_AlarmWeekday_(size_t size) {
|
|
168
|
+
std::vector<AlarmWeekday> vector;
|
|
169
|
+
vector.reserve(size);
|
|
170
|
+
return vector;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// pragma MARK: std::optional<std::string>
|
|
174
|
+
/**
|
|
175
|
+
* Specialized version of `std::optional<std::string>`.
|
|
176
|
+
*/
|
|
177
|
+
using std__optional_std__string_ = std::optional<std::string>;
|
|
178
|
+
inline std::optional<std::string> create_std__optional_std__string_(const std::string& value) {
|
|
179
|
+
return std::optional<std::string>(value);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// pragma MARK: std::shared_ptr<Promise<std::optional<std::string>>>
|
|
183
|
+
/**
|
|
184
|
+
* Specialized version of `std::shared_ptr<Promise<std::optional<std::string>>>`.
|
|
185
|
+
*/
|
|
186
|
+
using std__shared_ptr_Promise_std__optional_std__string___ = std::shared_ptr<Promise<std::optional<std::string>>>;
|
|
187
|
+
inline std::shared_ptr<Promise<std::optional<std::string>>> create_std__shared_ptr_Promise_std__optional_std__string___() {
|
|
188
|
+
return Promise<std::optional<std::string>>::create();
|
|
189
|
+
}
|
|
190
|
+
inline PromiseHolder<std::optional<std::string>> wrap_std__shared_ptr_Promise_std__optional_std__string___(std::shared_ptr<Promise<std::optional<std::string>>> promise) {
|
|
191
|
+
return PromiseHolder<std::optional<std::string>>(std::move(promise));
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// pragma MARK: std::function<void(const std::optional<std::string>& /* result */)>
|
|
195
|
+
/**
|
|
196
|
+
* Specialized version of `std::function<void(const std::optional<std::string>&)>`.
|
|
197
|
+
*/
|
|
198
|
+
using Func_void_std__optional_std__string_ = std::function<void(const std::optional<std::string>& /* result */)>;
|
|
199
|
+
/**
|
|
200
|
+
* Wrapper class for a `std::function<void(const std::optional<std::string>& / * result * /)>`, this can be used from Swift.
|
|
201
|
+
*/
|
|
202
|
+
class Func_void_std__optional_std__string__Wrapper final {
|
|
203
|
+
public:
|
|
204
|
+
explicit Func_void_std__optional_std__string__Wrapper(std::function<void(const std::optional<std::string>& /* result */)>&& func): _function(std::make_shared<std::function<void(const std::optional<std::string>& /* result */)>>(std::move(func))) {}
|
|
205
|
+
inline void call(std::optional<std::string> result) const {
|
|
206
|
+
_function->operator()(result);
|
|
207
|
+
}
|
|
208
|
+
private:
|
|
209
|
+
std::shared_ptr<std::function<void(const std::optional<std::string>& /* result */)>> _function;
|
|
210
|
+
};
|
|
211
|
+
Func_void_std__optional_std__string_ create_Func_void_std__optional_std__string_(void* _Nonnull swiftClosureWrapper);
|
|
212
|
+
inline Func_void_std__optional_std__string__Wrapper wrap_Func_void_std__optional_std__string_(Func_void_std__optional_std__string_ value) {
|
|
213
|
+
return Func_void_std__optional_std__string__Wrapper(std::move(value));
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// pragma MARK: std::vector<std::string>
|
|
217
|
+
/**
|
|
218
|
+
* Specialized version of `std::vector<std::string>`.
|
|
219
|
+
*/
|
|
220
|
+
using std__vector_std__string_ = std::vector<std::string>;
|
|
221
|
+
inline std::vector<std::string> create_std__vector_std__string_(size_t size) {
|
|
222
|
+
std::vector<std::string> vector;
|
|
223
|
+
vector.reserve(size);
|
|
224
|
+
return vector;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// pragma MARK: std::shared_ptr<Promise<std::vector<std::string>>>
|
|
228
|
+
/**
|
|
229
|
+
* Specialized version of `std::shared_ptr<Promise<std::vector<std::string>>>`.
|
|
230
|
+
*/
|
|
231
|
+
using std__shared_ptr_Promise_std__vector_std__string___ = std::shared_ptr<Promise<std::vector<std::string>>>;
|
|
232
|
+
inline std::shared_ptr<Promise<std::vector<std::string>>> create_std__shared_ptr_Promise_std__vector_std__string___() {
|
|
233
|
+
return Promise<std::vector<std::string>>::create();
|
|
234
|
+
}
|
|
235
|
+
inline PromiseHolder<std::vector<std::string>> wrap_std__shared_ptr_Promise_std__vector_std__string___(std::shared_ptr<Promise<std::vector<std::string>>> promise) {
|
|
236
|
+
return PromiseHolder<std::vector<std::string>>(std::move(promise));
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// pragma MARK: std::function<void(const std::vector<std::string>& /* result */)>
|
|
240
|
+
/**
|
|
241
|
+
* Specialized version of `std::function<void(const std::vector<std::string>&)>`.
|
|
242
|
+
*/
|
|
243
|
+
using Func_void_std__vector_std__string_ = std::function<void(const std::vector<std::string>& /* result */)>;
|
|
244
|
+
/**
|
|
245
|
+
* Wrapper class for a `std::function<void(const std::vector<std::string>& / * result * /)>`, this can be used from Swift.
|
|
246
|
+
*/
|
|
247
|
+
class Func_void_std__vector_std__string__Wrapper final {
|
|
248
|
+
public:
|
|
249
|
+
explicit Func_void_std__vector_std__string__Wrapper(std::function<void(const std::vector<std::string>& /* result */)>&& func): _function(std::make_shared<std::function<void(const std::vector<std::string>& /* result */)>>(std::move(func))) {}
|
|
250
|
+
inline void call(std::vector<std::string> result) const {
|
|
251
|
+
_function->operator()(result);
|
|
252
|
+
}
|
|
253
|
+
private:
|
|
254
|
+
std::shared_ptr<std::function<void(const std::vector<std::string>& /* result */)>> _function;
|
|
255
|
+
};
|
|
256
|
+
Func_void_std__vector_std__string_ create_Func_void_std__vector_std__string_(void* _Nonnull swiftClosureWrapper);
|
|
257
|
+
inline Func_void_std__vector_std__string__Wrapper wrap_Func_void_std__vector_std__string_(Func_void_std__vector_std__string_ value) {
|
|
258
|
+
return Func_void_std__vector_std__string__Wrapper(std::move(value));
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// pragma MARK: std::shared_ptr<margelo::nitro::alarmkit::HybridAlarmKitSpec>
|
|
262
|
+
/**
|
|
263
|
+
* Specialized version of `std::shared_ptr<margelo::nitro::alarmkit::HybridAlarmKitSpec>`.
|
|
264
|
+
*/
|
|
265
|
+
using std__shared_ptr_margelo__nitro__alarmkit__HybridAlarmKitSpec_ = std::shared_ptr<margelo::nitro::alarmkit::HybridAlarmKitSpec>;
|
|
266
|
+
std::shared_ptr<margelo::nitro::alarmkit::HybridAlarmKitSpec> create_std__shared_ptr_margelo__nitro__alarmkit__HybridAlarmKitSpec_(void* _Nonnull swiftUnsafePointer);
|
|
267
|
+
void* _Nonnull get_std__shared_ptr_margelo__nitro__alarmkit__HybridAlarmKitSpec_(std__shared_ptr_margelo__nitro__alarmkit__HybridAlarmKitSpec_ cppType);
|
|
268
|
+
|
|
269
|
+
// pragma MARK: std::weak_ptr<margelo::nitro::alarmkit::HybridAlarmKitSpec>
|
|
270
|
+
using std__weak_ptr_margelo__nitro__alarmkit__HybridAlarmKitSpec_ = std::weak_ptr<margelo::nitro::alarmkit::HybridAlarmKitSpec>;
|
|
271
|
+
inline std__weak_ptr_margelo__nitro__alarmkit__HybridAlarmKitSpec_ weakify_std__shared_ptr_margelo__nitro__alarmkit__HybridAlarmKitSpec_(const std::shared_ptr<margelo::nitro::alarmkit::HybridAlarmKitSpec>& strong) { return strong; }
|
|
272
|
+
|
|
273
|
+
// pragma MARK: Result<std::shared_ptr<Promise<bool>>>
|
|
274
|
+
using Result_std__shared_ptr_Promise_bool___ = Result<std::shared_ptr<Promise<bool>>>;
|
|
275
|
+
inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::shared_ptr<Promise<bool>>& value) {
|
|
276
|
+
return Result<std::shared_ptr<Promise<bool>>>::withValue(value);
|
|
277
|
+
}
|
|
278
|
+
inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::exception_ptr& error) {
|
|
279
|
+
return Result<std::shared_ptr<Promise<bool>>>::withError(error);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// pragma MARK: Result<std::shared_ptr<Promise<std::string>>>
|
|
283
|
+
using Result_std__shared_ptr_Promise_std__string___ = Result<std::shared_ptr<Promise<std::string>>>;
|
|
284
|
+
inline Result_std__shared_ptr_Promise_std__string___ create_Result_std__shared_ptr_Promise_std__string___(const std::shared_ptr<Promise<std::string>>& value) {
|
|
285
|
+
return Result<std::shared_ptr<Promise<std::string>>>::withValue(value);
|
|
286
|
+
}
|
|
287
|
+
inline Result_std__shared_ptr_Promise_std__string___ create_Result_std__shared_ptr_Promise_std__string___(const std::exception_ptr& error) {
|
|
288
|
+
return Result<std::shared_ptr<Promise<std::string>>>::withError(error);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// pragma MARK: Result<std::shared_ptr<Promise<std::optional<std::string>>>>
|
|
292
|
+
using Result_std__shared_ptr_Promise_std__optional_std__string____ = Result<std::shared_ptr<Promise<std::optional<std::string>>>>;
|
|
293
|
+
inline Result_std__shared_ptr_Promise_std__optional_std__string____ create_Result_std__shared_ptr_Promise_std__optional_std__string____(const std::shared_ptr<Promise<std::optional<std::string>>>& value) {
|
|
294
|
+
return Result<std::shared_ptr<Promise<std::optional<std::string>>>>::withValue(value);
|
|
295
|
+
}
|
|
296
|
+
inline Result_std__shared_ptr_Promise_std__optional_std__string____ create_Result_std__shared_ptr_Promise_std__optional_std__string____(const std::exception_ptr& error) {
|
|
297
|
+
return Result<std::shared_ptr<Promise<std::optional<std::string>>>>::withError(error);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
// pragma MARK: Result<std::shared_ptr<Promise<std::vector<std::string>>>>
|
|
301
|
+
using Result_std__shared_ptr_Promise_std__vector_std__string____ = Result<std::shared_ptr<Promise<std::vector<std::string>>>>;
|
|
302
|
+
inline Result_std__shared_ptr_Promise_std__vector_std__string____ create_Result_std__shared_ptr_Promise_std__vector_std__string____(const std::shared_ptr<Promise<std::vector<std::string>>>& value) {
|
|
303
|
+
return Result<std::shared_ptr<Promise<std::vector<std::string>>>>::withValue(value);
|
|
304
|
+
}
|
|
305
|
+
inline Result_std__shared_ptr_Promise_std__vector_std__string____ create_Result_std__shared_ptr_Promise_std__vector_std__string____(const std::exception_ptr& error) {
|
|
306
|
+
return Result<std::shared_ptr<Promise<std::vector<std::string>>>>::withError(error);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
} // namespace margelo::nitro::alarmkit::bridge::swift
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// AlarmKit-Swift-Cxx-Umbrella.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `AlarmCountdown` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::alarmkit { struct AlarmCountdown; }
|
|
13
|
+
// Forward declaration of `AlarmWeekday` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::alarmkit { enum class AlarmWeekday; }
|
|
15
|
+
// Forward declaration of `CustomizableAlarmButton` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::alarmkit { struct CustomizableAlarmButton; }
|
|
17
|
+
// Forward declaration of `HybridAlarmKitSpec` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::alarmkit { class HybridAlarmKitSpec; }
|
|
19
|
+
|
|
20
|
+
// Include C++ defined types
|
|
21
|
+
#include "AlarmCountdown.hpp"
|
|
22
|
+
#include "AlarmWeekday.hpp"
|
|
23
|
+
#include "CustomizableAlarmButton.hpp"
|
|
24
|
+
#include "HybridAlarmKitSpec.hpp"
|
|
25
|
+
#include <NitroModules/Promise.hpp>
|
|
26
|
+
#include <NitroModules/Result.hpp>
|
|
27
|
+
#include <exception>
|
|
28
|
+
#include <memory>
|
|
29
|
+
#include <optional>
|
|
30
|
+
#include <string>
|
|
31
|
+
#include <vector>
|
|
32
|
+
|
|
33
|
+
// C++ helpers for Swift
|
|
34
|
+
#include "AlarmKit-Swift-Cxx-Bridge.hpp"
|
|
35
|
+
|
|
36
|
+
// Common C++ types used in Swift
|
|
37
|
+
#include <NitroModules/ArrayBufferHolder.hpp>
|
|
38
|
+
#include <NitroModules/AnyMapHolder.hpp>
|
|
39
|
+
#include <NitroModules/RuntimeError.hpp>
|
|
40
|
+
#include <NitroModules/DateToChronoDate.hpp>
|
|
41
|
+
|
|
42
|
+
// Forward declarations of Swift defined types
|
|
43
|
+
// Forward declaration of `HybridAlarmKitSpec_cxx` to properly resolve imports.
|
|
44
|
+
namespace AlarmKit { class HybridAlarmKitSpec_cxx; }
|
|
45
|
+
|
|
46
|
+
// Include Swift defined types
|
|
47
|
+
#if __has_include("AlarmKit-Swift.h")
|
|
48
|
+
// This header is generated by Xcode/Swift on every app build.
|
|
49
|
+
// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "AlarmKit".
|
|
50
|
+
#include "AlarmKit-Swift.h"
|
|
51
|
+
// Same as above, but used when building with frameworks (`use_frameworks`)
|
|
52
|
+
#elif __has_include(<AlarmKit/AlarmKit-Swift.h>)
|
|
53
|
+
#include <AlarmKit/AlarmKit-Swift.h>
|
|
54
|
+
#else
|
|
55
|
+
#error AlarmKit's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "AlarmKit", and try building the app first.
|
|
56
|
+
#endif
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// AlarmKitAutolinking.mm
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <NitroModules/HybridObjectRegistry.hpp>
|
|
10
|
+
#import "AlarmKit-Swift-Cxx-Umbrella.hpp"
|
|
11
|
+
#import <type_traits>
|
|
12
|
+
|
|
13
|
+
#include "HybridAlarmKitSpecSwift.hpp"
|
|
14
|
+
|
|
15
|
+
@interface AlarmKitAutolinking : NSObject
|
|
16
|
+
@end
|
|
17
|
+
|
|
18
|
+
@implementation AlarmKitAutolinking
|
|
19
|
+
|
|
20
|
+
+ (void) load {
|
|
21
|
+
using namespace margelo::nitro;
|
|
22
|
+
using namespace margelo::nitro::alarmkit;
|
|
23
|
+
|
|
24
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
25
|
+
"AlarmKit",
|
|
26
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
27
|
+
std::shared_ptr<margelo::nitro::alarmkit::HybridAlarmKitSpec> hybridObject = AlarmKit::AlarmKitAutolinking::createAlarmKit();
|
|
28
|
+
return hybridObject;
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// AlarmKitAutolinking.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
public final class AlarmKitAutolinking {
|
|
9
|
+
public typealias bridge = margelo.nitro.alarmkit.bridge.swift
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Creates an instance of a Swift class that implements `HybridAlarmKitSpec`,
|
|
13
|
+
* and wraps it in a Swift class that can directly interop with C++ (`HybridAlarmKitSpec_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, `AlarmKit`).
|
|
17
|
+
*/
|
|
18
|
+
public static func createAlarmKit() -> bridge.std__shared_ptr_margelo__nitro__alarmkit__HybridAlarmKitSpec_ {
|
|
19
|
+
let hybridObject = AlarmKit()
|
|
20
|
+
return { () -> bridge.std__shared_ptr_margelo__nitro__alarmkit__HybridAlarmKitSpec_ in
|
|
21
|
+
let __cxxWrapped = hybridObject.getCxxWrapper()
|
|
22
|
+
return __cxxWrapped.getCxxPart()
|
|
23
|
+
}()
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridAlarmKitSpecSwift.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridAlarmKitSpecSwift.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::alarmkit {
|
|
11
|
+
} // namespace margelo::nitro::alarmkit
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridAlarmKitSpecSwift.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "HybridAlarmKitSpec.hpp"
|
|
11
|
+
|
|
12
|
+
// Forward declaration of `HybridAlarmKitSpec_cxx` to properly resolve imports.
|
|
13
|
+
namespace AlarmKit { class HybridAlarmKitSpec_cxx; }
|
|
14
|
+
|
|
15
|
+
// Forward declaration of `CustomizableAlarmButton` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::alarmkit { struct CustomizableAlarmButton; }
|
|
17
|
+
// Forward declaration of `AlarmCountdown` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::alarmkit { struct AlarmCountdown; }
|
|
19
|
+
// Forward declaration of `AlarmWeekday` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::alarmkit { enum class AlarmWeekday; }
|
|
21
|
+
|
|
22
|
+
#include <NitroModules/Promise.hpp>
|
|
23
|
+
#include <string>
|
|
24
|
+
#include "CustomizableAlarmButton.hpp"
|
|
25
|
+
#include <optional>
|
|
26
|
+
#include "AlarmCountdown.hpp"
|
|
27
|
+
#include <vector>
|
|
28
|
+
#include "AlarmWeekday.hpp"
|
|
29
|
+
|
|
30
|
+
#include "AlarmKit-Swift-Cxx-Umbrella.hpp"
|
|
31
|
+
|
|
32
|
+
namespace margelo::nitro::alarmkit {
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The C++ part of HybridAlarmKitSpec_cxx.swift.
|
|
36
|
+
*
|
|
37
|
+
* HybridAlarmKitSpecSwift (C++) accesses HybridAlarmKitSpec_cxx (Swift), and might
|
|
38
|
+
* contain some additional bridging code for C++ <> Swift interop.
|
|
39
|
+
*
|
|
40
|
+
* Since this obviously introduces an overhead, I hope at some point in
|
|
41
|
+
* the future, HybridAlarmKitSpec_cxx can directly inherit from the C++ class HybridAlarmKitSpec
|
|
42
|
+
* to simplify the whole structure and memory management.
|
|
43
|
+
*/
|
|
44
|
+
class HybridAlarmKitSpecSwift: public virtual HybridAlarmKitSpec {
|
|
45
|
+
public:
|
|
46
|
+
// Constructor from a Swift instance
|
|
47
|
+
explicit HybridAlarmKitSpecSwift(const AlarmKit::HybridAlarmKitSpec_cxx& swiftPart):
|
|
48
|
+
HybridObject(HybridAlarmKitSpec::TAG),
|
|
49
|
+
_swiftPart(swiftPart) { }
|
|
50
|
+
|
|
51
|
+
public:
|
|
52
|
+
// Get the Swift part
|
|
53
|
+
inline AlarmKit::HybridAlarmKitSpec_cxx& getSwiftPart() noexcept {
|
|
54
|
+
return _swiftPart;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public:
|
|
58
|
+
// Get memory pressure
|
|
59
|
+
inline size_t getExternalMemorySize() noexcept override {
|
|
60
|
+
return _swiftPart.getMemorySize();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public:
|
|
64
|
+
// Properties
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
public:
|
|
68
|
+
// Methods
|
|
69
|
+
inline std::shared_ptr<Promise<bool>> requestAlarmPermission() override {
|
|
70
|
+
auto __result = _swiftPart.requestAlarmPermission();
|
|
71
|
+
if (__result.hasError()) [[unlikely]] {
|
|
72
|
+
std::rethrow_exception(__result.error());
|
|
73
|
+
}
|
|
74
|
+
auto __value = std::move(__result.value());
|
|
75
|
+
return __value;
|
|
76
|
+
}
|
|
77
|
+
inline std::shared_ptr<Promise<std::string>> scheduleFixedAlarm(const std::string& title, const CustomizableAlarmButton& stopBtn, const std::string& tintColor, const std::optional<CustomizableAlarmButton>& secondaryBtn, std::optional<double> timestamp, const std::optional<AlarmCountdown>& countdown) override {
|
|
78
|
+
auto __result = _swiftPart.scheduleFixedAlarm(title, stopBtn, tintColor, secondaryBtn, timestamp, countdown);
|
|
79
|
+
if (__result.hasError()) [[unlikely]] {
|
|
80
|
+
std::rethrow_exception(__result.error());
|
|
81
|
+
}
|
|
82
|
+
auto __value = std::move(__result.value());
|
|
83
|
+
return __value;
|
|
84
|
+
}
|
|
85
|
+
inline std::shared_ptr<Promise<std::string>> scheduleRelativeAlarm(const std::string& title, const CustomizableAlarmButton& stopBtn, const std::string& tintColor, double hour, double minute, const std::vector<AlarmWeekday>& repeats, const std::optional<CustomizableAlarmButton>& secondaryBtn, const std::optional<AlarmCountdown>& countdown) override {
|
|
86
|
+
auto __result = _swiftPart.scheduleRelativeAlarm(title, stopBtn, tintColor, std::forward<decltype(hour)>(hour), std::forward<decltype(minute)>(minute), repeats, secondaryBtn, countdown);
|
|
87
|
+
if (__result.hasError()) [[unlikely]] {
|
|
88
|
+
std::rethrow_exception(__result.error());
|
|
89
|
+
}
|
|
90
|
+
auto __value = std::move(__result.value());
|
|
91
|
+
return __value;
|
|
92
|
+
}
|
|
93
|
+
inline std::shared_ptr<Promise<bool>> cancelAlarm(const std::string& id) override {
|
|
94
|
+
auto __result = _swiftPart.cancelAlarm(id);
|
|
95
|
+
if (__result.hasError()) [[unlikely]] {
|
|
96
|
+
std::rethrow_exception(__result.error());
|
|
97
|
+
}
|
|
98
|
+
auto __value = std::move(__result.value());
|
|
99
|
+
return __value;
|
|
100
|
+
}
|
|
101
|
+
inline std::shared_ptr<Promise<bool>> cancelAllAlarms() override {
|
|
102
|
+
auto __result = _swiftPart.cancelAllAlarms();
|
|
103
|
+
if (__result.hasError()) [[unlikely]] {
|
|
104
|
+
std::rethrow_exception(__result.error());
|
|
105
|
+
}
|
|
106
|
+
auto __value = std::move(__result.value());
|
|
107
|
+
return __value;
|
|
108
|
+
}
|
|
109
|
+
inline std::shared_ptr<Promise<std::optional<std::string>>> getAlarm(const std::string& id) override {
|
|
110
|
+
auto __result = _swiftPart.getAlarm(id);
|
|
111
|
+
if (__result.hasError()) [[unlikely]] {
|
|
112
|
+
std::rethrow_exception(__result.error());
|
|
113
|
+
}
|
|
114
|
+
auto __value = std::move(__result.value());
|
|
115
|
+
return __value;
|
|
116
|
+
}
|
|
117
|
+
inline std::shared_ptr<Promise<std::vector<std::string>>> getAllAlarms() override {
|
|
118
|
+
auto __result = _swiftPart.getAllAlarms();
|
|
119
|
+
if (__result.hasError()) [[unlikely]] {
|
|
120
|
+
std::rethrow_exception(__result.error());
|
|
121
|
+
}
|
|
122
|
+
auto __value = std::move(__result.value());
|
|
123
|
+
return __value;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
private:
|
|
127
|
+
AlarmKit::HybridAlarmKitSpec_cxx _swiftPart;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
} // namespace margelo::nitro::alarmkit
|