react-native-candle 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +188 -0
  2. package/ReactNativeCandle.podspec +45 -0
  3. package/app.plugin.js +1 -0
  4. package/ios/Sources/CandleLinkSheetWrapperView.swift +53 -0
  5. package/ios/Sources/CandleLinkViewModel.swift +67 -0
  6. package/ios/Sources/HostingViewController.swift +56 -0
  7. package/ios/Sources/RNCandle.swift +155 -0
  8. package/ios/Sources/UIApplication++.swift +14 -0
  9. package/lib/commonjs/index.js +49 -0
  10. package/lib/commonjs/index.js.map +1 -0
  11. package/lib/commonjs/specs/RNCandle.nitro.js +6 -0
  12. package/lib/commonjs/specs/RNCandle.nitro.js.map +1 -0
  13. package/lib/module/index.js +38 -0
  14. package/lib/module/index.js.map +1 -0
  15. package/lib/module/specs/RNCandle.nitro.js +4 -0
  16. package/lib/module/specs/RNCandle.nitro.js.map +1 -0
  17. package/lib/typescript/commonjs/package.json +1 -0
  18. package/lib/typescript/commonjs/src/index.d.ts +22 -0
  19. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  20. package/lib/typescript/commonjs/src/specs/RNCandle.nitro.d.ts +21 -0
  21. package/lib/typescript/commonjs/src/specs/RNCandle.nitro.d.ts.map +1 -0
  22. package/lib/typescript/module/package.json +1 -0
  23. package/lib/typescript/module/src/index.d.ts +22 -0
  24. package/lib/typescript/module/src/index.d.ts.map +1 -0
  25. package/lib/typescript/module/src/specs/RNCandle.nitro.d.ts +21 -0
  26. package/lib/typescript/module/src/specs/RNCandle.nitro.d.ts.map +1 -0
  27. package/nitrogen/generated/.gitattributes +1 -0
  28. package/nitrogen/generated/ios/ReactNativeCandle+autolinking.rb +60 -0
  29. package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Bridge.cpp +56 -0
  30. package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Bridge.hpp +173 -0
  31. package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Umbrella.hpp +58 -0
  32. package/nitrogen/generated/ios/ReactNativeCandleAutolinking.mm +33 -0
  33. package/nitrogen/generated/ios/ReactNativeCandleAutolinking.swift +30 -0
  34. package/nitrogen/generated/ios/c++/HybridRNCandleSpecSwift.cpp +11 -0
  35. package/nitrogen/generated/ios/c++/HybridRNCandleSpecSwift.hpp +139 -0
  36. package/nitrogen/generated/ios/swift/Func_void.swift +46 -0
  37. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
  38. package/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
  39. package/nitrogen/generated/ios/swift/HybridRNCandleSpec.swift +55 -0
  40. package/nitrogen/generated/ios/swift/HybridRNCandleSpec_cxx.swift +263 -0
  41. package/nitrogen/generated/ios/swift/PresentationBackground.swift +40 -0
  42. package/nitrogen/generated/ios/swift/PresentationStyle.swift +40 -0
  43. package/nitrogen/generated/ios/swift/Service.swift +56 -0
  44. package/nitrogen/generated/ios/swift/ToolCall.swift +46 -0
  45. package/nitrogen/generated/shared/c++/HybridRNCandleSpec.cpp +28 -0
  46. package/nitrogen/generated/shared/c++/HybridRNCandleSpec.hpp +83 -0
  47. package/nitrogen/generated/shared/c++/PresentationBackground.hpp +78 -0
  48. package/nitrogen/generated/shared/c++/PresentationStyle.hpp +78 -0
  49. package/nitrogen/generated/shared/c++/Service.hpp +94 -0
  50. package/nitrogen/generated/shared/c++/ToolCall.hpp +73 -0
  51. package/package.json +111 -0
  52. package/plugin/withIosDeploymentTarget.js +46 -0
  53. package/src/index.ts +73 -0
  54. package/src/specs/RNCandle.nitro.ts +39 -0
@@ -0,0 +1,139 @@
1
+ ///
2
+ /// HybridRNCandleSpecSwift.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 "HybridRNCandleSpec.hpp"
11
+
12
+ // Forward declaration of `HybridRNCandleSpec_cxx` to properly resolve imports.
13
+ namespace ReactNativeCandle { class HybridRNCandleSpec_cxx; }
14
+
15
+ // Forward declaration of `Service` to properly resolve imports.
16
+ namespace margelo::nitro::rncandle { enum class Service; }
17
+ // Forward declaration of `PresentationBackground` to properly resolve imports.
18
+ namespace margelo::nitro::rncandle { enum class PresentationBackground; }
19
+ // Forward declaration of `PresentationStyle` to properly resolve imports.
20
+ namespace margelo::nitro::rncandle { enum class PresentationStyle; }
21
+ // Forward declaration of `ToolCall` to properly resolve imports.
22
+ namespace margelo::nitro::rncandle { struct ToolCall; }
23
+
24
+ #include "Service.hpp"
25
+ #include <optional>
26
+ #include <string>
27
+ #include "PresentationBackground.hpp"
28
+ #include "PresentationStyle.hpp"
29
+ #include <functional>
30
+ #include <NitroModules/Promise.hpp>
31
+ #include "ToolCall.hpp"
32
+
33
+ #include "ReactNativeCandle-Swift-Cxx-Umbrella.hpp"
34
+
35
+ namespace margelo::nitro::rncandle {
36
+
37
+ /**
38
+ * The C++ part of HybridRNCandleSpec_cxx.swift.
39
+ *
40
+ * HybridRNCandleSpecSwift (C++) accesses HybridRNCandleSpec_cxx (Swift), and might
41
+ * contain some additional bridging code for C++ <> Swift interop.
42
+ *
43
+ * Since this obviously introduces an overhead, I hope at some point in
44
+ * the future, HybridRNCandleSpec_cxx can directly inherit from the C++ class HybridRNCandleSpec
45
+ * to simplify the whole structure and memory management.
46
+ */
47
+ class HybridRNCandleSpecSwift: public virtual HybridRNCandleSpec {
48
+ public:
49
+ // Constructor from a Swift instance
50
+ explicit HybridRNCandleSpecSwift(const ReactNativeCandle::HybridRNCandleSpec_cxx& swiftPart):
51
+ HybridObject(HybridRNCandleSpec::TAG),
52
+ _swiftPart(swiftPart) { }
53
+
54
+ public:
55
+ // Get the Swift part
56
+ inline ReactNativeCandle::HybridRNCandleSpec_cxx& getSwiftPart() noexcept {
57
+ return _swiftPart;
58
+ }
59
+
60
+ public:
61
+ // Get memory pressure
62
+ inline size_t getExternalMemorySize() noexcept override {
63
+ return _swiftPart.getMemorySize();
64
+ }
65
+
66
+ public:
67
+ // Properties
68
+
69
+
70
+ public:
71
+ // Methods
72
+ inline void candleLinkSheet(bool isPresented, Service service, double cornerRadius, const std::optional<std::string>& customerName, bool showSandbox, bool showDynamicLoading, PresentationBackground presentationBackground, PresentationStyle presentationStyle, const std::function<void(const std::string& /* account */)>& onSuccess) override {
73
+ auto __result = _swiftPart.candleLinkSheet(std::forward<decltype(isPresented)>(isPresented), static_cast<int>(service), std::forward<decltype(cornerRadius)>(cornerRadius), customerName, std::forward<decltype(showSandbox)>(showSandbox), std::forward<decltype(showDynamicLoading)>(showDynamicLoading), static_cast<int>(presentationBackground), static_cast<int>(presentationStyle), onSuccess);
74
+ if (__result.hasError()) [[unlikely]] {
75
+ std::rethrow_exception(__result.error());
76
+ }
77
+ }
78
+ inline std::shared_ptr<Promise<std::string>> getLinkedAccounts() override {
79
+ auto __result = _swiftPart.getLinkedAccounts();
80
+ if (__result.hasError()) [[unlikely]] {
81
+ std::rethrow_exception(__result.error());
82
+ }
83
+ auto __value = std::move(__result.value());
84
+ return __value;
85
+ }
86
+ inline std::shared_ptr<Promise<void>> unlinkAccount(const std::string& linkedAccountID) override {
87
+ auto __result = _swiftPart.unlinkAccount(linkedAccountID);
88
+ if (__result.hasError()) [[unlikely]] {
89
+ std::rethrow_exception(__result.error());
90
+ }
91
+ auto __value = std::move(__result.value());
92
+ return __value;
93
+ }
94
+ inline std::shared_ptr<Promise<std::string>> getFiatAccounts() override {
95
+ auto __result = _swiftPart.getFiatAccounts();
96
+ if (__result.hasError()) [[unlikely]] {
97
+ std::rethrow_exception(__result.error());
98
+ }
99
+ auto __value = std::move(__result.value());
100
+ return __value;
101
+ }
102
+ inline std::shared_ptr<Promise<std::string>> getActivity(const std::optional<std::string>& span) override {
103
+ auto __result = _swiftPart.getActivity(span);
104
+ if (__result.hasError()) [[unlikely]] {
105
+ std::rethrow_exception(__result.error());
106
+ }
107
+ auto __value = std::move(__result.value());
108
+ return __value;
109
+ }
110
+ inline std::shared_ptr<Promise<void>> deleteUser() override {
111
+ auto __result = _swiftPart.deleteUser();
112
+ if (__result.hasError()) [[unlikely]] {
113
+ std::rethrow_exception(__result.error());
114
+ }
115
+ auto __value = std::move(__result.value());
116
+ return __value;
117
+ }
118
+ inline std::shared_ptr<Promise<std::string>> getAvailableTools() override {
119
+ auto __result = _swiftPart.getAvailableTools();
120
+ if (__result.hasError()) [[unlikely]] {
121
+ std::rethrow_exception(__result.error());
122
+ }
123
+ auto __value = std::move(__result.value());
124
+ return __value;
125
+ }
126
+ inline std::shared_ptr<Promise<std::string>> executeTool(const ToolCall& tool) override {
127
+ auto __result = _swiftPart.executeTool(tool);
128
+ if (__result.hasError()) [[unlikely]] {
129
+ std::rethrow_exception(__result.error());
130
+ }
131
+ auto __value = std::move(__result.value());
132
+ return __value;
133
+ }
134
+
135
+ private:
136
+ ReactNativeCandle::HybridRNCandleSpec_cxx _swiftPart;
137
+ };
138
+
139
+ } // namespace margelo::nitro::rncandle
@@ -0,0 +1,46 @@
1
+ ///
2
+ /// Func_void.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 NitroModules
9
+
10
+ /**
11
+ * Wraps a Swift `() -> Void` as a class.
12
+ * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
13
+ */
14
+ public final class Func_void {
15
+ public typealias bridge = margelo.nitro.rncandle.bridge.swift
16
+
17
+ private let closure: () -> Void
18
+
19
+ public init(_ closure: @escaping () -> Void) {
20
+ self.closure = closure
21
+ }
22
+
23
+ @inline(__always)
24
+ public func call() -> Void {
25
+ self.closure()
26
+ }
27
+
28
+ /**
29
+ * Casts this instance to a retained unsafe raw pointer.
30
+ * This acquires one additional strong reference on the object!
31
+ */
32
+ @inline(__always)
33
+ public func toUnsafe() -> UnsafeMutableRawPointer {
34
+ return Unmanaged.passRetained(self).toOpaque()
35
+ }
36
+
37
+ /**
38
+ * Casts an unsafe pointer to a `Func_void`.
39
+ * The pointer has to be a retained opaque `Unmanaged<Func_void>`.
40
+ * This removes one strong reference from the object!
41
+ */
42
+ @inline(__always)
43
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void {
44
+ return Unmanaged<Func_void>.fromOpaque(pointer).takeRetainedValue()
45
+ }
46
+ }
@@ -0,0 +1,46 @@
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 NitroModules
9
+
10
+ /**
11
+ * Wraps a Swift `(_ error: Error) -> Void` as a class.
12
+ * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
13
+ */
14
+ public final class Func_void_std__exception_ptr {
15
+ public typealias bridge = margelo.nitro.rncandle.bridge.swift
16
+
17
+ private let closure: (_ error: Error) -> Void
18
+
19
+ public init(_ closure: @escaping (_ error: Error) -> Void) {
20
+ self.closure = closure
21
+ }
22
+
23
+ @inline(__always)
24
+ public func call(error: std.exception_ptr) -> Void {
25
+ self.closure(RuntimeError.from(cppError: error))
26
+ }
27
+
28
+ /**
29
+ * Casts this instance to a retained unsafe raw pointer.
30
+ * This acquires one additional strong reference on the object!
31
+ */
32
+ @inline(__always)
33
+ public func toUnsafe() -> UnsafeMutableRawPointer {
34
+ return Unmanaged.passRetained(self).toOpaque()
35
+ }
36
+
37
+ /**
38
+ * Casts an unsafe pointer to a `Func_void_std__exception_ptr`.
39
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_std__exception_ptr>`.
40
+ * This removes one strong reference from the object!
41
+ */
42
+ @inline(__always)
43
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__exception_ptr {
44
+ return Unmanaged<Func_void_std__exception_ptr>.fromOpaque(pointer).takeRetainedValue()
45
+ }
46
+ }
@@ -0,0 +1,46 @@
1
+ ///
2
+ /// Func_void_std__string.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 NitroModules
9
+
10
+ /**
11
+ * Wraps a Swift `(_ value: String) -> Void` as a class.
12
+ * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
13
+ */
14
+ public final class Func_void_std__string {
15
+ public typealias bridge = margelo.nitro.rncandle.bridge.swift
16
+
17
+ private let closure: (_ value: String) -> Void
18
+
19
+ public init(_ closure: @escaping (_ value: String) -> Void) {
20
+ self.closure = closure
21
+ }
22
+
23
+ @inline(__always)
24
+ public func call(value: std.string) -> Void {
25
+ self.closure(String(value))
26
+ }
27
+
28
+ /**
29
+ * Casts this instance to a retained unsafe raw pointer.
30
+ * This acquires one additional strong reference on the object!
31
+ */
32
+ @inline(__always)
33
+ public func toUnsafe() -> UnsafeMutableRawPointer {
34
+ return Unmanaged.passRetained(self).toOpaque()
35
+ }
36
+
37
+ /**
38
+ * Casts an unsafe pointer to a `Func_void_std__string`.
39
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_std__string>`.
40
+ * This removes one strong reference from the object!
41
+ */
42
+ @inline(__always)
43
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__string {
44
+ return Unmanaged<Func_void_std__string>.fromOpaque(pointer).takeRetainedValue()
45
+ }
46
+ }
@@ -0,0 +1,55 @@
1
+ ///
2
+ /// HybridRNCandleSpec.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
+ /// See ``HybridRNCandleSpec``
12
+ public protocol HybridRNCandleSpec_protocol: HybridObject {
13
+ // Properties
14
+
15
+
16
+ // Methods
17
+ func candleLinkSheet(isPresented: Bool, service: Service, cornerRadius: Double, customerName: String?, showSandbox: Bool, showDynamicLoading: Bool, presentationBackground: PresentationBackground, presentationStyle: PresentationStyle, onSuccess: @escaping (_ account: String) -> Void) throws -> Void
18
+ func getLinkedAccounts() throws -> Promise<String>
19
+ func unlinkAccount(linkedAccountID: String) throws -> Promise<Void>
20
+ func getFiatAccounts() throws -> Promise<String>
21
+ func getActivity(span: String?) throws -> Promise<String>
22
+ func deleteUser() throws -> Promise<Void>
23
+ func getAvailableTools() throws -> Promise<String>
24
+ func executeTool(tool: ToolCall) throws -> Promise<String>
25
+ }
26
+
27
+ /// See ``HybridRNCandleSpec``
28
+ public class HybridRNCandleSpec_base {
29
+ private weak var cxxWrapper: HybridRNCandleSpec_cxx? = nil
30
+ public func getCxxWrapper() -> HybridRNCandleSpec_cxx {
31
+ #if DEBUG
32
+ guard self is HybridRNCandleSpec else {
33
+ fatalError("`self` is not a `HybridRNCandleSpec`! Did you accidentally inherit from `HybridRNCandleSpec_base` instead of `HybridRNCandleSpec`?")
34
+ }
35
+ #endif
36
+ if let cxxWrapper = self.cxxWrapper {
37
+ return cxxWrapper
38
+ } else {
39
+ let cxxWrapper = HybridRNCandleSpec_cxx(self as! HybridRNCandleSpec)
40
+ self.cxxWrapper = cxxWrapper
41
+ return cxxWrapper
42
+ }
43
+ }
44
+ }
45
+
46
+ /**
47
+ * A Swift base-protocol representing the RNCandle HybridObject.
48
+ * Implement this protocol to create Swift-based instances of RNCandle.
49
+ * ```swift
50
+ * class HybridRNCandle : HybridRNCandleSpec {
51
+ * // ...
52
+ * }
53
+ * ```
54
+ */
55
+ public typealias HybridRNCandleSpec = HybridRNCandleSpec_protocol & HybridRNCandleSpec_base
@@ -0,0 +1,263 @@
1
+ ///
2
+ /// HybridRNCandleSpec_cxx.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
+ * A class implementation that bridges HybridRNCandleSpec over to C++.
13
+ * In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined.
14
+ *
15
+ * Also, some Swift types need to be bridged with special handling:
16
+ * - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330)
17
+ * - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper
18
+ * - Throwing methods need to be wrapped with a Result<T, Error> type, as exceptions cannot be propagated to C++
19
+ */
20
+ public class HybridRNCandleSpec_cxx {
21
+ /**
22
+ * The Swift <> C++ bridge's namespace (`margelo::nitro::rncandle::bridge::swift`)
23
+ * from `ReactNativeCandle-Swift-Cxx-Bridge.hpp`.
24
+ * This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift.
25
+ */
26
+ public typealias bridge = margelo.nitro.rncandle.bridge.swift
27
+
28
+ /**
29
+ * Holds an instance of the `HybridRNCandleSpec` Swift protocol.
30
+ */
31
+ private var __implementation: any HybridRNCandleSpec
32
+
33
+ /**
34
+ * Holds a weak pointer to the C++ class that wraps the Swift class.
35
+ */
36
+ private var __cxxPart: bridge.std__weak_ptr_margelo__nitro__rncandle__HybridRNCandleSpec_
37
+
38
+ /**
39
+ * Create a new `HybridRNCandleSpec_cxx` that wraps the given `HybridRNCandleSpec`.
40
+ * All properties and methods bridge to C++ types.
41
+ */
42
+ public init(_ implementation: any HybridRNCandleSpec) {
43
+ self.__implementation = implementation
44
+ self.__cxxPart = .init()
45
+ /* no base class */
46
+ }
47
+
48
+ /**
49
+ * Get the actual `HybridRNCandleSpec` instance this class wraps.
50
+ */
51
+ @inline(__always)
52
+ public func getHybridRNCandleSpec() -> any HybridRNCandleSpec {
53
+ return __implementation
54
+ }
55
+
56
+ /**
57
+ * Casts this instance to a retained unsafe raw pointer.
58
+ * This acquires one additional strong reference on the object!
59
+ */
60
+ public func toUnsafe() -> UnsafeMutableRawPointer {
61
+ return Unmanaged.passRetained(self).toOpaque()
62
+ }
63
+
64
+ /**
65
+ * Casts an unsafe pointer to a `HybridRNCandleSpec_cxx`.
66
+ * The pointer has to be a retained opaque `Unmanaged<HybridRNCandleSpec_cxx>`.
67
+ * This removes one strong reference from the object!
68
+ */
69
+ public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridRNCandleSpec_cxx {
70
+ return Unmanaged<HybridRNCandleSpec_cxx>.fromOpaque(pointer).takeRetainedValue()
71
+ }
72
+
73
+ /**
74
+ * Gets (or creates) the C++ part of this Hybrid Object.
75
+ * The C++ part is a `std::shared_ptr<margelo::nitro::rncandle::HybridRNCandleSpec>`.
76
+ */
77
+ public func getCxxPart() -> bridge.std__shared_ptr_margelo__nitro__rncandle__HybridRNCandleSpec_ {
78
+ let cachedCxxPart = self.__cxxPart.lock()
79
+ if cachedCxxPart.__convertToBool() {
80
+ return cachedCxxPart
81
+ } else {
82
+ let newCxxPart = bridge.create_std__shared_ptr_margelo__nitro__rncandle__HybridRNCandleSpec_(self.toUnsafe())
83
+ __cxxPart = bridge.weakify_std__shared_ptr_margelo__nitro__rncandle__HybridRNCandleSpec_(newCxxPart)
84
+ return newCxxPart
85
+ }
86
+ }
87
+
88
+
89
+
90
+ /**
91
+ * Get the memory size of the Swift class (plus size of any other allocations)
92
+ * so the JS VM can properly track it and garbage-collect the JS object if needed.
93
+ */
94
+ @inline(__always)
95
+ public var memorySize: Int {
96
+ return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
97
+ }
98
+
99
+ // Properties
100
+
101
+
102
+ // Methods
103
+ @inline(__always)
104
+ public final func candleLinkSheet(isPresented: Bool, service: Int32, cornerRadius: Double, customerName: bridge.std__optional_std__string_, showSandbox: Bool, showDynamicLoading: Bool, presentationBackground: Int32, presentationStyle: Int32, onSuccess: bridge.Func_void_std__string) -> bridge.Result_void_ {
105
+ do {
106
+ try self.__implementation.candleLinkSheet(isPresented: isPresented, service: margelo.nitro.rncandle.Service(rawValue: service)!, cornerRadius: cornerRadius, customerName: { () -> String? in
107
+ if let __unwrapped = customerName.value {
108
+ return String(__unwrapped)
109
+ } else {
110
+ return nil
111
+ }
112
+ }(), showSandbox: showSandbox, showDynamicLoading: showDynamicLoading, presentationBackground: margelo.nitro.rncandle.PresentationBackground(rawValue: presentationBackground)!, presentationStyle: margelo.nitro.rncandle.PresentationStyle(rawValue: presentationStyle)!, onSuccess: { () -> (String) -> Void in
113
+ let __wrappedFunction = bridge.wrap_Func_void_std__string(onSuccess)
114
+ return { (__account: String) -> Void in
115
+ __wrappedFunction.call(std.string(__account))
116
+ }
117
+ }())
118
+ return bridge.create_Result_void_()
119
+ } catch (let __error) {
120
+ let __exceptionPtr = __error.toCpp()
121
+ return bridge.create_Result_void_(__exceptionPtr)
122
+ }
123
+ }
124
+
125
+ @inline(__always)
126
+ public final func getLinkedAccounts() -> bridge.Result_std__shared_ptr_Promise_std__string___ {
127
+ do {
128
+ let __result = try self.__implementation.getLinkedAccounts()
129
+ let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__string__ in
130
+ let __promise = bridge.create_std__shared_ptr_Promise_std__string__()
131
+ let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__string__(__promise)
132
+ __result
133
+ .then({ __result in __promiseHolder.resolve(std.string(__result)) })
134
+ .catch({ __error in __promiseHolder.reject(__error.toCpp()) })
135
+ return __promise
136
+ }()
137
+ return bridge.create_Result_std__shared_ptr_Promise_std__string___(__resultCpp)
138
+ } catch (let __error) {
139
+ let __exceptionPtr = __error.toCpp()
140
+ return bridge.create_Result_std__shared_ptr_Promise_std__string___(__exceptionPtr)
141
+ }
142
+ }
143
+
144
+ @inline(__always)
145
+ public final func unlinkAccount(linkedAccountID: std.string) -> bridge.Result_std__shared_ptr_Promise_void___ {
146
+ do {
147
+ let __result = try self.__implementation.unlinkAccount(linkedAccountID: String(linkedAccountID))
148
+ let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in
149
+ let __promise = bridge.create_std__shared_ptr_Promise_void__()
150
+ let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise)
151
+ __result
152
+ .then({ __result in __promiseHolder.resolve() })
153
+ .catch({ __error in __promiseHolder.reject(__error.toCpp()) })
154
+ return __promise
155
+ }()
156
+ return bridge.create_Result_std__shared_ptr_Promise_void___(__resultCpp)
157
+ } catch (let __error) {
158
+ let __exceptionPtr = __error.toCpp()
159
+ return bridge.create_Result_std__shared_ptr_Promise_void___(__exceptionPtr)
160
+ }
161
+ }
162
+
163
+ @inline(__always)
164
+ public final func getFiatAccounts() -> bridge.Result_std__shared_ptr_Promise_std__string___ {
165
+ do {
166
+ let __result = try self.__implementation.getFiatAccounts()
167
+ let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__string__ in
168
+ let __promise = bridge.create_std__shared_ptr_Promise_std__string__()
169
+ let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__string__(__promise)
170
+ __result
171
+ .then({ __result in __promiseHolder.resolve(std.string(__result)) })
172
+ .catch({ __error in __promiseHolder.reject(__error.toCpp()) })
173
+ return __promise
174
+ }()
175
+ return bridge.create_Result_std__shared_ptr_Promise_std__string___(__resultCpp)
176
+ } catch (let __error) {
177
+ let __exceptionPtr = __error.toCpp()
178
+ return bridge.create_Result_std__shared_ptr_Promise_std__string___(__exceptionPtr)
179
+ }
180
+ }
181
+
182
+ @inline(__always)
183
+ public final func getActivity(span: bridge.std__optional_std__string_) -> bridge.Result_std__shared_ptr_Promise_std__string___ {
184
+ do {
185
+ let __result = try self.__implementation.getActivity(span: { () -> String? in
186
+ if let __unwrapped = span.value {
187
+ return String(__unwrapped)
188
+ } else {
189
+ return nil
190
+ }
191
+ }())
192
+ let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__string__ in
193
+ let __promise = bridge.create_std__shared_ptr_Promise_std__string__()
194
+ let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__string__(__promise)
195
+ __result
196
+ .then({ __result in __promiseHolder.resolve(std.string(__result)) })
197
+ .catch({ __error in __promiseHolder.reject(__error.toCpp()) })
198
+ return __promise
199
+ }()
200
+ return bridge.create_Result_std__shared_ptr_Promise_std__string___(__resultCpp)
201
+ } catch (let __error) {
202
+ let __exceptionPtr = __error.toCpp()
203
+ return bridge.create_Result_std__shared_ptr_Promise_std__string___(__exceptionPtr)
204
+ }
205
+ }
206
+
207
+ @inline(__always)
208
+ public final func deleteUser() -> bridge.Result_std__shared_ptr_Promise_void___ {
209
+ do {
210
+ let __result = try self.__implementation.deleteUser()
211
+ let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in
212
+ let __promise = bridge.create_std__shared_ptr_Promise_void__()
213
+ let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise)
214
+ __result
215
+ .then({ __result in __promiseHolder.resolve() })
216
+ .catch({ __error in __promiseHolder.reject(__error.toCpp()) })
217
+ return __promise
218
+ }()
219
+ return bridge.create_Result_std__shared_ptr_Promise_void___(__resultCpp)
220
+ } catch (let __error) {
221
+ let __exceptionPtr = __error.toCpp()
222
+ return bridge.create_Result_std__shared_ptr_Promise_void___(__exceptionPtr)
223
+ }
224
+ }
225
+
226
+ @inline(__always)
227
+ public final func getAvailableTools() -> bridge.Result_std__shared_ptr_Promise_std__string___ {
228
+ do {
229
+ let __result = try self.__implementation.getAvailableTools()
230
+ let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__string__ in
231
+ let __promise = bridge.create_std__shared_ptr_Promise_std__string__()
232
+ let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__string__(__promise)
233
+ __result
234
+ .then({ __result in __promiseHolder.resolve(std.string(__result)) })
235
+ .catch({ __error in __promiseHolder.reject(__error.toCpp()) })
236
+ return __promise
237
+ }()
238
+ return bridge.create_Result_std__shared_ptr_Promise_std__string___(__resultCpp)
239
+ } catch (let __error) {
240
+ let __exceptionPtr = __error.toCpp()
241
+ return bridge.create_Result_std__shared_ptr_Promise_std__string___(__exceptionPtr)
242
+ }
243
+ }
244
+
245
+ @inline(__always)
246
+ public final func executeTool(tool: ToolCall) -> bridge.Result_std__shared_ptr_Promise_std__string___ {
247
+ do {
248
+ let __result = try self.__implementation.executeTool(tool: tool)
249
+ let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__string__ in
250
+ let __promise = bridge.create_std__shared_ptr_Promise_std__string__()
251
+ let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__string__(__promise)
252
+ __result
253
+ .then({ __result in __promiseHolder.resolve(std.string(__result)) })
254
+ .catch({ __error in __promiseHolder.reject(__error.toCpp()) })
255
+ return __promise
256
+ }()
257
+ return bridge.create_Result_std__shared_ptr_Promise_std__string___(__resultCpp)
258
+ } catch (let __error) {
259
+ let __exceptionPtr = __error.toCpp()
260
+ return bridge.create_Result_std__shared_ptr_Promise_std__string___(__exceptionPtr)
261
+ }
262
+ }
263
+ }
@@ -0,0 +1,40 @@
1
+ ///
2
+ /// PresentationBackground.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
+ /**
9
+ * Represents the JS union `PresentationBackground`, backed by a C++ enum.
10
+ */
11
+ public typealias PresentationBackground = margelo.nitro.rncandle.PresentationBackground
12
+
13
+ public extension PresentationBackground {
14
+ /**
15
+ * Get a PresentationBackground for the given String value, or
16
+ * return `nil` if the given value was invalid/unknown.
17
+ */
18
+ init?(fromString string: String) {
19
+ switch string {
20
+ case "default":
21
+ self = .default
22
+ case "blur":
23
+ self = .blur
24
+ default:
25
+ return nil
26
+ }
27
+ }
28
+
29
+ /**
30
+ * Get the String value this PresentationBackground represents.
31
+ */
32
+ var stringValue: String {
33
+ switch self {
34
+ case .default:
35
+ return "default"
36
+ case .blur:
37
+ return "blur"
38
+ }
39
+ }
40
+ }
@@ -0,0 +1,40 @@
1
+ ///
2
+ /// PresentationStyle.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
+ /**
9
+ * Represents the JS union `PresentationStyle`, backed by a C++ enum.
10
+ */
11
+ public typealias PresentationStyle = margelo.nitro.rncandle.PresentationStyle
12
+
13
+ public extension PresentationStyle {
14
+ /**
15
+ * Get a PresentationStyle for the given String value, or
16
+ * return `nil` if the given value was invalid/unknown.
17
+ */
18
+ init?(fromString string: String) {
19
+ switch string {
20
+ case "sheet":
21
+ self = .sheet
22
+ case "fullScreen":
23
+ self = .fullscreen
24
+ default:
25
+ return nil
26
+ }
27
+ }
28
+
29
+ /**
30
+ * Get the String value this PresentationStyle represents.
31
+ */
32
+ var stringValue: String {
33
+ switch self {
34
+ case .sheet:
35
+ return "sheet"
36
+ case .fullscreen:
37
+ return "fullScreen"
38
+ }
39
+ }
40
+ }