@onramper/onramper-react-native 1.0.1

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 (163) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/LICENSE +202 -0
  3. package/NOTICE +5 -0
  4. package/OnramperReactNative.podspec +36 -0
  5. package/README.md +114 -0
  6. package/app.plugin.js +51 -0
  7. package/ios/Frameworks/LICENSE +202 -0
  8. package/ios/Frameworks/NOTICE +5 -0
  9. package/ios/Frameworks/OnramperSDK.xcframework/Info.plist +48 -0
  10. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/OnramperSDK.framework/Info.plist +0 -0
  11. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  12. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/arm64-apple-ios.swiftinterface +548 -0
  13. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/OnramperSDK.framework/OnramperSDK +0 -0
  14. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/OnramperSDK.framework/OnramperSDK_OnramperSDK.bundle/Info.plist +0 -0
  15. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/OnramperSDK.framework/OnramperSDK_OnramperSDK.bundle/PrivacyInfo.xcprivacy +27 -0
  16. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/OnramperSDK.framework/PrivacyInfo.xcprivacy +27 -0
  17. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/dSYMs/OnramperSDK.framework.dSYM/Contents/Info.plist +20 -0
  18. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/DWARF/OnramperSDK +0 -0
  19. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/Relocations/aarch64/OnramperSDK.yml +2518 -0
  20. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/Info.plist +0 -0
  21. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  22. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +548 -0
  23. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  24. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +548 -0
  25. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/OnramperSDK +0 -0
  26. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/OnramperSDK_OnramperSDK.bundle/Info.plist +0 -0
  27. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/OnramperSDK_OnramperSDK.bundle/PrivacyInfo.xcprivacy +27 -0
  28. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/PrivacyInfo.xcprivacy +27 -0
  29. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/OnramperSDK.framework.dSYM/Contents/Info.plist +20 -0
  30. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/DWARF/OnramperSDK +0 -0
  31. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/Relocations/aarch64/OnramperSDK.yml +2518 -0
  32. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/Relocations/x86_64/OnramperSDK.yml +2487 -0
  33. package/ios/HybridOnramperCheckoutButton.swift +112 -0
  34. package/ios/HybridOnramperNitro.swift +194 -0
  35. package/ios/OnramperCheckoutBridge.swift +88 -0
  36. package/ios/OnramperSDKBridge.swift +185 -0
  37. package/ios/PreparedIntentRegistry.swift +78 -0
  38. package/lib/commonjs/OnramperCheckoutButtonView.js +16 -0
  39. package/lib/commonjs/OnramperCheckoutButtonView.js.map +1 -0
  40. package/lib/commonjs/OnramperClient.js +161 -0
  41. package/lib/commonjs/OnramperClient.js.map +1 -0
  42. package/lib/commonjs/OnramperNative.js +22 -0
  43. package/lib/commonjs/OnramperNative.js.map +1 -0
  44. package/lib/commonjs/errors.js +35 -0
  45. package/lib/commonjs/errors.js.map +1 -0
  46. package/lib/commonjs/events.js +6 -0
  47. package/lib/commonjs/events.js.map +1 -0
  48. package/lib/commonjs/generated/OnramperCheckoutButtonConfig.json +10 -0
  49. package/lib/commonjs/index.js +27 -0
  50. package/lib/commonjs/index.js.map +1 -0
  51. package/lib/commonjs/package.json +1 -0
  52. package/lib/commonjs/specs/OnramperCheckoutButton.nitro.js +6 -0
  53. package/lib/commonjs/specs/OnramperCheckoutButton.nitro.js.map +1 -0
  54. package/lib/commonjs/specs/OnramperNitro.nitro.js +6 -0
  55. package/lib/commonjs/specs/OnramperNitro.nitro.js.map +1 -0
  56. package/lib/commonjs/types.js +6 -0
  57. package/lib/commonjs/types.js.map +1 -0
  58. package/lib/module/OnramperCheckoutButtonView.js +11 -0
  59. package/lib/module/OnramperCheckoutButtonView.js.map +1 -0
  60. package/lib/module/OnramperClient.js +156 -0
  61. package/lib/module/OnramperClient.js.map +1 -0
  62. package/lib/module/OnramperNative.js +18 -0
  63. package/lib/module/OnramperNative.js.map +1 -0
  64. package/lib/module/errors.js +30 -0
  65. package/lib/module/errors.js.map +1 -0
  66. package/lib/module/events.js +4 -0
  67. package/lib/module/events.js.map +1 -0
  68. package/lib/module/generated/OnramperCheckoutButtonConfig.json +10 -0
  69. package/lib/module/index.js +8 -0
  70. package/lib/module/index.js.map +1 -0
  71. package/lib/module/package.json +1 -0
  72. package/lib/module/specs/OnramperCheckoutButton.nitro.js +4 -0
  73. package/lib/module/specs/OnramperCheckoutButton.nitro.js.map +1 -0
  74. package/lib/module/specs/OnramperNitro.nitro.js +4 -0
  75. package/lib/module/specs/OnramperNitro.nitro.js.map +1 -0
  76. package/lib/module/types.js +4 -0
  77. package/lib/module/types.js.map +1 -0
  78. package/lib/typescript/commonjs/package.json +1 -0
  79. package/lib/typescript/commonjs/src/OnramperCheckoutButtonView.d.ts +9 -0
  80. package/lib/typescript/commonjs/src/OnramperCheckoutButtonView.d.ts.map +1 -0
  81. package/lib/typescript/commonjs/src/OnramperClient.d.ts +49 -0
  82. package/lib/typescript/commonjs/src/OnramperClient.d.ts.map +1 -0
  83. package/lib/typescript/commonjs/src/OnramperNative.d.ts +9 -0
  84. package/lib/typescript/commonjs/src/OnramperNative.d.ts.map +1 -0
  85. package/lib/typescript/commonjs/src/errors.d.ts +13 -0
  86. package/lib/typescript/commonjs/src/errors.d.ts.map +1 -0
  87. package/lib/typescript/commonjs/src/events.d.ts +48 -0
  88. package/lib/typescript/commonjs/src/events.d.ts.map +1 -0
  89. package/lib/typescript/commonjs/src/index.d.ts +9 -0
  90. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  91. package/lib/typescript/commonjs/src/specs/OnramperCheckoutButton.nitro.d.ts +10 -0
  92. package/lib/typescript/commonjs/src/specs/OnramperCheckoutButton.nitro.d.ts.map +1 -0
  93. package/lib/typescript/commonjs/src/specs/OnramperNitro.nitro.d.ts +39 -0
  94. package/lib/typescript/commonjs/src/specs/OnramperNitro.nitro.d.ts.map +1 -0
  95. package/lib/typescript/commonjs/src/types.d.ts +127 -0
  96. package/lib/typescript/commonjs/src/types.d.ts.map +1 -0
  97. package/lib/typescript/module/package.json +1 -0
  98. package/lib/typescript/module/src/OnramperCheckoutButtonView.d.ts +9 -0
  99. package/lib/typescript/module/src/OnramperCheckoutButtonView.d.ts.map +1 -0
  100. package/lib/typescript/module/src/OnramperClient.d.ts +49 -0
  101. package/lib/typescript/module/src/OnramperClient.d.ts.map +1 -0
  102. package/lib/typescript/module/src/OnramperNative.d.ts +9 -0
  103. package/lib/typescript/module/src/OnramperNative.d.ts.map +1 -0
  104. package/lib/typescript/module/src/errors.d.ts +13 -0
  105. package/lib/typescript/module/src/errors.d.ts.map +1 -0
  106. package/lib/typescript/module/src/events.d.ts +48 -0
  107. package/lib/typescript/module/src/events.d.ts.map +1 -0
  108. package/lib/typescript/module/src/index.d.ts +9 -0
  109. package/lib/typescript/module/src/index.d.ts.map +1 -0
  110. package/lib/typescript/module/src/specs/OnramperCheckoutButton.nitro.d.ts +10 -0
  111. package/lib/typescript/module/src/specs/OnramperCheckoutButton.nitro.d.ts.map +1 -0
  112. package/lib/typescript/module/src/specs/OnramperNitro.nitro.d.ts +39 -0
  113. package/lib/typescript/module/src/specs/OnramperNitro.nitro.d.ts.map +1 -0
  114. package/lib/typescript/module/src/types.d.ts +127 -0
  115. package/lib/typescript/module/src/types.d.ts.map +1 -0
  116. package/nitro.json +19 -0
  117. package/nitrogen/generated/.gitattributes +1 -0
  118. package/nitrogen/generated/ios/OnramperReactNative+autolinking.rb +62 -0
  119. package/nitrogen/generated/ios/OnramperReactNative-Swift-Cxx-Bridge.cpp +107 -0
  120. package/nitrogen/generated/ios/OnramperReactNative-Swift-Cxx-Bridge.hpp +299 -0
  121. package/nitrogen/generated/ios/OnramperReactNative-Swift-Cxx-Umbrella.hpp +60 -0
  122. package/nitrogen/generated/ios/OnramperReactNativeAutolinking.mm +41 -0
  123. package/nitrogen/generated/ios/OnramperReactNativeAutolinking.swift +38 -0
  124. package/nitrogen/generated/ios/c++/HybridOnramperCheckoutButtonSpecSwift.cpp +11 -0
  125. package/nitrogen/generated/ios/c++/HybridOnramperCheckoutButtonSpecSwift.hpp +81 -0
  126. package/nitrogen/generated/ios/c++/HybridOnramperNitroSpecSwift.cpp +11 -0
  127. package/nitrogen/generated/ios/c++/HybridOnramperNitroSpecSwift.hpp +150 -0
  128. package/nitrogen/generated/ios/c++/views/HybridOnramperCheckoutButtonComponent.mm +122 -0
  129. package/nitrogen/generated/ios/swift/Func_std__shared_ptr_Promise_std__shared_ptr_Promise_NitroSessionCredentials____.swift +61 -0
  130. package/nitrogen/generated/ios/swift/Func_void.swift +46 -0
  131. package/nitrogen/generated/ios/swift/Func_void_NitroSessionCredentials.swift +46 -0
  132. package/nitrogen/generated/ios/swift/Func_void_PreparedIntentResult.swift +46 -0
  133. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
  134. package/nitrogen/generated/ios/swift/Func_void_std__shared_ptr_Promise_NitroSessionCredentials__.swift +66 -0
  135. package/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
  136. package/nitrogen/generated/ios/swift/HybridOnramperCheckoutButtonSpec.swift +55 -0
  137. package/nitrogen/generated/ios/swift/HybridOnramperCheckoutButtonSpec_cxx.swift +156 -0
  138. package/nitrogen/generated/ios/swift/HybridOnramperNitroSpec.swift +63 -0
  139. package/nitrogen/generated/ios/swift/HybridOnramperNitroSpec_cxx.swift +309 -0
  140. package/nitrogen/generated/ios/swift/NitroSessionCredentials.swift +34 -0
  141. package/nitrogen/generated/ios/swift/OnramperNitroConfig.swift +49 -0
  142. package/nitrogen/generated/ios/swift/PreparedIntentResult.swift +34 -0
  143. package/nitrogen/generated/shared/c++/HybridOnramperCheckoutButtonSpec.cpp +22 -0
  144. package/nitrogen/generated/shared/c++/HybridOnramperCheckoutButtonSpec.hpp +63 -0
  145. package/nitrogen/generated/shared/c++/HybridOnramperNitroSpec.cpp +29 -0
  146. package/nitrogen/generated/shared/c++/HybridOnramperNitroSpec.hpp +80 -0
  147. package/nitrogen/generated/shared/c++/NitroSessionCredentials.hpp +87 -0
  148. package/nitrogen/generated/shared/c++/OnramperNitroConfig.hpp +99 -0
  149. package/nitrogen/generated/shared/c++/PreparedIntentResult.hpp +87 -0
  150. package/nitrogen/generated/shared/c++/views/HybridOnramperCheckoutButtonComponent.cpp +83 -0
  151. package/nitrogen/generated/shared/c++/views/HybridOnramperCheckoutButtonComponent.hpp +111 -0
  152. package/nitrogen/generated/shared/json/OnramperCheckoutButtonConfig.json +10 -0
  153. package/package.json +107 -0
  154. package/src/OnramperCheckoutButtonView.tsx +15 -0
  155. package/src/OnramperClient.ts +170 -0
  156. package/src/OnramperNative.ts +19 -0
  157. package/src/errors.ts +69 -0
  158. package/src/events.ts +23 -0
  159. package/src/generated/OnramperCheckoutButtonConfig.json +10 -0
  160. package/src/index.ts +30 -0
  161. package/src/specs/OnramperCheckoutButton.nitro.ts +16 -0
  162. package/src/specs/OnramperNitro.nitro.ts +60 -0
  163. package/src/types.ts +133 -0
@@ -0,0 +1,46 @@
1
+ ///
2
+ /// Func_void_PreparedIntentResult.swift
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ import NitroModules
9
+
10
+ /**
11
+ * Wraps a Swift `(_ value: PreparedIntentResult) -> 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_PreparedIntentResult {
15
+ public typealias bridge = margelo.nitro.onramper.bridge.swift
16
+
17
+ private let closure: (_ value: PreparedIntentResult) -> Void
18
+
19
+ public init(_ closure: @escaping (_ value: PreparedIntentResult) -> Void) {
20
+ self.closure = closure
21
+ }
22
+
23
+ @inline(__always)
24
+ public func call(value: PreparedIntentResult) -> Void {
25
+ self.closure(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_PreparedIntentResult`.
39
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_PreparedIntentResult>`.
40
+ * This removes one strong reference from the object!
41
+ */
42
+ @inline(__always)
43
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_PreparedIntentResult {
44
+ return Unmanaged<Func_void_PreparedIntentResult>.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 © 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.onramper.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,66 @@
1
+ ///
2
+ /// Func_void_std__shared_ptr_Promise_NitroSessionCredentials__.swift
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ import NitroModules
9
+
10
+ /**
11
+ * Wraps a Swift `(_ value: Promise<NitroSessionCredentials>) -> 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__shared_ptr_Promise_NitroSessionCredentials__ {
15
+ public typealias bridge = margelo.nitro.onramper.bridge.swift
16
+
17
+ private let closure: (_ value: Promise<NitroSessionCredentials>) -> Void
18
+
19
+ public init(_ closure: @escaping (_ value: Promise<NitroSessionCredentials>) -> Void) {
20
+ self.closure = closure
21
+ }
22
+
23
+ @inline(__always)
24
+ public func call(value: bridge.std__shared_ptr_Promise_NitroSessionCredentials__) -> Void {
25
+ self.closure({ () -> Promise<NitroSessionCredentials> in
26
+ let __promise = Promise<NitroSessionCredentials>()
27
+ let __resolver = { (__result: NitroSessionCredentials) in
28
+ __promise.resolve(withResult: __result)
29
+ }
30
+ let __rejecter = { (__error: Error) in
31
+ __promise.reject(withError: __error)
32
+ }
33
+ let __resolverCpp = { () -> bridge.Func_void_NitroSessionCredentials in
34
+ let __closureWrapper = Func_void_NitroSessionCredentials(__resolver)
35
+ return bridge.create_Func_void_NitroSessionCredentials(__closureWrapper.toUnsafe())
36
+ }()
37
+ let __rejecterCpp = { () -> bridge.Func_void_std__exception_ptr in
38
+ let __closureWrapper = Func_void_std__exception_ptr(__rejecter)
39
+ return bridge.create_Func_void_std__exception_ptr(__closureWrapper.toUnsafe())
40
+ }()
41
+ let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_NitroSessionCredentials__(value)
42
+ __promiseHolder.addOnResolvedListener(__resolverCpp)
43
+ __promiseHolder.addOnRejectedListener(__rejecterCpp)
44
+ return __promise
45
+ }())
46
+ }
47
+
48
+ /**
49
+ * Casts this instance to a retained unsafe raw pointer.
50
+ * This acquires one additional strong reference on the object!
51
+ */
52
+ @inline(__always)
53
+ public func toUnsafe() -> UnsafeMutableRawPointer {
54
+ return Unmanaged.passRetained(self).toOpaque()
55
+ }
56
+
57
+ /**
58
+ * Casts an unsafe pointer to a `Func_void_std__shared_ptr_Promise_NitroSessionCredentials__`.
59
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_std__shared_ptr_Promise_NitroSessionCredentials__>`.
60
+ * This removes one strong reference from the object!
61
+ */
62
+ @inline(__always)
63
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__shared_ptr_Promise_NitroSessionCredentials__ {
64
+ return Unmanaged<Func_void_std__shared_ptr_Promise_NitroSessionCredentials__>.fromOpaque(pointer).takeRetainedValue()
65
+ }
66
+ }
@@ -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 © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ import NitroModules
9
+
10
+ /**
11
+ * Wraps a Swift `(_ stateJson: 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.onramper.bridge.swift
16
+
17
+ private let closure: (_ stateJson: String) -> Void
18
+
19
+ public init(_ closure: @escaping (_ stateJson: String) -> Void) {
20
+ self.closure = closure
21
+ }
22
+
23
+ @inline(__always)
24
+ public func call(stateJson: std.string) -> Void {
25
+ self.closure(String(stateJson))
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
+ /// HybridOnramperCheckoutButtonSpec.swift
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ import NitroModules
9
+
10
+ /// See ``HybridOnramperCheckoutButtonSpec``
11
+ public protocol HybridOnramperCheckoutButtonSpec_protocol: HybridObject, HybridView {
12
+ // Properties
13
+ var intentHandle: String { get set }
14
+
15
+ // Methods
16
+
17
+ }
18
+
19
+ public extension HybridOnramperCheckoutButtonSpec_protocol {
20
+ /// Default implementation of ``HybridObject.toString``
21
+ func toString() -> String {
22
+ return "[HybridObject OnramperCheckoutButton]"
23
+ }
24
+ }
25
+
26
+ /// See ``HybridOnramperCheckoutButtonSpec``
27
+ open class HybridOnramperCheckoutButtonSpec_base {
28
+ private weak var cxxWrapper: HybridOnramperCheckoutButtonSpec_cxx? = nil
29
+ public init() { }
30
+ public func getCxxWrapper() -> HybridOnramperCheckoutButtonSpec_cxx {
31
+ #if DEBUG
32
+ guard self is any HybridOnramperCheckoutButtonSpec else {
33
+ fatalError("`self` is not a `HybridOnramperCheckoutButtonSpec`! Did you accidentally inherit from `HybridOnramperCheckoutButtonSpec_base` instead of `HybridOnramperCheckoutButtonSpec`?")
34
+ }
35
+ #endif
36
+ if let cxxWrapper = self.cxxWrapper {
37
+ return cxxWrapper
38
+ } else {
39
+ let cxxWrapper = HybridOnramperCheckoutButtonSpec_cxx(self as! any HybridOnramperCheckoutButtonSpec)
40
+ self.cxxWrapper = cxxWrapper
41
+ return cxxWrapper
42
+ }
43
+ }
44
+ }
45
+
46
+ /**
47
+ * A Swift base-protocol representing the OnramperCheckoutButton HybridObject.
48
+ * Implement this protocol to create Swift-based instances of OnramperCheckoutButton.
49
+ * ```swift
50
+ * class HybridOnramperCheckoutButton : HybridOnramperCheckoutButtonSpec {
51
+ * // ...
52
+ * }
53
+ * ```
54
+ */
55
+ public typealias HybridOnramperCheckoutButtonSpec = HybridOnramperCheckoutButtonSpec_protocol & HybridOnramperCheckoutButtonSpec_base
@@ -0,0 +1,156 @@
1
+ ///
2
+ /// HybridOnramperCheckoutButtonSpec_cxx.swift
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ import NitroModules
9
+
10
+ /**
11
+ * A class implementation that bridges HybridOnramperCheckoutButtonSpec over to C++.
12
+ * In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined.
13
+ *
14
+ * Also, some Swift types need to be bridged with special handling:
15
+ * - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330)
16
+ * - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper
17
+ * - Throwing methods need to be wrapped with a Result<T, Error> type, as exceptions cannot be propagated to C++
18
+ */
19
+ open class HybridOnramperCheckoutButtonSpec_cxx {
20
+ /**
21
+ * The Swift <> C++ bridge's namespace (`margelo::nitro::onramper::bridge::swift`)
22
+ * from `OnramperReactNative-Swift-Cxx-Bridge.hpp`.
23
+ * This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift.
24
+ */
25
+ public typealias bridge = margelo.nitro.onramper.bridge.swift
26
+
27
+ /**
28
+ * Holds an instance of the `HybridOnramperCheckoutButtonSpec` Swift protocol.
29
+ */
30
+ private var __implementation: any HybridOnramperCheckoutButtonSpec
31
+
32
+ /**
33
+ * Holds a weak pointer to the C++ class that wraps the Swift class.
34
+ */
35
+ private var __cxxPart: bridge.std__weak_ptr_HybridOnramperCheckoutButtonSpec_
36
+
37
+ /**
38
+ * Create a new `HybridOnramperCheckoutButtonSpec_cxx` that wraps the given `HybridOnramperCheckoutButtonSpec`.
39
+ * All properties and methods bridge to C++ types.
40
+ */
41
+ public init(_ implementation: any HybridOnramperCheckoutButtonSpec) {
42
+ self.__implementation = implementation
43
+ self.__cxxPart = .init()
44
+ /* no base class */
45
+ }
46
+
47
+ /**
48
+ * Get the actual `HybridOnramperCheckoutButtonSpec` instance this class wraps.
49
+ */
50
+ @inline(__always)
51
+ public func getHybridOnramperCheckoutButtonSpec() -> any HybridOnramperCheckoutButtonSpec {
52
+ return __implementation
53
+ }
54
+
55
+ /**
56
+ * Casts this instance to a retained unsafe raw pointer.
57
+ * This acquires one additional strong reference on the object!
58
+ */
59
+ public func toUnsafe() -> UnsafeMutableRawPointer {
60
+ return Unmanaged.passRetained(self).toOpaque()
61
+ }
62
+
63
+ /**
64
+ * Casts an unsafe pointer to a `HybridOnramperCheckoutButtonSpec_cxx`.
65
+ * The pointer has to be a retained opaque `Unmanaged<HybridOnramperCheckoutButtonSpec_cxx>`.
66
+ * This removes one strong reference from the object!
67
+ */
68
+ public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridOnramperCheckoutButtonSpec_cxx {
69
+ return Unmanaged<HybridOnramperCheckoutButtonSpec_cxx>.fromOpaque(pointer).takeRetainedValue()
70
+ }
71
+
72
+ /**
73
+ * Gets (or creates) the C++ part of this Hybrid Object.
74
+ * The C++ part is a `std::shared_ptr<HybridOnramperCheckoutButtonSpec>`.
75
+ */
76
+ public func getCxxPart() -> bridge.std__shared_ptr_HybridOnramperCheckoutButtonSpec_ {
77
+ let cachedCxxPart = self.__cxxPart.lock()
78
+ if Bool(fromCxx: cachedCxxPart) {
79
+ return cachedCxxPart
80
+ } else {
81
+ let newCxxPart = bridge.create_std__shared_ptr_HybridOnramperCheckoutButtonSpec_(self.toUnsafe())
82
+ __cxxPart = bridge.weakify_std__shared_ptr_HybridOnramperCheckoutButtonSpec_(newCxxPart)
83
+ return newCxxPart
84
+ }
85
+ }
86
+
87
+
88
+
89
+ /**
90
+ * Get the memory size of the Swift class (plus size of any other allocations)
91
+ * so the JS VM can properly track it and garbage-collect the JS object if needed.
92
+ */
93
+ @inline(__always)
94
+ public var memorySize: Int {
95
+ return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
96
+ }
97
+
98
+ /**
99
+ * Compares this object with the given [other] object for reference equality.
100
+ */
101
+ @inline(__always)
102
+ public func equals(other: HybridOnramperCheckoutButtonSpec_cxx) -> Bool {
103
+ return self.__implementation === other.__implementation
104
+ }
105
+
106
+ /**
107
+ * Call dispose() on the Swift class.
108
+ * This _may_ be called manually from JS.
109
+ */
110
+ @inline(__always)
111
+ public func dispose() {
112
+ self.__implementation.dispose()
113
+ }
114
+
115
+ /**
116
+ * Call toString() on the Swift class.
117
+ */
118
+ @inline(__always)
119
+ public func toString() -> String {
120
+ return self.__implementation.toString()
121
+ }
122
+
123
+ // Properties
124
+ public final var intentHandle: std.string {
125
+ @inline(__always)
126
+ get {
127
+ return std.string(self.__implementation.intentHandle)
128
+ }
129
+ @inline(__always)
130
+ set {
131
+ self.__implementation.intentHandle = String(newValue)
132
+ }
133
+ }
134
+
135
+ // Methods
136
+ public final func getView() -> UnsafeMutableRawPointer {
137
+ return Unmanaged.passRetained(__implementation.view).toOpaque()
138
+ }
139
+
140
+ public final func beforeUpdate() {
141
+ __implementation.beforeUpdate()
142
+ }
143
+
144
+ public final func afterUpdate() {
145
+ __implementation.afterUpdate()
146
+ }
147
+
148
+ public final func maybePrepareForRecycle() {
149
+ guard let recyclable = __implementation as? any RecyclableView else { return }
150
+ recyclable.prepareForRecycle()
151
+ }
152
+
153
+ public final func onDropView() {
154
+ __implementation.onDropView()
155
+ }
156
+ }
@@ -0,0 +1,63 @@
1
+ ///
2
+ /// HybridOnramperNitroSpec.swift
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ import NitroModules
9
+
10
+ /// See ``HybridOnramperNitroSpec``
11
+ public protocol HybridOnramperNitroSpec_protocol: HybridObject {
12
+ // Properties
13
+
14
+
15
+ // Methods
16
+ func configure(config: OnramperNitroConfig) throws -> Promise<Void>
17
+ func initialize(sessionId: String, sessionToken: String) throws -> Promise<Void>
18
+ func reset() throws -> Promise<Void>
19
+ func signOut() throws -> Promise<Void>
20
+ func getCheckoutRequirements(requestJson: String, styleJson: String) throws -> Promise<PreparedIntentResult>
21
+ func cancelPreparedIntent(intentHandle: String) throws -> Promise<Void>
22
+ func setStateListener(onState: @escaping (_ stateJson: String) -> Void) throws -> Void
23
+ func setEventListener(onEvent: @escaping (_ eventJson: String) -> Void) throws -> Void
24
+ func setSessionExpirationHandler(handler: @escaping () -> Promise<Promise<NitroSessionCredentials>>) throws -> Void
25
+ }
26
+
27
+ public extension HybridOnramperNitroSpec_protocol {
28
+ /// Default implementation of ``HybridObject.toString``
29
+ func toString() -> String {
30
+ return "[HybridObject OnramperNitro]"
31
+ }
32
+ }
33
+
34
+ /// See ``HybridOnramperNitroSpec``
35
+ open class HybridOnramperNitroSpec_base {
36
+ private weak var cxxWrapper: HybridOnramperNitroSpec_cxx? = nil
37
+ public init() { }
38
+ public func getCxxWrapper() -> HybridOnramperNitroSpec_cxx {
39
+ #if DEBUG
40
+ guard self is any HybridOnramperNitroSpec else {
41
+ fatalError("`self` is not a `HybridOnramperNitroSpec`! Did you accidentally inherit from `HybridOnramperNitroSpec_base` instead of `HybridOnramperNitroSpec`?")
42
+ }
43
+ #endif
44
+ if let cxxWrapper = self.cxxWrapper {
45
+ return cxxWrapper
46
+ } else {
47
+ let cxxWrapper = HybridOnramperNitroSpec_cxx(self as! any HybridOnramperNitroSpec)
48
+ self.cxxWrapper = cxxWrapper
49
+ return cxxWrapper
50
+ }
51
+ }
52
+ }
53
+
54
+ /**
55
+ * A Swift base-protocol representing the OnramperNitro HybridObject.
56
+ * Implement this protocol to create Swift-based instances of OnramperNitro.
57
+ * ```swift
58
+ * class HybridOnramperNitro : HybridOnramperNitroSpec {
59
+ * // ...
60
+ * }
61
+ * ```
62
+ */
63
+ public typealias HybridOnramperNitroSpec = HybridOnramperNitroSpec_protocol & HybridOnramperNitroSpec_base