@kingstinct/react-native-healthkit 8.0.1 → 8.1.1
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/ios/ReactNativeHealthkit.m +10 -0
- package/ios/ReactNativeHealthkit.swift +137 -70
- package/lib/commonjs/index.ios.js +18 -2
- package/lib/commonjs/index.ios.js.map +1 -1
- package/lib/commonjs/index.native.js +33 -23
- package/lib/commonjs/index.native.js.map +1 -1
- package/lib/commonjs/native-types.js.map +1 -1
- package/lib/commonjs/test-setup.js +1 -0
- package/lib/commonjs/test-setup.js.map +1 -1
- package/lib/commonjs/utils/queryCategorySamplesWithAnchor.js.map +1 -1
- package/lib/commonjs/utils/queryWorkoutSamplesWithAnchor.js +26 -0
- package/lib/commonjs/utils/queryWorkoutSamplesWithAnchor.js.map +1 -0
- package/lib/module/index.ios.js +14 -3
- package/lib/module/index.ios.js.map +1 -1
- package/lib/module/index.native.js +20 -12
- package/lib/module/index.native.js.map +1 -1
- package/lib/module/native-types.js.map +1 -1
- package/lib/module/test-setup.js +1 -0
- package/lib/module/test-setup.js.map +1 -1
- package/lib/module/utils/queryCategorySamplesWithAnchor.js +2 -2
- package/lib/module/utils/queryCategorySamplesWithAnchor.js.map +1 -1
- package/lib/module/utils/queryWorkoutSamplesWithAnchor.js +19 -0
- package/lib/module/utils/queryWorkoutSamplesWithAnchor.js.map +1 -0
- package/lib/typescript/src/index.ios.d.ts +14 -3
- package/lib/typescript/src/index.native.d.ts +6 -2
- package/lib/typescript/src/native-types.d.ts +14 -1
- package/lib/typescript/src/utils/queryWorkoutSamplesWithAnchor.d.ts +9 -0
- package/package.json +1 -1
- package/src/index.ios.tsx +15 -2
- package/src/index.native.tsx +30 -20
- package/src/native-types.ts +74 -47
- package/src/test-setup.ts +1 -0
- package/src/utils/queryCategorySamplesWithAnchor.ts +2 -2
- package/src/utils/queryWorkoutSamplesWithAnchor.ts +46 -0
|
@@ -89,6 +89,16 @@ RCT_EXTERN_METHOD(saveCategorySample:(NSString)typeIdentifier
|
|
|
89
89
|
reject:(RCTPromiseRejectBlock)reject
|
|
90
90
|
)
|
|
91
91
|
|
|
92
|
+
RCT_EXTERN_METHOD(queryWorkoutSamplesWithAnchor:(NSString)energyUnitString
|
|
93
|
+
distanceUnitString:(NSString)distanceUnitString
|
|
94
|
+
from:(NSDate)from
|
|
95
|
+
to:(NSDate)to
|
|
96
|
+
limit:(NSInteger)limit
|
|
97
|
+
anchor:(NSString)anchor
|
|
98
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
99
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
100
|
+
)
|
|
101
|
+
|
|
92
102
|
RCT_EXTERN_METHOD(queryWorkoutSamples:(NSString)energyUnitString
|
|
93
103
|
distanceUnitString:(NSString)distanceUnitString
|
|
94
104
|
from:(NSDate)from
|
|
@@ -717,6 +717,76 @@ class ReactNativeHealthkit: RCTEventEmitter {
|
|
|
717
717
|
store.execute(query)
|
|
718
718
|
}
|
|
719
719
|
|
|
720
|
+
func mapWorkout(workout: HKWorkout, distanceUnit: HKUnit, energyUnit: HKUnit) -> NSMutableDictionary {
|
|
721
|
+
let endDate = self._dateFormatter.string(from: workout.endDate)
|
|
722
|
+
let startDate = self._dateFormatter.string(from: workout.startDate)
|
|
723
|
+
|
|
724
|
+
let dict: NSMutableDictionary = [
|
|
725
|
+
"uuid": workout.uuid.uuidString,
|
|
726
|
+
"device": serializeDevice(_device: workout.device) as Any,
|
|
727
|
+
"duration": workout.duration,
|
|
728
|
+
"totalDistance": serializeQuantity(unit: distanceUnit, quantity: workout.totalDistance) as Any,
|
|
729
|
+
"totalEnergyBurned": serializeQuantity(unit: energyUnit, quantity: workout.totalEnergyBurned) as Any,
|
|
730
|
+
"totalSwimmingStrokeCount": serializeQuantity(unit: HKUnit.count(), quantity: workout.totalSwimmingStrokeCount) as Any,
|
|
731
|
+
"workoutActivityType": workout.workoutActivityType.rawValue,
|
|
732
|
+
"startDate": startDate,
|
|
733
|
+
"endDate": endDate,
|
|
734
|
+
"metadata": serializeMetadata(metadata: workout.metadata),
|
|
735
|
+
"sourceRevision": serializeSourceRevision(_sourceRevision: workout.sourceRevision) as Any
|
|
736
|
+
]
|
|
737
|
+
|
|
738
|
+
// this is used for our laps functionality to get markers
|
|
739
|
+
// https://developer.apple.com/documentation/healthkit/hkworkoutevent
|
|
740
|
+
var eventArray: [[String: Any]] = []
|
|
741
|
+
if let events = workout.workoutEvents {
|
|
742
|
+
for event in events {
|
|
743
|
+
let eventStartDate = self._dateFormatter.string(from: event.dateInterval.start)
|
|
744
|
+
let eventEndDate = self._dateFormatter.string(from: event.dateInterval.end)
|
|
745
|
+
let eventDict: [String: Any] = [
|
|
746
|
+
"type": event.type.rawValue, // https://developer.apple.com/documentation/healthkit/hkworkouteventtype
|
|
747
|
+
"startDate": eventStartDate,
|
|
748
|
+
"endDate": eventEndDate
|
|
749
|
+
]
|
|
750
|
+
eventArray.append(eventDict)
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
dict["events"] = eventArray
|
|
754
|
+
|
|
755
|
+
// also used for our laps functionality to get activities for custom workouts defined by the user
|
|
756
|
+
// https://developer.apple.com/documentation/healthkit/hkworkout/1615340-init
|
|
757
|
+
// it seems this might be depricated in the latest beta so this might need updating!
|
|
758
|
+
var activitiesArray: [[String: Any]] = []
|
|
759
|
+
if #available(iOS 16.0, *) {
|
|
760
|
+
let activities: [HKWorkoutActivity] = workout.workoutActivities
|
|
761
|
+
|
|
762
|
+
if !activities.isEmpty {
|
|
763
|
+
for activity in activities {
|
|
764
|
+
var activityStartDate = ""
|
|
765
|
+
var activityEndDate = ""
|
|
766
|
+
if let start = activity.startDate as Date? {
|
|
767
|
+
activityStartDate = self._dateFormatter.string(from: start)
|
|
768
|
+
}
|
|
769
|
+
if let end = activity.endDate as Date? {
|
|
770
|
+
activityEndDate = self._dateFormatter.string(from: end)
|
|
771
|
+
}
|
|
772
|
+
let activityDict: [String: Any] = [
|
|
773
|
+
"startDate": activityStartDate,
|
|
774
|
+
"endDate": activityEndDate,
|
|
775
|
+
"uuid": activity.uuid.uuidString,
|
|
776
|
+
"duration": activity.duration
|
|
777
|
+
]
|
|
778
|
+
activitiesArray.append(activityDict)
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
dict["activities"] = activitiesArray
|
|
783
|
+
|
|
784
|
+
if #available(iOS 11, *) {
|
|
785
|
+
dict.setValue(serializeQuantity(unit: HKUnit.count(), quantity: workout.totalFlightsClimbed), forKey: "totalFlightsClimbed")
|
|
786
|
+
}
|
|
787
|
+
return dict
|
|
788
|
+
}
|
|
789
|
+
|
|
720
790
|
@objc(queryWorkoutSamples:distanceUnitString:from:to:limit:ascending:resolve:reject:)
|
|
721
791
|
func queryWorkoutSamples(energyUnitString: String, distanceUnitString: String, from: Date, to: Date, limit: Int, ascending: Bool, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
|
|
722
792
|
guard let store = _store else {
|
|
@@ -741,76 +811,15 @@ class ReactNativeHealthkit: RCTEventEmitter {
|
|
|
741
811
|
let arr: NSMutableArray = []
|
|
742
812
|
|
|
743
813
|
for s in samples {
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
"totalEnergyBurned": serializeQuantity(unit: energyUnit, quantity: workout.totalEnergyBurned) as Any,
|
|
754
|
-
"totalSwimmingStrokeCount": serializeQuantity(unit: HKUnit.count(), quantity: workout.totalSwimmingStrokeCount) as Any,
|
|
755
|
-
"workoutActivityType": workout.workoutActivityType.rawValue,
|
|
756
|
-
"startDate": startDate,
|
|
757
|
-
"endDate": endDate,
|
|
758
|
-
"metadata": serializeMetadata(metadata: workout.metadata),
|
|
759
|
-
"sourceRevision": serializeSourceRevision(_sourceRevision: workout.sourceRevision) as Any
|
|
760
|
-
]
|
|
761
|
-
|
|
762
|
-
// this is used for our laps functionality to get markers
|
|
763
|
-
// https://developer.apple.com/documentation/healthkit/hkworkoutevent
|
|
764
|
-
var eventArray: [[String: Any]] = []
|
|
765
|
-
if let events = workout.workoutEvents {
|
|
766
|
-
for event in events {
|
|
767
|
-
let eventStartDate = self._dateFormatter.string(from: event.dateInterval.start)
|
|
768
|
-
let eventEndDate = self._dateFormatter.string(from: event.dateInterval.end)
|
|
769
|
-
let eventDict: [String: Any] = [
|
|
770
|
-
"type": event.type.rawValue, // https://developer.apple.com/documentation/healthkit/hkworkouteventtype
|
|
771
|
-
"startDate": eventStartDate,
|
|
772
|
-
"endDate": eventEndDate
|
|
773
|
-
]
|
|
774
|
-
eventArray.append(eventDict)
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
dict["events"] = eventArray
|
|
778
|
-
|
|
779
|
-
// also used for our laps functionality to get activities for custom workouts defined by the user
|
|
780
|
-
// https://developer.apple.com/documentation/healthkit/hkworkout/1615340-init
|
|
781
|
-
// it seems this might be depricated in the latest beta so this might need updating!
|
|
782
|
-
var activitiesArray: [[String: Any]] = []
|
|
783
|
-
if #available(iOS 16.0, *) {
|
|
784
|
-
let activities: [HKWorkoutActivity] = workout.workoutActivities
|
|
785
|
-
|
|
786
|
-
if !activities.isEmpty {
|
|
787
|
-
for activity in activities {
|
|
788
|
-
var activityStartDate = ""
|
|
789
|
-
var activityEndDate = ""
|
|
790
|
-
if let start = activity.startDate as Date? {
|
|
791
|
-
activityStartDate = self._dateFormatter.string(from: start)
|
|
792
|
-
}
|
|
793
|
-
if let end = activity.endDate as Date? {
|
|
794
|
-
activityEndDate = self._dateFormatter.string(from: end)
|
|
795
|
-
}
|
|
796
|
-
let activityDict: [String: Any] = [
|
|
797
|
-
"startDate": activityStartDate,
|
|
798
|
-
"endDate": activityEndDate,
|
|
799
|
-
"uuid": activity.uuid.uuidString,
|
|
800
|
-
"duration": activity.duration
|
|
801
|
-
]
|
|
802
|
-
activitiesArray.append(activityDict)
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
dict["activities"] = activitiesArray
|
|
807
|
-
|
|
808
|
-
if #available(iOS 11, *) {
|
|
809
|
-
dict.setValue(serializeQuantity(unit: HKUnit.count(), quantity: workout.totalFlightsClimbed), forKey: "totalFlightsClimbed")
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
arr.add(dict)
|
|
813
|
-
}
|
|
814
|
+
if let workout = s as? HKWorkout {
|
|
815
|
+
let dict = self.mapWorkout(
|
|
816
|
+
workout: workout,
|
|
817
|
+
distanceUnit: distanceUnit,
|
|
818
|
+
energyUnit: energyUnit
|
|
819
|
+
)
|
|
820
|
+
|
|
821
|
+
arr.add(dict)
|
|
822
|
+
}
|
|
814
823
|
}
|
|
815
824
|
|
|
816
825
|
return resolve(arr)
|
|
@@ -821,6 +830,64 @@ class ReactNativeHealthkit: RCTEventEmitter {
|
|
|
821
830
|
store.execute(q)
|
|
822
831
|
}
|
|
823
832
|
|
|
833
|
+
@objc(queryWorkoutSamplesWithAnchor:distanceUnitString:from:to:limit:anchor:resolve:reject:)
|
|
834
|
+
func queryWorkoutSamplesWithAnchor(energyUnitString: String, distanceUnitString: String, from: Date, to: Date, limit: Int, anchor: String, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
|
|
835
|
+
guard let store = _store else {
|
|
836
|
+
return reject(INIT_ERROR, INIT_ERROR_MESSAGE, nil)
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
let from = dateOrNilIfZero(date: from)
|
|
840
|
+
let to = dateOrNilIfZero(date: to)
|
|
841
|
+
|
|
842
|
+
let predicate = createPredicate(from: from, to: to)
|
|
843
|
+
|
|
844
|
+
let limit = limitOrNilIfZero(limit: limit)
|
|
845
|
+
|
|
846
|
+
let energyUnit = HKUnit.init(from: energyUnitString)
|
|
847
|
+
let distanceUnit = HKUnit.init(from: distanceUnitString)
|
|
848
|
+
|
|
849
|
+
let actualAnchor = deserializeHKQueryAnchor(anchor: anchor)
|
|
850
|
+
|
|
851
|
+
let q = HKAnchoredObjectQuery(type: .workoutType(), predicate: predicate, anchor: actualAnchor, limit: limit) { (
|
|
852
|
+
_: HKAnchoredObjectQuery,
|
|
853
|
+
s: [HKSample]?,
|
|
854
|
+
deletedSamples: [HKDeletedObject]?,
|
|
855
|
+
newAnchor: HKQueryAnchor?,
|
|
856
|
+
error: Error?
|
|
857
|
+
) in
|
|
858
|
+
guard let err = error else {
|
|
859
|
+
guard let samples = s else {
|
|
860
|
+
return resolve([])
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
let arr: NSMutableArray = []
|
|
864
|
+
|
|
865
|
+
for s in samples {
|
|
866
|
+
if let workout = s as? HKWorkout {
|
|
867
|
+
let dict = self.mapWorkout(
|
|
868
|
+
workout: workout,
|
|
869
|
+
distanceUnit: distanceUnit,
|
|
870
|
+
energyUnit: energyUnit
|
|
871
|
+
)
|
|
872
|
+
|
|
873
|
+
arr.add(dict)
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
return resolve([
|
|
878
|
+
"samples": arr as Any,
|
|
879
|
+
"deletedSamples": deletedSamples?.map({ sample in
|
|
880
|
+
return serializeDeletedSample(sample: sample)
|
|
881
|
+
}) as Any,
|
|
882
|
+
"newAnchor": serializeAnchor(anchor: newAnchor) as Any
|
|
883
|
+
])
|
|
884
|
+
}
|
|
885
|
+
reject(GENERIC_ERROR, err.localizedDescription, err)
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
store.execute(q)
|
|
889
|
+
}
|
|
890
|
+
|
|
824
891
|
@objc(queryQuantitySamples:unitString:from:to:limit:ascending:resolve:reject:)
|
|
825
892
|
func queryQuantitySamples(
|
|
826
893
|
typeIdentifier: String,
|
|
@@ -15,6 +15,7 @@ var _exportNames = {
|
|
|
15
15
|
getWheelchairUse: true,
|
|
16
16
|
getWorkoutRoutes: true,
|
|
17
17
|
isHealthDataAvailable: true,
|
|
18
|
+
queryWorkouts: true,
|
|
18
19
|
isProtectedDataAvailable: true,
|
|
19
20
|
useHealthkitAuthorization: true,
|
|
20
21
|
useIsHealthDataAvailable: true,
|
|
@@ -43,7 +44,8 @@ var _exportNames = {
|
|
|
43
44
|
queryQuantitySamplesWithAnchor: true,
|
|
44
45
|
querySources: true,
|
|
45
46
|
queryStatisticsForQuantity: true,
|
|
46
|
-
|
|
47
|
+
queryWorkoutSamples: true,
|
|
48
|
+
queryWorkoutSamplesWithAnchor: true,
|
|
47
49
|
requestAuthorization: true,
|
|
48
50
|
saveCategorySample: true,
|
|
49
51
|
saveCorrelationSample: true,
|
|
@@ -171,12 +173,19 @@ Object.defineProperty(exports, "queryStatisticsForQuantity", {
|
|
|
171
173
|
return _queryStatisticsForQuantity.default;
|
|
172
174
|
}
|
|
173
175
|
});
|
|
174
|
-
Object.defineProperty(exports, "
|
|
176
|
+
Object.defineProperty(exports, "queryWorkoutSamples", {
|
|
175
177
|
enumerable: true,
|
|
176
178
|
get: function () {
|
|
177
179
|
return _queryWorkouts.default;
|
|
178
180
|
}
|
|
179
181
|
});
|
|
182
|
+
Object.defineProperty(exports, "queryWorkoutSamplesWithAnchor", {
|
|
183
|
+
enumerable: true,
|
|
184
|
+
get: function () {
|
|
185
|
+
return _queryWorkoutSamplesWithAnchor.default;
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
exports.queryWorkouts = void 0;
|
|
180
189
|
Object.defineProperty(exports, "requestAuthorization", {
|
|
181
190
|
enumerable: true,
|
|
182
191
|
get: function () {
|
|
@@ -297,6 +306,7 @@ var _queryQuantitySamplesWithAnchor = _interopRequireDefault(require("./utils/qu
|
|
|
297
306
|
var _querySources = _interopRequireDefault(require("./utils/querySources"));
|
|
298
307
|
var _queryStatisticsForQuantity = _interopRequireDefault(require("./utils/queryStatisticsForQuantity"));
|
|
299
308
|
var _queryWorkouts = _interopRequireDefault(require("./utils/queryWorkouts"));
|
|
309
|
+
var _queryWorkoutSamplesWithAnchor = _interopRequireDefault(require("./utils/queryWorkoutSamplesWithAnchor"));
|
|
300
310
|
var _requestAuthorization = _interopRequireDefault(require("./utils/requestAuthorization"));
|
|
301
311
|
var _saveCategorySample = _interopRequireDefault(require("./utils/saveCategorySample"));
|
|
302
312
|
var _saveCorrelationSample = _interopRequireDefault(require("./utils/saveCorrelationSample"));
|
|
@@ -422,7 +432,12 @@ var _default = exports.default = {
|
|
|
422
432
|
queryQuantitySamples: _queryQuantitySamples.default,
|
|
423
433
|
queryQuantitySamplesWithAnchor: _queryQuantitySamplesWithAnchor.default,
|
|
424
434
|
queryStatisticsForQuantity: _queryStatisticsForQuantity.default,
|
|
435
|
+
/**
|
|
436
|
+
* @deprecated Use queryWorkoutSamples instead
|
|
437
|
+
*/
|
|
425
438
|
queryWorkouts: _queryWorkouts.default,
|
|
439
|
+
queryWorkoutSamples: _queryWorkouts.default,
|
|
440
|
+
queryWorkoutSamplesWithAnchor: _queryWorkoutSamplesWithAnchor.default,
|
|
426
441
|
querySources: _querySources.default,
|
|
427
442
|
requestAuthorization: _requestAuthorization.default,
|
|
428
443
|
// delete methods
|
|
@@ -468,4 +483,5 @@ var _default = exports.default = {
|
|
|
468
483
|
useSources: _useSources.default,
|
|
469
484
|
useStatisticsForQuantity: _useStatisticsForQuantity.default
|
|
470
485
|
};
|
|
486
|
+
const queryWorkouts = exports.queryWorkouts = _queryWorkouts.default;
|
|
471
487
|
//# sourceMappingURL=index.ios.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_useHealthkitAuthorization","_interopRequireDefault","_useIsHealthDataAvailable","_useMostRecentCategorySample","_useMostRecentQuantitySample","_useMostRecentWorkout","_useSources","_useStatisticsForQuantity","_useSubscribeToChanges","_nativeTypes","_interopRequireWildcard","_deleteQuantitySample","_deleteSamples","_getDateOfBirth","_getMostRecentCategorySample","_getMostRecentQuantitySample","_getMostRecentWorkout","_getPreferredUnit","_getPreferredUnits","_getRequestStatusForAuthorization","_getWorkoutPlanById","_queryCategorySamples","_queryCategorySamplesWithAnchor","_queryCorrelationSamples","_queryHeartbeatSeriesSamples","_queryHeartbeatSeriesSamplesWithAnchor","_queryQuantitySamples","_queryQuantitySamplesWithAnchor","_querySources","_queryStatisticsForQuantity","_queryWorkouts","_requestAuthorization","_saveCategorySample","_saveCorrelationSample","_saveQuantitySample","_saveWorkoutRoute","_saveWorkoutSample","_subscribeToChanges","_types","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","n","__proto__","a","getOwnPropertyDescriptor","u","i","set","currentMajorVersionIOS","Platform","OS","parseInt","Version","allQuantityTypesList","values","HKQuantityTypeIdentifier","availableQuantityTypes","majorVersionIOS","filter","type","cyclingCadence","cyclingFunctionalThresholdPower","cyclingPower","cyclingSpeed","physicalEffort","timeInDaylight","includes","authorizationStatusFor","Native","bind","isHealthDataAvailable","isProtectedDataAvailable","disableBackgroundDelivery","disableAllBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","getFitzpatrickSkinType","getWheelchairUse","getBloodType","getWorkoutRoutes","_default","getDateOfBirth","getMostRecentQuantitySample","getMostRecentCategorySample","getMostRecentWorkout","getWorkoutPlanById","getPreferredUnit","getPreferredUnits","getRequestStatusForAuthorization","queryCategorySamples","queryCategorySamplesWithAnchor","queryCorrelationSamples","queryHeartbeatSeriesSamples","queryHeartbeatSeriesSamplesWithAnchor","queryQuantitySamples","queryQuantitySamplesWithAnchor","queryStatisticsForQuantity","queryWorkouts","querySources","requestAuthorization","deleteQuantitySample","deleteSamples","saveCategorySample","saveCorrelationSample","saveQuantitySample","saveWorkoutSample","saveWorkoutRoute","subscribeToChanges","useMostRecentCategorySample","useMostRecentQuantitySample","useMostRecentWorkout","useSubscribeToChanges","useIsHealthDataAvailable","useHealthkitAuthorization","useSources","useStatisticsForQuantity"],"sources":["index.ios.tsx"],"sourcesContent":["import { Platform } from 'react-native'\n\nimport useHealthkitAuthorization from './hooks/useHealthkitAuthorization'\nimport useIsHealthDataAvailable from './hooks/useIsHealthDataAvailable'\nimport useMostRecentCategorySample from './hooks/useMostRecentCategorySample'\nimport useMostRecentQuantitySample from './hooks/useMostRecentQuantitySample'\nimport useMostRecentWorkout from './hooks/useMostRecentWorkout'\nimport useSources from './hooks/useSources'\nimport useStatisticsForQuantity from './hooks/useStatisticsForQuantity'\nimport useSubscribeToChanges from './hooks/useSubscribeToChanges'\nimport Native, { HKQuantityTypeIdentifier } from './native-types'\nimport deleteQuantitySample from './utils/deleteQuantitySample'\nimport deleteSamples from './utils/deleteSamples'\nimport getDateOfBirth from './utils/getDateOfBirth'\nimport getMostRecentCategorySample from './utils/getMostRecentCategorySample'\nimport getMostRecentQuantitySample from './utils/getMostRecentQuantitySample'\nimport getMostRecentWorkout from './utils/getMostRecentWorkout'\nimport getPreferredUnit from './utils/getPreferredUnit'\nimport getPreferredUnits from './utils/getPreferredUnits'\nimport getRequestStatusForAuthorization from './utils/getRequestStatusForAuthorization'\nimport getWorkoutPlanById from './utils/getWorkoutPlanById'\nimport queryCategorySamples from './utils/queryCategorySamples'\nimport queryCategorySamplesWithAnchor from './utils/queryCategorySamplesWithAnchor'\nimport queryCorrelationSamples from './utils/queryCorrelationSamples'\nimport queryHeartbeatSeriesSamples from './utils/queryHeartbeatSeriesSamples'\nimport queryHeartbeatSeriesSamplesWithAnchor from './utils/queryHeartbeatSeriesSamplesWithAnchor'\nimport queryQuantitySamples from './utils/queryQuantitySamples'\nimport queryQuantitySamplesWithAnchor from './utils/queryQuantitySamplesWithAnchor'\nimport querySources from './utils/querySources'\nimport queryStatisticsForQuantity from './utils/queryStatisticsForQuantity'\nimport queryWorkouts from './utils/queryWorkouts'\nimport requestAuthorization from './utils/requestAuthorization'\nimport saveCategorySample from './utils/saveCategorySample'\nimport saveCorrelationSample from './utils/saveCorrelationSample'\nimport saveQuantitySample from './utils/saveQuantitySample'\nimport saveWorkoutRoute from './utils/saveWorkoutRoute'\nimport saveWorkoutSample from './utils/saveWorkoutSample'\nimport subscribeToChanges from './utils/subscribeToChanges'\n\nconst currentMajorVersionIOS = Platform.OS === 'ios' ? parseInt(Platform.Version, 10) : 0\n\nconst allQuantityTypesList = [...Object.values(HKQuantityTypeIdentifier)]\n\nconst availableQuantityTypes = (majorVersionIOS = currentMajorVersionIOS) => {\n if (majorVersionIOS >= 17) {\n return allQuantityTypesList\n }\n\n // remove types that are not available before iOS 17\n return allQuantityTypesList.filter((type) => ![\n HKQuantityTypeIdentifier.cyclingCadence,\n HKQuantityTypeIdentifier.cyclingFunctionalThresholdPower,\n HKQuantityTypeIdentifier.cyclingPower,\n HKQuantityTypeIdentifier.cyclingSpeed,\n HKQuantityTypeIdentifier.physicalEffort,\n HKQuantityTypeIdentifier.timeInDaylight,\n ].includes(type))\n}\n\nconst authorizationStatusFor = Native.authorizationStatusFor.bind(Native)\nconst isHealthDataAvailable = Native.isHealthDataAvailable.bind(Native)\nconst isProtectedDataAvailable = Native.isProtectedDataAvailable.bind(Native)\nconst disableBackgroundDelivery = Native.disableBackgroundDelivery.bind(Native)\nconst disableAllBackgroundDelivery = Native.disableAllBackgroundDelivery.bind(Native)\nconst enableBackgroundDelivery = Native.enableBackgroundDelivery.bind(Native)\nconst getBiologicalSex = Native.getBiologicalSex.bind(Native)\nconst getFitzpatrickSkinType = Native.getFitzpatrickSkinType.bind(Native)\nconst getWheelchairUse = Native.getWheelchairUse.bind(Native)\nconst getBloodType = Native.getBloodType.bind(Native)\nconst getWorkoutRoutes = Native.getWorkoutRoutes.bind(Native)\n\n/**\n * @see {@link https://developer.apple.com/documentation/healthkit/about_the_healthkit_framework About the HealthKit Framework (Apple Docs)}\n */\nexport default {\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614154-authorizationstatus authorizationStatus(for:) (Apple Docs) }\n * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Authorizing access to health data (Apple Docs) }\n */\n authorizationStatusFor,\n\n /**\n *\n * @returns All available quantity types for the current iOS version (currently excluding types that are not available before iOS 17)\n */\n availableQuantityTypes,\n\n /**\n * @description By default, HealthKit data is available on iOS and watchOS. HealthKit data is also available on iPadOS 17 or later. However, devices running in an enterprise environment may restrict access to HealthKit data.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable isHealthDataAvailable() (Apple Docs)}\n * @returns {boolean} true if HealthKit is available; otherwise, false.\n */\n isHealthDataAvailable,\n\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614181-isprotecteddataavailable isProtectedDataAvailable() (Apple Docs)}\n * @see {@link https://developer.apple.com/documentation/healthkit/protecting_user_privacy#3705074 Protecting User Privacy - Access encrypted data (Apple Docs)}\n * @returns {boolean} A Boolean value that indicates whether content protection is active.\n */\n isProtectedDataAvailable,\n\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614158-disableallbackgrounddelivery disableAllBackgroundDelivery(completion:) (Apple Docs)}\n */\n disableAllBackgroundDelivery,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614177-disablebackgrounddelivery disableBackgroundDelivery(for:withCompletion:) (Apple Docs)}\n */\n disableBackgroundDelivery,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614175-enablebackgrounddelivery enableBackgroundDelivery(for:frequency:withCompletion:) (Apple Docs)}\n */\n enableBackgroundDelivery,\n\n // simple convenience getters\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614171-biologicalsex biologicalSex() (Apple Docs)}\n */\n getBiologicalSex,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614161-fitzpatrickskintype fitzpatrickSkinType() (Apple Docs)}\n */\n getFitzpatrickSkinType,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648356-wheelchairuse wheelchairUse() (Apple Docs)}\n */\n getWheelchairUse,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614164-bloodtype bloodType() (Apple Docs)}\n */\n getBloodType,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648357-dateofbirthcomponents dateOfBirthComponents() (Apple Docs)}\n */\n getDateOfBirth,\n\n getMostRecentQuantitySample,\n getMostRecentCategorySample,\n getMostRecentWorkout,\n\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/workouts_and_activity_rings/reading_route_data Reading route data (Apple Docs)}\n * @see {@link https://developer.apple.com/documentation/healthkit/hkworkoutroutequery HKWorkoutRouteQuery (Apple Docs)}\n */\n getWorkoutRoutes,\n getWorkoutPlanById,\n\n getPreferredUnit,\n getPreferredUnits,\n getRequestStatusForAuthorization,\n\n // query methods\n queryCategorySamples,\n queryCategorySamplesWithAnchor,\n queryCorrelationSamples,\n queryHeartbeatSeriesSamples,\n queryHeartbeatSeriesSamplesWithAnchor,\n queryQuantitySamples,\n queryQuantitySamplesWithAnchor,\n queryStatisticsForQuantity,\n queryWorkouts,\n querySources,\n\n requestAuthorization,\n\n // delete methods\n deleteQuantitySample,\n deleteSamples,\n\n // save methods\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614168-savecategorysample save(_:withCompletion:) (Apple Docs)}\n * @see {@link https://developer.apple.com/documentation/healthkit/saving_data_to_healthkit Saving data to HealthKit (Apple Docs)}\n */\n saveCategorySample,\n saveCorrelationSample,\n saveQuantitySample,\n saveWorkoutSample,\n saveWorkoutRoute,\n\n // subscriptions\n subscribeToChanges,\n\n /**\n * @returns the most recent sample for the given category type.\n */\n useMostRecentCategorySample,\n /**\n * @returns the most recent sample for the given quantity type.\n */\n useMostRecentQuantitySample,\n /**\n * @returns the most recent workout sample.\n */\n useMostRecentWorkout,\n useSubscribeToChanges,\n /**\n * @description By default, HealthKit data is available on iOS and watchOS. HealthKit data is also available on iPadOS 17 or later. However, devices running in an enterprise environment may restrict access to HealthKit data.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable Apple Docs}\n * @returns {boolean | null} true if HealthKit is available; otherwise, false. null while initializing.\n */\n useIsHealthDataAvailable,\n /**\n * @description Hook to retrieve the current authorization status for the given types, and request authorization if needed.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614152-requestauthorization Apple Docs - requestAuthorization}\n * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Apple Docs - Authorizing access to health data}\n */\n useHealthkitAuthorization,\n useSources,\n useStatisticsForQuantity,\n}\n\nexport {\n authorizationStatusFor,\n availableQuantityTypes,\n disableAllBackgroundDelivery,\n disableBackgroundDelivery,\n enableBackgroundDelivery,\n getBiologicalSex,\n getBloodType,\n getDateOfBirth,\n getFitzpatrickSkinType,\n getMostRecentCategorySample,\n getMostRecentQuantitySample,\n getMostRecentWorkout,\n getPreferredUnit,\n getPreferredUnits,\n getRequestStatusForAuthorization,\n getWheelchairUse,\n getWorkoutRoutes,\n isHealthDataAvailable,\n queryCategorySamples,\n queryCategorySamplesWithAnchor,\n queryCorrelationSamples,\n queryHeartbeatSeriesSamples,\n queryHeartbeatSeriesSamplesWithAnchor,\n queryQuantitySamples,\n queryQuantitySamplesWithAnchor,\n queryStatisticsForQuantity,\n queryWorkouts,\n querySources,\n requestAuthorization,\n deleteQuantitySample,\n deleteSamples,\n getWorkoutPlanById,\n saveCategorySample,\n saveCorrelationSample,\n saveQuantitySample,\n saveWorkoutSample,\n saveWorkoutRoute,\n subscribeToChanges,\n useMostRecentCategorySample,\n useMostRecentQuantitySample,\n useMostRecentWorkout,\n useSubscribeToChanges,\n useHealthkitAuthorization,\n useIsHealthDataAvailable,\n useSources,\n useStatisticsForQuantity,\n isProtectedDataAvailable,\n}\n\nexport * from './types'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AChBM,kBAAkB,EAAlBA,2BAAkB;EAElBC,gBAAgB,EAAhBA,yBAAgB;EAChBC,iBAAiB,EAAjBA,0BAAiB;EACjBC,gCAAgC,EAAhCA,yCAAgC;EAEhC;EACAC,oBAAoB,EAApBA,6BAAoB;EACpBC,8BAA8B,EAA9BA,uCAA8B;EAC9BC,uBAAuB,EAAvBA,gCAAuB;EACvBC,2BAA2B,EAA3BA,oCAA2B;EAC3BC,qCAAqC,EAArCA,8CAAqC;EACrCC,oBAAoB,EAApBA,6BAAoB;EACpBC,8BAA8B,EAA9BA,uCAA8B;EAC9BC,0BAA0B,EAA1BA,mCAA0B;EAC1BC,aAAa,EAAbA,sBAAa;EACbC,YAAY,EAAZA,qBAAY;EAEZC,oBAAoB,EAApBA,6BAAoB;EAEpB;EACAC,oBAAoB,EAApBA,6BAAoB;EACpBC,aAAa,EAAbA,sBAAa;EAEb;EACA;AACF;AACA;AACA;EACEC,kBAAkB,EAAlBA,2BAAkB;EAClBC,qBAAqB,EAArBA,8BAAqB;EACrBC,kBAAkB,EAAlBA,2BAAkB;EAClBC,iBAAiB,EAAjBA,0BAAiB;EACjBC,gBAAgB,EAAhBA,yBAAgB;EAEhB;EACAC,kBAAkB,EAAlBA,2BAAkB;EAElB;AACF;AACA;EACEC,2BAA2B,EAA3BA,oCAA2B;EAC3B;AACF;AACA;EACEC,2BAA2B,EAA3BA,oCAA2B;EAC3B;AACF;AACA;EACEC,oBAAoB,EAApBA,6BAAoB;EACpBC,qBAAqB,EAArBA,8BAAqB;EACrB;AACF;AACA;AACA;AACA;EACEC,wBAAwB,EAAxBA,iCAAwB;EACxB;AACF;AACA;AACA;AACA;EACEC,yBAAyB,EAAzBA,kCAAyB;EACzBC,UAAU,EAAVA,mBAAU;EACVC,wBAAwB,EAAxBA;AACF,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_useHealthkitAuthorization","_interopRequireDefault","_useIsHealthDataAvailable","_useMostRecentCategorySample","_useMostRecentQuantitySample","_useMostRecentWorkout","_useSources","_useStatisticsForQuantity","_useSubscribeToChanges","_nativeTypes","_interopRequireWildcard","_deleteQuantitySample","_deleteSamples","_getDateOfBirth","_getMostRecentCategorySample","_getMostRecentQuantitySample","_getMostRecentWorkout","_getPreferredUnit","_getPreferredUnits","_getRequestStatusForAuthorization","_getWorkoutPlanById","_queryCategorySamples","_queryCategorySamplesWithAnchor","_queryCorrelationSamples","_queryHeartbeatSeriesSamples","_queryHeartbeatSeriesSamplesWithAnchor","_queryQuantitySamples","_queryQuantitySamplesWithAnchor","_querySources","_queryStatisticsForQuantity","_queryWorkouts","_queryWorkoutSamplesWithAnchor","_requestAuthorization","_saveCategorySample","_saveCorrelationSample","_saveQuantitySample","_saveWorkoutRoute","_saveWorkoutSample","_subscribeToChanges","_types","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","n","__proto__","a","getOwnPropertyDescriptor","u","i","set","currentMajorVersionIOS","Platform","OS","parseInt","Version","allQuantityTypesList","values","HKQuantityTypeIdentifier","availableQuantityTypes","majorVersionIOS","filter","type","cyclingCadence","cyclingFunctionalThresholdPower","cyclingPower","cyclingSpeed","physicalEffort","timeInDaylight","includes","authorizationStatusFor","Native","bind","isHealthDataAvailable","isProtectedDataAvailable","disableBackgroundDelivery","disableAllBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","getFitzpatrickSkinType","getWheelchairUse","getBloodType","getWorkoutRoutes","_default","getDateOfBirth","getMostRecentQuantitySample","getMostRecentCategorySample","getMostRecentWorkout","getWorkoutPlanById","getPreferredUnit","getPreferredUnits","getRequestStatusForAuthorization","queryCategorySamples","queryCategorySamplesWithAnchor","queryCorrelationSamples","queryHeartbeatSeriesSamples","queryHeartbeatSeriesSamplesWithAnchor","queryQuantitySamples","queryQuantitySamplesWithAnchor","queryStatisticsForQuantity","queryWorkouts","queryWorkoutSamples","queryWorkoutSamplesWithAnchor","querySources","requestAuthorization","deleteQuantitySample","deleteSamples","saveCategorySample","saveCorrelationSample","saveQuantitySample","saveWorkoutSample","saveWorkoutRoute","subscribeToChanges","useMostRecentCategorySample","useMostRecentQuantitySample","useMostRecentWorkout","useSubscribeToChanges","useIsHealthDataAvailable","useHealthkitAuthorization","useSources","useStatisticsForQuantity"],"sources":["index.ios.tsx"],"sourcesContent":["import { Platform } from 'react-native'\n\nimport useHealthkitAuthorization from './hooks/useHealthkitAuthorization'\nimport useIsHealthDataAvailable from './hooks/useIsHealthDataAvailable'\nimport useMostRecentCategorySample from './hooks/useMostRecentCategorySample'\nimport useMostRecentQuantitySample from './hooks/useMostRecentQuantitySample'\nimport useMostRecentWorkout from './hooks/useMostRecentWorkout'\nimport useSources from './hooks/useSources'\nimport useStatisticsForQuantity from './hooks/useStatisticsForQuantity'\nimport useSubscribeToChanges from './hooks/useSubscribeToChanges'\nimport Native, { HKQuantityTypeIdentifier } from './native-types'\nimport deleteQuantitySample from './utils/deleteQuantitySample'\nimport deleteSamples from './utils/deleteSamples'\nimport getDateOfBirth from './utils/getDateOfBirth'\nimport getMostRecentCategorySample from './utils/getMostRecentCategorySample'\nimport getMostRecentQuantitySample from './utils/getMostRecentQuantitySample'\nimport getMostRecentWorkout from './utils/getMostRecentWorkout'\nimport getPreferredUnit from './utils/getPreferredUnit'\nimport getPreferredUnits from './utils/getPreferredUnits'\nimport getRequestStatusForAuthorization from './utils/getRequestStatusForAuthorization'\nimport getWorkoutPlanById from './utils/getWorkoutPlanById'\nimport queryCategorySamples from './utils/queryCategorySamples'\nimport queryCategorySamplesWithAnchor from './utils/queryCategorySamplesWithAnchor'\nimport queryCorrelationSamples from './utils/queryCorrelationSamples'\nimport queryHeartbeatSeriesSamples from './utils/queryHeartbeatSeriesSamples'\nimport queryHeartbeatSeriesSamplesWithAnchor from './utils/queryHeartbeatSeriesSamplesWithAnchor'\nimport queryQuantitySamples from './utils/queryQuantitySamples'\nimport queryQuantitySamplesWithAnchor from './utils/queryQuantitySamplesWithAnchor'\nimport querySources from './utils/querySources'\nimport queryStatisticsForQuantity from './utils/queryStatisticsForQuantity'\nimport queryWorkoutSamples from './utils/queryWorkouts'\nimport queryWorkoutSamplesWithAnchor from './utils/queryWorkoutSamplesWithAnchor'\nimport requestAuthorization from './utils/requestAuthorization'\nimport saveCategorySample from './utils/saveCategorySample'\nimport saveCorrelationSample from './utils/saveCorrelationSample'\nimport saveQuantitySample from './utils/saveQuantitySample'\nimport saveWorkoutRoute from './utils/saveWorkoutRoute'\nimport saveWorkoutSample from './utils/saveWorkoutSample'\nimport subscribeToChanges from './utils/subscribeToChanges'\n\nconst currentMajorVersionIOS = Platform.OS === 'ios' ? parseInt(Platform.Version, 10) : 0\n\nconst allQuantityTypesList = [...Object.values(HKQuantityTypeIdentifier)]\n\nconst availableQuantityTypes = (majorVersionIOS = currentMajorVersionIOS) => {\n if (majorVersionIOS >= 17) {\n return allQuantityTypesList\n }\n\n // remove types that are not available before iOS 17\n return allQuantityTypesList.filter((type) => ![\n HKQuantityTypeIdentifier.cyclingCadence,\n HKQuantityTypeIdentifier.cyclingFunctionalThresholdPower,\n HKQuantityTypeIdentifier.cyclingPower,\n HKQuantityTypeIdentifier.cyclingSpeed,\n HKQuantityTypeIdentifier.physicalEffort,\n HKQuantityTypeIdentifier.timeInDaylight,\n ].includes(type))\n}\n\nconst authorizationStatusFor = Native.authorizationStatusFor.bind(Native)\nconst isHealthDataAvailable = Native.isHealthDataAvailable.bind(Native)\nconst isProtectedDataAvailable = Native.isProtectedDataAvailable.bind(Native)\nconst disableBackgroundDelivery = Native.disableBackgroundDelivery.bind(Native)\nconst disableAllBackgroundDelivery = Native.disableAllBackgroundDelivery.bind(Native)\nconst enableBackgroundDelivery = Native.enableBackgroundDelivery.bind(Native)\nconst getBiologicalSex = Native.getBiologicalSex.bind(Native)\nconst getFitzpatrickSkinType = Native.getFitzpatrickSkinType.bind(Native)\nconst getWheelchairUse = Native.getWheelchairUse.bind(Native)\nconst getBloodType = Native.getBloodType.bind(Native)\nconst getWorkoutRoutes = Native.getWorkoutRoutes.bind(Native)\n\n/**\n * @see {@link https://developer.apple.com/documentation/healthkit/about_the_healthkit_framework About the HealthKit Framework (Apple Docs)}\n */\nexport default {\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614154-authorizationstatus authorizationStatus(for:) (Apple Docs) }\n * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Authorizing access to health data (Apple Docs) }\n */\n authorizationStatusFor,\n\n /**\n *\n * @returns All available quantity types for the current iOS version (currently excluding types that are not available before iOS 17)\n */\n availableQuantityTypes,\n\n /**\n * @description By default, HealthKit data is available on iOS and watchOS. HealthKit data is also available on iPadOS 17 or later. However, devices running in an enterprise environment may restrict access to HealthKit data.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable isHealthDataAvailable() (Apple Docs)}\n * @returns {boolean} true if HealthKit is available; otherwise, false.\n */\n isHealthDataAvailable,\n\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614181-isprotecteddataavailable isProtectedDataAvailable() (Apple Docs)}\n * @see {@link https://developer.apple.com/documentation/healthkit/protecting_user_privacy#3705074 Protecting User Privacy - Access encrypted data (Apple Docs)}\n * @returns {boolean} A Boolean value that indicates whether content protection is active.\n */\n isProtectedDataAvailable,\n\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614158-disableallbackgrounddelivery disableAllBackgroundDelivery(completion:) (Apple Docs)}\n */\n disableAllBackgroundDelivery,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614177-disablebackgrounddelivery disableBackgroundDelivery(for:withCompletion:) (Apple Docs)}\n */\n disableBackgroundDelivery,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614175-enablebackgrounddelivery enableBackgroundDelivery(for:frequency:withCompletion:) (Apple Docs)}\n */\n enableBackgroundDelivery,\n\n // simple convenience getters\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614171-biologicalsex biologicalSex() (Apple Docs)}\n */\n getBiologicalSex,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614161-fitzpatrickskintype fitzpatrickSkinType() (Apple Docs)}\n */\n getFitzpatrickSkinType,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648356-wheelchairuse wheelchairUse() (Apple Docs)}\n */\n getWheelchairUse,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614164-bloodtype bloodType() (Apple Docs)}\n */\n getBloodType,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648357-dateofbirthcomponents dateOfBirthComponents() (Apple Docs)}\n */\n getDateOfBirth,\n\n getMostRecentQuantitySample,\n getMostRecentCategorySample,\n getMostRecentWorkout,\n\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/workouts_and_activity_rings/reading_route_data Reading route data (Apple Docs)}\n * @see {@link https://developer.apple.com/documentation/healthkit/hkworkoutroutequery HKWorkoutRouteQuery (Apple Docs)}\n */\n getWorkoutRoutes,\n getWorkoutPlanById,\n\n getPreferredUnit,\n getPreferredUnits,\n getRequestStatusForAuthorization,\n\n // query methods\n queryCategorySamples,\n queryCategorySamplesWithAnchor,\n queryCorrelationSamples,\n queryHeartbeatSeriesSamples,\n queryHeartbeatSeriesSamplesWithAnchor,\n queryQuantitySamples,\n queryQuantitySamplesWithAnchor,\n queryStatisticsForQuantity,\n /**\n * @deprecated Use queryWorkoutSamples instead\n */\n queryWorkouts: queryWorkoutSamples,\n queryWorkoutSamples,\n queryWorkoutSamplesWithAnchor,\n querySources,\n\n requestAuthorization,\n\n // delete methods\n deleteQuantitySample,\n deleteSamples,\n\n // save methods\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614168-savecategorysample save(_:withCompletion:) (Apple Docs)}\n * @see {@link https://developer.apple.com/documentation/healthkit/saving_data_to_healthkit Saving data to HealthKit (Apple Docs)}\n */\n saveCategorySample,\n saveCorrelationSample,\n saveQuantitySample,\n saveWorkoutSample,\n saveWorkoutRoute,\n\n // subscriptions\n subscribeToChanges,\n\n /**\n * @returns the most recent sample for the given category type.\n */\n useMostRecentCategorySample,\n /**\n * @returns the most recent sample for the given quantity type.\n */\n useMostRecentQuantitySample,\n /**\n * @returns the most recent workout sample.\n */\n useMostRecentWorkout,\n useSubscribeToChanges,\n /**\n * @description By default, HealthKit data is available on iOS and watchOS. HealthKit data is also available on iPadOS 17 or later. However, devices running in an enterprise environment may restrict access to HealthKit data.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable Apple Docs}\n * @returns {boolean | null} true if HealthKit is available; otherwise, false. null while initializing.\n */\n useIsHealthDataAvailable,\n /**\n * @description Hook to retrieve the current authorization status for the given types, and request authorization if needed.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614152-requestauthorization Apple Docs - requestAuthorization}\n * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Apple Docs - Authorizing access to health data}\n */\n useHealthkitAuthorization,\n useSources,\n useStatisticsForQuantity,\n}\n\nconst queryWorkouts = queryWorkoutSamples\n\nexport {\n authorizationStatusFor,\n availableQuantityTypes,\n disableAllBackgroundDelivery,\n disableBackgroundDelivery,\n enableBackgroundDelivery,\n getBiologicalSex,\n getBloodType,\n getDateOfBirth,\n getFitzpatrickSkinType,\n getMostRecentCategorySample,\n getMostRecentQuantitySample,\n getMostRecentWorkout,\n getPreferredUnit,\n getPreferredUnits,\n getRequestStatusForAuthorization,\n getWheelchairUse,\n getWorkoutRoutes,\n isHealthDataAvailable,\n queryCategorySamples,\n queryCategorySamplesWithAnchor,\n queryCorrelationSamples,\n queryHeartbeatSeriesSamples,\n queryHeartbeatSeriesSamplesWithAnchor,\n queryQuantitySamples,\n queryQuantitySamplesWithAnchor,\n queryStatisticsForQuantity,\n /**\n * @deprecated Use queryWorkoutSamples instead\n */\n queryWorkouts,\n queryWorkoutSamples,\n queryWorkoutSamplesWithAnchor,\n querySources,\n requestAuthorization,\n deleteQuantitySample,\n deleteSamples,\n getWorkoutPlanById,\n saveCategorySample,\n saveCorrelationSample,\n saveQuantitySample,\n saveWorkoutSample,\n saveWorkoutRoute,\n subscribeToChanges,\n useMostRecentCategorySample,\n useMostRecentQuantitySample,\n useMostRecentWorkout,\n useSubscribeToChanges,\n useHealthkitAuthorization,\n useIsHealthDataAvailable,\n useSources,\n useStatisticsForQuantity,\n isProtectedDataAvailable,\n}\n\nexport * from './types'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,0BAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,yBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,4BAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,4BAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,qBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,WAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,yBAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,sBAAA,GAAAP,sBAAA,CAAAF,OAAA;AACA,IAAAU,YAAA,GAAAC,uBAAA,CAAAX,OAAA;AACA,IAAAY,qBAAA,GAAAV,sBAAA,CAAAF,OA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EC,kBAAkB,EAAlBA,2BAAkB;EAClBC,qBAAqB,EAArBA,8BAAqB;EACrBC,kBAAkB,EAAlBA,2BAAkB;EAClBC,iBAAiB,EAAjBA,0BAAiB;EACjBC,gBAAgB,EAAhBA,yBAAgB;EAEhB;EACAC,kBAAkB,EAAlBA,2BAAkB;EAElB;AACF;AACA;EACEC,2BAA2B,EAA3BA,oCAA2B;EAC3B;AACF;AACA;EACEC,2BAA2B,EAA3BA,oCAA2B;EAC3B;AACF;AACA;EACEC,oBAAoB,EAApBA,6BAAoB;EACpBC,qBAAqB,EAArBA,8BAAqB;EACrB;AACF;AACA;AACA;AACA;EACEC,wBAAwB,EAAxBA,iCAAwB;EACxB;AACF;AACA;AACA;AACA;EACEC,yBAAyB,EAAzBA,kCAAyB;EACzBC,UAAU,EAAVA,mBAAU;EACVC,wBAAwB,EAAxBA;AACF,CAAC;AAED,MAAMpB,aAAa,GAAApE,OAAA,CAAAoE,aAAA,GAAGC,sBAAmB","ignoreList":[]}
|
|
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
var _exportNames = {
|
|
7
7
|
authorizationStatusFor: true,
|
|
8
8
|
availableQuantityTypes: true,
|
|
9
|
+
deleteQuantitySample: true,
|
|
10
|
+
deleteSamples: true,
|
|
9
11
|
disableAllBackgroundDelivery: true,
|
|
10
12
|
disableBackgroundDelivery: true,
|
|
11
13
|
enableBackgroundDelivery: true,
|
|
12
|
-
useSources: true,
|
|
13
|
-
useStatisticsForQuantity: true,
|
|
14
14
|
getBiologicalSex: true,
|
|
15
15
|
getBloodType: true,
|
|
16
16
|
getDateOfBirth: true,
|
|
@@ -22,8 +22,10 @@ var _exportNames = {
|
|
|
22
22
|
getPreferredUnits: true,
|
|
23
23
|
getRequestStatusForAuthorization: true,
|
|
24
24
|
getWheelchairUse: true,
|
|
25
|
+
getWorkoutPlanById: true,
|
|
25
26
|
getWorkoutRoutes: true,
|
|
26
27
|
isHealthDataAvailable: true,
|
|
28
|
+
isProtectedDataAvailable: true,
|
|
27
29
|
queryCategorySamples: true,
|
|
28
30
|
queryCategorySamplesWithAnchor: true,
|
|
29
31
|
queryCorrelationSamples: true,
|
|
@@ -31,28 +33,28 @@ var _exportNames = {
|
|
|
31
33
|
queryHeartbeatSeriesSamplesWithAnchor: true,
|
|
32
34
|
queryQuantitySamples: true,
|
|
33
35
|
queryQuantitySamplesWithAnchor: true,
|
|
36
|
+
querySources: true,
|
|
34
37
|
queryStatisticsForQuantity: true,
|
|
35
38
|
queryWorkouts: true,
|
|
36
|
-
|
|
39
|
+
queryWorkoutSamples: true,
|
|
40
|
+
queryWorkoutSamplesWithAnchor: true,
|
|
37
41
|
requestAuthorization: true,
|
|
38
|
-
deleteQuantitySample: true,
|
|
39
|
-
deleteSamples: true,
|
|
40
|
-
getWorkoutPlanById: true,
|
|
41
42
|
saveCategorySample: true,
|
|
42
43
|
saveCorrelationSample: true,
|
|
43
44
|
saveQuantitySample: true,
|
|
44
|
-
saveWorkoutSample: true,
|
|
45
45
|
saveWorkoutRoute: true,
|
|
46
|
+
saveWorkoutSample: true,
|
|
46
47
|
subscribeToChanges: true,
|
|
48
|
+
useHealthkitAuthorization: true,
|
|
49
|
+
useIsHealthDataAvailable: true,
|
|
47
50
|
useMostRecentCategorySample: true,
|
|
48
51
|
useMostRecentQuantitySample: true,
|
|
49
52
|
useMostRecentWorkout: true,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
isProtectedDataAvailable: true
|
|
53
|
+
useSources: true,
|
|
54
|
+
useStatisticsForQuantity: true,
|
|
55
|
+
useSubscribeToChanges: true
|
|
54
56
|
};
|
|
55
|
-
exports.useSubscribeToChanges = exports.useStatisticsForQuantity = exports.useSources = exports.useMostRecentWorkout = exports.useMostRecentQuantitySample = exports.useMostRecentCategorySample = exports.useIsHealthDataAvailable = exports.useHealthkitAuthorization = exports.subscribeToChanges = exports.saveWorkoutSample = exports.saveWorkoutRoute = exports.saveQuantitySample = exports.saveCorrelationSample = exports.saveCategorySample = exports.requestAuthorization = exports.queryWorkouts = exports.queryStatisticsForQuantity = exports.querySources = exports.queryQuantitySamplesWithAnchor = exports.queryQuantitySamples = exports.queryHeartbeatSeriesSamplesWithAnchor = exports.queryHeartbeatSeriesSamples = exports.queryCorrelationSamples = exports.queryCategorySamplesWithAnchor = exports.queryCategorySamples = exports.isProtectedDataAvailable = exports.isHealthDataAvailable = exports.getWorkoutRoutes = exports.getWorkoutPlanById = exports.getWheelchairUse = exports.getRequestStatusForAuthorization = exports.getPreferredUnits = exports.getPreferredUnit = exports.getMostRecentWorkout = exports.getMostRecentQuantitySample = exports.getMostRecentCategorySample = exports.getFitzpatrickSkinType = exports.getDateOfBirth = exports.getBloodType = exports.getBiologicalSex = exports.enableBackgroundDelivery = exports.disableBackgroundDelivery = exports.disableAllBackgroundDelivery = exports.deleteSamples = exports.deleteQuantitySample = exports.default = exports.availableQuantityTypes = exports.authorizationStatusFor = void 0;
|
|
57
|
+
exports.useSubscribeToChanges = exports.useStatisticsForQuantity = exports.useSources = exports.useMostRecentWorkout = exports.useMostRecentQuantitySample = exports.useMostRecentCategorySample = exports.useIsHealthDataAvailable = exports.useHealthkitAuthorization = exports.subscribeToChanges = exports.saveWorkoutSample = exports.saveWorkoutRoute = exports.saveQuantitySample = exports.saveCorrelationSample = exports.saveCategorySample = exports.requestAuthorization = exports.queryWorkouts = exports.queryWorkoutSamplesWithAnchor = exports.queryWorkoutSamples = exports.queryStatisticsForQuantity = exports.querySources = exports.queryQuantitySamplesWithAnchor = exports.queryQuantitySamples = exports.queryHeartbeatSeriesSamplesWithAnchor = exports.queryHeartbeatSeriesSamples = exports.queryCorrelationSamples = exports.queryCategorySamplesWithAnchor = exports.queryCategorySamples = exports.isProtectedDataAvailable = exports.isHealthDataAvailable = exports.getWorkoutRoutes = exports.getWorkoutPlanById = exports.getWheelchairUse = exports.getRequestStatusForAuthorization = exports.getPreferredUnits = exports.getPreferredUnit = exports.getMostRecentWorkout = exports.getMostRecentQuantitySample = exports.getMostRecentCategorySample = exports.getFitzpatrickSkinType = exports.getDateOfBirth = exports.getBloodType = exports.getBiologicalSex = exports.enableBackgroundDelivery = exports.disableBackgroundDelivery = exports.disableAllBackgroundDelivery = exports.deleteSamples = exports.deleteQuantitySample = exports.default = exports.availableQuantityTypes = exports.authorizationStatusFor = void 0;
|
|
56
58
|
var _reactNative = require("react-native");
|
|
57
59
|
var _nativeTypes = require("./native-types");
|
|
58
60
|
var _types = require("./types");
|
|
@@ -128,6 +130,12 @@ const authorizationStatusFor = exports.authorizationStatusFor = UnavailableFn(Pr
|
|
|
128
130
|
duration: undefined
|
|
129
131
|
})),
|
|
130
132
|
queryWorkouts = exports.queryWorkouts = UnavailableFn(Promise.resolve([])),
|
|
133
|
+
queryWorkoutSamples = exports.queryWorkoutSamples = UnavailableFn(Promise.resolve([])),
|
|
134
|
+
queryWorkoutSamplesWithAnchor = exports.queryWorkoutSamplesWithAnchor = UnavailableFn(Promise.resolve({
|
|
135
|
+
samples: [],
|
|
136
|
+
deletedSamples: [],
|
|
137
|
+
newAnchor: ''
|
|
138
|
+
})),
|
|
131
139
|
querySources = exports.querySources = UnavailableFn(Promise.resolve([])),
|
|
132
140
|
requestAuthorization = exports.requestAuthorization = UnavailableFn(Promise.resolve(false)),
|
|
133
141
|
deleteQuantitySample = exports.deleteQuantitySample = UnavailableFn(Promise.resolve(false)),
|
|
@@ -152,8 +160,8 @@ exports.isHealthDataAvailable = isHealthDataAvailable;
|
|
|
152
160
|
const Healthkit = {
|
|
153
161
|
authorizationStatusFor,
|
|
154
162
|
availableQuantityTypes,
|
|
155
|
-
|
|
156
|
-
|
|
163
|
+
deleteQuantitySample,
|
|
164
|
+
deleteSamples,
|
|
157
165
|
disableAllBackgroundDelivery,
|
|
158
166
|
disableBackgroundDelivery,
|
|
159
167
|
enableBackgroundDelivery,
|
|
@@ -168,8 +176,10 @@ const Healthkit = {
|
|
|
168
176
|
getPreferredUnits,
|
|
169
177
|
getRequestStatusForAuthorization,
|
|
170
178
|
getWheelchairUse,
|
|
179
|
+
getWorkoutPlanById,
|
|
171
180
|
getWorkoutRoutes,
|
|
172
181
|
isHealthDataAvailable,
|
|
182
|
+
isProtectedDataAvailable,
|
|
173
183
|
queryCategorySamples,
|
|
174
184
|
queryCategorySamplesWithAnchor,
|
|
175
185
|
queryCorrelationSamples,
|
|
@@ -177,26 +187,26 @@ const Healthkit = {
|
|
|
177
187
|
queryHeartbeatSeriesSamplesWithAnchor,
|
|
178
188
|
queryQuantitySamples,
|
|
179
189
|
queryQuantitySamplesWithAnchor,
|
|
190
|
+
querySources,
|
|
180
191
|
queryStatisticsForQuantity,
|
|
181
192
|
queryWorkouts,
|
|
182
|
-
|
|
193
|
+
queryWorkoutSamples,
|
|
194
|
+
queryWorkoutSamplesWithAnchor,
|
|
183
195
|
requestAuthorization,
|
|
184
|
-
deleteQuantitySample,
|
|
185
|
-
deleteSamples,
|
|
186
|
-
getWorkoutPlanById,
|
|
187
196
|
saveCategorySample,
|
|
188
197
|
saveCorrelationSample,
|
|
189
198
|
saveQuantitySample,
|
|
190
|
-
saveWorkoutSample,
|
|
191
199
|
saveWorkoutRoute,
|
|
200
|
+
saveWorkoutSample,
|
|
192
201
|
subscribeToChanges,
|
|
202
|
+
useHealthkitAuthorization,
|
|
203
|
+
useIsHealthDataAvailable,
|
|
193
204
|
useMostRecentCategorySample,
|
|
194
205
|
useMostRecentQuantitySample,
|
|
195
206
|
useMostRecentWorkout,
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
isProtectedDataAvailable
|
|
207
|
+
useSources,
|
|
208
|
+
useStatisticsForQuantity,
|
|
209
|
+
useSubscribeToChanges
|
|
200
210
|
};
|
|
201
211
|
var _default = exports.default = Healthkit;
|
|
202
212
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_nativeTypes","_types","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","notAvailableError","Platform","OS","hasWarned","UnavailableFn","retVal","console","warn","authorizationStatusFor","Promise","resolve","HKAuthorizationStatus","notDetermined","availableQuantityTypes","disableAllBackgroundDelivery","disableBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","HKBiologicalSex","notSet","getBloodType","HKBloodType","getDateOfBirth","Date","getFitzpatrickSkinType","HKFitzpatrickSkinType","getMostRecentCategorySample","getMostRecentQuantitySample","getMostRecentWorkout","getPreferredUnit","HKUnits","Count","getPreferredUnits","getRequestStatusForAuthorization","HKAuthorizationRequestStatus","unknown","getWheelchairUse","HKWheelchairUse","getWorkoutRoutes","isHealthDataAvailable","useSources","useStatisticsForQuantity","queryCategorySamples","queryCategorySamplesWithAnchor","samples","deletedSamples","newAnchor","queryCorrelationSamples","queryHeartbeatSeriesSamples","queryHeartbeatSeriesSamplesWithAnchor","queryQuantitySamples","queryQuantitySamplesWithAnchor","queryStatisticsForQuantity","averageQuantity","undefined","maximumQuantity","minimumQuantity","sumQuantity","mostRecentQuantity","mostRecentQuantityDateInterval","duration","queryWorkouts","querySources","requestAuthorization","deleteQuantitySample","deleteSamples","getWorkoutPlanById","saveCategorySample","saveCorrelationSample","saveQuantitySample","saveWorkoutSample","saveWorkoutRoute","subscribeToChanges","useMostRecentCategorySample","useMostRecentQuantitySample","useMostRecentWorkout","useSubscribeToChanges","useHealthkitAuthorization","useIsHealthDataAvailable","isProtectedDataAvailable","Healthkit","_default","default"],"sources":["index.native.tsx"],"sourcesContent":["import { Platform } from 'react-native'\n\nimport {\n HKAuthorizationRequestStatus, HKAuthorizationStatus, HKBiologicalSex, HKBloodType, HKFitzpatrickSkinType, HKUnits, HKWheelchairUse,\n} from './native-types'\n\nimport type ReactNativeHealthkit from './index.ios'\nimport type { QueryCategorySamplesFn } from './utils/queryCategorySamples'\nimport type { QueryQuantitySamplesFn } from './utils/queryQuantitySamples'\n\nconst notAvailableError = `[@kingstinct/react-native-healthkit] Platform \"${\n Platform.OS\n}\" not supported`\n\nlet hasWarned = false\n\nfunction UnavailableFn<T = unknown>(retVal: T) {\n return () => {\n if (!hasWarned) {\n // eslint-disable-next-line no-console\n console.warn(notAvailableError)\n hasWarned = true\n }\n return retVal\n }\n}\n\nconst authorizationStatusFor = UnavailableFn(Promise.resolve(HKAuthorizationStatus.notDetermined)),\n availableQuantityTypes = UnavailableFn([]),\n disableAllBackgroundDelivery = UnavailableFn(Promise.resolve(false)),\n disableBackgroundDelivery = UnavailableFn(Promise.resolve(false)),\n enableBackgroundDelivery = UnavailableFn(Promise.resolve(false)),\n getBiologicalSex = UnavailableFn(Promise.resolve(HKBiologicalSex.notSet)),\n getBloodType = UnavailableFn(Promise.resolve(HKBloodType.notSet)),\n getDateOfBirth = UnavailableFn(Promise.resolve(new Date(0))),\n getFitzpatrickSkinType = UnavailableFn(Promise.resolve(HKFitzpatrickSkinType.notSet)),\n getMostRecentCategorySample = UnavailableFn(Promise.resolve(null)),\n getMostRecentQuantitySample = UnavailableFn(Promise.resolve(null)),\n getMostRecentWorkout = UnavailableFn(Promise.resolve(null)),\n getPreferredUnit = UnavailableFn(Promise.resolve(HKUnits.Count)),\n getPreferredUnits = UnavailableFn(Promise.resolve([])),\n getRequestStatusForAuthorization = UnavailableFn(Promise.resolve(HKAuthorizationRequestStatus.unknown)),\n getWheelchairUse = UnavailableFn(Promise.resolve(HKWheelchairUse.notSet)),\n getWorkoutRoutes = UnavailableFn(Promise.resolve([])),\n isHealthDataAvailable = async () => Promise.resolve(false),\n useSources = UnavailableFn(null),\n useStatisticsForQuantity = UnavailableFn(null),\n queryCategorySamples = UnavailableFn(Promise.resolve([])) as unknown as QueryCategorySamplesFn,\n queryCategorySamplesWithAnchor = UnavailableFn(Promise.resolve({\n samples: [],\n deletedSamples: [],\n newAnchor: '',\n })),\n queryCorrelationSamples = UnavailableFn(Promise.resolve([])),\n queryHeartbeatSeriesSamples = UnavailableFn(Promise.resolve([])),\n queryHeartbeatSeriesSamplesWithAnchor = UnavailableFn(Promise.resolve({\n samples: [],\n deletedSamples: [],\n newAnchor: '',\n })),\n queryQuantitySamples = UnavailableFn(Promise.resolve([])) as unknown as QueryQuantitySamplesFn,\n queryQuantitySamplesWithAnchor = UnavailableFn(Promise.resolve({\n samples: [],\n deletedSamples: [],\n newAnchor: '',\n })),\n queryStatisticsForQuantity = UnavailableFn(Promise.resolve({\n averageQuantity: undefined,\n maximumQuantity: undefined,\n minimumQuantity: undefined,\n sumQuantity: undefined,\n mostRecentQuantity: undefined,\n mostRecentQuantityDateInterval: undefined,\n duration: undefined,\n })),\n queryWorkouts = UnavailableFn(Promise.resolve([])),\n querySources = UnavailableFn(Promise.resolve([])),\n requestAuthorization = UnavailableFn(Promise.resolve(false)),\n deleteQuantitySample = UnavailableFn(Promise.resolve(false)),\n deleteSamples = UnavailableFn(Promise.resolve(false)),\n getWorkoutPlanById = UnavailableFn(Promise.resolve(null)),\n saveCategorySample = UnavailableFn(Promise.resolve(false)),\n saveCorrelationSample = UnavailableFn(Promise.resolve(false)),\n saveQuantitySample = UnavailableFn(Promise.resolve(false)),\n saveWorkoutSample = UnavailableFn(Promise.resolve(null)),\n saveWorkoutRoute = UnavailableFn(Promise.resolve(false)),\n subscribeToChanges = UnavailableFn(Promise.resolve(async () => Promise.resolve(false))),\n useMostRecentCategorySample = UnavailableFn(null),\n useMostRecentQuantitySample = UnavailableFn(null),\n useMostRecentWorkout = UnavailableFn(null),\n useSubscribeToChanges = UnavailableFn([null, () => null]),\n useHealthkitAuthorization = UnavailableFn([null, async () => Promise.resolve(HKAuthorizationRequestStatus.unknown)] as const),\n useIsHealthDataAvailable = () => false,\n isProtectedDataAvailable = async () => Promise.resolve(false)\n\nconst Healthkit: typeof ReactNativeHealthkit = {\n authorizationStatusFor,\n availableQuantityTypes,\n useSources,\n useStatisticsForQuantity,\n disableAllBackgroundDelivery,\n disableBackgroundDelivery,\n enableBackgroundDelivery,\n getBiologicalSex,\n getBloodType,\n getDateOfBirth,\n getFitzpatrickSkinType,\n getMostRecentCategorySample,\n getMostRecentQuantitySample,\n getMostRecentWorkout,\n getPreferredUnit,\n getPreferredUnits,\n getRequestStatusForAuthorization,\n getWheelchairUse,\n getWorkoutRoutes,\n isHealthDataAvailable,\n queryCategorySamples,\n queryCategorySamplesWithAnchor,\n queryCorrelationSamples,\n queryHeartbeatSeriesSamples,\n queryHeartbeatSeriesSamplesWithAnchor,\n queryQuantitySamples,\n queryQuantitySamplesWithAnchor,\n queryStatisticsForQuantity,\n queryWorkouts,\n querySources,\n requestAuthorization,\n deleteQuantitySample,\n deleteSamples,\n getWorkoutPlanById,\n saveCategorySample,\n saveCorrelationSample,\n saveQuantitySample,\n saveWorkoutSample,\n saveWorkoutRoute,\n subscribeToChanges,\n useMostRecentCategorySample,\n useMostRecentQuantitySample,\n useMostRecentWorkout,\n useSubscribeToChanges,\n useHealthkitAuthorization,\n useIsHealthDataAvailable,\n isProtectedDataAvailable,\n}\n\nexport {\n authorizationStatusFor,\n availableQuantityTypes,\n disableAllBackgroundDelivery,\n disableBackgroundDelivery,\n enableBackgroundDelivery,\n useSources,\n useStatisticsForQuantity,\n getBiologicalSex,\n getBloodType,\n getDateOfBirth,\n getFitzpatrickSkinType,\n getMostRecentCategorySample,\n getMostRecentQuantitySample,\n getMostRecentWorkout,\n getPreferredUnit,\n getPreferredUnits,\n getRequestStatusForAuthorization,\n getWheelchairUse,\n getWorkoutRoutes,\n isHealthDataAvailable,\n queryCategorySamples,\n queryCategorySamplesWithAnchor,\n queryCorrelationSamples,\n queryHeartbeatSeriesSamples,\n queryHeartbeatSeriesSamplesWithAnchor,\n queryQuantitySamples,\n queryQuantitySamplesWithAnchor,\n queryStatisticsForQuantity,\n queryWorkouts,\n querySources,\n requestAuthorization,\n deleteQuantitySample,\n deleteSamples,\n getWorkoutPlanById,\n saveCategorySample,\n saveCorrelationSample,\n saveQuantitySample,\n saveWorkoutSample,\n saveWorkoutRoute,\n subscribeToChanges,\n useMostRecentCategorySample,\n useMostRecentQuantitySample,\n useMostRecentWorkout,\n useSubscribeToChanges,\n useHealthkitAuthorization,\n useIsHealthDataAvailable,\n isProtectedDataAvailable,\n}\n\nexport * from './types'\n\nexport default Healthkit\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AAiMA,IAAAE,MAAA,GAAAF,OAAA;AAAAG,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;AAzLA,MAAMS,iBAAiB,GAAG,kDACxBC,qBAAQ,CAACC,EAAE,iBACI;AAEjB,IAAIC,SAAS,GAAG,KAAK;AAErB,SAASC,aAAaA,CAAcC,MAAS,EAAE;EAC7C,OAAO,MAAM;IACX,IAAI,CAACF,SAAS,EAAE;MACd;MACAG,OAAO,CAACC,IAAI,CAACP,iBAAiB,CAAC;MAC/BG,SAAS,GAAG,IAAI;IAClB;IACA,OAAOE,MAAM;EACf,CAAC;AACH;AAEA,MAAMG,sBAAsB,GAAAZ,OAAA,CAAAY,sBAAA,GAAGJ,aAAa,CAACK,OAAO,CAACC,OAAO,CAACC,kCAAqB,CAACC,aAAa,CAAC,CAAC;EAC5FC,sBAAsB,GAAAjB,OAAA,CAAAiB,sBAAA,GAAGT,aAAa,CAAC,EAAE,CAAC;EAC1CU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F,OAAA,GAsDcF,SAAS","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_nativeTypes","_types","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","notAvailableError","Platform","OS","hasWarned","UnavailableFn","retVal","console","warn","authorizationStatusFor","Promise","resolve","HKAuthorizationStatus","notDetermined","availableQuantityTypes","disableAllBackgroundDelivery","disableBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","HKBiologicalSex","notSet","getBloodType","HKBloodType","getDateOfBirth","Date","getFitzpatrickSkinType","HKFitzpatrickSkinType","getMostRecentCategorySample","getMostRecentQuantitySample","getMostRecentWorkout","getPreferredUnit","HKUnits","Count","getPreferredUnits","getRequestStatusForAuthorization","HKAuthorizationRequestStatus","unknown","getWheelchairUse","HKWheelchairUse","getWorkoutRoutes","isHealthDataAvailable","useSources","useStatisticsForQuantity","queryCategorySamples","queryCategorySamplesWithAnchor","samples","deletedSamples","newAnchor","queryCorrelationSamples","queryHeartbeatSeriesSamples","queryHeartbeatSeriesSamplesWithAnchor","queryQuantitySamples","queryQuantitySamplesWithAnchor","queryStatisticsForQuantity","averageQuantity","undefined","maximumQuantity","minimumQuantity","sumQuantity","mostRecentQuantity","mostRecentQuantityDateInterval","duration","queryWorkouts","queryWorkoutSamples","queryWorkoutSamplesWithAnchor","querySources","requestAuthorization","deleteQuantitySample","deleteSamples","getWorkoutPlanById","saveCategorySample","saveCorrelationSample","saveQuantitySample","saveWorkoutSample","saveWorkoutRoute","subscribeToChanges","useMostRecentCategorySample","useMostRecentQuantitySample","useMostRecentWorkout","useSubscribeToChanges","useHealthkitAuthorization","useIsHealthDataAvailable","isProtectedDataAvailable","Healthkit","_default","default"],"sources":["index.native.tsx"],"sourcesContent":["import { Platform } from 'react-native'\n\nimport {\n HKAuthorizationRequestStatus, HKAuthorizationStatus, HKBiologicalSex, HKBloodType, HKFitzpatrickSkinType, HKUnits, HKWheelchairUse,\n} from './native-types'\n\nimport type ReactNativeHealthkit from './index.ios'\nimport type { QueryCategorySamplesFn } from './utils/queryCategorySamples'\nimport type { QueryQuantitySamplesFn } from './utils/queryQuantitySamples'\n\nconst notAvailableError = `[@kingstinct/react-native-healthkit] Platform \"${\n Platform.OS\n}\" not supported`\n\nlet hasWarned = false\n\nfunction UnavailableFn<T = unknown>(retVal: T) {\n return () => {\n if (!hasWarned) {\n // eslint-disable-next-line no-console\n console.warn(notAvailableError)\n hasWarned = true\n }\n return retVal\n }\n}\n\nconst authorizationStatusFor = UnavailableFn(Promise.resolve(HKAuthorizationStatus.notDetermined)),\n availableQuantityTypes = UnavailableFn([]),\n disableAllBackgroundDelivery = UnavailableFn(Promise.resolve(false)),\n disableBackgroundDelivery = UnavailableFn(Promise.resolve(false)),\n enableBackgroundDelivery = UnavailableFn(Promise.resolve(false)),\n getBiologicalSex = UnavailableFn(Promise.resolve(HKBiologicalSex.notSet)),\n getBloodType = UnavailableFn(Promise.resolve(HKBloodType.notSet)),\n getDateOfBirth = UnavailableFn(Promise.resolve(new Date(0))),\n getFitzpatrickSkinType = UnavailableFn(Promise.resolve(HKFitzpatrickSkinType.notSet)),\n getMostRecentCategorySample = UnavailableFn(Promise.resolve(null)),\n getMostRecentQuantitySample = UnavailableFn(Promise.resolve(null)),\n getMostRecentWorkout = UnavailableFn(Promise.resolve(null)),\n getPreferredUnit = UnavailableFn(Promise.resolve(HKUnits.Count)),\n getPreferredUnits = UnavailableFn(Promise.resolve([])),\n getRequestStatusForAuthorization = UnavailableFn(Promise.resolve(HKAuthorizationRequestStatus.unknown)),\n getWheelchairUse = UnavailableFn(Promise.resolve(HKWheelchairUse.notSet)),\n getWorkoutRoutes = UnavailableFn(Promise.resolve([])),\n isHealthDataAvailable = async () => Promise.resolve(false),\n useSources = UnavailableFn(null),\n useStatisticsForQuantity = UnavailableFn(null),\n queryCategorySamples = UnavailableFn(Promise.resolve([])) as unknown as QueryCategorySamplesFn,\n queryCategorySamplesWithAnchor = UnavailableFn(Promise.resolve({\n samples: [],\n deletedSamples: [],\n newAnchor: '',\n })),\n queryCorrelationSamples = UnavailableFn(Promise.resolve([])),\n queryHeartbeatSeriesSamples = UnavailableFn(Promise.resolve([])),\n queryHeartbeatSeriesSamplesWithAnchor = UnavailableFn(Promise.resolve({\n samples: [],\n deletedSamples: [],\n newAnchor: '',\n })),\n queryQuantitySamples = UnavailableFn(Promise.resolve([])) as unknown as QueryQuantitySamplesFn,\n queryQuantitySamplesWithAnchor = UnavailableFn(Promise.resolve({\n samples: [],\n deletedSamples: [],\n newAnchor: '',\n })),\n queryStatisticsForQuantity = UnavailableFn(Promise.resolve({\n averageQuantity: undefined,\n maximumQuantity: undefined,\n minimumQuantity: undefined,\n sumQuantity: undefined,\n mostRecentQuantity: undefined,\n mostRecentQuantityDateInterval: undefined,\n duration: undefined,\n })),\n queryWorkouts = UnavailableFn(Promise.resolve([])),\n queryWorkoutSamples = UnavailableFn(Promise.resolve([])),\n queryWorkoutSamplesWithAnchor = UnavailableFn(Promise.resolve({\n samples: [],\n deletedSamples: [],\n newAnchor: '',\n })),\n querySources = UnavailableFn(Promise.resolve([])),\n requestAuthorization = UnavailableFn(Promise.resolve(false)),\n deleteQuantitySample = UnavailableFn(Promise.resolve(false)),\n deleteSamples = UnavailableFn(Promise.resolve(false)),\n getWorkoutPlanById = UnavailableFn(Promise.resolve(null)),\n saveCategorySample = UnavailableFn(Promise.resolve(false)),\n saveCorrelationSample = UnavailableFn(Promise.resolve(false)),\n saveQuantitySample = UnavailableFn(Promise.resolve(false)),\n saveWorkoutSample = UnavailableFn(Promise.resolve(null)),\n saveWorkoutRoute = UnavailableFn(Promise.resolve(false)),\n subscribeToChanges = UnavailableFn(Promise.resolve(async () => Promise.resolve(false))),\n useMostRecentCategorySample = UnavailableFn(null),\n useMostRecentQuantitySample = UnavailableFn(null),\n useMostRecentWorkout = UnavailableFn(null),\n useSubscribeToChanges = UnavailableFn([null, () => null]),\n useHealthkitAuthorization = UnavailableFn([null, async () => Promise.resolve(HKAuthorizationRequestStatus.unknown)] as const),\n useIsHealthDataAvailable = () => false,\n isProtectedDataAvailable = async () => Promise.resolve(false)\n\nconst Healthkit: typeof ReactNativeHealthkit = {\n authorizationStatusFor,\n availableQuantityTypes,\n deleteQuantitySample,\n deleteSamples,\n disableAllBackgroundDelivery,\n disableBackgroundDelivery,\n enableBackgroundDelivery,\n getBiologicalSex,\n getBloodType,\n getDateOfBirth,\n getFitzpatrickSkinType,\n getMostRecentCategorySample,\n getMostRecentQuantitySample,\n getMostRecentWorkout,\n getPreferredUnit,\n getPreferredUnits,\n getRequestStatusForAuthorization,\n getWheelchairUse,\n getWorkoutPlanById,\n getWorkoutRoutes,\n isHealthDataAvailable,\n isProtectedDataAvailable,\n queryCategorySamples,\n queryCategorySamplesWithAnchor,\n queryCorrelationSamples,\n queryHeartbeatSeriesSamples,\n queryHeartbeatSeriesSamplesWithAnchor,\n queryQuantitySamples,\n queryQuantitySamplesWithAnchor,\n querySources,\n queryStatisticsForQuantity,\n queryWorkouts,\n queryWorkoutSamples,\n queryWorkoutSamplesWithAnchor,\n requestAuthorization,\n saveCategorySample,\n saveCorrelationSample,\n saveQuantitySample,\n saveWorkoutRoute,\n saveWorkoutSample,\n subscribeToChanges,\n useHealthkitAuthorization,\n useIsHealthDataAvailable,\n useMostRecentCategorySample,\n useMostRecentQuantitySample,\n useMostRecentWorkout,\n useSources,\n useStatisticsForQuantity,\n useSubscribeToChanges,\n}\n\nexport {\n authorizationStatusFor,\n availableQuantityTypes,\n deleteQuantitySample,\n deleteSamples,\n disableAllBackgroundDelivery,\n disableBackgroundDelivery,\n enableBackgroundDelivery,\n getBiologicalSex,\n getBloodType,\n getDateOfBirth,\n getFitzpatrickSkinType,\n getMostRecentCategorySample,\n getMostRecentQuantitySample,\n getMostRecentWorkout,\n getPreferredUnit,\n getPreferredUnits,\n getRequestStatusForAuthorization,\n getWheelchairUse,\n getWorkoutPlanById,\n getWorkoutRoutes,\n isHealthDataAvailable,\n isProtectedDataAvailable,\n queryCategorySamples,\n queryCategorySamplesWithAnchor,\n queryCorrelationSamples,\n queryHeartbeatSeriesSamples,\n queryHeartbeatSeriesSamplesWithAnchor,\n queryQuantitySamples,\n queryQuantitySamplesWithAnchor,\n querySources,\n queryStatisticsForQuantity,\n queryWorkouts,\n queryWorkoutSamples,\n queryWorkoutSamplesWithAnchor,\n requestAuthorization,\n saveCategorySample,\n saveCorrelationSample,\n saveQuantitySample,\n saveWorkoutRoute,\n saveWorkoutSample,\n subscribeToChanges,\n useHealthkitAuthorization,\n useIsHealthDataAvailable,\n useMostRecentCategorySample,\n useMostRecentQuantitySample,\n useMostRecentWorkout,\n useSources,\n useStatisticsForQuantity,\n useSubscribeToChanges,\n}\n\nexport * from './types'\n\nexport default Healthkit\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AA2MA,IAAAE,MAAA,GAAAF,OAAA;AAAAG,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;AAnMA,MAAMS,iBAAiB,GAAG,kDACxBC,qBAAQ,CAACC,EAAE,iBACI;AAEjB,IAAIC,SAAS,GAAG,KAAK;AAErB,SAASC,aAAaA,CAAcC,MAAS,EAAE;EAC7C,OAAO,MAAM;IACX,IAAI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