@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
@@ -2,7 +2,7 @@
2
2
  /// RangeFallbackKind.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  /**
@@ -2,7 +2,7 @@
2
2
  /// DownloadChannel.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -32,6 +32,7 @@ namespace margelo::nitro::reactnativerangedownloader {
32
32
  BUNDLE SWIFT_NAME(bundle) = 0,
33
33
  APK SWIFT_NAME(apk) = 1,
34
34
  CHART SWIFT_NAME(chart) = 2,
35
+ FIRMWARE SWIFT_NAME(firmware) = 3,
35
36
  } CLOSED_ENUM;
36
37
 
37
38
  } // namespace margelo::nitro::reactnativerangedownloader
@@ -47,6 +48,7 @@ namespace margelo::nitro {
47
48
  case hashString("bundle"): return margelo::nitro::reactnativerangedownloader::DownloadChannel::BUNDLE;
48
49
  case hashString("apk"): return margelo::nitro::reactnativerangedownloader::DownloadChannel::APK;
49
50
  case hashString("chart"): return margelo::nitro::reactnativerangedownloader::DownloadChannel::CHART;
51
+ case hashString("firmware"): return margelo::nitro::reactnativerangedownloader::DownloadChannel::FIRMWARE;
50
52
  default: [[unlikely]]
51
53
  throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum DownloadChannel - invalid value!");
52
54
  }
@@ -56,6 +58,7 @@ namespace margelo::nitro {
56
58
  case margelo::nitro::reactnativerangedownloader::DownloadChannel::BUNDLE: return JSIConverter<std::string>::toJSI(runtime, "bundle");
57
59
  case margelo::nitro::reactnativerangedownloader::DownloadChannel::APK: return JSIConverter<std::string>::toJSI(runtime, "apk");
58
60
  case margelo::nitro::reactnativerangedownloader::DownloadChannel::CHART: return JSIConverter<std::string>::toJSI(runtime, "chart");
61
+ case margelo::nitro::reactnativerangedownloader::DownloadChannel::FIRMWARE: return JSIConverter<std::string>::toJSI(runtime, "firmware");
59
62
  default: [[unlikely]]
60
63
  throw std::invalid_argument("Cannot convert DownloadChannel to JS - invalid value: "
61
64
  + std::to_string(static_cast<int>(arg)) + "!");
@@ -70,6 +73,7 @@ namespace margelo::nitro {
70
73
  case hashString("bundle"):
71
74
  case hashString("apk"):
72
75
  case hashString("chart"):
76
+ case hashString("firmware"):
73
77
  return true;
74
78
  default:
75
79
  return false;
@@ -0,0 +1,95 @@
1
+ ///
2
+ /// FirmwareArchiveExpectedEntry.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 (FirmwareArchiveExpectedEntry).
39
+ */
40
+ struct FirmwareArchiveExpectedEntry final {
41
+ public:
42
+ std::string artifactId SWIFT_PRIVATE;
43
+ std::string entryName SWIFT_PRIVATE;
44
+ double expectedSize SWIFT_PRIVATE;
45
+ std::string expectedSha256 SWIFT_PRIVATE;
46
+
47
+ public:
48
+ FirmwareArchiveExpectedEntry() = default;
49
+ explicit FirmwareArchiveExpectedEntry(std::string artifactId, std::string entryName, double expectedSize, std::string expectedSha256): artifactId(artifactId), entryName(entryName), expectedSize(expectedSize), expectedSha256(expectedSha256) {}
50
+
51
+ public:
52
+ friend bool operator==(const FirmwareArchiveExpectedEntry& lhs, const FirmwareArchiveExpectedEntry& rhs) = default;
53
+ };
54
+
55
+ } // namespace margelo::nitro::reactnativerangedownloader
56
+
57
+ namespace margelo::nitro {
58
+
59
+ // C++ FirmwareArchiveExpectedEntry <> JS FirmwareArchiveExpectedEntry (object)
60
+ template <>
61
+ struct JSIConverter<margelo::nitro::reactnativerangedownloader::FirmwareArchiveExpectedEntry> final {
62
+ static inline margelo::nitro::reactnativerangedownloader::FirmwareArchiveExpectedEntry fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
63
+ jsi::Object obj = arg.asObject(runtime);
64
+ return margelo::nitro::reactnativerangedownloader::FirmwareArchiveExpectedEntry(
65
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "artifactId"))),
66
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "entryName"))),
67
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "expectedSize"))),
68
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "expectedSha256")))
69
+ );
70
+ }
71
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativerangedownloader::FirmwareArchiveExpectedEntry& arg) {
72
+ jsi::Object obj(runtime);
73
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "artifactId"), JSIConverter<std::string>::toJSI(runtime, arg.artifactId));
74
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "entryName"), JSIConverter<std::string>::toJSI(runtime, arg.entryName));
75
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "expectedSize"), JSIConverter<double>::toJSI(runtime, arg.expectedSize));
76
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "expectedSha256"), JSIConverter<std::string>::toJSI(runtime, arg.expectedSha256));
77
+ return obj;
78
+ }
79
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
80
+ if (!value.isObject()) {
81
+ return false;
82
+ }
83
+ jsi::Object obj = value.getObject(runtime);
84
+ if (!nitro::isPlainObject(runtime, obj)) {
85
+ return false;
86
+ }
87
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "artifactId")))) return false;
88
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "entryName")))) return false;
89
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "expectedSize")))) return false;
90
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "expectedSha256")))) return false;
91
+ return true;
92
+ }
93
+ };
94
+
95
+ } // namespace margelo::nitro
@@ -0,0 +1,95 @@
1
+ ///
2
+ /// FirmwareArchiveMaterializeParams.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
+ // Forward declaration of `FirmwareArchiveExpectedEntry` to properly resolve imports.
32
+ namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArchiveExpectedEntry; }
33
+
34
+ #include <string>
35
+ #include "FirmwareArchiveExpectedEntry.hpp"
36
+ #include <vector>
37
+ #include <optional>
38
+
39
+ namespace margelo::nitro::reactnativerangedownloader {
40
+
41
+ /**
42
+ * A struct which can be represented as a JavaScript object (FirmwareArchiveMaterializeParams).
43
+ */
44
+ struct FirmwareArchiveMaterializeParams final {
45
+ public:
46
+ std::string leaseRef SWIFT_PRIVATE;
47
+ std::string archiveArtifactRef SWIFT_PRIVATE;
48
+ std::optional<std::vector<FirmwareArchiveExpectedEntry>> expectedEntries SWIFT_PRIVATE;
49
+
50
+ public:
51
+ FirmwareArchiveMaterializeParams() = default;
52
+ explicit FirmwareArchiveMaterializeParams(std::string leaseRef, std::string archiveArtifactRef, std::optional<std::vector<FirmwareArchiveExpectedEntry>> expectedEntries): leaseRef(leaseRef), archiveArtifactRef(archiveArtifactRef), expectedEntries(expectedEntries) {}
53
+
54
+ public:
55
+ friend bool operator==(const FirmwareArchiveMaterializeParams& lhs, const FirmwareArchiveMaterializeParams& rhs) = default;
56
+ };
57
+
58
+ } // namespace margelo::nitro::reactnativerangedownloader
59
+
60
+ namespace margelo::nitro {
61
+
62
+ // C++ FirmwareArchiveMaterializeParams <> JS FirmwareArchiveMaterializeParams (object)
63
+ template <>
64
+ struct JSIConverter<margelo::nitro::reactnativerangedownloader::FirmwareArchiveMaterializeParams> final {
65
+ static inline margelo::nitro::reactnativerangedownloader::FirmwareArchiveMaterializeParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
66
+ jsi::Object obj = arg.asObject(runtime);
67
+ return margelo::nitro::reactnativerangedownloader::FirmwareArchiveMaterializeParams(
68
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "leaseRef"))),
69
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "archiveArtifactRef"))),
70
+ JSIConverter<std::optional<std::vector<margelo::nitro::reactnativerangedownloader::FirmwareArchiveExpectedEntry>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "expectedEntries")))
71
+ );
72
+ }
73
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativerangedownloader::FirmwareArchiveMaterializeParams& arg) {
74
+ jsi::Object obj(runtime);
75
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "leaseRef"), JSIConverter<std::string>::toJSI(runtime, arg.leaseRef));
76
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "archiveArtifactRef"), JSIConverter<std::string>::toJSI(runtime, arg.archiveArtifactRef));
77
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "expectedEntries"), JSIConverter<std::optional<std::vector<margelo::nitro::reactnativerangedownloader::FirmwareArchiveExpectedEntry>>>::toJSI(runtime, arg.expectedEntries));
78
+ return obj;
79
+ }
80
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
81
+ if (!value.isObject()) {
82
+ return false;
83
+ }
84
+ jsi::Object obj = value.getObject(runtime);
85
+ if (!nitro::isPlainObject(runtime, obj)) {
86
+ return false;
87
+ }
88
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "leaseRef")))) return false;
89
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "archiveArtifactRef")))) return false;
90
+ if (!JSIConverter<std::optional<std::vector<margelo::nitro::reactnativerangedownloader::FirmwareArchiveExpectedEntry>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "expectedEntries")))) return false;
91
+ return true;
92
+ }
93
+ };
94
+
95
+ } // namespace margelo::nitro
@@ -0,0 +1,85 @@
1
+ ///
2
+ /// FirmwareArchiveMaterializeResult.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
+ // Forward declaration of `FirmwareArchiveMaterializedArtifact` to properly resolve imports.
32
+ namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArchiveMaterializedArtifact; }
33
+
34
+ #include "FirmwareArchiveMaterializedArtifact.hpp"
35
+ #include <vector>
36
+
37
+ namespace margelo::nitro::reactnativerangedownloader {
38
+
39
+ /**
40
+ * A struct which can be represented as a JavaScript object (FirmwareArchiveMaterializeResult).
41
+ */
42
+ struct FirmwareArchiveMaterializeResult final {
43
+ public:
44
+ std::vector<FirmwareArchiveMaterializedArtifact> artifacts SWIFT_PRIVATE;
45
+
46
+ public:
47
+ FirmwareArchiveMaterializeResult() = default;
48
+ explicit FirmwareArchiveMaterializeResult(std::vector<FirmwareArchiveMaterializedArtifact> artifacts): artifacts(artifacts) {}
49
+
50
+ public:
51
+ friend bool operator==(const FirmwareArchiveMaterializeResult& lhs, const FirmwareArchiveMaterializeResult& rhs) = default;
52
+ };
53
+
54
+ } // namespace margelo::nitro::reactnativerangedownloader
55
+
56
+ namespace margelo::nitro {
57
+
58
+ // C++ FirmwareArchiveMaterializeResult <> JS FirmwareArchiveMaterializeResult (object)
59
+ template <>
60
+ struct JSIConverter<margelo::nitro::reactnativerangedownloader::FirmwareArchiveMaterializeResult> final {
61
+ static inline margelo::nitro::reactnativerangedownloader::FirmwareArchiveMaterializeResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
62
+ jsi::Object obj = arg.asObject(runtime);
63
+ return margelo::nitro::reactnativerangedownloader::FirmwareArchiveMaterializeResult(
64
+ JSIConverter<std::vector<margelo::nitro::reactnativerangedownloader::FirmwareArchiveMaterializedArtifact>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "artifacts")))
65
+ );
66
+ }
67
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativerangedownloader::FirmwareArchiveMaterializeResult& arg) {
68
+ jsi::Object obj(runtime);
69
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "artifacts"), JSIConverter<std::vector<margelo::nitro::reactnativerangedownloader::FirmwareArchiveMaterializedArtifact>>::toJSI(runtime, arg.artifacts));
70
+ return obj;
71
+ }
72
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
73
+ if (!value.isObject()) {
74
+ return false;
75
+ }
76
+ jsi::Object obj = value.getObject(runtime);
77
+ if (!nitro::isPlainObject(runtime, obj)) {
78
+ return false;
79
+ }
80
+ if (!JSIConverter<std::vector<margelo::nitro::reactnativerangedownloader::FirmwareArchiveMaterializedArtifact>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "artifacts")))) return false;
81
+ return true;
82
+ }
83
+ };
84
+
85
+ } // namespace margelo::nitro
@@ -0,0 +1,89 @@
1
+ ///
2
+ /// FirmwareArchiveMaterializedArtifact.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
+ // Forward declaration of `FirmwareArtifactReceipt` to properly resolve imports.
32
+ namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactReceipt; }
33
+
34
+ #include <string>
35
+ #include "FirmwareArtifactReceipt.hpp"
36
+
37
+ namespace margelo::nitro::reactnativerangedownloader {
38
+
39
+ /**
40
+ * A struct which can be represented as a JavaScript object (FirmwareArchiveMaterializedArtifact).
41
+ */
42
+ struct FirmwareArchiveMaterializedArtifact final {
43
+ public:
44
+ std::string entryName SWIFT_PRIVATE;
45
+ FirmwareArtifactReceipt receipt SWIFT_PRIVATE;
46
+
47
+ public:
48
+ FirmwareArchiveMaterializedArtifact() = default;
49
+ explicit FirmwareArchiveMaterializedArtifact(std::string entryName, FirmwareArtifactReceipt receipt): entryName(entryName), receipt(receipt) {}
50
+
51
+ public:
52
+ friend bool operator==(const FirmwareArchiveMaterializedArtifact& lhs, const FirmwareArchiveMaterializedArtifact& rhs) = default;
53
+ };
54
+
55
+ } // namespace margelo::nitro::reactnativerangedownloader
56
+
57
+ namespace margelo::nitro {
58
+
59
+ // C++ FirmwareArchiveMaterializedArtifact <> JS FirmwareArchiveMaterializedArtifact (object)
60
+ template <>
61
+ struct JSIConverter<margelo::nitro::reactnativerangedownloader::FirmwareArchiveMaterializedArtifact> final {
62
+ static inline margelo::nitro::reactnativerangedownloader::FirmwareArchiveMaterializedArtifact fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
63
+ jsi::Object obj = arg.asObject(runtime);
64
+ return margelo::nitro::reactnativerangedownloader::FirmwareArchiveMaterializedArtifact(
65
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "entryName"))),
66
+ JSIConverter<margelo::nitro::reactnativerangedownloader::FirmwareArtifactReceipt>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "receipt")))
67
+ );
68
+ }
69
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativerangedownloader::FirmwareArchiveMaterializedArtifact& arg) {
70
+ jsi::Object obj(runtime);
71
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "entryName"), JSIConverter<std::string>::toJSI(runtime, arg.entryName));
72
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "receipt"), JSIConverter<margelo::nitro::reactnativerangedownloader::FirmwareArtifactReceipt>::toJSI(runtime, arg.receipt));
73
+ return obj;
74
+ }
75
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
76
+ if (!value.isObject()) {
77
+ return false;
78
+ }
79
+ jsi::Object obj = value.getObject(runtime);
80
+ if (!nitro::isPlainObject(runtime, obj)) {
81
+ return false;
82
+ }
83
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "entryName")))) return false;
84
+ if (!JSIConverter<margelo::nitro::reactnativerangedownloader::FirmwareArtifactReceipt>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "receipt")))) return false;
85
+ return true;
86
+ }
87
+ };
88
+
89
+ } // namespace margelo::nitro
@@ -0,0 +1,83 @@
1
+ ///
2
+ /// FirmwareArtifactCancelParams.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 (FirmwareArtifactCancelParams).
39
+ */
40
+ struct FirmwareArtifactCancelParams final {
41
+ public:
42
+ std::string transactionId SWIFT_PRIVATE;
43
+
44
+ public:
45
+ FirmwareArtifactCancelParams() = default;
46
+ explicit FirmwareArtifactCancelParams(std::string transactionId): transactionId(transactionId) {}
47
+
48
+ public:
49
+ friend bool operator==(const FirmwareArtifactCancelParams& lhs, const FirmwareArtifactCancelParams& rhs) = default;
50
+ };
51
+
52
+ } // namespace margelo::nitro::reactnativerangedownloader
53
+
54
+ namespace margelo::nitro {
55
+
56
+ // C++ FirmwareArtifactCancelParams <> JS FirmwareArtifactCancelParams (object)
57
+ template <>
58
+ struct JSIConverter<margelo::nitro::reactnativerangedownloader::FirmwareArtifactCancelParams> final {
59
+ static inline margelo::nitro::reactnativerangedownloader::FirmwareArtifactCancelParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
60
+ jsi::Object obj = arg.asObject(runtime);
61
+ return margelo::nitro::reactnativerangedownloader::FirmwareArtifactCancelParams(
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::FirmwareArtifactCancelParams& 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,96 @@
1
+ ///
2
+ /// FirmwareArtifactCapabilities.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 <vector>
35
+
36
+ namespace margelo::nitro::reactnativerangedownloader {
37
+
38
+ /**
39
+ * A struct which can be represented as a JavaScript object (FirmwareArtifactCapabilities).
40
+ */
41
+ struct FirmwareArtifactCapabilities final {
42
+ public:
43
+ double firmwareArtifactProtocolVersion SWIFT_PRIVATE;
44
+ std::vector<std::string> supportedRouteTypes SWIFT_PRIVATE;
45
+ bool supportsArchiveMaterialization SWIFT_PRIVATE;
46
+ double maxReadBytes SWIFT_PRIVATE;
47
+
48
+ public:
49
+ FirmwareArtifactCapabilities() = default;
50
+ explicit FirmwareArtifactCapabilities(double firmwareArtifactProtocolVersion, std::vector<std::string> supportedRouteTypes, bool supportsArchiveMaterialization, double maxReadBytes): firmwareArtifactProtocolVersion(firmwareArtifactProtocolVersion), supportedRouteTypes(supportedRouteTypes), supportsArchiveMaterialization(supportsArchiveMaterialization), maxReadBytes(maxReadBytes) {}
51
+
52
+ public:
53
+ friend bool operator==(const FirmwareArtifactCapabilities& lhs, const FirmwareArtifactCapabilities& rhs) = default;
54
+ };
55
+
56
+ } // namespace margelo::nitro::reactnativerangedownloader
57
+
58
+ namespace margelo::nitro {
59
+
60
+ // C++ FirmwareArtifactCapabilities <> JS FirmwareArtifactCapabilities (object)
61
+ template <>
62
+ struct JSIConverter<margelo::nitro::reactnativerangedownloader::FirmwareArtifactCapabilities> final {
63
+ static inline margelo::nitro::reactnativerangedownloader::FirmwareArtifactCapabilities fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
64
+ jsi::Object obj = arg.asObject(runtime);
65
+ return margelo::nitro::reactnativerangedownloader::FirmwareArtifactCapabilities(
66
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "firmwareArtifactProtocolVersion"))),
67
+ JSIConverter<std::vector<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "supportedRouteTypes"))),
68
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "supportsArchiveMaterialization"))),
69
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxReadBytes")))
70
+ );
71
+ }
72
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativerangedownloader::FirmwareArtifactCapabilities& arg) {
73
+ jsi::Object obj(runtime);
74
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "firmwareArtifactProtocolVersion"), JSIConverter<double>::toJSI(runtime, arg.firmwareArtifactProtocolVersion));
75
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "supportedRouteTypes"), JSIConverter<std::vector<std::string>>::toJSI(runtime, arg.supportedRouteTypes));
76
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "supportsArchiveMaterialization"), JSIConverter<bool>::toJSI(runtime, arg.supportsArchiveMaterialization));
77
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "maxReadBytes"), JSIConverter<double>::toJSI(runtime, arg.maxReadBytes));
78
+ return obj;
79
+ }
80
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
81
+ if (!value.isObject()) {
82
+ return false;
83
+ }
84
+ jsi::Object obj = value.getObject(runtime);
85
+ if (!nitro::isPlainObject(runtime, obj)) {
86
+ return false;
87
+ }
88
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "firmwareArtifactProtocolVersion")))) return false;
89
+ if (!JSIConverter<std::vector<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "supportedRouteTypes")))) return false;
90
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "supportsArchiveMaterialization")))) return false;
91
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxReadBytes")))) return false;
92
+ return true;
93
+ }
94
+ };
95
+
96
+ } // namespace margelo::nitro