@onekeyfe/react-native-range-downloader 3.0.81 → 3.0.85

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 (146) hide show
  1. package/ReactNativeRangeDownloader.podspec +7 -0
  2. package/android/src/main/java/com/margelo/nitro/reactnativerangedownloader/FirmwareArchiveRules.kt +291 -0
  3. package/android/src/main/java/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactOrphanSweep.kt +111 -0
  4. package/android/src/main/java/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactStore.kt +822 -0
  5. package/android/src/main/java/com/margelo/nitro/reactnativerangedownloader/ReactNativeRangeDownloader.kt +148 -0
  6. package/android/src/test/java/com/margelo/nitro/reactnativerangedownloader/FirmwareArchiveRulesTest.kt +114 -0
  7. package/android/src/test/java/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactDeadlineTest.kt +26 -0
  8. package/android/src/test/java/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactOrphanSweepTest.kt +107 -0
  9. package/ios/FirmwareArchiveMinizipBridge.h +33 -0
  10. package/ios/FirmwareArchiveMinizipBridge.mm +213 -0
  11. package/ios/FirmwareArtifactStore.swift +1508 -0
  12. package/ios/RangeDownloadLogic.swift +317 -0
  13. package/ios/ReactNativeRangeDownloader.swift +214 -6
  14. package/lib/module/index.js +2 -1
  15. package/lib/module/index.js.map +1 -1
  16. package/lib/typescript/src/ReactNativeRangeDownloader.nitro.d.ts +92 -1
  17. package/lib/typescript/src/ReactNativeRangeDownloader.nitro.d.ts.map +1 -1
  18. package/lib/typescript/src/index.d.ts +1 -0
  19. package/lib/typescript/src/index.d.ts.map +1 -1
  20. package/nitrogen/generated/android/c++/JDownloadChannel.hpp +8 -6
  21. package/nitrogen/generated/android/c++/JFirmwareArchiveExpectedEntry.hpp +69 -0
  22. package/nitrogen/generated/android/c++/JFirmwareArchiveMaterializeParams.hpp +87 -0
  23. package/nitrogen/generated/android/c++/JFirmwareArchiveMaterializeResult.hpp +80 -0
  24. package/nitrogen/generated/android/c++/JFirmwareArchiveMaterializedArtifact.hpp +63 -0
  25. package/nitrogen/generated/android/c++/JFirmwareArtifactCancelParams.hpp +57 -0
  26. package/nitrogen/generated/android/c++/JFirmwareArtifactCapabilities.hpp +88 -0
  27. package/nitrogen/generated/android/c++/JFirmwareArtifactDownloadParams.hpp +98 -0
  28. package/nitrogen/generated/android/c++/JFirmwareArtifactLease.hpp +57 -0
  29. package/nitrogen/generated/android/c++/JFirmwareArtifactLeaseCreateParams.hpp +57 -0
  30. package/nitrogen/generated/android/c++/JFirmwareArtifactLeaseReleaseParams.hpp +61 -0
  31. package/nitrogen/generated/android/c++/JFirmwareArtifactLeaseRetainParams.hpp +61 -0
  32. package/nitrogen/generated/android/c++/JFirmwareArtifactReaderCloseParams.hpp +57 -0
  33. package/nitrogen/generated/android/c++/JFirmwareArtifactReaderInfo.hpp +61 -0
  34. package/nitrogen/generated/android/c++/JFirmwareArtifactReaderReadParams.hpp +65 -0
  35. package/nitrogen/generated/android/c++/JFirmwareArtifactReceipt.hpp +69 -0
  36. package/nitrogen/generated/android/c++/JFirmwareArtifactRefParams.hpp +57 -0
  37. package/nitrogen/generated/android/c++/JFirmwareArtifactSweepResult.hpp +61 -0
  38. package/nitrogen/generated/android/c++/JFunc_void_RangeDownloadEvent.hpp +3 -3
  39. package/nitrogen/generated/android/c++/JHybridReactNativeRangeDownloaderSpec.cpp +274 -25
  40. package/nitrogen/generated/android/c++/JHybridReactNativeRangeDownloaderSpec.hpp +32 -22
  41. package/nitrogen/generated/android/c++/JRangeDownloadEvent.hpp +2 -2
  42. package/nitrogen/generated/android/c++/JRangeDownloadOutcome.hpp +6 -7
  43. package/nitrogen/generated/android/c++/JRangeDownloadParams.hpp +2 -2
  44. package/nitrogen/generated/android/c++/JRangeDownloadResult.hpp +2 -2
  45. package/nitrogen/generated/android/c++/JRangeFallbackKind.hpp +12 -13
  46. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/DownloadChannel.kt +5 -2
  47. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArchiveExpectedEntry.kt +47 -0
  48. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArchiveMaterializeParams.kt +44 -0
  49. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArchiveMaterializeResult.kt +38 -0
  50. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArchiveMaterializedArtifact.kt +41 -0
  51. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactCancelParams.kt +38 -0
  52. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactCapabilities.kt +47 -0
  53. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactDownloadParams.kt +68 -0
  54. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactLease.kt +38 -0
  55. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactLeaseCreateParams.kt +38 -0
  56. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactLeaseReleaseParams.kt +41 -0
  57. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactLeaseRetainParams.kt +41 -0
  58. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactReaderCloseParams.kt +38 -0
  59. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactReaderInfo.kt +41 -0
  60. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactReaderReadParams.kt +44 -0
  61. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactReceipt.kt +47 -0
  62. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactRefParams.kt +38 -0
  63. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactSweepResult.kt +41 -0
  64. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/Func_void_RangeDownloadEvent.kt +1 -1
  65. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/HybridReactNativeRangeDownloaderSpec.kt +65 -19
  66. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/RangeDownloadEvent.kt +2 -2
  67. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/RangeDownloadOutcome.kt +3 -1
  68. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/RangeDownloadParams.kt +2 -2
  69. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/RangeDownloadResult.kt +2 -2
  70. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/RangeFallbackKind.kt +3 -1
  71. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/reactnativerangedownloaderOnLoad.kt +1 -1
  72. package/nitrogen/generated/android/reactnativerangedownloader+autolinking.cmake +1 -1
  73. package/nitrogen/generated/android/reactnativerangedownloader+autolinking.gradle +1 -1
  74. package/nitrogen/generated/android/reactnativerangedownloaderOnLoad.cpp +28 -18
  75. package/nitrogen/generated/android/reactnativerangedownloaderOnLoad.hpp +14 -5
  76. package/nitrogen/generated/ios/ReactNativeRangeDownloader+autolinking.rb +2 -2
  77. package/nitrogen/generated/ios/ReactNativeRangeDownloader-Swift-Cxx-Bridge.cpp +49 -1
  78. package/nitrogen/generated/ios/ReactNativeRangeDownloader-Swift-Cxx-Bridge.hpp +348 -4
  79. package/nitrogen/generated/ios/ReactNativeRangeDownloader-Swift-Cxx-Umbrella.hpp +54 -1
  80. package/nitrogen/generated/ios/ReactNativeRangeDownloaderAutolinking.mm +1 -1
  81. package/nitrogen/generated/ios/ReactNativeRangeDownloaderAutolinking.swift +9 -8
  82. package/nitrogen/generated/ios/c++/HybridReactNativeRangeDownloaderSpecSwift.cpp +1 -1
  83. package/nitrogen/generated/ios/c++/HybridReactNativeRangeDownloaderSpecSwift.hpp +159 -1
  84. package/nitrogen/generated/ios/swift/DownloadChannel.swift +5 -1
  85. package/nitrogen/generated/ios/swift/FirmwareArchiveExpectedEntry.swift +44 -0
  86. package/nitrogen/generated/ios/swift/FirmwareArchiveMaterializeParams.swift +58 -0
  87. package/nitrogen/generated/ios/swift/FirmwareArchiveMaterializeResult.swift +35 -0
  88. package/nitrogen/generated/ios/swift/FirmwareArchiveMaterializedArtifact.swift +34 -0
  89. package/nitrogen/generated/ios/swift/FirmwareArtifactCancelParams.swift +29 -0
  90. package/nitrogen/generated/ios/swift/FirmwareArtifactCapabilities.swift +50 -0
  91. package/nitrogen/generated/ios/swift/FirmwareArtifactDownloadParams.swift +131 -0
  92. package/nitrogen/generated/ios/swift/FirmwareArtifactLease.swift +29 -0
  93. package/nitrogen/generated/ios/swift/FirmwareArtifactLeaseCreateParams.swift +29 -0
  94. package/nitrogen/generated/ios/swift/FirmwareArtifactLeaseReleaseParams.swift +34 -0
  95. package/nitrogen/generated/ios/swift/FirmwareArtifactLeaseRetainParams.swift +34 -0
  96. package/nitrogen/generated/ios/swift/FirmwareArtifactReaderCloseParams.swift +29 -0
  97. package/nitrogen/generated/ios/swift/FirmwareArtifactReaderInfo.swift +34 -0
  98. package/nitrogen/generated/ios/swift/FirmwareArtifactReaderReadParams.swift +39 -0
  99. package/nitrogen/generated/ios/swift/FirmwareArtifactReceipt.swift +44 -0
  100. package/nitrogen/generated/ios/swift/FirmwareArtifactRefParams.swift +29 -0
  101. package/nitrogen/generated/ios/swift/FirmwareArtifactSweepResult.swift +34 -0
  102. package/nitrogen/generated/ios/swift/Func_void.swift +1 -2
  103. package/nitrogen/generated/ios/swift/Func_void_FirmwareArchiveMaterializeResult.swift +46 -0
  104. package/nitrogen/generated/ios/swift/Func_void_FirmwareArtifactLease.swift +46 -0
  105. package/nitrogen/generated/ios/swift/Func_void_FirmwareArtifactReaderInfo.swift +46 -0
  106. package/nitrogen/generated/ios/swift/Func_void_FirmwareArtifactReceipt.swift +46 -0
  107. package/nitrogen/generated/ios/swift/Func_void_FirmwareArtifactSweepResult.swift +46 -0
  108. package/nitrogen/generated/ios/swift/Func_void_RangeDownloadEvent.swift +1 -2
  109. package/nitrogen/generated/ios/swift/Func_void_RangeDownloadResult.swift +1 -2
  110. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +1 -2
  111. package/nitrogen/generated/ios/swift/Func_void_std__shared_ptr_ArrayBuffer_.swift +46 -0
  112. package/nitrogen/generated/ios/swift/HybridReactNativeRangeDownloaderSpec.swift +15 -4
  113. package/nitrogen/generated/ios/swift/HybridReactNativeRangeDownloaderSpec_cxx.swift +230 -2
  114. package/nitrogen/generated/ios/swift/RangeDownloadEvent.swift +11 -42
  115. package/nitrogen/generated/ios/swift/RangeDownloadOutcome.swift +1 -1
  116. package/nitrogen/generated/ios/swift/RangeDownloadParams.swift +72 -139
  117. package/nitrogen/generated/ios/swift/RangeDownloadResult.swift +16 -53
  118. package/nitrogen/generated/ios/swift/RangeFallbackKind.swift +1 -1
  119. package/nitrogen/generated/shared/c++/DownloadChannel.hpp +5 -1
  120. package/nitrogen/generated/shared/c++/FirmwareArchiveExpectedEntry.hpp +95 -0
  121. package/nitrogen/generated/shared/c++/FirmwareArchiveMaterializeParams.hpp +95 -0
  122. package/nitrogen/generated/shared/c++/FirmwareArchiveMaterializeResult.hpp +85 -0
  123. package/nitrogen/generated/shared/c++/FirmwareArchiveMaterializedArtifact.hpp +89 -0
  124. package/nitrogen/generated/shared/c++/FirmwareArtifactCancelParams.hpp +83 -0
  125. package/nitrogen/generated/shared/c++/FirmwareArtifactCapabilities.hpp +96 -0
  126. package/nitrogen/generated/shared/c++/FirmwareArtifactDownloadParams.hpp +124 -0
  127. package/nitrogen/generated/shared/c++/FirmwareArtifactLease.hpp +83 -0
  128. package/nitrogen/generated/shared/c++/FirmwareArtifactLeaseCreateParams.hpp +83 -0
  129. package/nitrogen/generated/shared/c++/FirmwareArtifactLeaseReleaseParams.hpp +87 -0
  130. package/nitrogen/generated/shared/c++/FirmwareArtifactLeaseRetainParams.hpp +87 -0
  131. package/nitrogen/generated/shared/c++/FirmwareArtifactReaderCloseParams.hpp +83 -0
  132. package/nitrogen/generated/shared/c++/FirmwareArtifactReaderInfo.hpp +87 -0
  133. package/nitrogen/generated/shared/c++/FirmwareArtifactReaderReadParams.hpp +91 -0
  134. package/nitrogen/generated/shared/c++/FirmwareArtifactReceipt.hpp +95 -0
  135. package/nitrogen/generated/shared/c++/FirmwareArtifactRefParams.hpp +83 -0
  136. package/nitrogen/generated/shared/c++/FirmwareArtifactSweepResult.hpp +87 -0
  137. package/nitrogen/generated/shared/c++/HybridReactNativeRangeDownloaderSpec.cpp +13 -1
  138. package/nitrogen/generated/shared/c++/HybridReactNativeRangeDownloaderSpec.hpp +59 -1
  139. package/nitrogen/generated/shared/c++/RangeDownloadEvent.hpp +25 -17
  140. package/nitrogen/generated/shared/c++/RangeDownloadOutcome.hpp +1 -1
  141. package/nitrogen/generated/shared/c++/RangeDownloadParams.hpp +43 -35
  142. package/nitrogen/generated/shared/c++/RangeDownloadResult.hpp +22 -14
  143. package/nitrogen/generated/shared/c++/RangeFallbackKind.hpp +1 -1
  144. package/package.json +4 -4
  145. package/src/ReactNativeRangeDownloader.nitro.ts +130 -1
  146. package/src/index.tsx +3 -1
@@ -0,0 +1,124 @@
1
+ ///
2
+ /// FirmwareArtifactDownloadParams.hpp
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
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
30
+
31
+
32
+
33
+ #include <string>
34
+ #include <optional>
35
+
36
+ namespace margelo::nitro::reactnativerangedownloader {
37
+
38
+ /**
39
+ * A struct which can be represented as a JavaScript object (FirmwareArtifactDownloadParams).
40
+ */
41
+ struct FirmwareArtifactDownloadParams final {
42
+ public:
43
+ std::string taskId SWIFT_PRIVATE;
44
+ std::string transactionId SWIFT_PRIVATE;
45
+ std::string leaseRef SWIFT_PRIVATE;
46
+ std::string artifactId SWIFT_PRIVATE;
47
+ std::string url SWIFT_PRIVATE;
48
+ std::string routeType SWIFT_PRIVATE;
49
+ std::optional<std::string> resolvedIp SWIFT_PRIVATE;
50
+ std::optional<double> expectedSize SWIFT_PRIVATE;
51
+ std::optional<std::string> expectedSha256 SWIFT_PRIVATE;
52
+ double maxBytes SWIFT_PRIVATE;
53
+ std::optional<double> overallDeadlineSeconds SWIFT_PRIVATE;
54
+
55
+ public:
56
+ FirmwareArtifactDownloadParams() = default;
57
+ explicit FirmwareArtifactDownloadParams(std::string taskId, std::string transactionId, std::string leaseRef, std::string artifactId, std::string url, std::string routeType, std::optional<std::string> resolvedIp, std::optional<double> expectedSize, std::optional<std::string> expectedSha256, double maxBytes, std::optional<double> overallDeadlineSeconds): taskId(taskId), transactionId(transactionId), leaseRef(leaseRef), artifactId(artifactId), url(url), routeType(routeType), resolvedIp(resolvedIp), expectedSize(expectedSize), expectedSha256(expectedSha256), maxBytes(maxBytes), overallDeadlineSeconds(overallDeadlineSeconds) {}
58
+
59
+ public:
60
+ friend bool operator==(const FirmwareArtifactDownloadParams& lhs, const FirmwareArtifactDownloadParams& rhs) = default;
61
+ };
62
+
63
+ } // namespace margelo::nitro::reactnativerangedownloader
64
+
65
+ namespace margelo::nitro {
66
+
67
+ // C++ FirmwareArtifactDownloadParams <> JS FirmwareArtifactDownloadParams (object)
68
+ template <>
69
+ struct JSIConverter<margelo::nitro::reactnativerangedownloader::FirmwareArtifactDownloadParams> final {
70
+ static inline margelo::nitro::reactnativerangedownloader::FirmwareArtifactDownloadParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
71
+ jsi::Object obj = arg.asObject(runtime);
72
+ return margelo::nitro::reactnativerangedownloader::FirmwareArtifactDownloadParams(
73
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "taskId"))),
74
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "transactionId"))),
75
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "leaseRef"))),
76
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "artifactId"))),
77
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "url"))),
78
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "routeType"))),
79
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "resolvedIp"))),
80
+ JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "expectedSize"))),
81
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "expectedSha256"))),
82
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxBytes"))),
83
+ JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "overallDeadlineSeconds")))
84
+ );
85
+ }
86
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativerangedownloader::FirmwareArtifactDownloadParams& arg) {
87
+ jsi::Object obj(runtime);
88
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "taskId"), JSIConverter<std::string>::toJSI(runtime, arg.taskId));
89
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "transactionId"), JSIConverter<std::string>::toJSI(runtime, arg.transactionId));
90
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "leaseRef"), JSIConverter<std::string>::toJSI(runtime, arg.leaseRef));
91
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "artifactId"), JSIConverter<std::string>::toJSI(runtime, arg.artifactId));
92
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "url"), JSIConverter<std::string>::toJSI(runtime, arg.url));
93
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "routeType"), JSIConverter<std::string>::toJSI(runtime, arg.routeType));
94
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "resolvedIp"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.resolvedIp));
95
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "expectedSize"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.expectedSize));
96
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "expectedSha256"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.expectedSha256));
97
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "maxBytes"), JSIConverter<double>::toJSI(runtime, arg.maxBytes));
98
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "overallDeadlineSeconds"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.overallDeadlineSeconds));
99
+ return obj;
100
+ }
101
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
102
+ if (!value.isObject()) {
103
+ return false;
104
+ }
105
+ jsi::Object obj = value.getObject(runtime);
106
+ if (!nitro::isPlainObject(runtime, obj)) {
107
+ return false;
108
+ }
109
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "taskId")))) return false;
110
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "transactionId")))) return false;
111
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "leaseRef")))) return false;
112
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "artifactId")))) return false;
113
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "url")))) return false;
114
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "routeType")))) return false;
115
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "resolvedIp")))) return false;
116
+ if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "expectedSize")))) return false;
117
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "expectedSha256")))) return false;
118
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxBytes")))) return false;
119
+ if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "overallDeadlineSeconds")))) return false;
120
+ return true;
121
+ }
122
+ };
123
+
124
+ } // namespace margelo::nitro
@@ -0,0 +1,83 @@
1
+ ///
2
+ /// FirmwareArtifactLease.hpp
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
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
30
+
31
+
32
+
33
+ #include <string>
34
+
35
+ namespace margelo::nitro::reactnativerangedownloader {
36
+
37
+ /**
38
+ * A struct which can be represented as a JavaScript object (FirmwareArtifactLease).
39
+ */
40
+ struct FirmwareArtifactLease final {
41
+ public:
42
+ std::string leaseRef SWIFT_PRIVATE;
43
+
44
+ public:
45
+ FirmwareArtifactLease() = default;
46
+ explicit FirmwareArtifactLease(std::string leaseRef): leaseRef(leaseRef) {}
47
+
48
+ public:
49
+ friend bool operator==(const FirmwareArtifactLease& lhs, const FirmwareArtifactLease& rhs) = default;
50
+ };
51
+
52
+ } // namespace margelo::nitro::reactnativerangedownloader
53
+
54
+ namespace margelo::nitro {
55
+
56
+ // C++ FirmwareArtifactLease <> JS FirmwareArtifactLease (object)
57
+ template <>
58
+ struct JSIConverter<margelo::nitro::reactnativerangedownloader::FirmwareArtifactLease> final {
59
+ static inline margelo::nitro::reactnativerangedownloader::FirmwareArtifactLease fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
60
+ jsi::Object obj = arg.asObject(runtime);
61
+ return margelo::nitro::reactnativerangedownloader::FirmwareArtifactLease(
62
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "leaseRef")))
63
+ );
64
+ }
65
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativerangedownloader::FirmwareArtifactLease& arg) {
66
+ jsi::Object obj(runtime);
67
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "leaseRef"), JSIConverter<std::string>::toJSI(runtime, arg.leaseRef));
68
+ return obj;
69
+ }
70
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
71
+ if (!value.isObject()) {
72
+ return false;
73
+ }
74
+ jsi::Object obj = value.getObject(runtime);
75
+ if (!nitro::isPlainObject(runtime, obj)) {
76
+ return false;
77
+ }
78
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "leaseRef")))) return false;
79
+ return true;
80
+ }
81
+ };
82
+
83
+ } // namespace margelo::nitro
@@ -0,0 +1,83 @@
1
+ ///
2
+ /// FirmwareArtifactLeaseCreateParams.hpp
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
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
30
+
31
+
32
+
33
+ #include <string>
34
+
35
+ namespace margelo::nitro::reactnativerangedownloader {
36
+
37
+ /**
38
+ * A struct which can be represented as a JavaScript object (FirmwareArtifactLeaseCreateParams).
39
+ */
40
+ struct FirmwareArtifactLeaseCreateParams final {
41
+ public:
42
+ std::string transactionId SWIFT_PRIVATE;
43
+
44
+ public:
45
+ FirmwareArtifactLeaseCreateParams() = default;
46
+ explicit FirmwareArtifactLeaseCreateParams(std::string transactionId): transactionId(transactionId) {}
47
+
48
+ public:
49
+ friend bool operator==(const FirmwareArtifactLeaseCreateParams& lhs, const FirmwareArtifactLeaseCreateParams& rhs) = default;
50
+ };
51
+
52
+ } // namespace margelo::nitro::reactnativerangedownloader
53
+
54
+ namespace margelo::nitro {
55
+
56
+ // C++ FirmwareArtifactLeaseCreateParams <> JS FirmwareArtifactLeaseCreateParams (object)
57
+ template <>
58
+ struct JSIConverter<margelo::nitro::reactnativerangedownloader::FirmwareArtifactLeaseCreateParams> final {
59
+ static inline margelo::nitro::reactnativerangedownloader::FirmwareArtifactLeaseCreateParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
60
+ jsi::Object obj = arg.asObject(runtime);
61
+ return margelo::nitro::reactnativerangedownloader::FirmwareArtifactLeaseCreateParams(
62
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "transactionId")))
63
+ );
64
+ }
65
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativerangedownloader::FirmwareArtifactLeaseCreateParams& arg) {
66
+ jsi::Object obj(runtime);
67
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "transactionId"), JSIConverter<std::string>::toJSI(runtime, arg.transactionId));
68
+ return obj;
69
+ }
70
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
71
+ if (!value.isObject()) {
72
+ return false;
73
+ }
74
+ jsi::Object obj = value.getObject(runtime);
75
+ if (!nitro::isPlainObject(runtime, obj)) {
76
+ return false;
77
+ }
78
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "transactionId")))) return false;
79
+ return true;
80
+ }
81
+ };
82
+
83
+ } // namespace margelo::nitro
@@ -0,0 +1,87 @@
1
+ ///
2
+ /// FirmwareArtifactLeaseReleaseParams.hpp
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
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
30
+
31
+
32
+
33
+ #include <string>
34
+
35
+ namespace margelo::nitro::reactnativerangedownloader {
36
+
37
+ /**
38
+ * A struct which can be represented as a JavaScript object (FirmwareArtifactLeaseReleaseParams).
39
+ */
40
+ struct FirmwareArtifactLeaseReleaseParams final {
41
+ public:
42
+ std::string leaseRef SWIFT_PRIVATE;
43
+ std::string disposition SWIFT_PRIVATE;
44
+
45
+ public:
46
+ FirmwareArtifactLeaseReleaseParams() = default;
47
+ explicit FirmwareArtifactLeaseReleaseParams(std::string leaseRef, std::string disposition): leaseRef(leaseRef), disposition(disposition) {}
48
+
49
+ public:
50
+ friend bool operator==(const FirmwareArtifactLeaseReleaseParams& lhs, const FirmwareArtifactLeaseReleaseParams& rhs) = default;
51
+ };
52
+
53
+ } // namespace margelo::nitro::reactnativerangedownloader
54
+
55
+ namespace margelo::nitro {
56
+
57
+ // C++ FirmwareArtifactLeaseReleaseParams <> JS FirmwareArtifactLeaseReleaseParams (object)
58
+ template <>
59
+ struct JSIConverter<margelo::nitro::reactnativerangedownloader::FirmwareArtifactLeaseReleaseParams> final {
60
+ static inline margelo::nitro::reactnativerangedownloader::FirmwareArtifactLeaseReleaseParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
61
+ jsi::Object obj = arg.asObject(runtime);
62
+ return margelo::nitro::reactnativerangedownloader::FirmwareArtifactLeaseReleaseParams(
63
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "leaseRef"))),
64
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "disposition")))
65
+ );
66
+ }
67
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativerangedownloader::FirmwareArtifactLeaseReleaseParams& arg) {
68
+ jsi::Object obj(runtime);
69
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "leaseRef"), JSIConverter<std::string>::toJSI(runtime, arg.leaseRef));
70
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "disposition"), JSIConverter<std::string>::toJSI(runtime, arg.disposition));
71
+ return obj;
72
+ }
73
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
74
+ if (!value.isObject()) {
75
+ return false;
76
+ }
77
+ jsi::Object obj = value.getObject(runtime);
78
+ if (!nitro::isPlainObject(runtime, obj)) {
79
+ return false;
80
+ }
81
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "leaseRef")))) return false;
82
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "disposition")))) return false;
83
+ return true;
84
+ }
85
+ };
86
+
87
+ } // namespace margelo::nitro
@@ -0,0 +1,87 @@
1
+ ///
2
+ /// FirmwareArtifactLeaseRetainParams.hpp
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
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
30
+
31
+
32
+
33
+ #include <string>
34
+
35
+ namespace margelo::nitro::reactnativerangedownloader {
36
+
37
+ /**
38
+ * A struct which can be represented as a JavaScript object (FirmwareArtifactLeaseRetainParams).
39
+ */
40
+ struct FirmwareArtifactLeaseRetainParams final {
41
+ public:
42
+ std::string leaseRef SWIFT_PRIVATE;
43
+ std::string artifactRef SWIFT_PRIVATE;
44
+
45
+ public:
46
+ FirmwareArtifactLeaseRetainParams() = default;
47
+ explicit FirmwareArtifactLeaseRetainParams(std::string leaseRef, std::string artifactRef): leaseRef(leaseRef), artifactRef(artifactRef) {}
48
+
49
+ public:
50
+ friend bool operator==(const FirmwareArtifactLeaseRetainParams& lhs, const FirmwareArtifactLeaseRetainParams& rhs) = default;
51
+ };
52
+
53
+ } // namespace margelo::nitro::reactnativerangedownloader
54
+
55
+ namespace margelo::nitro {
56
+
57
+ // C++ FirmwareArtifactLeaseRetainParams <> JS FirmwareArtifactLeaseRetainParams (object)
58
+ template <>
59
+ struct JSIConverter<margelo::nitro::reactnativerangedownloader::FirmwareArtifactLeaseRetainParams> final {
60
+ static inline margelo::nitro::reactnativerangedownloader::FirmwareArtifactLeaseRetainParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
61
+ jsi::Object obj = arg.asObject(runtime);
62
+ return margelo::nitro::reactnativerangedownloader::FirmwareArtifactLeaseRetainParams(
63
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "leaseRef"))),
64
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "artifactRef")))
65
+ );
66
+ }
67
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativerangedownloader::FirmwareArtifactLeaseRetainParams& arg) {
68
+ jsi::Object obj(runtime);
69
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "leaseRef"), JSIConverter<std::string>::toJSI(runtime, arg.leaseRef));
70
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "artifactRef"), JSIConverter<std::string>::toJSI(runtime, arg.artifactRef));
71
+ return obj;
72
+ }
73
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
74
+ if (!value.isObject()) {
75
+ return false;
76
+ }
77
+ jsi::Object obj = value.getObject(runtime);
78
+ if (!nitro::isPlainObject(runtime, obj)) {
79
+ return false;
80
+ }
81
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "leaseRef")))) return false;
82
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "artifactRef")))) return false;
83
+ return true;
84
+ }
85
+ };
86
+
87
+ } // namespace margelo::nitro
@@ -0,0 +1,83 @@
1
+ ///
2
+ /// FirmwareArtifactReaderCloseParams.hpp
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
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
30
+
31
+
32
+
33
+ #include <string>
34
+
35
+ namespace margelo::nitro::reactnativerangedownloader {
36
+
37
+ /**
38
+ * A struct which can be represented as a JavaScript object (FirmwareArtifactReaderCloseParams).
39
+ */
40
+ struct FirmwareArtifactReaderCloseParams final {
41
+ public:
42
+ std::string readerId SWIFT_PRIVATE;
43
+
44
+ public:
45
+ FirmwareArtifactReaderCloseParams() = default;
46
+ explicit FirmwareArtifactReaderCloseParams(std::string readerId): readerId(readerId) {}
47
+
48
+ public:
49
+ friend bool operator==(const FirmwareArtifactReaderCloseParams& lhs, const FirmwareArtifactReaderCloseParams& rhs) = default;
50
+ };
51
+
52
+ } // namespace margelo::nitro::reactnativerangedownloader
53
+
54
+ namespace margelo::nitro {
55
+
56
+ // C++ FirmwareArtifactReaderCloseParams <> JS FirmwareArtifactReaderCloseParams (object)
57
+ template <>
58
+ struct JSIConverter<margelo::nitro::reactnativerangedownloader::FirmwareArtifactReaderCloseParams> final {
59
+ static inline margelo::nitro::reactnativerangedownloader::FirmwareArtifactReaderCloseParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
60
+ jsi::Object obj = arg.asObject(runtime);
61
+ return margelo::nitro::reactnativerangedownloader::FirmwareArtifactReaderCloseParams(
62
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "readerId")))
63
+ );
64
+ }
65
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativerangedownloader::FirmwareArtifactReaderCloseParams& arg) {
66
+ jsi::Object obj(runtime);
67
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "readerId"), JSIConverter<std::string>::toJSI(runtime, arg.readerId));
68
+ return obj;
69
+ }
70
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
71
+ if (!value.isObject()) {
72
+ return false;
73
+ }
74
+ jsi::Object obj = value.getObject(runtime);
75
+ if (!nitro::isPlainObject(runtime, obj)) {
76
+ return false;
77
+ }
78
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "readerId")))) return false;
79
+ return true;
80
+ }
81
+ };
82
+
83
+ } // namespace margelo::nitro
@@ -0,0 +1,87 @@
1
+ ///
2
+ /// FirmwareArtifactReaderInfo.hpp
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
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
30
+
31
+
32
+
33
+ #include <string>
34
+
35
+ namespace margelo::nitro::reactnativerangedownloader {
36
+
37
+ /**
38
+ * A struct which can be represented as a JavaScript object (FirmwareArtifactReaderInfo).
39
+ */
40
+ struct FirmwareArtifactReaderInfo final {
41
+ public:
42
+ std::string readerId SWIFT_PRIVATE;
43
+ double size SWIFT_PRIVATE;
44
+
45
+ public:
46
+ FirmwareArtifactReaderInfo() = default;
47
+ explicit FirmwareArtifactReaderInfo(std::string readerId, double size): readerId(readerId), size(size) {}
48
+
49
+ public:
50
+ friend bool operator==(const FirmwareArtifactReaderInfo& lhs, const FirmwareArtifactReaderInfo& rhs) = default;
51
+ };
52
+
53
+ } // namespace margelo::nitro::reactnativerangedownloader
54
+
55
+ namespace margelo::nitro {
56
+
57
+ // C++ FirmwareArtifactReaderInfo <> JS FirmwareArtifactReaderInfo (object)
58
+ template <>
59
+ struct JSIConverter<margelo::nitro::reactnativerangedownloader::FirmwareArtifactReaderInfo> final {
60
+ static inline margelo::nitro::reactnativerangedownloader::FirmwareArtifactReaderInfo fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
61
+ jsi::Object obj = arg.asObject(runtime);
62
+ return margelo::nitro::reactnativerangedownloader::FirmwareArtifactReaderInfo(
63
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "readerId"))),
64
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "size")))
65
+ );
66
+ }
67
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativerangedownloader::FirmwareArtifactReaderInfo& arg) {
68
+ jsi::Object obj(runtime);
69
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "readerId"), JSIConverter<std::string>::toJSI(runtime, arg.readerId));
70
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "size"), JSIConverter<double>::toJSI(runtime, arg.size));
71
+ return obj;
72
+ }
73
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
74
+ if (!value.isObject()) {
75
+ return false;
76
+ }
77
+ jsi::Object obj = value.getObject(runtime);
78
+ if (!nitro::isPlainObject(runtime, obj)) {
79
+ return false;
80
+ }
81
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "readerId")))) return false;
82
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "size")))) return false;
83
+ return true;
84
+ }
85
+ };
86
+
87
+ } // namespace margelo::nitro