@onekeyfe/react-native-range-downloader 3.0.79 → 3.0.81-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/ReactNativeRangeDownloader.podspec +8 -0
  2. package/android/build.gradle +1 -0
  3. package/android/src/main/java/com/margelo/nitro/reactnativerangedownloader/FirmwareArchiveRules.kt +284 -0
  4. package/android/src/main/java/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactStore.kt +842 -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 +75 -0
  7. package/ios/FirmwareArchiveMinizipBridge.h +33 -0
  8. package/ios/FirmwareArchiveMinizipBridge.mm +213 -0
  9. package/ios/FirmwareArtifactStore.swift +1276 -0
  10. package/ios/FirmwareBackgroundSessionEventRouter.swift +17 -0
  11. package/ios/ReactNativeRangeDownloader.swift +638 -6
  12. package/lib/module/index.js +2 -1
  13. package/lib/module/index.js.map +1 -1
  14. package/lib/typescript/src/ReactNativeRangeDownloader.nitro.d.ts +95 -1
  15. package/lib/typescript/src/ReactNativeRangeDownloader.nitro.d.ts.map +1 -1
  16. package/lib/typescript/src/index.d.ts +1 -0
  17. package/lib/typescript/src/index.d.ts.map +1 -1
  18. package/nitrogen/generated/android/c++/JDownloadChannel.hpp +3 -0
  19. package/nitrogen/generated/android/c++/JFirmwareArchiveExpectedEntry.hpp +69 -0
  20. package/nitrogen/generated/android/c++/JFirmwareArchiveMaterializeParams.hpp +86 -0
  21. package/nitrogen/generated/android/c++/JFirmwareArchiveMaterializeResult.hpp +80 -0
  22. package/nitrogen/generated/android/c++/JFirmwareArchiveMaterializedArtifact.hpp +63 -0
  23. package/nitrogen/generated/android/c++/JFirmwareArtifactCancelParams.hpp +57 -0
  24. package/nitrogen/generated/android/c++/JFirmwareArtifactCapabilities.hpp +88 -0
  25. package/nitrogen/generated/android/c++/JFirmwareArtifactDownloadParams.hpp +98 -0
  26. package/nitrogen/generated/android/c++/JFirmwareArtifactLease.hpp +57 -0
  27. package/nitrogen/generated/android/c++/JFirmwareArtifactLeaseCreateParams.hpp +57 -0
  28. package/nitrogen/generated/android/c++/JFirmwareArtifactLeaseReconcileParams.hpp +76 -0
  29. package/nitrogen/generated/android/c++/JFirmwareArtifactLeaseReleaseParams.hpp +61 -0
  30. package/nitrogen/generated/android/c++/JFirmwareArtifactLeaseRetainParams.hpp +61 -0
  31. package/nitrogen/generated/android/c++/JFirmwareArtifactReaderCloseParams.hpp +57 -0
  32. package/nitrogen/generated/android/c++/JFirmwareArtifactReaderInfo.hpp +61 -0
  33. package/nitrogen/generated/android/c++/JFirmwareArtifactReaderReadParams.hpp +65 -0
  34. package/nitrogen/generated/android/c++/JFirmwareArtifactReceipt.hpp +65 -0
  35. package/nitrogen/generated/android/c++/JFirmwareArtifactRefParams.hpp +57 -0
  36. package/nitrogen/generated/android/c++/JFirmwareArtifactSweepResult.hpp +61 -0
  37. package/nitrogen/generated/android/c++/JHybridReactNativeRangeDownloaderSpec.cpp +267 -0
  38. package/nitrogen/generated/android/c++/JHybridReactNativeRangeDownloaderSpec.hpp +13 -0
  39. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/DownloadChannel.kt +2 -1
  40. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArchiveExpectedEntry.kt +47 -0
  41. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArchiveMaterializeParams.kt +44 -0
  42. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArchiveMaterializeResult.kt +38 -0
  43. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArchiveMaterializedArtifact.kt +41 -0
  44. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactCancelParams.kt +38 -0
  45. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactCapabilities.kt +47 -0
  46. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactDownloadParams.kt +68 -0
  47. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactLease.kt +38 -0
  48. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactLeaseCreateParams.kt +38 -0
  49. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactLeaseReconcileParams.kt +38 -0
  50. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactLeaseReleaseParams.kt +41 -0
  51. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactLeaseRetainParams.kt +41 -0
  52. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactReaderCloseParams.kt +38 -0
  53. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactReaderInfo.kt +41 -0
  54. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactReaderReadParams.kt +44 -0
  55. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactReceipt.kt +44 -0
  56. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactRefParams.kt +38 -0
  57. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/FirmwareArtifactSweepResult.kt +41 -0
  58. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativerangedownloader/HybridReactNativeRangeDownloaderSpec.kt +53 -0
  59. package/nitrogen/generated/ios/ReactNativeRangeDownloader-Swift-Cxx-Bridge.cpp +48 -0
  60. package/nitrogen/generated/ios/ReactNativeRangeDownloader-Swift-Cxx-Bridge.hpp +329 -0
  61. package/nitrogen/generated/ios/ReactNativeRangeDownloader-Swift-Cxx-Umbrella.hpp +56 -0
  62. package/nitrogen/generated/ios/c++/HybridReactNativeRangeDownloaderSpecSwift.hpp +163 -0
  63. package/nitrogen/generated/ios/swift/DownloadChannel.swift +4 -0
  64. package/nitrogen/generated/ios/swift/FirmwareArchiveExpectedEntry.swift +69 -0
  65. package/nitrogen/generated/ios/swift/FirmwareArchiveMaterializeParams.swift +70 -0
  66. package/nitrogen/generated/ios/swift/FirmwareArchiveMaterializeResult.swift +48 -0
  67. package/nitrogen/generated/ios/swift/FirmwareArchiveMaterializedArtifact.swift +47 -0
  68. package/nitrogen/generated/ios/swift/FirmwareArtifactCancelParams.swift +36 -0
  69. package/nitrogen/generated/ios/swift/FirmwareArtifactCapabilities.swift +81 -0
  70. package/nitrogen/generated/ios/swift/FirmwareArtifactDownloadParams.swift +177 -0
  71. package/nitrogen/generated/ios/swift/FirmwareArtifactLease.swift +36 -0
  72. package/nitrogen/generated/ios/swift/FirmwareArtifactLeaseCreateParams.swift +36 -0
  73. package/nitrogen/generated/ios/swift/FirmwareArtifactLeaseReconcileParams.swift +48 -0
  74. package/nitrogen/generated/ios/swift/FirmwareArtifactLeaseReleaseParams.swift +47 -0
  75. package/nitrogen/generated/ios/swift/FirmwareArtifactLeaseRetainParams.swift +47 -0
  76. package/nitrogen/generated/ios/swift/FirmwareArtifactReaderCloseParams.swift +36 -0
  77. package/nitrogen/generated/ios/swift/FirmwareArtifactReaderInfo.swift +47 -0
  78. package/nitrogen/generated/ios/swift/FirmwareArtifactReaderReadParams.swift +58 -0
  79. package/nitrogen/generated/ios/swift/FirmwareArtifactReceipt.swift +58 -0
  80. package/nitrogen/generated/ios/swift/FirmwareArtifactRefParams.swift +36 -0
  81. package/nitrogen/generated/ios/swift/FirmwareArtifactSweepResult.swift +47 -0
  82. package/nitrogen/generated/ios/swift/Func_void_FirmwareArchiveMaterializeResult.swift +47 -0
  83. package/nitrogen/generated/ios/swift/Func_void_FirmwareArtifactLease.swift +47 -0
  84. package/nitrogen/generated/ios/swift/Func_void_FirmwareArtifactReaderInfo.swift +47 -0
  85. package/nitrogen/generated/ios/swift/Func_void_FirmwareArtifactReceipt.swift +47 -0
  86. package/nitrogen/generated/ios/swift/Func_void_FirmwareArtifactSweepResult.swift +47 -0
  87. package/nitrogen/generated/ios/swift/Func_void_std__shared_ptr_ArrayBuffer_.swift +47 -0
  88. package/nitrogen/generated/ios/swift/HybridReactNativeRangeDownloaderSpec.swift +13 -0
  89. package/nitrogen/generated/ios/swift/HybridReactNativeRangeDownloaderSpec_cxx.swift +240 -0
  90. package/nitrogen/generated/shared/c++/DownloadChannel.hpp +4 -0
  91. package/nitrogen/generated/shared/c++/FirmwareArchiveExpectedEntry.hpp +87 -0
  92. package/nitrogen/generated/shared/c++/FirmwareArchiveMaterializeParams.hpp +86 -0
  93. package/nitrogen/generated/shared/c++/FirmwareArchiveMaterializeResult.hpp +77 -0
  94. package/nitrogen/generated/shared/c++/FirmwareArchiveMaterializedArtifact.hpp +81 -0
  95. package/nitrogen/generated/shared/c++/FirmwareArtifactCancelParams.hpp +75 -0
  96. package/nitrogen/generated/shared/c++/FirmwareArtifactCapabilities.hpp +88 -0
  97. package/nitrogen/generated/shared/c++/FirmwareArtifactDownloadParams.hpp +116 -0
  98. package/nitrogen/generated/shared/c++/FirmwareArtifactLease.hpp +75 -0
  99. package/nitrogen/generated/shared/c++/FirmwareArtifactLeaseCreateParams.hpp +75 -0
  100. package/nitrogen/generated/shared/c++/FirmwareArtifactLeaseReconcileParams.hpp +76 -0
  101. package/nitrogen/generated/shared/c++/FirmwareArtifactLeaseReleaseParams.hpp +79 -0
  102. package/nitrogen/generated/shared/c++/FirmwareArtifactLeaseRetainParams.hpp +79 -0
  103. package/nitrogen/generated/shared/c++/FirmwareArtifactReaderCloseParams.hpp +75 -0
  104. package/nitrogen/generated/shared/c++/FirmwareArtifactReaderInfo.hpp +79 -0
  105. package/nitrogen/generated/shared/c++/FirmwareArtifactReaderReadParams.hpp +83 -0
  106. package/nitrogen/generated/shared/c++/FirmwareArtifactReceipt.hpp +83 -0
  107. package/nitrogen/generated/shared/c++/FirmwareArtifactRefParams.hpp +75 -0
  108. package/nitrogen/generated/shared/c++/FirmwareArtifactSweepResult.hpp +79 -0
  109. package/nitrogen/generated/shared/c++/HybridReactNativeRangeDownloaderSpec.cpp +13 -0
  110. package/nitrogen/generated/shared/c++/HybridReactNativeRangeDownloaderSpec.hpp +62 -0
  111. package/package.json +4 -2
  112. package/src/ReactNativeRangeDownloader.nitro.ts +134 -1
  113. package/src/index.tsx +3 -1
@@ -0,0 +1,75 @@
1
+ ///
2
+ /// FirmwareArtifactReaderCloseParams.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 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
+
26
+
27
+
28
+ #include <string>
29
+
30
+ namespace margelo::nitro::reactnativerangedownloader {
31
+
32
+ /**
33
+ * A struct which can be represented as a JavaScript object (FirmwareArtifactReaderCloseParams).
34
+ */
35
+ struct FirmwareArtifactReaderCloseParams {
36
+ public:
37
+ std::string readerId SWIFT_PRIVATE;
38
+
39
+ public:
40
+ FirmwareArtifactReaderCloseParams() = default;
41
+ explicit FirmwareArtifactReaderCloseParams(std::string readerId): readerId(readerId) {}
42
+ };
43
+
44
+ } // namespace margelo::nitro::reactnativerangedownloader
45
+
46
+ namespace margelo::nitro {
47
+
48
+ // C++ FirmwareArtifactReaderCloseParams <> JS FirmwareArtifactReaderCloseParams (object)
49
+ template <>
50
+ struct JSIConverter<margelo::nitro::reactnativerangedownloader::FirmwareArtifactReaderCloseParams> final {
51
+ static inline margelo::nitro::reactnativerangedownloader::FirmwareArtifactReaderCloseParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
52
+ jsi::Object obj = arg.asObject(runtime);
53
+ return margelo::nitro::reactnativerangedownloader::FirmwareArtifactReaderCloseParams(
54
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "readerId"))
55
+ );
56
+ }
57
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativerangedownloader::FirmwareArtifactReaderCloseParams& arg) {
58
+ jsi::Object obj(runtime);
59
+ obj.setProperty(runtime, "readerId", JSIConverter<std::string>::toJSI(runtime, arg.readerId));
60
+ return obj;
61
+ }
62
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
63
+ if (!value.isObject()) {
64
+ return false;
65
+ }
66
+ jsi::Object obj = value.getObject(runtime);
67
+ if (!nitro::isPlainObject(runtime, obj)) {
68
+ return false;
69
+ }
70
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "readerId"))) return false;
71
+ return true;
72
+ }
73
+ };
74
+
75
+ } // namespace margelo::nitro
@@ -0,0 +1,79 @@
1
+ ///
2
+ /// FirmwareArtifactReaderInfo.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 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
+
26
+
27
+
28
+ #include <string>
29
+
30
+ namespace margelo::nitro::reactnativerangedownloader {
31
+
32
+ /**
33
+ * A struct which can be represented as a JavaScript object (FirmwareArtifactReaderInfo).
34
+ */
35
+ struct FirmwareArtifactReaderInfo {
36
+ public:
37
+ std::string readerId SWIFT_PRIVATE;
38
+ double size SWIFT_PRIVATE;
39
+
40
+ public:
41
+ FirmwareArtifactReaderInfo() = default;
42
+ explicit FirmwareArtifactReaderInfo(std::string readerId, double size): readerId(readerId), size(size) {}
43
+ };
44
+
45
+ } // namespace margelo::nitro::reactnativerangedownloader
46
+
47
+ namespace margelo::nitro {
48
+
49
+ // C++ FirmwareArtifactReaderInfo <> JS FirmwareArtifactReaderInfo (object)
50
+ template <>
51
+ struct JSIConverter<margelo::nitro::reactnativerangedownloader::FirmwareArtifactReaderInfo> final {
52
+ static inline margelo::nitro::reactnativerangedownloader::FirmwareArtifactReaderInfo fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
53
+ jsi::Object obj = arg.asObject(runtime);
54
+ return margelo::nitro::reactnativerangedownloader::FirmwareArtifactReaderInfo(
55
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "readerId")),
56
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "size"))
57
+ );
58
+ }
59
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativerangedownloader::FirmwareArtifactReaderInfo& arg) {
60
+ jsi::Object obj(runtime);
61
+ obj.setProperty(runtime, "readerId", JSIConverter<std::string>::toJSI(runtime, arg.readerId));
62
+ obj.setProperty(runtime, "size", JSIConverter<double>::toJSI(runtime, arg.size));
63
+ return obj;
64
+ }
65
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
66
+ if (!value.isObject()) {
67
+ return false;
68
+ }
69
+ jsi::Object obj = value.getObject(runtime);
70
+ if (!nitro::isPlainObject(runtime, obj)) {
71
+ return false;
72
+ }
73
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "readerId"))) return false;
74
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "size"))) return false;
75
+ return true;
76
+ }
77
+ };
78
+
79
+ } // namespace margelo::nitro
@@ -0,0 +1,83 @@
1
+ ///
2
+ /// FirmwareArtifactReaderReadParams.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 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
+
26
+
27
+
28
+ #include <string>
29
+
30
+ namespace margelo::nitro::reactnativerangedownloader {
31
+
32
+ /**
33
+ * A struct which can be represented as a JavaScript object (FirmwareArtifactReaderReadParams).
34
+ */
35
+ struct FirmwareArtifactReaderReadParams {
36
+ public:
37
+ std::string readerId SWIFT_PRIVATE;
38
+ double offset SWIFT_PRIVATE;
39
+ double length SWIFT_PRIVATE;
40
+
41
+ public:
42
+ FirmwareArtifactReaderReadParams() = default;
43
+ explicit FirmwareArtifactReaderReadParams(std::string readerId, double offset, double length): readerId(readerId), offset(offset), length(length) {}
44
+ };
45
+
46
+ } // namespace margelo::nitro::reactnativerangedownloader
47
+
48
+ namespace margelo::nitro {
49
+
50
+ // C++ FirmwareArtifactReaderReadParams <> JS FirmwareArtifactReaderReadParams (object)
51
+ template <>
52
+ struct JSIConverter<margelo::nitro::reactnativerangedownloader::FirmwareArtifactReaderReadParams> final {
53
+ static inline margelo::nitro::reactnativerangedownloader::FirmwareArtifactReaderReadParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
54
+ jsi::Object obj = arg.asObject(runtime);
55
+ return margelo::nitro::reactnativerangedownloader::FirmwareArtifactReaderReadParams(
56
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "readerId")),
57
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "offset")),
58
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "length"))
59
+ );
60
+ }
61
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativerangedownloader::FirmwareArtifactReaderReadParams& arg) {
62
+ jsi::Object obj(runtime);
63
+ obj.setProperty(runtime, "readerId", JSIConverter<std::string>::toJSI(runtime, arg.readerId));
64
+ obj.setProperty(runtime, "offset", JSIConverter<double>::toJSI(runtime, arg.offset));
65
+ obj.setProperty(runtime, "length", JSIConverter<double>::toJSI(runtime, arg.length));
66
+ return obj;
67
+ }
68
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
69
+ if (!value.isObject()) {
70
+ return false;
71
+ }
72
+ jsi::Object obj = value.getObject(runtime);
73
+ if (!nitro::isPlainObject(runtime, obj)) {
74
+ return false;
75
+ }
76
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "readerId"))) return false;
77
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "offset"))) return false;
78
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "length"))) return false;
79
+ return true;
80
+ }
81
+ };
82
+
83
+ } // namespace margelo::nitro
@@ -0,0 +1,83 @@
1
+ ///
2
+ /// FirmwareArtifactReceipt.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 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
+
26
+
27
+
28
+ #include <string>
29
+
30
+ namespace margelo::nitro::reactnativerangedownloader {
31
+
32
+ /**
33
+ * A struct which can be represented as a JavaScript object (FirmwareArtifactReceipt).
34
+ */
35
+ struct FirmwareArtifactReceipt {
36
+ public:
37
+ std::string artifactRef SWIFT_PRIVATE;
38
+ double size SWIFT_PRIVATE;
39
+ std::string sha256 SWIFT_PRIVATE;
40
+
41
+ public:
42
+ FirmwareArtifactReceipt() = default;
43
+ explicit FirmwareArtifactReceipt(std::string artifactRef, double size, std::string sha256): artifactRef(artifactRef), size(size), sha256(sha256) {}
44
+ };
45
+
46
+ } // namespace margelo::nitro::reactnativerangedownloader
47
+
48
+ namespace margelo::nitro {
49
+
50
+ // C++ FirmwareArtifactReceipt <> JS FirmwareArtifactReceipt (object)
51
+ template <>
52
+ struct JSIConverter<margelo::nitro::reactnativerangedownloader::FirmwareArtifactReceipt> final {
53
+ static inline margelo::nitro::reactnativerangedownloader::FirmwareArtifactReceipt fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
54
+ jsi::Object obj = arg.asObject(runtime);
55
+ return margelo::nitro::reactnativerangedownloader::FirmwareArtifactReceipt(
56
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "artifactRef")),
57
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "size")),
58
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "sha256"))
59
+ );
60
+ }
61
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativerangedownloader::FirmwareArtifactReceipt& arg) {
62
+ jsi::Object obj(runtime);
63
+ obj.setProperty(runtime, "artifactRef", JSIConverter<std::string>::toJSI(runtime, arg.artifactRef));
64
+ obj.setProperty(runtime, "size", JSIConverter<double>::toJSI(runtime, arg.size));
65
+ obj.setProperty(runtime, "sha256", JSIConverter<std::string>::toJSI(runtime, arg.sha256));
66
+ return obj;
67
+ }
68
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
69
+ if (!value.isObject()) {
70
+ return false;
71
+ }
72
+ jsi::Object obj = value.getObject(runtime);
73
+ if (!nitro::isPlainObject(runtime, obj)) {
74
+ return false;
75
+ }
76
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "artifactRef"))) return false;
77
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "size"))) return false;
78
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "sha256"))) return false;
79
+ return true;
80
+ }
81
+ };
82
+
83
+ } // namespace margelo::nitro
@@ -0,0 +1,75 @@
1
+ ///
2
+ /// FirmwareArtifactRefParams.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 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
+
26
+
27
+
28
+ #include <string>
29
+
30
+ namespace margelo::nitro::reactnativerangedownloader {
31
+
32
+ /**
33
+ * A struct which can be represented as a JavaScript object (FirmwareArtifactRefParams).
34
+ */
35
+ struct FirmwareArtifactRefParams {
36
+ public:
37
+ std::string artifactRef SWIFT_PRIVATE;
38
+
39
+ public:
40
+ FirmwareArtifactRefParams() = default;
41
+ explicit FirmwareArtifactRefParams(std::string artifactRef): artifactRef(artifactRef) {}
42
+ };
43
+
44
+ } // namespace margelo::nitro::reactnativerangedownloader
45
+
46
+ namespace margelo::nitro {
47
+
48
+ // C++ FirmwareArtifactRefParams <> JS FirmwareArtifactRefParams (object)
49
+ template <>
50
+ struct JSIConverter<margelo::nitro::reactnativerangedownloader::FirmwareArtifactRefParams> final {
51
+ static inline margelo::nitro::reactnativerangedownloader::FirmwareArtifactRefParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
52
+ jsi::Object obj = arg.asObject(runtime);
53
+ return margelo::nitro::reactnativerangedownloader::FirmwareArtifactRefParams(
54
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "artifactRef"))
55
+ );
56
+ }
57
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativerangedownloader::FirmwareArtifactRefParams& arg) {
58
+ jsi::Object obj(runtime);
59
+ obj.setProperty(runtime, "artifactRef", JSIConverter<std::string>::toJSI(runtime, arg.artifactRef));
60
+ return obj;
61
+ }
62
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
63
+ if (!value.isObject()) {
64
+ return false;
65
+ }
66
+ jsi::Object obj = value.getObject(runtime);
67
+ if (!nitro::isPlainObject(runtime, obj)) {
68
+ return false;
69
+ }
70
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "artifactRef"))) return false;
71
+ return true;
72
+ }
73
+ };
74
+
75
+ } // namespace margelo::nitro
@@ -0,0 +1,79 @@
1
+ ///
2
+ /// FirmwareArtifactSweepResult.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 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
+
26
+
27
+
28
+
29
+
30
+ namespace margelo::nitro::reactnativerangedownloader {
31
+
32
+ /**
33
+ * A struct which can be represented as a JavaScript object (FirmwareArtifactSweepResult).
34
+ */
35
+ struct FirmwareArtifactSweepResult {
36
+ public:
37
+ double deletedFiles SWIFT_PRIVATE;
38
+ double deletedBytes SWIFT_PRIVATE;
39
+
40
+ public:
41
+ FirmwareArtifactSweepResult() = default;
42
+ explicit FirmwareArtifactSweepResult(double deletedFiles, double deletedBytes): deletedFiles(deletedFiles), deletedBytes(deletedBytes) {}
43
+ };
44
+
45
+ } // namespace margelo::nitro::reactnativerangedownloader
46
+
47
+ namespace margelo::nitro {
48
+
49
+ // C++ FirmwareArtifactSweepResult <> JS FirmwareArtifactSweepResult (object)
50
+ template <>
51
+ struct JSIConverter<margelo::nitro::reactnativerangedownloader::FirmwareArtifactSweepResult> final {
52
+ static inline margelo::nitro::reactnativerangedownloader::FirmwareArtifactSweepResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
53
+ jsi::Object obj = arg.asObject(runtime);
54
+ return margelo::nitro::reactnativerangedownloader::FirmwareArtifactSweepResult(
55
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "deletedFiles")),
56
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "deletedBytes"))
57
+ );
58
+ }
59
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativerangedownloader::FirmwareArtifactSweepResult& arg) {
60
+ jsi::Object obj(runtime);
61
+ obj.setProperty(runtime, "deletedFiles", JSIConverter<double>::toJSI(runtime, arg.deletedFiles));
62
+ obj.setProperty(runtime, "deletedBytes", JSIConverter<double>::toJSI(runtime, arg.deletedBytes));
63
+ return obj;
64
+ }
65
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
66
+ if (!value.isObject()) {
67
+ return false;
68
+ }
69
+ jsi::Object obj = value.getObject(runtime);
70
+ if (!nitro::isPlainObject(runtime, obj)) {
71
+ return false;
72
+ }
73
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "deletedFiles"))) return false;
74
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "deletedBytes"))) return false;
75
+ return true;
76
+ }
77
+ };
78
+
79
+ } // namespace margelo::nitro
@@ -20,6 +20,19 @@ namespace margelo::nitro::reactnativerangedownloader {
20
20
  prototype.registerHybridMethod("addDownloadListener", &HybridReactNativeRangeDownloaderSpec::addDownloadListener);
21
21
  prototype.registerHybridMethod("removeDownloadListener", &HybridReactNativeRangeDownloaderSpec::removeDownloadListener);
22
22
  prototype.registerHybridMethod("getDownloadsDir", &HybridReactNativeRangeDownloaderSpec::getDownloadsDir);
23
+ prototype.registerHybridMethod("getFirmwareArtifactCapabilities", &HybridReactNativeRangeDownloaderSpec::getFirmwareArtifactCapabilities);
24
+ prototype.registerHybridMethod("downloadFirmwareArtifact", &HybridReactNativeRangeDownloaderSpec::downloadFirmwareArtifact);
25
+ prototype.registerHybridMethod("cancelFirmwareArtifactDownloads", &HybridReactNativeRangeDownloaderSpec::cancelFirmwareArtifactDownloads);
26
+ prototype.registerHybridMethod("discardFirmwareArtifact", &HybridReactNativeRangeDownloaderSpec::discardFirmwareArtifact);
27
+ prototype.registerHybridMethod("openFirmwareArtifact", &HybridReactNativeRangeDownloaderSpec::openFirmwareArtifact);
28
+ prototype.registerHybridMethod("readFirmwareArtifact", &HybridReactNativeRangeDownloaderSpec::readFirmwareArtifact);
29
+ prototype.registerHybridMethod("closeFirmwareArtifact", &HybridReactNativeRangeDownloaderSpec::closeFirmwareArtifact);
30
+ prototype.registerHybridMethod("materializeFirmwareArchive", &HybridReactNativeRangeDownloaderSpec::materializeFirmwareArchive);
31
+ prototype.registerHybridMethod("createFirmwareArtifactLease", &HybridReactNativeRangeDownloaderSpec::createFirmwareArtifactLease);
32
+ prototype.registerHybridMethod("retainFirmwareArtifact", &HybridReactNativeRangeDownloaderSpec::retainFirmwareArtifact);
33
+ prototype.registerHybridMethod("releaseFirmwareArtifactLease", &HybridReactNativeRangeDownloaderSpec::releaseFirmwareArtifactLease);
34
+ prototype.registerHybridMethod("reconcileFirmwareArtifactLeases", &HybridReactNativeRangeDownloaderSpec::reconcileFirmwareArtifactLeases);
35
+ prototype.registerHybridMethod("sweepFirmwareArtifactOrphans", &HybridReactNativeRangeDownloaderSpec::sweepFirmwareArtifactOrphans);
23
36
  });
24
37
  }
25
38
 
@@ -21,6 +21,38 @@ namespace margelo::nitro::reactnativerangedownloader { struct RangeDownloadParam
21
21
  namespace margelo::nitro::reactnativerangedownloader { enum class DownloadChannel; }
22
22
  // Forward declaration of `RangeDownloadEvent` to properly resolve imports.
23
23
  namespace margelo::nitro::reactnativerangedownloader { struct RangeDownloadEvent; }
24
+ // Forward declaration of `FirmwareArtifactCapabilities` to properly resolve imports.
25
+ namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactCapabilities; }
26
+ // Forward declaration of `FirmwareArtifactReceipt` to properly resolve imports.
27
+ namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactReceipt; }
28
+ // Forward declaration of `FirmwareArtifactDownloadParams` to properly resolve imports.
29
+ namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactDownloadParams; }
30
+ // Forward declaration of `FirmwareArtifactCancelParams` to properly resolve imports.
31
+ namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactCancelParams; }
32
+ // Forward declaration of `FirmwareArtifactRefParams` to properly resolve imports.
33
+ namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactRefParams; }
34
+ // Forward declaration of `FirmwareArtifactReaderInfo` to properly resolve imports.
35
+ namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactReaderInfo; }
36
+ // Forward declaration of `FirmwareArtifactReaderReadParams` to properly resolve imports.
37
+ namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactReaderReadParams; }
38
+ // Forward declaration of `FirmwareArtifactReaderCloseParams` to properly resolve imports.
39
+ namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactReaderCloseParams; }
40
+ // Forward declaration of `FirmwareArchiveMaterializeResult` to properly resolve imports.
41
+ namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArchiveMaterializeResult; }
42
+ // Forward declaration of `FirmwareArchiveMaterializeParams` to properly resolve imports.
43
+ namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArchiveMaterializeParams; }
44
+ // Forward declaration of `FirmwareArtifactLease` to properly resolve imports.
45
+ namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactLease; }
46
+ // Forward declaration of `FirmwareArtifactLeaseCreateParams` to properly resolve imports.
47
+ namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactLeaseCreateParams; }
48
+ // Forward declaration of `FirmwareArtifactLeaseRetainParams` to properly resolve imports.
49
+ namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactLeaseRetainParams; }
50
+ // Forward declaration of `FirmwareArtifactLeaseReleaseParams` to properly resolve imports.
51
+ namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactLeaseReleaseParams; }
52
+ // Forward declaration of `FirmwareArtifactLeaseReconcileParams` to properly resolve imports.
53
+ namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactLeaseReconcileParams; }
54
+ // Forward declaration of `FirmwareArtifactSweepResult` to properly resolve imports.
55
+ namespace margelo::nitro::reactnativerangedownloader { struct FirmwareArtifactSweepResult; }
24
56
 
25
57
  #include "RangeDownloadResult.hpp"
26
58
  #include <NitroModules/Promise.hpp>
@@ -29,6 +61,23 @@ namespace margelo::nitro::reactnativerangedownloader { struct RangeDownloadEvent
29
61
  #include <string>
30
62
  #include "RangeDownloadEvent.hpp"
31
63
  #include <functional>
64
+ #include "FirmwareArtifactCapabilities.hpp"
65
+ #include "FirmwareArtifactReceipt.hpp"
66
+ #include "FirmwareArtifactDownloadParams.hpp"
67
+ #include "FirmwareArtifactCancelParams.hpp"
68
+ #include "FirmwareArtifactRefParams.hpp"
69
+ #include "FirmwareArtifactReaderInfo.hpp"
70
+ #include <NitroModules/ArrayBuffer.hpp>
71
+ #include "FirmwareArtifactReaderReadParams.hpp"
72
+ #include "FirmwareArtifactReaderCloseParams.hpp"
73
+ #include "FirmwareArchiveMaterializeResult.hpp"
74
+ #include "FirmwareArchiveMaterializeParams.hpp"
75
+ #include "FirmwareArtifactLease.hpp"
76
+ #include "FirmwareArtifactLeaseCreateParams.hpp"
77
+ #include "FirmwareArtifactLeaseRetainParams.hpp"
78
+ #include "FirmwareArtifactLeaseReleaseParams.hpp"
79
+ #include "FirmwareArtifactLeaseReconcileParams.hpp"
80
+ #include "FirmwareArtifactSweepResult.hpp"
32
81
 
33
82
  namespace margelo::nitro::reactnativerangedownloader {
34
83
 
@@ -67,6 +116,19 @@ namespace margelo::nitro::reactnativerangedownloader {
67
116
  virtual double addDownloadListener(const std::function<void(const RangeDownloadEvent& /* event */)>& callback) = 0;
68
117
  virtual void removeDownloadListener(double id) = 0;
69
118
  virtual std::string getDownloadsDir() = 0;
119
+ virtual FirmwareArtifactCapabilities getFirmwareArtifactCapabilities() = 0;
120
+ virtual std::shared_ptr<Promise<FirmwareArtifactReceipt>> downloadFirmwareArtifact(const FirmwareArtifactDownloadParams& params) = 0;
121
+ virtual std::shared_ptr<Promise<void>> cancelFirmwareArtifactDownloads(const FirmwareArtifactCancelParams& params) = 0;
122
+ virtual std::shared_ptr<Promise<void>> discardFirmwareArtifact(const FirmwareArtifactRefParams& params) = 0;
123
+ virtual std::shared_ptr<Promise<FirmwareArtifactReaderInfo>> openFirmwareArtifact(const FirmwareArtifactRefParams& params) = 0;
124
+ virtual std::shared_ptr<Promise<std::shared_ptr<ArrayBuffer>>> readFirmwareArtifact(const FirmwareArtifactReaderReadParams& params) = 0;
125
+ virtual std::shared_ptr<Promise<void>> closeFirmwareArtifact(const FirmwareArtifactReaderCloseParams& params) = 0;
126
+ virtual std::shared_ptr<Promise<FirmwareArchiveMaterializeResult>> materializeFirmwareArchive(const FirmwareArchiveMaterializeParams& params) = 0;
127
+ virtual std::shared_ptr<Promise<FirmwareArtifactLease>> createFirmwareArtifactLease(const FirmwareArtifactLeaseCreateParams& params) = 0;
128
+ virtual std::shared_ptr<Promise<void>> retainFirmwareArtifact(const FirmwareArtifactLeaseRetainParams& params) = 0;
129
+ virtual std::shared_ptr<Promise<void>> releaseFirmwareArtifactLease(const FirmwareArtifactLeaseReleaseParams& params) = 0;
130
+ virtual std::shared_ptr<Promise<void>> reconcileFirmwareArtifactLeases(const FirmwareArtifactLeaseReconcileParams& params) = 0;
131
+ virtual std::shared_ptr<Promise<FirmwareArtifactSweepResult>> sweepFirmwareArtifactOrphans() = 0;
70
132
 
71
133
  protected:
72
134
  // Hybrid Setup
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-range-downloader",
3
- "version": "3.0.79",
3
+ "version": "3.0.81-alpha.0",
4
4
  "description": "react-native-range-downloader",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -88,6 +88,7 @@
88
88
  "typescript": "^5.9.2"
89
89
  },
90
90
  "peerDependencies": {
91
+ "@onekeyfe/react-native-sni-connect": "3.0.81",
91
92
  "react": "*",
92
93
  "react-native": "*",
93
94
  "react-native-nitro-modules": "0.33.2"
@@ -165,5 +166,6 @@
165
166
  "release-it"
166
167
  ],
167
168
  "version": "0.56.0"
168
- }
169
+ },
170
+ "stableVersion": "3.0.80"
169
171
  }