@gromozeqa/react-native-apple-health-kit 0.1.4 → 0.1.5
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/android/generated/jni/react/renderer/components/RNAppleHealthKitSpec/RNAppleHealthKitSpecJSI.h +1 -158
- package/ios/generated/RNAppleHealthKitSpecJSI.h +1 -158
- package/lib/commonjs/NativeAppleHealthKit.js.map +1 -1
- package/lib/commonjs/index.js +32 -8
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/types.js +2 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/module/NativeAppleHealthKit.js.map +1 -1
- package/lib/module/index.js +13 -6
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/lib/typescript/commonjs/src/NativeAppleHealthKit.d.ts +1 -17
- package/lib/typescript/commonjs/src/NativeAppleHealthKit.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +5 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types.d.ts +19 -0
- package/lib/typescript/commonjs/src/types.d.ts.map +1 -0
- package/lib/typescript/module/src/NativeAppleHealthKit.d.ts +1 -17
- package/lib/typescript/module/src/NativeAppleHealthKit.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +5 -1
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/types.d.ts +19 -0
- package/lib/typescript/module/src/types.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/NativeAppleHealthKit.ts +1 -20
- package/src/index.tsx +16 -6
- package/src/types.ts +21 -0
@@ -15,164 +15,7 @@
|
|
15
15
|
namespace facebook::react {
|
16
16
|
|
17
17
|
|
18
|
-
|
19
|
-
#pragma mark - NativeAppleHealthKitHeartRate
|
20
|
-
|
21
|
-
template <typename P0, typename P1>
|
22
|
-
struct NativeAppleHealthKitHeartRate {
|
23
|
-
P0 date;
|
24
|
-
P1 value;
|
25
|
-
bool operator==(const NativeAppleHealthKitHeartRate &other) const {
|
26
|
-
return date == other.date && value == other.value;
|
27
|
-
}
|
28
|
-
};
|
29
|
-
|
30
|
-
template <typename T>
|
31
|
-
struct NativeAppleHealthKitHeartRateBridging {
|
32
|
-
static T types;
|
33
|
-
|
34
|
-
static T fromJs(
|
35
|
-
jsi::Runtime &rt,
|
36
|
-
const jsi::Object &value,
|
37
|
-
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
38
|
-
T result{
|
39
|
-
bridging::fromJs<decltype(types.date)>(rt, value.getProperty(rt, "date"), jsInvoker),
|
40
|
-
bridging::fromJs<decltype(types.value)>(rt, value.getProperty(rt, "value"), jsInvoker)};
|
41
|
-
return result;
|
42
|
-
}
|
43
|
-
|
44
|
-
#ifdef DEBUG
|
45
|
-
static jsi::String dateToJs(jsi::Runtime &rt, decltype(types.date) value) {
|
46
|
-
return bridging::toJs(rt, value);
|
47
|
-
}
|
48
|
-
|
49
|
-
static jsi::Array valueToJs(jsi::Runtime &rt, decltype(types.value) value) {
|
50
|
-
return bridging::toJs(rt, value);
|
51
|
-
}
|
52
|
-
#endif
|
53
|
-
|
54
|
-
static jsi::Object toJs(
|
55
|
-
jsi::Runtime &rt,
|
56
|
-
const T &value,
|
57
|
-
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
58
|
-
auto result = facebook::jsi::Object(rt);
|
59
|
-
result.setProperty(rt, "date", bridging::toJs(rt, value.date, jsInvoker));
|
60
|
-
result.setProperty(rt, "value", bridging::toJs(rt, value.value, jsInvoker));
|
61
|
-
return result;
|
62
|
-
}
|
63
|
-
};
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
#pragma mark - NativeAppleHealthKitMeasurement
|
68
|
-
|
69
|
-
template <typename P0, typename P1, typename P2, typename P3>
|
70
|
-
struct NativeAppleHealthKitMeasurement {
|
71
|
-
P0 bodyMass;
|
72
|
-
P1 height;
|
73
|
-
P2 biologicalSex;
|
74
|
-
P3 dateOfBirth;
|
75
|
-
bool operator==(const NativeAppleHealthKitMeasurement &other) const {
|
76
|
-
return bodyMass == other.bodyMass && height == other.height && biologicalSex == other.biologicalSex && dateOfBirth == other.dateOfBirth;
|
77
|
-
}
|
78
|
-
};
|
79
|
-
|
80
|
-
template <typename T>
|
81
|
-
struct NativeAppleHealthKitMeasurementBridging {
|
82
|
-
static T types;
|
83
|
-
|
84
|
-
static T fromJs(
|
85
|
-
jsi::Runtime &rt,
|
86
|
-
const jsi::Object &value,
|
87
|
-
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
88
|
-
T result{
|
89
|
-
bridging::fromJs<decltype(types.bodyMass)>(rt, value.getProperty(rt, "bodyMass"), jsInvoker),
|
90
|
-
bridging::fromJs<decltype(types.height)>(rt, value.getProperty(rt, "height"), jsInvoker),
|
91
|
-
bridging::fromJs<decltype(types.biologicalSex)>(rt, value.getProperty(rt, "biologicalSex"), jsInvoker),
|
92
|
-
bridging::fromJs<decltype(types.dateOfBirth)>(rt, value.getProperty(rt, "dateOfBirth"), jsInvoker)};
|
93
|
-
return result;
|
94
|
-
}
|
95
|
-
|
96
|
-
#ifdef DEBUG
|
97
|
-
static std::optional<double> bodyMassToJs(jsi::Runtime &rt, decltype(types.bodyMass) value) {
|
98
|
-
return bridging::toJs(rt, value);
|
99
|
-
}
|
100
|
-
|
101
|
-
static std::optional<double> heightToJs(jsi::Runtime &rt, decltype(types.height) value) {
|
102
|
-
return bridging::toJs(rt, value);
|
103
|
-
}
|
104
|
-
|
105
|
-
static std::optional<jsi::String> biologicalSexToJs(jsi::Runtime &rt, decltype(types.biologicalSex) value) {
|
106
|
-
return bridging::toJs(rt, value);
|
107
|
-
}
|
108
|
-
|
109
|
-
static std::optional<jsi::String> dateOfBirthToJs(jsi::Runtime &rt, decltype(types.dateOfBirth) value) {
|
110
|
-
return bridging::toJs(rt, value);
|
111
|
-
}
|
112
|
-
#endif
|
113
|
-
|
114
|
-
static jsi::Object toJs(
|
115
|
-
jsi::Runtime &rt,
|
116
|
-
const T &value,
|
117
|
-
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
118
|
-
auto result = facebook::jsi::Object(rt);
|
119
|
-
result.setProperty(rt, "bodyMass", bridging::toJs(rt, value.bodyMass, jsInvoker));
|
120
|
-
result.setProperty(rt, "height", bridging::toJs(rt, value.height, jsInvoker));
|
121
|
-
result.setProperty(rt, "biologicalSex", bridging::toJs(rt, value.biologicalSex, jsInvoker));
|
122
|
-
result.setProperty(rt, "dateOfBirth", bridging::toJs(rt, value.dateOfBirth, jsInvoker));
|
123
|
-
return result;
|
124
|
-
}
|
125
|
-
};
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
#pragma mark - NativeAppleHealthKitStep
|
130
|
-
|
131
|
-
template <typename P0, typename P1>
|
132
|
-
struct NativeAppleHealthKitStep {
|
133
|
-
P0 dateString;
|
134
|
-
P1 stepCount;
|
135
|
-
bool operator==(const NativeAppleHealthKitStep &other) const {
|
136
|
-
return dateString == other.dateString && stepCount == other.stepCount;
|
137
|
-
}
|
138
|
-
};
|
139
|
-
|
140
|
-
template <typename T>
|
141
|
-
struct NativeAppleHealthKitStepBridging {
|
142
|
-
static T types;
|
143
|
-
|
144
|
-
static T fromJs(
|
145
|
-
jsi::Runtime &rt,
|
146
|
-
const jsi::Object &value,
|
147
|
-
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
148
|
-
T result{
|
149
|
-
bridging::fromJs<decltype(types.dateString)>(rt, value.getProperty(rt, "dateString"), jsInvoker),
|
150
|
-
bridging::fromJs<decltype(types.stepCount)>(rt, value.getProperty(rt, "stepCount"), jsInvoker)};
|
151
|
-
return result;
|
152
|
-
}
|
153
|
-
|
154
|
-
#ifdef DEBUG
|
155
|
-
static jsi::String dateStringToJs(jsi::Runtime &rt, decltype(types.dateString) value) {
|
156
|
-
return bridging::toJs(rt, value);
|
157
|
-
}
|
158
|
-
|
159
|
-
static double stepCountToJs(jsi::Runtime &rt, decltype(types.stepCount) value) {
|
160
|
-
return bridging::toJs(rt, value);
|
161
|
-
}
|
162
|
-
#endif
|
163
|
-
|
164
|
-
static jsi::Object toJs(
|
165
|
-
jsi::Runtime &rt,
|
166
|
-
const T &value,
|
167
|
-
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
168
|
-
auto result = facebook::jsi::Object(rt);
|
169
|
-
result.setProperty(rt, "dateString", bridging::toJs(rt, value.dateString, jsInvoker));
|
170
|
-
result.setProperty(rt, "stepCount", bridging::toJs(rt, value.stepCount, jsInvoker));
|
171
|
-
return result;
|
172
|
-
}
|
173
|
-
};
|
174
|
-
|
175
|
-
class JSI_EXPORT NativeAppleHealthKitCxxSpecJSI : public TurboModule {
|
18
|
+
class JSI_EXPORT NativeAppleHealthKitCxxSpecJSI : public TurboModule {
|
176
19
|
protected:
|
177
20
|
NativeAppleHealthKitCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
|
178
21
|
|
@@ -15,164 +15,7 @@
|
|
15
15
|
namespace facebook::react {
|
16
16
|
|
17
17
|
|
18
|
-
|
19
|
-
#pragma mark - NativeAppleHealthKitHeartRate
|
20
|
-
|
21
|
-
template <typename P0, typename P1>
|
22
|
-
struct NativeAppleHealthKitHeartRate {
|
23
|
-
P0 date;
|
24
|
-
P1 value;
|
25
|
-
bool operator==(const NativeAppleHealthKitHeartRate &other) const {
|
26
|
-
return date == other.date && value == other.value;
|
27
|
-
}
|
28
|
-
};
|
29
|
-
|
30
|
-
template <typename T>
|
31
|
-
struct NativeAppleHealthKitHeartRateBridging {
|
32
|
-
static T types;
|
33
|
-
|
34
|
-
static T fromJs(
|
35
|
-
jsi::Runtime &rt,
|
36
|
-
const jsi::Object &value,
|
37
|
-
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
38
|
-
T result{
|
39
|
-
bridging::fromJs<decltype(types.date)>(rt, value.getProperty(rt, "date"), jsInvoker),
|
40
|
-
bridging::fromJs<decltype(types.value)>(rt, value.getProperty(rt, "value"), jsInvoker)};
|
41
|
-
return result;
|
42
|
-
}
|
43
|
-
|
44
|
-
#ifdef DEBUG
|
45
|
-
static jsi::String dateToJs(jsi::Runtime &rt, decltype(types.date) value) {
|
46
|
-
return bridging::toJs(rt, value);
|
47
|
-
}
|
48
|
-
|
49
|
-
static jsi::Array valueToJs(jsi::Runtime &rt, decltype(types.value) value) {
|
50
|
-
return bridging::toJs(rt, value);
|
51
|
-
}
|
52
|
-
#endif
|
53
|
-
|
54
|
-
static jsi::Object toJs(
|
55
|
-
jsi::Runtime &rt,
|
56
|
-
const T &value,
|
57
|
-
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
58
|
-
auto result = facebook::jsi::Object(rt);
|
59
|
-
result.setProperty(rt, "date", bridging::toJs(rt, value.date, jsInvoker));
|
60
|
-
result.setProperty(rt, "value", bridging::toJs(rt, value.value, jsInvoker));
|
61
|
-
return result;
|
62
|
-
}
|
63
|
-
};
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
#pragma mark - NativeAppleHealthKitMeasurement
|
68
|
-
|
69
|
-
template <typename P0, typename P1, typename P2, typename P3>
|
70
|
-
struct NativeAppleHealthKitMeasurement {
|
71
|
-
P0 bodyMass;
|
72
|
-
P1 height;
|
73
|
-
P2 biologicalSex;
|
74
|
-
P3 dateOfBirth;
|
75
|
-
bool operator==(const NativeAppleHealthKitMeasurement &other) const {
|
76
|
-
return bodyMass == other.bodyMass && height == other.height && biologicalSex == other.biologicalSex && dateOfBirth == other.dateOfBirth;
|
77
|
-
}
|
78
|
-
};
|
79
|
-
|
80
|
-
template <typename T>
|
81
|
-
struct NativeAppleHealthKitMeasurementBridging {
|
82
|
-
static T types;
|
83
|
-
|
84
|
-
static T fromJs(
|
85
|
-
jsi::Runtime &rt,
|
86
|
-
const jsi::Object &value,
|
87
|
-
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
88
|
-
T result{
|
89
|
-
bridging::fromJs<decltype(types.bodyMass)>(rt, value.getProperty(rt, "bodyMass"), jsInvoker),
|
90
|
-
bridging::fromJs<decltype(types.height)>(rt, value.getProperty(rt, "height"), jsInvoker),
|
91
|
-
bridging::fromJs<decltype(types.biologicalSex)>(rt, value.getProperty(rt, "biologicalSex"), jsInvoker),
|
92
|
-
bridging::fromJs<decltype(types.dateOfBirth)>(rt, value.getProperty(rt, "dateOfBirth"), jsInvoker)};
|
93
|
-
return result;
|
94
|
-
}
|
95
|
-
|
96
|
-
#ifdef DEBUG
|
97
|
-
static std::optional<double> bodyMassToJs(jsi::Runtime &rt, decltype(types.bodyMass) value) {
|
98
|
-
return bridging::toJs(rt, value);
|
99
|
-
}
|
100
|
-
|
101
|
-
static std::optional<double> heightToJs(jsi::Runtime &rt, decltype(types.height) value) {
|
102
|
-
return bridging::toJs(rt, value);
|
103
|
-
}
|
104
|
-
|
105
|
-
static std::optional<jsi::String> biologicalSexToJs(jsi::Runtime &rt, decltype(types.biologicalSex) value) {
|
106
|
-
return bridging::toJs(rt, value);
|
107
|
-
}
|
108
|
-
|
109
|
-
static std::optional<jsi::String> dateOfBirthToJs(jsi::Runtime &rt, decltype(types.dateOfBirth) value) {
|
110
|
-
return bridging::toJs(rt, value);
|
111
|
-
}
|
112
|
-
#endif
|
113
|
-
|
114
|
-
static jsi::Object toJs(
|
115
|
-
jsi::Runtime &rt,
|
116
|
-
const T &value,
|
117
|
-
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
118
|
-
auto result = facebook::jsi::Object(rt);
|
119
|
-
result.setProperty(rt, "bodyMass", bridging::toJs(rt, value.bodyMass, jsInvoker));
|
120
|
-
result.setProperty(rt, "height", bridging::toJs(rt, value.height, jsInvoker));
|
121
|
-
result.setProperty(rt, "biologicalSex", bridging::toJs(rt, value.biologicalSex, jsInvoker));
|
122
|
-
result.setProperty(rt, "dateOfBirth", bridging::toJs(rt, value.dateOfBirth, jsInvoker));
|
123
|
-
return result;
|
124
|
-
}
|
125
|
-
};
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
#pragma mark - NativeAppleHealthKitStep
|
130
|
-
|
131
|
-
template <typename P0, typename P1>
|
132
|
-
struct NativeAppleHealthKitStep {
|
133
|
-
P0 dateString;
|
134
|
-
P1 stepCount;
|
135
|
-
bool operator==(const NativeAppleHealthKitStep &other) const {
|
136
|
-
return dateString == other.dateString && stepCount == other.stepCount;
|
137
|
-
}
|
138
|
-
};
|
139
|
-
|
140
|
-
template <typename T>
|
141
|
-
struct NativeAppleHealthKitStepBridging {
|
142
|
-
static T types;
|
143
|
-
|
144
|
-
static T fromJs(
|
145
|
-
jsi::Runtime &rt,
|
146
|
-
const jsi::Object &value,
|
147
|
-
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
148
|
-
T result{
|
149
|
-
bridging::fromJs<decltype(types.dateString)>(rt, value.getProperty(rt, "dateString"), jsInvoker),
|
150
|
-
bridging::fromJs<decltype(types.stepCount)>(rt, value.getProperty(rt, "stepCount"), jsInvoker)};
|
151
|
-
return result;
|
152
|
-
}
|
153
|
-
|
154
|
-
#ifdef DEBUG
|
155
|
-
static jsi::String dateStringToJs(jsi::Runtime &rt, decltype(types.dateString) value) {
|
156
|
-
return bridging::toJs(rt, value);
|
157
|
-
}
|
158
|
-
|
159
|
-
static double stepCountToJs(jsi::Runtime &rt, decltype(types.stepCount) value) {
|
160
|
-
return bridging::toJs(rt, value);
|
161
|
-
}
|
162
|
-
#endif
|
163
|
-
|
164
|
-
static jsi::Object toJs(
|
165
|
-
jsi::Runtime &rt,
|
166
|
-
const T &value,
|
167
|
-
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
168
|
-
auto result = facebook::jsi::Object(rt);
|
169
|
-
result.setProperty(rt, "dateString", bridging::toJs(rt, value.dateString, jsInvoker));
|
170
|
-
result.setProperty(rt, "stepCount", bridging::toJs(rt, value.stepCount, jsInvoker));
|
171
|
-
return result;
|
172
|
-
}
|
173
|
-
};
|
174
|
-
|
175
|
-
class JSI_EXPORT NativeAppleHealthKitCxxSpecJSI : public TurboModule {
|
18
|
+
class JSI_EXPORT NativeAppleHealthKitCxxSpecJSI : public TurboModule {
|
176
19
|
protected:
|
177
20
|
NativeAppleHealthKitCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
|
178
21
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_reactNative","require","NoOpSpec","requestHealthKitPermissions","Promise","reject","Error","getSteps","getHeartRate","getMeasurement","_default","exports","default","Platform","OS","TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeAppleHealthKit.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;
|
1
|
+
{"version":3,"names":["_reactNative","require","NoOpSpec","requestHealthKitPermissions","Promise","reject","Error","getSteps","getHeartRate","getMeasurement","_default","exports","default","Platform","OS","TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeAppleHealthKit.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAUA,MAAMC,QAAc,GAAG;EACrBC,2BAA2BA,CAAA,EAAoB;IAC7C,OAAOC,OAAO,CAACC,MAAM,CAAC,IAAIC,KAAK,CAAC,wCAAwC,CAAC,CAAC;EAC5E,CAAC;EACDC,QAAQA,CAAA,EAAoB;IAC1B,OAAOH,OAAO,CAACC,MAAM,CAAC,IAAIC,KAAK,CAAC,wCAAwC,CAAC,CAAC;EAC5E,CAAC;EACDE,YAAYA,CAAA,EAAyB;IACnC,OAAOJ,OAAO,CAACC,MAAM,CAAC,IAAIC,KAAK,CAAC,wCAAwC,CAAC,CAAC;EAC5E,CAAC;EACDG,cAAcA,CAAA,EAAyB;IACrC,OAAOL,OAAO,CAACC,MAAM,CAAC,IAAIC,KAAK,CAAC,wCAAwC,CAAC,CAAC;EAC5E;AACF,CAAC;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaC,qBAAQ,CAACC,EAAE,KAAK,SAAS,GACpCZ,QAAQ,GACRa,gCAAmB,CAACC,YAAY,CAAO,gBAAgB,CAAC","ignoreList":[]}
|
package/lib/commonjs/index.js
CHANGED
@@ -3,17 +3,41 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
+
var _exportNames = {
|
7
|
+
requestHealthKitPermissions: true,
|
8
|
+
getHeartRate: true,
|
9
|
+
getSteps: true,
|
10
|
+
getMeasurement: true
|
11
|
+
};
|
6
12
|
exports.requestHealthKitPermissions = exports.getSteps = exports.getMeasurement = exports.getHeartRate = void 0;
|
7
13
|
var _NativeAppleHealthKit = _interopRequireDefault(require("./NativeAppleHealthKit.js"));
|
14
|
+
var _types = require("./types.js");
|
15
|
+
Object.keys(_types).forEach(function (key) {
|
16
|
+
if (key === "default" || key === "__esModule") return;
|
17
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
18
|
+
if (key in exports && exports[key] === _types[key]) return;
|
19
|
+
Object.defineProperty(exports, key, {
|
20
|
+
enumerable: true,
|
21
|
+
get: function () {
|
22
|
+
return _types[key];
|
23
|
+
}
|
24
|
+
});
|
25
|
+
});
|
8
26
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
9
|
-
const {
|
10
|
-
requestHealthKitPermissions
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
27
|
+
const requestHealthKitPermissions = async () => {
|
28
|
+
await _NativeAppleHealthKit.default.requestHealthKitPermissions();
|
29
|
+
};
|
30
|
+
exports.requestHealthKitPermissions = requestHealthKitPermissions;
|
31
|
+
const getHeartRate = async days => {
|
32
|
+
await _NativeAppleHealthKit.default.getHeartRate(days);
|
33
|
+
};
|
34
|
+
exports.getHeartRate = getHeartRate;
|
35
|
+
const getSteps = async days => {
|
36
|
+
await _NativeAppleHealthKit.default.getSteps(days);
|
37
|
+
};
|
15
38
|
exports.getSteps = getSteps;
|
39
|
+
const getMeasurement = async () => {
|
40
|
+
await _NativeAppleHealthKit.default.getMeasurement();
|
41
|
+
};
|
16
42
|
exports.getMeasurement = getMeasurement;
|
17
|
-
exports.getHeartRate = getHeartRate;
|
18
|
-
exports.requestHealthKitPermissions = requestHealthKitPermissions;
|
19
43
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_NativeAppleHealthKit","_interopRequireDefault","require","e","__esModule","default","requestHealthKitPermissions","
|
1
|
+
{"version":3,"names":["_NativeAppleHealthKit","_interopRequireDefault","require","_types","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","e","__esModule","default","requestHealthKitPermissions","NativeAppleHealthKit","getHeartRate","days","getSteps","getMeasurement"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAF,MAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,MAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,MAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAAwB,SAAAN,uBAAAe,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEjB,MAAMG,2BAA2B,GAAG,MAAAA,CAAA,KAAY;EACrD,MAAMC,6BAAoB,CAACD,2BAA2B,CAAC,CAAC;AAC1D,CAAC;AAACP,OAAA,CAAAO,2BAAA,GAAAA,2BAAA;AAEK,MAAME,YAAY,GAAG,MAAOC,IAAY,IAAK;EAClD,MAAMF,6BAAoB,CAACC,YAAY,CAACC,IAAI,CAAC;AAC/C,CAAC;AAACV,OAAA,CAAAS,YAAA,GAAAA,YAAA;AAEK,MAAME,QAAQ,GAAG,MAAOD,IAAY,IAAK;EAC9C,MAAMF,6BAAoB,CAACG,QAAQ,CAACD,IAAI,CAAC;AAC3C,CAAC;AAACV,OAAA,CAAAW,QAAA,GAAAA,QAAA;AAEK,MAAMC,cAAc,GAAG,MAAAA,CAAA,KAAY;EACxC,MAAMJ,6BAAoB,CAACI,cAAc,CAAC,CAAC;AAC7C,CAAC;AAACZ,OAAA,CAAAY,cAAA,GAAAA,cAAA","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Platform","TurboModuleRegistry","NoOpSpec","requestHealthKitPermissions","Promise","reject","Error","getSteps","getHeartRate","getMeasurement","OS","getEnforcing"],"sourceRoot":"../../src","sources":["NativeAppleHealthKit.ts"],"mappings":";;AACA,SAASA,QAAQ,EAAEC,mBAAmB,QAAQ,cAAc;
|
1
|
+
{"version":3,"names":["Platform","TurboModuleRegistry","NoOpSpec","requestHealthKitPermissions","Promise","reject","Error","getSteps","getHeartRate","getMeasurement","OS","getEnforcing"],"sourceRoot":"../../src","sources":["NativeAppleHealthKit.ts"],"mappings":";;AACA,SAASA,QAAQ,EAAEC,mBAAmB,QAAQ,cAAc;AAU5D,MAAMC,QAAc,GAAG;EACrBC,2BAA2BA,CAAA,EAAoB;IAC7C,OAAOC,OAAO,CAACC,MAAM,CAAC,IAAIC,KAAK,CAAC,wCAAwC,CAAC,CAAC;EAC5E,CAAC;EACDC,QAAQA,CAAA,EAAoB;IAC1B,OAAOH,OAAO,CAACC,MAAM,CAAC,IAAIC,KAAK,CAAC,wCAAwC,CAAC,CAAC;EAC5E,CAAC;EACDE,YAAYA,CAAA,EAAyB;IACnC,OAAOJ,OAAO,CAACC,MAAM,CAAC,IAAIC,KAAK,CAAC,wCAAwC,CAAC,CAAC;EAC5E,CAAC;EACDG,cAAcA,CAAA,EAAyB;IACrC,OAAOL,OAAO,CAACC,MAAM,CAAC,IAAIC,KAAK,CAAC,wCAAwC,CAAC,CAAC;EAC5E;AACF,CAAC;AAED,eAAeN,QAAQ,CAACU,EAAE,KAAK,SAAS,GACpCR,QAAQ,GACRD,mBAAmB,CAACU,YAAY,CAAO,gBAAgB,CAAC","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
@@ -1,10 +1,17 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
import NativeAppleHealthKit from "./NativeAppleHealthKit.js";
|
4
|
-
export
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
4
|
+
export * from "./types.js";
|
5
|
+
export const requestHealthKitPermissions = async () => {
|
6
|
+
await NativeAppleHealthKit.requestHealthKitPermissions();
|
7
|
+
};
|
8
|
+
export const getHeartRate = async days => {
|
9
|
+
await NativeAppleHealthKit.getHeartRate(days);
|
10
|
+
};
|
11
|
+
export const getSteps = async days => {
|
12
|
+
await NativeAppleHealthKit.getSteps(days);
|
13
|
+
};
|
14
|
+
export const getMeasurement = async () => {
|
15
|
+
await NativeAppleHealthKit.getMeasurement();
|
16
|
+
};
|
10
17
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["NativeAppleHealthKit","requestHealthKitPermissions","getHeartRate","
|
1
|
+
{"version":3,"names":["NativeAppleHealthKit","requestHealthKitPermissions","getHeartRate","days","getSteps","getMeasurement"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,OAAOA,oBAAoB,MAAM,2BAAwB;AACzD,cAAc,YAAS;AAEvB,OAAO,MAAMC,2BAA2B,GAAG,MAAAA,CAAA,KAAY;EACrD,MAAMD,oBAAoB,CAACC,2BAA2B,CAAC,CAAC;AAC1D,CAAC;AAED,OAAO,MAAMC,YAAY,GAAG,MAAOC,IAAY,IAAK;EAClD,MAAMH,oBAAoB,CAACE,YAAY,CAACC,IAAI,CAAC;AAC/C,CAAC;AAED,OAAO,MAAMC,QAAQ,GAAG,MAAOD,IAAY,IAAK;EAC9C,MAAMH,oBAAoB,CAACI,QAAQ,CAACD,IAAI,CAAC;AAC3C,CAAC;AAED,OAAO,MAAME,cAAc,GAAG,MAAAA,CAAA,KAAY;EACxC,MAAML,oBAAoB,CAACK,cAAc,CAAC,CAAC;AAC7C,CAAC","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"","ignoreList":[]}
|
@@ -1,21 +1,5 @@
|
|
1
1
|
import type { TurboModule } from 'react-native';
|
2
|
-
|
3
|
-
dateString: string;
|
4
|
-
stepCount: number;
|
5
|
-
}
|
6
|
-
export interface HeartRate {
|
7
|
-
date: string;
|
8
|
-
value: {
|
9
|
-
time: string;
|
10
|
-
heartRate: number;
|
11
|
-
}[];
|
12
|
-
}
|
13
|
-
export interface Measurement {
|
14
|
-
bodyMass: number | null;
|
15
|
-
height: number | null;
|
16
|
-
biologicalSex: string | null;
|
17
|
-
dateOfBirth: string | null;
|
18
|
-
}
|
2
|
+
import type { HeartRate, Measurement, Step } from './types';
|
19
3
|
export interface Spec extends TurboModule {
|
20
4
|
requestHealthKitPermissions(): Promise<string>;
|
21
5
|
getSteps(daysBefore: number): Promise<Step[]>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"NativeAppleHealthKit.d.ts","sourceRoot":"","sources":["../../../../src/NativeAppleHealthKit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
1
|
+
{"version":3,"file":"NativeAppleHealthKit.d.ts","sourceRoot":"","sources":["../../../../src/NativeAppleHealthKit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE5D,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,2BAA2B,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/C,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IAC9C,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IACvD,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;CACxC;;AAiBD,wBAE6D"}
|
@@ -1,2 +1,6 @@
|
|
1
|
-
export
|
1
|
+
export * from './types';
|
2
|
+
export declare const requestHealthKitPermissions: () => Promise<void>;
|
3
|
+
export declare const getHeartRate: (days: number) => Promise<void>;
|
4
|
+
export declare const getSteps: (days: number) => Promise<void>;
|
5
|
+
export declare const getMeasurement: () => Promise<void>;
|
2
6
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AACA,cAAc,SAAS,CAAC;AAExB,eAAO,MAAM,2BAA2B,qBAEvC,CAAC;AAEF,eAAO,MAAM,YAAY,SAAgB,MAAM,kBAE9C,CAAC;AAEF,eAAO,MAAM,QAAQ,SAAgB,MAAM,kBAE1C,CAAC;AAEF,eAAO,MAAM,cAAc,qBAE1B,CAAC"}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
export interface Step {
|
2
|
+
dateString: string;
|
3
|
+
stepCount: number;
|
4
|
+
}
|
5
|
+
export interface HeartRateValue {
|
6
|
+
time: string;
|
7
|
+
heartRate: number;
|
8
|
+
}
|
9
|
+
export interface HeartRate {
|
10
|
+
date: string;
|
11
|
+
value: HeartRateValue[];
|
12
|
+
}
|
13
|
+
export interface Measurement {
|
14
|
+
bodyMass: number | null;
|
15
|
+
height: number | null;
|
16
|
+
biologicalSex: string | null;
|
17
|
+
dateOfBirth: string | null;
|
18
|
+
}
|
19
|
+
//# sourceMappingURL=types.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,cAAc,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B"}
|
@@ -1,21 +1,5 @@
|
|
1
1
|
import type { TurboModule } from 'react-native';
|
2
|
-
|
3
|
-
dateString: string;
|
4
|
-
stepCount: number;
|
5
|
-
}
|
6
|
-
export interface HeartRate {
|
7
|
-
date: string;
|
8
|
-
value: {
|
9
|
-
time: string;
|
10
|
-
heartRate: number;
|
11
|
-
}[];
|
12
|
-
}
|
13
|
-
export interface Measurement {
|
14
|
-
bodyMass: number | null;
|
15
|
-
height: number | null;
|
16
|
-
biologicalSex: string | null;
|
17
|
-
dateOfBirth: string | null;
|
18
|
-
}
|
2
|
+
import type { HeartRate, Measurement, Step } from './types';
|
19
3
|
export interface Spec extends TurboModule {
|
20
4
|
requestHealthKitPermissions(): Promise<string>;
|
21
5
|
getSteps(daysBefore: number): Promise<Step[]>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"NativeAppleHealthKit.d.ts","sourceRoot":"","sources":["../../../../src/NativeAppleHealthKit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
1
|
+
{"version":3,"file":"NativeAppleHealthKit.d.ts","sourceRoot":"","sources":["../../../../src/NativeAppleHealthKit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE5D,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,2BAA2B,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/C,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IAC9C,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IACvD,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;CACxC;;AAiBD,wBAE6D"}
|
@@ -1,2 +1,6 @@
|
|
1
|
-
export
|
1
|
+
export * from './types';
|
2
|
+
export declare const requestHealthKitPermissions: () => Promise<void>;
|
3
|
+
export declare const getHeartRate: (days: number) => Promise<void>;
|
4
|
+
export declare const getSteps: (days: number) => Promise<void>;
|
5
|
+
export declare const getMeasurement: () => Promise<void>;
|
2
6
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AACA,cAAc,SAAS,CAAC;AAExB,eAAO,MAAM,2BAA2B,qBAEvC,CAAC;AAEF,eAAO,MAAM,YAAY,SAAgB,MAAM,kBAE9C,CAAC;AAEF,eAAO,MAAM,QAAQ,SAAgB,MAAM,kBAE1C,CAAC;AAEF,eAAO,MAAM,cAAc,qBAE1B,CAAC"}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
export interface Step {
|
2
|
+
dateString: string;
|
3
|
+
stepCount: number;
|
4
|
+
}
|
5
|
+
export interface HeartRateValue {
|
6
|
+
time: string;
|
7
|
+
heartRate: number;
|
8
|
+
}
|
9
|
+
export interface HeartRate {
|
10
|
+
date: string;
|
11
|
+
value: HeartRateValue[];
|
12
|
+
}
|
13
|
+
export interface Measurement {
|
14
|
+
bodyMass: number | null;
|
15
|
+
height: number | null;
|
16
|
+
biologicalSex: string | null;
|
17
|
+
dateOfBirth: string | null;
|
18
|
+
}
|
19
|
+
//# sourceMappingURL=types.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,cAAc,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B"}
|
package/package.json
CHANGED
@@ -1,25 +1,6 @@
|
|
1
1
|
import type { TurboModule } from 'react-native';
|
2
2
|
import { Platform, TurboModuleRegistry } from 'react-native';
|
3
|
-
|
4
|
-
export interface Step {
|
5
|
-
dateString: string;
|
6
|
-
stepCount: number;
|
7
|
-
}
|
8
|
-
|
9
|
-
export interface HeartRate {
|
10
|
-
date: string;
|
11
|
-
value: {
|
12
|
-
time: string;
|
13
|
-
heartRate: number;
|
14
|
-
}[];
|
15
|
-
}
|
16
|
-
|
17
|
-
export interface Measurement {
|
18
|
-
bodyMass: number | null;
|
19
|
-
height: number | null;
|
20
|
-
biologicalSex: string | null;
|
21
|
-
dateOfBirth: string | null;
|
22
|
-
}
|
3
|
+
import type { HeartRate, Measurement, Step } from './types';
|
23
4
|
|
24
5
|
export interface Spec extends TurboModule {
|
25
6
|
requestHealthKitPermissions(): Promise<string>;
|
package/src/index.tsx
CHANGED
@@ -1,8 +1,18 @@
|
|
1
1
|
import NativeAppleHealthKit from './NativeAppleHealthKit';
|
2
|
+
export * from './types';
|
2
3
|
|
3
|
-
export const {
|
4
|
-
requestHealthKitPermissions
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
export const requestHealthKitPermissions = async () => {
|
5
|
+
await NativeAppleHealthKit.requestHealthKitPermissions();
|
6
|
+
};
|
7
|
+
|
8
|
+
export const getHeartRate = async (days: number) => {
|
9
|
+
await NativeAppleHealthKit.getHeartRate(days);
|
10
|
+
};
|
11
|
+
|
12
|
+
export const getSteps = async (days: number) => {
|
13
|
+
await NativeAppleHealthKit.getSteps(days);
|
14
|
+
};
|
15
|
+
|
16
|
+
export const getMeasurement = async () => {
|
17
|
+
await NativeAppleHealthKit.getMeasurement();
|
18
|
+
};
|
package/src/types.ts
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
export interface Step {
|
2
|
+
dateString: string;
|
3
|
+
stepCount: number;
|
4
|
+
}
|
5
|
+
|
6
|
+
export interface HeartRateValue {
|
7
|
+
time: string;
|
8
|
+
heartRate: number;
|
9
|
+
}
|
10
|
+
|
11
|
+
export interface HeartRate {
|
12
|
+
date: string;
|
13
|
+
value: HeartRateValue[];
|
14
|
+
}
|
15
|
+
|
16
|
+
export interface Measurement {
|
17
|
+
bodyMass: number | null;
|
18
|
+
height: number | null;
|
19
|
+
biologicalSex: string | null;
|
20
|
+
dateOfBirth: string | null;
|
21
|
+
}
|