@kingstinct/react-native-healthkit 14.1.0 → 15.1.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.
- package/README.md +32 -2
- package/app.plugin.js +49 -94
- package/app.plugin.ts +6 -56
- package/ios/BackgroundDeliveryManager.swift +13 -6
- package/ios/BackgroundLaunchHook.mm +41 -0
- package/ios/Constants.swift +24 -0
- package/ios/CoreModule.swift +5 -1
- package/ios/Helpers.swift +29 -1
- package/ios/MemoryEstimation.swift +83 -0
- package/ios/QuantityTypeModule.swift +34 -26
- package/ios/Serializers.swift +18 -3
- package/ios/SourceProxy.swift +14 -5
- package/ios/WorkoutProxy.swift +28 -11
- package/lib/commonjs/generated/healthkit.generated.js +13 -3
- package/lib/commonjs/healthkit.ios.js +3 -1
- package/lib/commonjs/healthkit.js +4 -2
- package/lib/module/generated/healthkit.generated.js +12 -2
- package/lib/module/healthkit.ios.js +2 -0
- package/lib/module/healthkit.js +2 -0
- package/lib/typescript/generated/healthkit.generated.d.ts +17 -7
- package/lib/typescript/healthkit.d.ts +1 -0
- package/lib/typescript/healthkit.ios.d.ts +2 -0
- package/lib/typescript/specs/CoreModule.nitro.d.ts +6 -4
- package/lib/typescript/specs/SourceProxy.nitro.d.ts +1 -2
- package/lib/typescript/types/QuantityType.d.ts +3 -3
- package/lib/typescript/types/Source.d.ts +2 -2
- package/lib/typescript/types/Units.d.ts +1 -1
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.cpp +16 -16
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.hpp +23 -12
- package/nitrogen/generated/ios/c++/HybridCategoryTypeModuleSpecSwift.hpp +7 -4
- package/nitrogen/generated/ios/c++/HybridCorrelationTypeModuleSpecSwift.hpp +7 -4
- package/nitrogen/generated/ios/c++/HybridElectrocardiogramModuleSpecSwift.hpp +7 -4
- package/nitrogen/generated/ios/c++/HybridHeartbeatSeriesModuleSpecSwift.hpp +7 -4
- package/nitrogen/generated/ios/c++/HybridMedicationModuleSpecSwift.hpp +7 -4
- package/nitrogen/generated/ios/c++/HybridQuantityTypeModuleSpecSwift.hpp +7 -4
- package/nitrogen/generated/ios/c++/HybridStateOfMindModuleSpecSwift.hpp +7 -4
- package/nitrogen/generated/ios/c++/HybridWorkoutProxySpecSwift.hpp +3 -4
- package/nitrogen/generated/ios/c++/HybridWorkoutsModuleSpecSwift.hpp +6 -3
- package/nitrogen/generated/ios/swift/CategoryTypeIdentifier.swift +8 -0
- package/nitrogen/generated/ios/swift/CategoryTypeIdentifierWriteable.swift +8 -0
- package/nitrogen/generated/ios/swift/ObjectTypeIdentifier.swift +8 -4
- package/nitrogen/generated/ios/swift/QuantityTypeIdentifier.swift +0 -4
- package/nitrogen/generated/ios/swift/QuantityTypeIdentifierWriteable.swift +0 -4
- package/nitrogen/generated/ios/swift/QueryStatisticsResponse.swift +6 -13
- package/nitrogen/generated/ios/swift/QueryStatisticsResponseFromSingleSource.swift +4 -11
- package/nitrogen/generated/ios/swift/SampleTypeIdentifier.swift +8 -4
- package/nitrogen/generated/ios/swift/SampleTypeIdentifierWriteable.swift +8 -4
- package/nitrogen/generated/ios/swift/SourceRevision.swift +4 -11
- package/nitrogen/generated/ios/swift/WorkoutActivityType.swift +8 -0
- package/nitrogen/generated/shared/c++/CategoryTypeIdentifier.hpp +67 -59
- package/nitrogen/generated/shared/c++/CategoryTypeIdentifierWriteable.hpp +67 -59
- package/nitrogen/generated/shared/c++/ObjectTypeIdentifier.hpp +202 -198
- package/nitrogen/generated/shared/c++/QuantityTypeIdentifier.hpp +107 -111
- package/nitrogen/generated/shared/c++/QuantityTypeIdentifierWriteable.hpp +107 -111
- package/nitrogen/generated/shared/c++/QueryStatisticsResponse.hpp +8 -9
- package/nitrogen/generated/shared/c++/QueryStatisticsResponseFromSingleSource.hpp +8 -9
- package/nitrogen/generated/shared/c++/SampleTypeIdentifier.hpp +195 -191
- package/nitrogen/generated/shared/c++/SampleTypeIdentifierWriteable.hpp +189 -185
- package/nitrogen/generated/shared/c++/SourceRevision.hpp +8 -9
- package/nitrogen/generated/shared/c++/WorkoutActivityType.hpp +4 -0
- package/package.json +5 -3
- package/src/generated/healthkit-schema.json +45 -8
- package/src/generated/healthkit.generated.ts +18 -6
- package/src/healthkit.ios.ts +3 -0
- package/src/healthkit.ts +5 -0
- package/src/specs/CoreModule.nitro.ts +6 -4
- package/src/specs/SourceProxy.nitro.ts +1 -1
- package/src/type-tests/generated-typing.ts +30 -8
- package/src/types/QuantityType.ts +3 -3
- package/src/types/Source.ts +2 -2
- package/src/types/Units.ts +1 -1
|
@@ -32,15 +32,14 @@
|
|
|
32
32
|
namespace margelo::nitro::healthkit { struct Quantity; }
|
|
33
33
|
// Forward declaration of `QuantityDateInterval` to properly resolve imports.
|
|
34
34
|
namespace margelo::nitro::healthkit { struct QuantityDateInterval; }
|
|
35
|
-
// Forward declaration of `
|
|
36
|
-
namespace margelo::nitro::healthkit {
|
|
35
|
+
// Forward declaration of `Source` to properly resolve imports.
|
|
36
|
+
namespace margelo::nitro::healthkit { struct Source; }
|
|
37
37
|
|
|
38
38
|
#include "Quantity.hpp"
|
|
39
39
|
#include <optional>
|
|
40
40
|
#include "QuantityDateInterval.hpp"
|
|
41
41
|
#include <chrono>
|
|
42
|
-
#include
|
|
43
|
-
#include "HybridSourceProxySpec.hpp"
|
|
42
|
+
#include "Source.hpp"
|
|
44
43
|
#include <vector>
|
|
45
44
|
|
|
46
45
|
namespace margelo::nitro::healthkit {
|
|
@@ -59,11 +58,11 @@ namespace margelo::nitro::healthkit {
|
|
|
59
58
|
std::optional<Quantity> duration SWIFT_PRIVATE;
|
|
60
59
|
std::optional<std::chrono::system_clock::time_point> startDate SWIFT_PRIVATE;
|
|
61
60
|
std::optional<std::chrono::system_clock::time_point> endDate SWIFT_PRIVATE;
|
|
62
|
-
std::vector<
|
|
61
|
+
std::vector<Source> sources SWIFT_PRIVATE;
|
|
63
62
|
|
|
64
63
|
public:
|
|
65
64
|
QueryStatisticsResponse() = default;
|
|
66
|
-
explicit QueryStatisticsResponse(std::optional<Quantity> averageQuantity, std::optional<Quantity> maximumQuantity, std::optional<Quantity> minimumQuantity, std::optional<Quantity> sumQuantity, std::optional<Quantity> mostRecentQuantity, std::optional<QuantityDateInterval> mostRecentQuantityDateInterval, std::optional<Quantity> duration, std::optional<std::chrono::system_clock::time_point> startDate, std::optional<std::chrono::system_clock::time_point> endDate, std::vector<
|
|
65
|
+
explicit QueryStatisticsResponse(std::optional<Quantity> averageQuantity, std::optional<Quantity> maximumQuantity, std::optional<Quantity> minimumQuantity, std::optional<Quantity> sumQuantity, std::optional<Quantity> mostRecentQuantity, std::optional<QuantityDateInterval> mostRecentQuantityDateInterval, std::optional<Quantity> duration, std::optional<std::chrono::system_clock::time_point> startDate, std::optional<std::chrono::system_clock::time_point> endDate, std::vector<Source> sources): averageQuantity(averageQuantity), maximumQuantity(maximumQuantity), minimumQuantity(minimumQuantity), sumQuantity(sumQuantity), mostRecentQuantity(mostRecentQuantity), mostRecentQuantityDateInterval(mostRecentQuantityDateInterval), duration(duration), startDate(startDate), endDate(endDate), sources(sources) {}
|
|
67
66
|
|
|
68
67
|
public:
|
|
69
68
|
friend bool operator==(const QueryStatisticsResponse& lhs, const QueryStatisticsResponse& rhs) = default;
|
|
@@ -88,7 +87,7 @@ namespace margelo::nitro {
|
|
|
88
87
|
JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "duration"))),
|
|
89
88
|
JSIConverter<std::optional<std::chrono::system_clock::time_point>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate"))),
|
|
90
89
|
JSIConverter<std::optional<std::chrono::system_clock::time_point>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate"))),
|
|
91
|
-
JSIConverter<std::vector<
|
|
90
|
+
JSIConverter<std::vector<margelo::nitro::healthkit::Source>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sources")))
|
|
92
91
|
);
|
|
93
92
|
}
|
|
94
93
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::QueryStatisticsResponse& arg) {
|
|
@@ -102,7 +101,7 @@ namespace margelo::nitro {
|
|
|
102
101
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "duration"), JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.duration));
|
|
103
102
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "startDate"), JSIConverter<std::optional<std::chrono::system_clock::time_point>>::toJSI(runtime, arg.startDate));
|
|
104
103
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "endDate"), JSIConverter<std::optional<std::chrono::system_clock::time_point>>::toJSI(runtime, arg.endDate));
|
|
105
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "sources"), JSIConverter<std::vector<
|
|
104
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "sources"), JSIConverter<std::vector<margelo::nitro::healthkit::Source>>::toJSI(runtime, arg.sources));
|
|
106
105
|
return obj;
|
|
107
106
|
}
|
|
108
107
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -122,7 +121,7 @@ namespace margelo::nitro {
|
|
|
122
121
|
if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "duration")))) return false;
|
|
123
122
|
if (!JSIConverter<std::optional<std::chrono::system_clock::time_point>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate")))) return false;
|
|
124
123
|
if (!JSIConverter<std::optional<std::chrono::system_clock::time_point>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate")))) return false;
|
|
125
|
-
if (!JSIConverter<std::vector<
|
|
124
|
+
if (!JSIConverter<std::vector<margelo::nitro::healthkit::Source>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sources")))) return false;
|
|
126
125
|
return true;
|
|
127
126
|
}
|
|
128
127
|
};
|
|
@@ -28,15 +28,14 @@
|
|
|
28
28
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
29
|
#endif
|
|
30
30
|
|
|
31
|
-
// Forward declaration of `
|
|
32
|
-
namespace margelo::nitro::healthkit {
|
|
31
|
+
// Forward declaration of `Source` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::healthkit { struct Source; }
|
|
33
33
|
// Forward declaration of `Quantity` to properly resolve imports.
|
|
34
34
|
namespace margelo::nitro::healthkit { struct Quantity; }
|
|
35
35
|
// Forward declaration of `QuantityDateInterval` to properly resolve imports.
|
|
36
36
|
namespace margelo::nitro::healthkit { struct QuantityDateInterval; }
|
|
37
37
|
|
|
38
|
-
#include
|
|
39
|
-
#include "HybridSourceProxySpec.hpp"
|
|
38
|
+
#include "Source.hpp"
|
|
40
39
|
#include <chrono>
|
|
41
40
|
#include <optional>
|
|
42
41
|
#include "Quantity.hpp"
|
|
@@ -49,7 +48,7 @@ namespace margelo::nitro::healthkit {
|
|
|
49
48
|
*/
|
|
50
49
|
struct QueryStatisticsResponseFromSingleSource final {
|
|
51
50
|
public:
|
|
52
|
-
|
|
51
|
+
Source source SWIFT_PRIVATE;
|
|
53
52
|
std::optional<std::chrono::system_clock::time_point> startDate SWIFT_PRIVATE;
|
|
54
53
|
std::optional<std::chrono::system_clock::time_point> endDate SWIFT_PRIVATE;
|
|
55
54
|
std::optional<Quantity> duration SWIFT_PRIVATE;
|
|
@@ -62,7 +61,7 @@ namespace margelo::nitro::healthkit {
|
|
|
62
61
|
|
|
63
62
|
public:
|
|
64
63
|
QueryStatisticsResponseFromSingleSource() = default;
|
|
65
|
-
explicit QueryStatisticsResponseFromSingleSource(
|
|
64
|
+
explicit QueryStatisticsResponseFromSingleSource(Source source, std::optional<std::chrono::system_clock::time_point> startDate, std::optional<std::chrono::system_clock::time_point> endDate, std::optional<Quantity> duration, std::optional<Quantity> averageQuantity, std::optional<Quantity> maximumQuantity, std::optional<Quantity> minimumQuantity, std::optional<Quantity> sumQuantity, std::optional<Quantity> mostRecentQuantity, std::optional<QuantityDateInterval> mostRecentQuantityDateInterval): source(source), startDate(startDate), endDate(endDate), duration(duration), averageQuantity(averageQuantity), maximumQuantity(maximumQuantity), minimumQuantity(minimumQuantity), sumQuantity(sumQuantity), mostRecentQuantity(mostRecentQuantity), mostRecentQuantityDateInterval(mostRecentQuantityDateInterval) {}
|
|
66
65
|
|
|
67
66
|
public:
|
|
68
67
|
friend bool operator==(const QueryStatisticsResponseFromSingleSource& lhs, const QueryStatisticsResponseFromSingleSource& rhs) = default;
|
|
@@ -78,7 +77,7 @@ namespace margelo::nitro {
|
|
|
78
77
|
static inline margelo::nitro::healthkit::QueryStatisticsResponseFromSingleSource fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
79
78
|
jsi::Object obj = arg.asObject(runtime);
|
|
80
79
|
return margelo::nitro::healthkit::QueryStatisticsResponseFromSingleSource(
|
|
81
|
-
JSIConverter<
|
|
80
|
+
JSIConverter<margelo::nitro::healthkit::Source>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "source"))),
|
|
82
81
|
JSIConverter<std::optional<std::chrono::system_clock::time_point>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate"))),
|
|
83
82
|
JSIConverter<std::optional<std::chrono::system_clock::time_point>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate"))),
|
|
84
83
|
JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "duration"))),
|
|
@@ -92,7 +91,7 @@ namespace margelo::nitro {
|
|
|
92
91
|
}
|
|
93
92
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::QueryStatisticsResponseFromSingleSource& arg) {
|
|
94
93
|
jsi::Object obj(runtime);
|
|
95
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "source"), JSIConverter<
|
|
94
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "source"), JSIConverter<margelo::nitro::healthkit::Source>::toJSI(runtime, arg.source));
|
|
96
95
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "startDate"), JSIConverter<std::optional<std::chrono::system_clock::time_point>>::toJSI(runtime, arg.startDate));
|
|
97
96
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "endDate"), JSIConverter<std::optional<std::chrono::system_clock::time_point>>::toJSI(runtime, arg.endDate));
|
|
98
97
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "duration"), JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.duration));
|
|
@@ -112,7 +111,7 @@ namespace margelo::nitro {
|
|
|
112
111
|
if (!nitro::isPlainObject(runtime, obj)) {
|
|
113
112
|
return false;
|
|
114
113
|
}
|
|
115
|
-
if (!JSIConverter<
|
|
114
|
+
if (!JSIConverter<margelo::nitro::healthkit::Source>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "source")))) return false;
|
|
116
115
|
if (!JSIConverter<std::optional<std::chrono::system_clock::time_point>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate")))) return false;
|
|
117
116
|
if (!JSIConverter<std::optional<std::chrono::system_clock::time_point>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate")))) return false;
|
|
118
117
|
if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "duration")))) return false;
|