@onekeyfe/react-native-cloud-kit-module 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/CloudKitModule.podspec +29 -0
  2. package/LICENSE +20 -0
  3. package/README.md +39 -0
  4. package/android/CMakeLists.txt +24 -0
  5. package/android/build.gradle +128 -0
  6. package/android/gradle.properties +5 -0
  7. package/android/src/main/AndroidManifest.xml +2 -0
  8. package/android/src/main/cpp/cpp-adapter.cpp +6 -0
  9. package/android/src/main/java/com/margelo/nitro/cloudkitmodule/CloudKitModule.kt +51 -0
  10. package/android/src/main/java/com/margelo/nitro/cloudkitmodule/CloudKitModulePackage.kt +22 -0
  11. package/ios/CloudKitModule.swift +186 -0
  12. package/ios/CloudKitModuleCore.swift +195 -0
  13. package/lib/module/CloudKitModule.nitro.js +4 -0
  14. package/lib/module/CloudKitModule.nitro.js.map +1 -0
  15. package/lib/module/index.js +6 -0
  16. package/lib/module/index.js.map +1 -0
  17. package/lib/module/package.json +1 -0
  18. package/lib/typescript/package.json +1 -0
  19. package/lib/typescript/src/CloudKitModule.nitro.d.ts +55 -0
  20. package/lib/typescript/src/CloudKitModule.nitro.d.ts.map +1 -0
  21. package/lib/typescript/src/index.d.ts +4 -0
  22. package/lib/typescript/src/index.d.ts.map +1 -0
  23. package/nitro.json +17 -0
  24. package/nitrogen/generated/android/c++/JAccountInfoResult.hpp +62 -0
  25. package/nitrogen/generated/android/c++/JDeleteRecordParams.hpp +57 -0
  26. package/nitrogen/generated/android/c++/JFetchRecordParams.hpp +57 -0
  27. package/nitrogen/generated/android/c++/JHybridCloudKitModuleSpec.cpp +192 -0
  28. package/nitrogen/generated/android/c++/JHybridCloudKitModuleSpec.hpp +70 -0
  29. package/nitrogen/generated/android/c++/JQueryRecordsParams.hpp +53 -0
  30. package/nitrogen/generated/android/c++/JQueryRecordsResult.hpp +73 -0
  31. package/nitrogen/generated/android/c++/JRecordExistsParams.hpp +57 -0
  32. package/nitrogen/generated/android/c++/JRecordResult.hpp +73 -0
  33. package/nitrogen/generated/android/c++/JSaveRecordParams.hpp +65 -0
  34. package/nitrogen/generated/android/c++/JSaveRecordResult.hpp +57 -0
  35. package/nitrogen/generated/android/cloudkitmodule+autolinking.cmake +81 -0
  36. package/nitrogen/generated/android/cloudkitmodule+autolinking.gradle +27 -0
  37. package/nitrogen/generated/android/cloudkitmoduleOnLoad.cpp +44 -0
  38. package/nitrogen/generated/android/cloudkitmoduleOnLoad.hpp +25 -0
  39. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/AccountInfoResult.kt +35 -0
  40. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/DeleteRecordParams.kt +32 -0
  41. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/FetchRecordParams.kt +32 -0
  42. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/HybridCloudKitModuleSpec.kt +76 -0
  43. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/QueryRecordsParams.kt +29 -0
  44. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/QueryRecordsResult.kt +29 -0
  45. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/RecordExistsParams.kt +32 -0
  46. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/RecordResult.kt +44 -0
  47. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/SaveRecordParams.kt +38 -0
  48. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/SaveRecordResult.kt +32 -0
  49. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/cloudkitmoduleOnLoad.kt +35 -0
  50. package/nitrogen/generated/ios/CloudKitModule+autolinking.rb +60 -0
  51. package/nitrogen/generated/ios/CloudKitModule-Swift-Cxx-Bridge.cpp +80 -0
  52. package/nitrogen/generated/ios/CloudKitModule-Swift-Cxx-Bridge.hpp +340 -0
  53. package/nitrogen/generated/ios/CloudKitModule-Swift-Cxx-Umbrella.hpp +74 -0
  54. package/nitrogen/generated/ios/CloudKitModuleAutolinking.mm +33 -0
  55. package/nitrogen/generated/ios/CloudKitModuleAutolinking.swift +25 -0
  56. package/nitrogen/generated/ios/c++/HybridCloudKitModuleSpecSwift.cpp +11 -0
  57. package/nitrogen/generated/ios/c++/HybridCloudKitModuleSpecSwift.hpp +150 -0
  58. package/nitrogen/generated/ios/swift/AccountInfoResult.swift +76 -0
  59. package/nitrogen/generated/ios/swift/DeleteRecordParams.swift +46 -0
  60. package/nitrogen/generated/ios/swift/FetchRecordParams.swift +46 -0
  61. package/nitrogen/generated/ios/swift/Func_void_AccountInfoResult.swift +47 -0
  62. package/nitrogen/generated/ios/swift/Func_void_QueryRecordsResult.swift +47 -0
  63. package/nitrogen/generated/ios/swift/Func_void_SaveRecordResult.swift +47 -0
  64. package/nitrogen/generated/ios/swift/Func_void_bool.swift +47 -0
  65. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +47 -0
  66. package/nitrogen/generated/ios/swift/Func_void_std__optional_RecordResult_.swift +47 -0
  67. package/nitrogen/generated/ios/swift/HybridCloudKitModuleSpec.swift +55 -0
  68. package/nitrogen/generated/ios/swift/HybridCloudKitModuleSpec_cxx.swift +250 -0
  69. package/nitrogen/generated/ios/swift/QueryRecordsParams.swift +35 -0
  70. package/nitrogen/generated/ios/swift/QueryRecordsResult.swift +43 -0
  71. package/nitrogen/generated/ios/swift/RecordExistsParams.swift +46 -0
  72. package/nitrogen/generated/ios/swift/RecordResult.swift +90 -0
  73. package/nitrogen/generated/ios/swift/SaveRecordParams.swift +68 -0
  74. package/nitrogen/generated/ios/swift/SaveRecordResult.swift +46 -0
  75. package/nitrogen/generated/shared/c++/AccountInfoResult.hpp +76 -0
  76. package/nitrogen/generated/shared/c++/DeleteRecordParams.hpp +71 -0
  77. package/nitrogen/generated/shared/c++/FetchRecordParams.hpp +71 -0
  78. package/nitrogen/generated/shared/c++/HybridCloudKitModuleSpec.cpp +27 -0
  79. package/nitrogen/generated/shared/c++/HybridCloudKitModuleSpec.hpp +95 -0
  80. package/nitrogen/generated/shared/c++/QueryRecordsParams.hpp +67 -0
  81. package/nitrogen/generated/shared/c++/QueryRecordsResult.hpp +69 -0
  82. package/nitrogen/generated/shared/c++/RecordExistsParams.hpp +71 -0
  83. package/nitrogen/generated/shared/c++/RecordResult.hpp +87 -0
  84. package/nitrogen/generated/shared/c++/SaveRecordParams.hpp +79 -0
  85. package/nitrogen/generated/shared/c++/SaveRecordResult.hpp +71 -0
  86. package/package.json +174 -0
  87. package/src/CloudKitModule.nitro.ts +64 -0
  88. package/src/index.tsx +8 -0
@@ -0,0 +1,76 @@
1
+ ///
2
+ /// AccountInfoResult.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
+ * Represents an instance of `AccountInfoResult`, backed by a C++ struct.
12
+ */
13
+ public typealias AccountInfoResult = margelo.nitro.cloudkitmodule.AccountInfoResult
14
+
15
+ public extension AccountInfoResult {
16
+ private typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift
17
+
18
+ /**
19
+ * Create a new instance of `AccountInfoResult`.
20
+ */
21
+ init(status: Double, statusName: String, containerUserId: String?) {
22
+ self.init(status, std.string(statusName), { () -> bridge.std__optional_std__string_ in
23
+ if let __unwrappedValue = containerUserId {
24
+ return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
25
+ } else {
26
+ return .init()
27
+ }
28
+ }())
29
+ }
30
+
31
+ var status: Double {
32
+ @inline(__always)
33
+ get {
34
+ return self.__status
35
+ }
36
+ @inline(__always)
37
+ set {
38
+ self.__status = newValue
39
+ }
40
+ }
41
+
42
+ var statusName: String {
43
+ @inline(__always)
44
+ get {
45
+ return String(self.__statusName)
46
+ }
47
+ @inline(__always)
48
+ set {
49
+ self.__statusName = std.string(newValue)
50
+ }
51
+ }
52
+
53
+ var containerUserId: String? {
54
+ @inline(__always)
55
+ get {
56
+ return { () -> String? in
57
+ if bridge.has_value_std__optional_std__string_(self.__containerUserId) {
58
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__containerUserId)
59
+ return String(__unwrapped)
60
+ } else {
61
+ return nil
62
+ }
63
+ }()
64
+ }
65
+ @inline(__always)
66
+ set {
67
+ self.__containerUserId = { () -> bridge.std__optional_std__string_ in
68
+ if let __unwrappedValue = newValue {
69
+ return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
70
+ } else {
71
+ return .init()
72
+ }
73
+ }()
74
+ }
75
+ }
76
+ }
@@ -0,0 +1,46 @@
1
+ ///
2
+ /// DeleteRecordParams.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
+ * Represents an instance of `DeleteRecordParams`, backed by a C++ struct.
12
+ */
13
+ public typealias DeleteRecordParams = margelo.nitro.cloudkitmodule.DeleteRecordParams
14
+
15
+ public extension DeleteRecordParams {
16
+ private typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift
17
+
18
+ /**
19
+ * Create a new instance of `DeleteRecordParams`.
20
+ */
21
+ init(recordType: String, recordID: String) {
22
+ self.init(std.string(recordType), std.string(recordID))
23
+ }
24
+
25
+ var recordType: String {
26
+ @inline(__always)
27
+ get {
28
+ return String(self.__recordType)
29
+ }
30
+ @inline(__always)
31
+ set {
32
+ self.__recordType = std.string(newValue)
33
+ }
34
+ }
35
+
36
+ var recordID: String {
37
+ @inline(__always)
38
+ get {
39
+ return String(self.__recordID)
40
+ }
41
+ @inline(__always)
42
+ set {
43
+ self.__recordID = std.string(newValue)
44
+ }
45
+ }
46
+ }
@@ -0,0 +1,46 @@
1
+ ///
2
+ /// FetchRecordParams.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
+ * Represents an instance of `FetchRecordParams`, backed by a C++ struct.
12
+ */
13
+ public typealias FetchRecordParams = margelo.nitro.cloudkitmodule.FetchRecordParams
14
+
15
+ public extension FetchRecordParams {
16
+ private typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift
17
+
18
+ /**
19
+ * Create a new instance of `FetchRecordParams`.
20
+ */
21
+ init(recordType: String, recordID: String) {
22
+ self.init(std.string(recordType), std.string(recordID))
23
+ }
24
+
25
+ var recordType: String {
26
+ @inline(__always)
27
+ get {
28
+ return String(self.__recordType)
29
+ }
30
+ @inline(__always)
31
+ set {
32
+ self.__recordType = std.string(newValue)
33
+ }
34
+ }
35
+
36
+ var recordID: String {
37
+ @inline(__always)
38
+ get {
39
+ return String(self.__recordID)
40
+ }
41
+ @inline(__always)
42
+ set {
43
+ self.__recordID = std.string(newValue)
44
+ }
45
+ }
46
+ }
@@ -0,0 +1,47 @@
1
+ ///
2
+ /// Func_void_AccountInfoResult.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
+ /**
12
+ * Wraps a Swift `(_ value: AccountInfoResult) -> Void` as a class.
13
+ * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
14
+ */
15
+ public final class Func_void_AccountInfoResult {
16
+ public typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift
17
+
18
+ private let closure: (_ value: AccountInfoResult) -> Void
19
+
20
+ public init(_ closure: @escaping (_ value: AccountInfoResult) -> Void) {
21
+ self.closure = closure
22
+ }
23
+
24
+ @inline(__always)
25
+ public func call(value: AccountInfoResult) -> Void {
26
+ self.closure(value)
27
+ }
28
+
29
+ /**
30
+ * Casts this instance to a retained unsafe raw pointer.
31
+ * This acquires one additional strong reference on the object!
32
+ */
33
+ @inline(__always)
34
+ public func toUnsafe() -> UnsafeMutableRawPointer {
35
+ return Unmanaged.passRetained(self).toOpaque()
36
+ }
37
+
38
+ /**
39
+ * Casts an unsafe pointer to a `Func_void_AccountInfoResult`.
40
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_AccountInfoResult>`.
41
+ * This removes one strong reference from the object!
42
+ */
43
+ @inline(__always)
44
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_AccountInfoResult {
45
+ return Unmanaged<Func_void_AccountInfoResult>.fromOpaque(pointer).takeRetainedValue()
46
+ }
47
+ }
@@ -0,0 +1,47 @@
1
+ ///
2
+ /// Func_void_QueryRecordsResult.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
+ /**
12
+ * Wraps a Swift `(_ value: QueryRecordsResult) -> Void` as a class.
13
+ * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
14
+ */
15
+ public final class Func_void_QueryRecordsResult {
16
+ public typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift
17
+
18
+ private let closure: (_ value: QueryRecordsResult) -> Void
19
+
20
+ public init(_ closure: @escaping (_ value: QueryRecordsResult) -> Void) {
21
+ self.closure = closure
22
+ }
23
+
24
+ @inline(__always)
25
+ public func call(value: QueryRecordsResult) -> Void {
26
+ self.closure(value)
27
+ }
28
+
29
+ /**
30
+ * Casts this instance to a retained unsafe raw pointer.
31
+ * This acquires one additional strong reference on the object!
32
+ */
33
+ @inline(__always)
34
+ public func toUnsafe() -> UnsafeMutableRawPointer {
35
+ return Unmanaged.passRetained(self).toOpaque()
36
+ }
37
+
38
+ /**
39
+ * Casts an unsafe pointer to a `Func_void_QueryRecordsResult`.
40
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_QueryRecordsResult>`.
41
+ * This removes one strong reference from the object!
42
+ */
43
+ @inline(__always)
44
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_QueryRecordsResult {
45
+ return Unmanaged<Func_void_QueryRecordsResult>.fromOpaque(pointer).takeRetainedValue()
46
+ }
47
+ }
@@ -0,0 +1,47 @@
1
+ ///
2
+ /// Func_void_SaveRecordResult.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
+ /**
12
+ * Wraps a Swift `(_ value: SaveRecordResult) -> Void` as a class.
13
+ * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
14
+ */
15
+ public final class Func_void_SaveRecordResult {
16
+ public typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift
17
+
18
+ private let closure: (_ value: SaveRecordResult) -> Void
19
+
20
+ public init(_ closure: @escaping (_ value: SaveRecordResult) -> Void) {
21
+ self.closure = closure
22
+ }
23
+
24
+ @inline(__always)
25
+ public func call(value: SaveRecordResult) -> Void {
26
+ self.closure(value)
27
+ }
28
+
29
+ /**
30
+ * Casts this instance to a retained unsafe raw pointer.
31
+ * This acquires one additional strong reference on the object!
32
+ */
33
+ @inline(__always)
34
+ public func toUnsafe() -> UnsafeMutableRawPointer {
35
+ return Unmanaged.passRetained(self).toOpaque()
36
+ }
37
+
38
+ /**
39
+ * Casts an unsafe pointer to a `Func_void_SaveRecordResult`.
40
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_SaveRecordResult>`.
41
+ * This removes one strong reference from the object!
42
+ */
43
+ @inline(__always)
44
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_SaveRecordResult {
45
+ return Unmanaged<Func_void_SaveRecordResult>.fromOpaque(pointer).takeRetainedValue()
46
+ }
47
+ }
@@ -0,0 +1,47 @@
1
+ ///
2
+ /// Func_void_bool.swift
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ import NitroModules
9
+
10
+
11
+ /**
12
+ * Wraps a Swift `(_ value: Bool) -> Void` as a class.
13
+ * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
14
+ */
15
+ public final class Func_void_bool {
16
+ public typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift
17
+
18
+ private let closure: (_ value: Bool) -> Void
19
+
20
+ public init(_ closure: @escaping (_ value: Bool) -> Void) {
21
+ self.closure = closure
22
+ }
23
+
24
+ @inline(__always)
25
+ public func call(value: Bool) -> Void {
26
+ self.closure(value)
27
+ }
28
+
29
+ /**
30
+ * Casts this instance to a retained unsafe raw pointer.
31
+ * This acquires one additional strong reference on the object!
32
+ */
33
+ @inline(__always)
34
+ public func toUnsafe() -> UnsafeMutableRawPointer {
35
+ return Unmanaged.passRetained(self).toOpaque()
36
+ }
37
+
38
+ /**
39
+ * Casts an unsafe pointer to a `Func_void_bool`.
40
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_bool>`.
41
+ * This removes one strong reference from the object!
42
+ */
43
+ @inline(__always)
44
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_bool {
45
+ return Unmanaged<Func_void_bool>.fromOpaque(pointer).takeRetainedValue()
46
+ }
47
+ }
@@ -0,0 +1,47 @@
1
+ ///
2
+ /// Func_void_std__exception_ptr.swift
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ import NitroModules
9
+
10
+
11
+ /**
12
+ * Wraps a Swift `(_ error: Error) -> Void` as a class.
13
+ * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
14
+ */
15
+ public final class Func_void_std__exception_ptr {
16
+ public typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift
17
+
18
+ private let closure: (_ error: Error) -> Void
19
+
20
+ public init(_ closure: @escaping (_ error: Error) -> Void) {
21
+ self.closure = closure
22
+ }
23
+
24
+ @inline(__always)
25
+ public func call(error: std.exception_ptr) -> Void {
26
+ self.closure(RuntimeError.from(cppError: error))
27
+ }
28
+
29
+ /**
30
+ * Casts this instance to a retained unsafe raw pointer.
31
+ * This acquires one additional strong reference on the object!
32
+ */
33
+ @inline(__always)
34
+ public func toUnsafe() -> UnsafeMutableRawPointer {
35
+ return Unmanaged.passRetained(self).toOpaque()
36
+ }
37
+
38
+ /**
39
+ * Casts an unsafe pointer to a `Func_void_std__exception_ptr`.
40
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_std__exception_ptr>`.
41
+ * This removes one strong reference from the object!
42
+ */
43
+ @inline(__always)
44
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__exception_ptr {
45
+ return Unmanaged<Func_void_std__exception_ptr>.fromOpaque(pointer).takeRetainedValue()
46
+ }
47
+ }
@@ -0,0 +1,47 @@
1
+ ///
2
+ /// Func_void_std__optional_RecordResult_.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
+ /**
12
+ * Wraps a Swift `(_ value: RecordResult?) -> Void` as a class.
13
+ * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
14
+ */
15
+ public final class Func_void_std__optional_RecordResult_ {
16
+ public typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift
17
+
18
+ private let closure: (_ value: RecordResult?) -> Void
19
+
20
+ public init(_ closure: @escaping (_ value: RecordResult?) -> Void) {
21
+ self.closure = closure
22
+ }
23
+
24
+ @inline(__always)
25
+ public func call(value: bridge.std__optional_RecordResult_) -> Void {
26
+ self.closure(value.value)
27
+ }
28
+
29
+ /**
30
+ * Casts this instance to a retained unsafe raw pointer.
31
+ * This acquires one additional strong reference on the object!
32
+ */
33
+ @inline(__always)
34
+ public func toUnsafe() -> UnsafeMutableRawPointer {
35
+ return Unmanaged.passRetained(self).toOpaque()
36
+ }
37
+
38
+ /**
39
+ * Casts an unsafe pointer to a `Func_void_std__optional_RecordResult_`.
40
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_std__optional_RecordResult_>`.
41
+ * This removes one strong reference from the object!
42
+ */
43
+ @inline(__always)
44
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__optional_RecordResult_ {
45
+ return Unmanaged<Func_void_std__optional_RecordResult_>.fromOpaque(pointer).takeRetainedValue()
46
+ }
47
+ }
@@ -0,0 +1,55 @@
1
+ ///
2
+ /// HybridCloudKitModuleSpec.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 ``HybridCloudKitModuleSpec``
12
+ public protocol HybridCloudKitModuleSpec_protocol: HybridObject {
13
+ // Properties
14
+
15
+
16
+ // Methods
17
+ func isAvailable() throws -> Promise<Bool>
18
+ func getAccountInfo() throws -> Promise<AccountInfoResult>
19
+ func saveRecord(params: SaveRecordParams) throws -> Promise<SaveRecordResult>
20
+ func fetchRecord(params: FetchRecordParams) throws -> Promise<RecordResult?>
21
+ func deleteRecord(params: DeleteRecordParams) throws -> Promise<Bool>
22
+ func recordExists(params: RecordExistsParams) throws -> Promise<Bool>
23
+ func queryRecords(params: QueryRecordsParams) throws -> Promise<QueryRecordsResult>
24
+ }
25
+
26
+ /// See ``HybridCloudKitModuleSpec``
27
+ open class HybridCloudKitModuleSpec_base {
28
+ private weak var cxxWrapper: HybridCloudKitModuleSpec_cxx? = nil
29
+ public init() { }
30
+ public func getCxxWrapper() -> HybridCloudKitModuleSpec_cxx {
31
+ #if DEBUG
32
+ guard self is HybridCloudKitModuleSpec else {
33
+ fatalError("`self` is not a `HybridCloudKitModuleSpec`! Did you accidentally inherit from `HybridCloudKitModuleSpec_base` instead of `HybridCloudKitModuleSpec`?")
34
+ }
35
+ #endif
36
+ if let cxxWrapper = self.cxxWrapper {
37
+ return cxxWrapper
38
+ } else {
39
+ let cxxWrapper = HybridCloudKitModuleSpec_cxx(self as! HybridCloudKitModuleSpec)
40
+ self.cxxWrapper = cxxWrapper
41
+ return cxxWrapper
42
+ }
43
+ }
44
+ }
45
+
46
+ /**
47
+ * A Swift base-protocol representing the CloudKitModule HybridObject.
48
+ * Implement this protocol to create Swift-based instances of CloudKitModule.
49
+ * ```swift
50
+ * class HybridCloudKitModule : HybridCloudKitModuleSpec {
51
+ * // ...
52
+ * }
53
+ * ```
54
+ */
55
+ public typealias HybridCloudKitModuleSpec = HybridCloudKitModuleSpec_protocol & HybridCloudKitModuleSpec_base