@kingstinct/react-native-healthkit 12.1.2 → 12.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ios/CategoryTypeModule.swift +49 -97
- package/ios/CharacteristicTypeModule.swift +77 -63
- package/ios/CoreModule.swift +324 -280
- package/ios/CorrelationTypeModule.swift +192 -144
- package/ios/ElectrocardiogramModule.swift +185 -194
- package/ios/HeartbeatSeriesModule.swift +123 -171
- package/ios/Helpers.swift +312 -571
- package/ios/MedicationModule.swift +259 -0
- package/ios/PredicateHelpers.swift +334 -0
- package/ios/QuantityTypeModule.swift +297 -378
- package/ios/Serializers.swift +273 -210
- package/ios/SourceProxy.swift +2 -2
- package/ios/StateOfMindModule.swift +179 -125
- package/ios/WorkoutProxy.swift +235 -112
- package/ios/WorkoutsModule.swift +214 -262
- package/lib/commonjs/healthkit.ios.js +22 -2
- package/lib/commonjs/healthkit.js +35 -5
- package/lib/commonjs/hooks/useStatisticsForQuantity.js +1 -1
- package/lib/commonjs/hooks/useSubscribeToCategorySamples.js +20 -0
- package/lib/commonjs/modules.js +2 -1
- package/lib/commonjs/specs/MedicationModule.nitro.js +27 -0
- package/lib/commonjs/types/Constants.js +2 -1
- package/lib/commonjs/types/QuantityType.js +8 -1
- package/lib/commonjs/types/QueryOptions.js +18 -0
- package/lib/commonjs/types/WeatherCondition.js +32 -32
- package/lib/commonjs/types/Workouts.js +1 -50
- package/lib/commonjs/utils/getCategorySampleById.js +1 -1
- package/lib/commonjs/utils/getQuantitySampleById.js +1 -1
- package/lib/commonjs/utils/getWorkoutById.js +1 -1
- package/lib/commonjs/utils/subscribeToCategorySamples.js +29 -0
- package/lib/commonjs/utils/subscribeToQuantitySamples.js +8 -25
- package/lib/module/healthkit.ios.js +20 -2
- package/lib/module/healthkit.js +32 -2
- package/lib/module/hooks/useStatisticsForQuantity.js +1 -1
- package/lib/module/hooks/useSubscribeToCategorySamples.js +17 -0
- package/lib/module/modules.js +1 -0
- package/lib/module/specs/MedicationModule.nitro.js +26 -0
- package/lib/module/types/Constants.js +1 -0
- package/lib/module/types/QuantityType.js +7 -0
- package/lib/module/types/QueryOptions.js +17 -1
- package/lib/module/types/WeatherCondition.js +31 -31
- package/lib/module/types/Workouts.js +0 -49
- package/lib/module/utils/getCategorySampleById.js +1 -1
- package/lib/module/utils/getQuantitySampleById.js +1 -1
- package/lib/module/utils/getWorkoutById.js +1 -1
- package/lib/module/utils/subscribeToCategorySamples.js +26 -0
- package/lib/module/utils/subscribeToQuantitySamples.js +8 -25
- package/lib/typescript/healthkit.d.ts +18 -9
- package/lib/typescript/healthkit.ios.d.ts +33 -15
- package/lib/typescript/hooks/useSubscribeToCategorySamples.d.ts +3 -0
- package/lib/typescript/modules.d.ts +2 -0
- package/lib/typescript/specs/CategoryTypeModule.nitro.d.ts +2 -2
- package/lib/typescript/specs/CoreModule.nitro.d.ts +2 -1
- package/lib/typescript/specs/CorrelationTypeModule.nitro.d.ts +4 -2
- package/lib/typescript/specs/ElectrocardiogramModule.nitro.d.ts +1 -1
- package/lib/typescript/specs/HeartbeatSeriesModule.nitro.d.ts +1 -1
- package/lib/typescript/specs/MedicationModule.nitro.d.ts +56 -0
- package/lib/typescript/specs/QuantityTypeModule.nitro.d.ts +4 -4
- package/lib/typescript/specs/StateOfMindModule.nitro.d.ts +4 -3
- package/lib/typescript/types/CategoryType.d.ts +10 -20
- package/lib/typescript/types/Constants.d.ts +1 -0
- package/lib/typescript/types/CorrelationType.d.ts +8 -10
- package/lib/typescript/types/ElectrocardiogramSample.d.ts +2 -12
- package/lib/typescript/types/HeartbeatSeries.d.ts +2 -14
- package/lib/typescript/types/QuantitySample.d.ts +2 -8
- package/lib/typescript/types/QuantityType.d.ts +7 -8
- package/lib/typescript/types/QuantityTypeIdentifier.d.ts +23 -23
- package/lib/typescript/types/QueryOptions.d.ts +43 -28
- package/lib/typescript/types/Shared.d.ts +52 -7
- package/lib/typescript/types/StateOfMind.d.ts +7 -10
- package/lib/typescript/types/Subscriptions.d.ts +12 -3
- package/lib/typescript/types/WeatherCondition.d.ts +1 -1
- package/lib/typescript/types/Workouts.d.ts +28 -81
- package/lib/typescript/utils/subscribeToCategorySamples.d.ts +5 -0
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.cpp +57 -0
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.hpp +592 -389
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Umbrella.hpp +65 -30
- package/nitrogen/generated/ios/ReactNativeHealthkitAutolinking.mm +8 -0
- package/nitrogen/generated/ios/ReactNativeHealthkitAutolinking.swift +15 -0
- package/nitrogen/generated/ios/c++/HybridCategoryTypeModuleSpecSwift.hpp +32 -26
- package/nitrogen/generated/ios/c++/HybridCoreModuleSpecSwift.hpp +36 -37
- package/nitrogen/generated/ios/c++/HybridCorrelationTypeModuleSpecSwift.hpp +55 -2
- package/nitrogen/generated/ios/c++/HybridElectrocardiogramModuleSpecSwift.hpp +36 -30
- package/nitrogen/generated/ios/c++/HybridHeartbeatSeriesModuleSpecSwift.hpp +35 -29
- package/nitrogen/generated/ios/c++/HybridMedicationModuleSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridMedicationModuleSpecSwift.hpp +181 -0
- package/nitrogen/generated/ios/c++/HybridQuantityTypeModuleSpecSwift.hpp +48 -42
- package/nitrogen/generated/ios/c++/HybridStateOfMindModuleSpecSwift.hpp +59 -36
- package/nitrogen/generated/ios/c++/HybridWorkoutProxySpecSwift.hpp +150 -29
- package/nitrogen/generated/ios/c++/HybridWorkoutsModuleSpecSwift.hpp +13 -28
- package/nitrogen/generated/ios/swift/AggregationStyle.swift +48 -0
- package/nitrogen/generated/ios/swift/CategorySample.swift +571 -24
- package/nitrogen/generated/ios/swift/ComparisonPredicateOperator.swift +2 -2
- package/nitrogen/generated/ios/swift/CorrelationSample.swift +640 -17
- package/nitrogen/generated/ios/swift/{PredicateWithStartAndEnd.swift → DateFilter.swift} +5 -5
- package/nitrogen/generated/ios/swift/ECGQueryOptionsWithAnchor.swift +11 -91
- package/nitrogen/generated/ios/swift/ECGQueryOptionsWithSortOrder.swift +11 -91
- package/nitrogen/generated/ios/swift/ElectrocardiogramSample.swift +570 -72
- package/nitrogen/generated/ios/swift/FilterForSamples.swift +349 -12
- package/nitrogen/generated/ios/swift/FilterForSamplesBase.swift +234 -0
- package/nitrogen/generated/ios/swift/FilterForWorkouts.swift +366 -0
- package/nitrogen/generated/ios/swift/FilterForWorkoutsBase.swift +240 -0
- package/nitrogen/generated/ios/swift/Func_void_MedicationDoseEventsWithAnchorResponse.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_QueryCorrelationSamplesWithAnchorResponse.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_StateOfMindSamplesWithAnchorResponse.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_MedicationDoseEvent_.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_UserAnnotatedMedication_.swift +47 -0
- package/nitrogen/generated/ios/swift/GeneralForm.swift +104 -0
- package/nitrogen/generated/ios/swift/HeartRateMotionContext.swift +44 -0
- package/nitrogen/generated/ios/swift/HeartbeatSeriesSample.swift +565 -37
- package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec_cxx.swift +2 -2
- package/nitrogen/generated/ios/swift/HybridCoreModuleSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridCoreModuleSpec_cxx.swift +19 -31
- package/nitrogen/generated/ios/swift/HybridCorrelationTypeModuleSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridCorrelationTypeModuleSpec_cxx.swift +21 -2
- package/nitrogen/generated/ios/swift/HybridElectrocardiogramModuleSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridElectrocardiogramModuleSpec_cxx.swift +2 -2
- package/nitrogen/generated/ios/swift/HybridHeartbeatSeriesModuleSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridHeartbeatSeriesModuleSpec_cxx.swift +2 -2
- package/nitrogen/generated/ios/swift/HybridMedicationModuleSpec.swift +60 -0
- package/nitrogen/generated/ios/swift/HybridMedicationModuleSpec_cxx.swift +208 -0
- package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec.swift +2 -2
- package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec_cxx.swift +9 -43
- package/nitrogen/generated/ios/swift/HybridStateOfMindModuleSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridStateOfMindModuleSpec_cxx.swift +21 -2
- package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec.swift +34 -6
- package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec_cxx.swift +376 -36
- package/nitrogen/generated/ios/swift/InsulinDeliveryReason.swift +40 -0
- package/nitrogen/generated/ios/swift/MedicationConcept.swift +80 -0
- package/nitrogen/generated/ios/swift/MedicationDoseEvent.swift +781 -0
- package/nitrogen/generated/ios/swift/MedicationDoseEventLogStatus.swift +56 -0
- package/nitrogen/generated/ios/swift/MedicationDoseEventScheduleType.swift +40 -0
- package/nitrogen/generated/ios/swift/MedicationDoseEventsWithAnchorResponse.swift +81 -0
- package/nitrogen/generated/ios/swift/ObjectTypeIdentifier.swift +16 -16
- package/nitrogen/generated/ios/swift/PredicateWithMetadataKey.swift +7 -7
- package/nitrogen/generated/ios/swift/QuantitySample.swift +574 -27
- package/nitrogen/generated/ios/swift/QuantityTypeIdentifier.swift +16 -16
- package/nitrogen/generated/ios/swift/QueryCorrelationSamplesWithAnchorResponse.swift +81 -0
- package/nitrogen/generated/ios/swift/QueryOptionsWithAnchor.swift +11 -91
- package/nitrogen/generated/ios/swift/QueryOptionsWithAnchorAndUnit.swift +11 -91
- package/nitrogen/generated/ios/swift/QueryOptionsWithSortOrder.swift +11 -91
- package/nitrogen/generated/ios/swift/QueryOptionsWithSortOrderAndUnit.swift +11 -91
- package/nitrogen/generated/ios/swift/RelatedCoding.swift +76 -0
- package/nitrogen/generated/ios/swift/SampleType.swift +68 -0
- package/nitrogen/generated/ios/swift/SampleTypeIdentifier.swift +16 -16
- package/nitrogen/generated/ios/swift/SampleTypeIdentifierWriteable.swift +0 -16
- package/nitrogen/generated/ios/swift/StateOfMindSample.swift +586 -58
- package/nitrogen/generated/ios/swift/StateOfMindSamplesWithAnchorResponse.swift +81 -0
- package/nitrogen/generated/ios/swift/StatisticsQueryOptions.swift +7 -75
- package/nitrogen/generated/ios/swift/UserAnnotatedMedication.swift +87 -0
- package/nitrogen/generated/ios/swift/WeatherCondition.swift +144 -0
- package/nitrogen/generated/ios/swift/WorkoutQueryOptions.swift +11 -105
- package/nitrogen/generated/ios/swift/WorkoutQueryOptionsWithAnchor.swift +11 -105
- package/nitrogen/generated/ios/swift/WorkoutSample.swift +751 -78
- package/nitrogen/generated/shared/c++/AggregationStyle.hpp +64 -0
- package/nitrogen/generated/shared/c++/CategorySample.hpp +126 -23
- package/nitrogen/generated/shared/c++/CorrelationSample.hpp +134 -12
- package/nitrogen/generated/shared/c++/{PredicateWithStartAndEnd.hpp → DateFilter.hpp} +10 -10
- package/nitrogen/generated/shared/c++/ECGQueryOptionsWithAnchor.hpp +12 -31
- package/nitrogen/generated/shared/c++/ECGQueryOptionsWithSortOrder.hpp +12 -31
- package/nitrogen/generated/shared/c++/ElectrocardiogramSample.hpp +135 -36
- package/nitrogen/generated/shared/c++/FilterForSamples.hpp +124 -0
- package/nitrogen/generated/shared/c++/FilterForSamplesBase.hpp +109 -0
- package/nitrogen/generated/shared/c++/FilterForWorkouts.hpp +131 -0
- package/nitrogen/generated/shared/c++/FilterForWorkoutsBase.hpp +116 -0
- package/nitrogen/generated/shared/c++/GeneralForm.hpp +140 -0
- package/nitrogen/generated/shared/c++/HeartRateMotionContext.hpp +67 -0
- package/nitrogen/generated/shared/c++/HeartbeatSeriesSample.hpp +131 -28
- package/nitrogen/generated/shared/c++/HybridCategoryTypeModuleSpec.hpp +1 -2
- package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.hpp +10 -28
- package/nitrogen/generated/shared/c++/HybridCorrelationTypeModuleSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridCorrelationTypeModuleSpec.hpp +11 -1
- package/nitrogen/generated/shared/c++/HybridElectrocardiogramModuleSpec.hpp +1 -2
- package/nitrogen/generated/shared/c++/HybridHeartbeatSeriesModuleSpec.hpp +1 -2
- package/nitrogen/generated/shared/c++/HybridMedicationModuleSpec.cpp +24 -0
- package/nitrogen/generated/shared/c++/HybridMedicationModuleSpec.hpp +80 -0
- package/nitrogen/generated/shared/c++/HybridQuantityTypeModuleSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridQuantityTypeModuleSpec.hpp +6 -25
- package/nitrogen/generated/shared/c++/HybridStateOfMindModuleSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridStateOfMindModuleSpec.hpp +9 -2
- package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.cpp +33 -5
- package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.hpp +56 -16
- package/nitrogen/generated/shared/c++/InsulinDeliveryReason.hpp +62 -0
- package/nitrogen/generated/shared/c++/MedicationConcept.hpp +93 -0
- package/nitrogen/generated/shared/c++/MedicationDoseEvent.hpp +240 -0
- package/nitrogen/generated/shared/c++/MedicationDoseEventLogStatus.hpp +66 -0
- package/nitrogen/generated/shared/c++/MedicationDoseEventScheduleType.hpp +62 -0
- package/nitrogen/generated/shared/c++/MedicationDoseEventsWithAnchorResponse.hpp +89 -0
- package/nitrogen/generated/shared/c++/ObjectTypeIdentifier.hpp +105 -105
- package/nitrogen/generated/shared/c++/PredicateWithMetadataKey.hpp +8 -8
- package/nitrogen/generated/shared/c++/QuantitySample.hpp +130 -27
- package/nitrogen/generated/shared/c++/QuantityTypeIdentifier.hpp +105 -105
- package/nitrogen/generated/shared/c++/QueryCorrelationSamplesWithAnchorResponse.hpp +89 -0
- package/nitrogen/generated/shared/c++/QueryOptionsWithAnchor.hpp +12 -31
- package/nitrogen/generated/shared/c++/QueryOptionsWithAnchorAndUnit.hpp +12 -31
- package/nitrogen/generated/shared/c++/QueryOptionsWithSortOrder.hpp +12 -31
- package/nitrogen/generated/shared/c++/QueryOptionsWithSortOrderAndUnit.hpp +12 -31
- package/nitrogen/generated/shared/c++/RelatedCoding.hpp +84 -0
- package/nitrogen/generated/shared/c++/SampleType.hpp +87 -0
- package/nitrogen/generated/shared/c++/SampleTypeIdentifier.hpp +105 -105
- package/nitrogen/generated/shared/c++/SampleTypeIdentifierWriteable.hpp +105 -121
- package/nitrogen/generated/shared/c++/StateOfMindSample.hpp +139 -36
- package/nitrogen/generated/shared/c++/StateOfMindSamplesWithAnchorResponse.hpp +89 -0
- package/nitrogen/generated/shared/c++/StatisticsQueryOptions.hpp +8 -27
- package/nitrogen/generated/shared/c++/UserAnnotatedMedication.hpp +90 -0
- package/nitrogen/generated/shared/c++/WeatherCondition.hpp +88 -0
- package/nitrogen/generated/shared/c++/WorkoutQueryOptions.hpp +12 -37
- package/nitrogen/generated/shared/c++/WorkoutQueryOptionsWithAnchor.hpp +12 -37
- package/nitrogen/generated/shared/c++/WorkoutSample.hpp +159 -35
- package/package.json +1 -1
- package/src/healthkit.ios.ts +30 -0
- package/src/healthkit.ts +68 -3
- package/src/hooks/useStatisticsForQuantity.ts +1 -1
- package/src/hooks/useSubscribeToCategorySamples.ts +31 -0
- package/src/modules.ts +4 -0
- package/src/specs/CategoryTypeModule.nitro.ts +2 -2
- package/src/specs/CoreModule.nitro.ts +3 -0
- package/src/specs/CorrelationTypeModule.nitro.ts +11 -3
- package/src/specs/ElectrocardiogramModule.nitro.ts +1 -1
- package/src/specs/HeartbeatSeriesModule.nitro.ts +1 -1
- package/src/specs/MedicationModule.nitro.ts +140 -0
- package/src/specs/QuantityTypeModule.nitro.ts +4 -7
- package/src/specs/StateOfMindModule.nitro.ts +10 -2
- package/src/types/CategoryType.ts +15 -22
- package/src/types/Constants.ts +3 -0
- package/src/types/CorrelationType.ts +10 -15
- package/src/types/ElectrocardiogramSample.ts +2 -14
- package/src/types/HeartbeatSeries.ts +2 -15
- package/src/types/QuantitySample.ts +2 -8
- package/src/types/QuantityType.ts +8 -17
- package/src/types/QuantityTypeIdentifier.ts +25 -25
- package/src/types/QueryOptions.ts +54 -43
- package/src/types/Shared.ts +74 -17
- package/src/types/StateOfMind.ts +8 -10
- package/src/types/Subscriptions.ts +19 -3
- package/src/types/WeatherCondition.ts +1 -1
- package/src/types/Workouts.ts +28 -91
- package/src/utils/getCategorySampleById.ts +1 -1
- package/src/utils/getQuantitySampleById.ts +1 -1
- package/src/utils/getWorkoutById.ts +1 -2
- package/src/utils/subscribeToCategorySamples.ts +38 -0
- package/src/utils/subscribeToQuantitySamples.ts +12 -37
- package/nitrogen/generated/ios/swift/FilterForSamplesAnd.swift +0 -94
- package/nitrogen/generated/ios/swift/FilterForSamplesOr.swift +0 -94
- package/nitrogen/generated/ios/swift/PredicateForSamples.swift +0 -21
- package/nitrogen/generated/ios/swift/PredicateForWorkouts.swift +0 -23
- package/nitrogen/generated/ios/swift/PredicateForWorkoutsAnd.swift +0 -108
- package/nitrogen/generated/ios/swift/PredicateForWorkoutsOr.swift +0 -108
- package/nitrogen/generated/ios/swift/PredicateFromWorkout.swift +0 -45
- package/nitrogen/generated/ios/swift/PredicateWithMetadataOperator.swift +0 -48
- package/nitrogen/generated/ios/swift/PredicateWithUUID.swift +0 -35
- package/nitrogen/generated/ios/swift/PredicateWithUUIDs.swift +0 -47
- package/nitrogen/generated/ios/swift/Variant_PredicateWithUUID_PredicateWithUUIDs_PredicateWithMetadataKey_PredicateWithStartAndEnd_PredicateFromWorkout_FilterForSamplesAnd_FilterForSamplesOr.swift +0 -23
- package/nitrogen/generated/ios/swift/Variant_PredicateWithUUID_PredicateWithUUIDs_PredicateWithMetadataKey_PredicateWithStartAndEnd_PredicateFromWorkout_WorkoutActivityTypePredicate_WorkoutDurationPredicate_PredicateForWorkoutsOr_PredicateForWorkoutsAnd.swift +0 -25
- package/nitrogen/generated/ios/swift/WorkoutActivityTypePredicate.swift +0 -35
- package/nitrogen/generated/shared/c++/FilterForSamplesAnd.hpp +0 -90
- package/nitrogen/generated/shared/c++/FilterForSamplesOr.hpp +0 -90
- package/nitrogen/generated/shared/c++/PredicateForWorkoutsAnd.hpp +0 -96
- package/nitrogen/generated/shared/c++/PredicateForWorkoutsOr.hpp +0 -96
- package/nitrogen/generated/shared/c++/PredicateFromWorkout.hpp +0 -77
- package/nitrogen/generated/shared/c++/PredicateWithMetadataOperator.hpp +0 -84
- package/nitrogen/generated/shared/c++/PredicateWithUUID.hpp +0 -75
- package/nitrogen/generated/shared/c++/PredicateWithUUIDs.hpp +0 -76
- package/nitrogen/generated/shared/c++/WorkoutActivityTypePredicate.hpp +0 -76
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
import { subscribeToCategorySamples } from '../utils/subscribeToCategorySamples';
|
|
3
|
+
export function useSubscribeToCategorySamples(identifier, onChange) {
|
|
4
|
+
const onChangeRef = useRef(onChange);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
onChangeRef.current = onChange;
|
|
7
|
+
}, [onChange]);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const subscription = subscribeToCategorySamples(identifier, (args) => {
|
|
10
|
+
onChangeRef.current(args);
|
|
11
|
+
});
|
|
12
|
+
return () => {
|
|
13
|
+
subscription.remove();
|
|
14
|
+
};
|
|
15
|
+
}, [identifier]);
|
|
16
|
+
}
|
|
17
|
+
export default useSubscribeToCategorySamples;
|
package/lib/module/modules.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { NitroModules } from 'react-native-nitro-modules';
|
|
2
2
|
export const Core = NitroModules.createHybridObject('CoreModule');
|
|
3
|
+
export const Medication = NitroModules.createHybridObject('MedicationModule');
|
|
3
4
|
export const Workouts = NitroModules.createHybridObject('WorkoutsModule');
|
|
4
5
|
export const Characteristics = NitroModules.createHybridObject('CharacteristicTypeModule');
|
|
5
6
|
export const QuantityTypes = NitroModules.createHybridObject('QuantityTypeModule');
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var MedicationDoseEventScheduleType;
|
|
2
|
+
(function (MedicationDoseEventScheduleType) {
|
|
3
|
+
MedicationDoseEventScheduleType[MedicationDoseEventScheduleType["asNeeded"] = 1] = "asNeeded";
|
|
4
|
+
/// The person logged this dose event in response to a scheduled medication reminder.
|
|
5
|
+
MedicationDoseEventScheduleType[MedicationDoseEventScheduleType["schedule"] = 2] = "schedule";
|
|
6
|
+
})(MedicationDoseEventScheduleType || (MedicationDoseEventScheduleType = {}));
|
|
7
|
+
var MedicationDoseEventLogStatus;
|
|
8
|
+
(function (MedicationDoseEventLogStatus) {
|
|
9
|
+
MedicationDoseEventLogStatus[MedicationDoseEventLogStatus["notInteracted"] = 1] = "notInteracted";
|
|
10
|
+
/// The system assigns this status when it fails to deliver a scheduled medication notification.
|
|
11
|
+
///
|
|
12
|
+
/// The system can generate this status because of a person's notification
|
|
13
|
+
/// restrictions or issues with notification delivery.
|
|
14
|
+
MedicationDoseEventLogStatus[MedicationDoseEventLogStatus["notificationNotSent"] = 2] = "notificationNotSent";
|
|
15
|
+
/// The person snoozes a scheduled medication notification.
|
|
16
|
+
MedicationDoseEventLogStatus[MedicationDoseEventLogStatus["snoozed"] = 3] = "snoozed";
|
|
17
|
+
/// The person logs that they took the medication dose.
|
|
18
|
+
MedicationDoseEventLogStatus[MedicationDoseEventLogStatus["taken"] = 4] = "taken";
|
|
19
|
+
/// The person logs that they skipped the medication dose.
|
|
20
|
+
MedicationDoseEventLogStatus[MedicationDoseEventLogStatus["skipped"] = 5] = "skipped";
|
|
21
|
+
/// The person undoes a previously logged medication status.
|
|
22
|
+
///
|
|
23
|
+
/// The system clears the prior status.
|
|
24
|
+
MedicationDoseEventLogStatus[MedicationDoseEventLogStatus["notLogged"] = 6] = "notLogged";
|
|
25
|
+
})(MedicationDoseEventLogStatus || (MedicationDoseEventLogStatus = {}));
|
|
26
|
+
export {};
|
|
@@ -23,3 +23,4 @@ export const HeartbeatSeriesTypeIdentifier = 'HKDataTypeIdentifierHeartbeatSerie
|
|
|
23
23
|
* @see {@link https://developer.apple.com/documentation/healthkit/hkelectrocardiogramtype Apple Docs HKElectrocardiogramType}
|
|
24
24
|
*/
|
|
25
25
|
export const ElectrocardiogramTypeIdentifier = 'HKElectrocardiogramType';
|
|
26
|
+
export const UserAnnotatedMedicationTypeIdentifier = 'HKUserAnnotatedMedicationTypeIdentifier';
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
export var AggregationStyle;
|
|
2
|
+
(function (AggregationStyle) {
|
|
3
|
+
AggregationStyle[AggregationStyle["cumulative"] = 0] = "cumulative";
|
|
4
|
+
AggregationStyle[AggregationStyle["discreteArithmetic"] = 1] = "discreteArithmetic";
|
|
5
|
+
AggregationStyle[AggregationStyle["discreteTemporallyWeighted"] = 2] = "discreteTemporallyWeighted";
|
|
6
|
+
AggregationStyle[AggregationStyle["discreteEquivalentContinuousLevel"] = 3] = "discreteEquivalentContinuousLevel";
|
|
7
|
+
})(AggregationStyle || (AggregationStyle = {}));
|
|
1
8
|
/**
|
|
2
9
|
* @see {@link https://developer.apple.com/documentation/healthkit/hkinsulindeliveryreason Apple Docs }
|
|
3
10
|
*/
|
|
@@ -1 +1,17 @@
|
|
|
1
|
-
export
|
|
1
|
+
export var ComparisonPredicateOperator;
|
|
2
|
+
(function (ComparisonPredicateOperator) {
|
|
3
|
+
ComparisonPredicateOperator[ComparisonPredicateOperator["lessThan"] = 0] = "lessThan";
|
|
4
|
+
ComparisonPredicateOperator[ComparisonPredicateOperator["lessThanOrEqualTo"] = 1] = "lessThanOrEqualTo";
|
|
5
|
+
ComparisonPredicateOperator[ComparisonPredicateOperator["greaterThan"] = 2] = "greaterThan";
|
|
6
|
+
ComparisonPredicateOperator[ComparisonPredicateOperator["greaterThanOrEqualTo"] = 3] = "greaterThanOrEqualTo";
|
|
7
|
+
ComparisonPredicateOperator[ComparisonPredicateOperator["equalTo"] = 4] = "equalTo";
|
|
8
|
+
ComparisonPredicateOperator[ComparisonPredicateOperator["notEqualTo"] = 5] = "notEqualTo";
|
|
9
|
+
ComparisonPredicateOperator[ComparisonPredicateOperator["matches"] = 6] = "matches";
|
|
10
|
+
ComparisonPredicateOperator[ComparisonPredicateOperator["like"] = 7] = "like";
|
|
11
|
+
ComparisonPredicateOperator[ComparisonPredicateOperator["beginsWith"] = 8] = "beginsWith";
|
|
12
|
+
ComparisonPredicateOperator[ComparisonPredicateOperator["endsWith"] = 9] = "endsWith";
|
|
13
|
+
ComparisonPredicateOperator[ComparisonPredicateOperator["IN"] = 10] = "IN";
|
|
14
|
+
ComparisonPredicateOperator[ComparisonPredicateOperator["customSelector"] = 11] = "customSelector";
|
|
15
|
+
ComparisonPredicateOperator[ComparisonPredicateOperator["contains"] = 99] = "contains";
|
|
16
|
+
ComparisonPredicateOperator[ComparisonPredicateOperator["between"] = 100] = "between";
|
|
17
|
+
})(ComparisonPredicateOperator || (ComparisonPredicateOperator = {}));
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
// documented at https://developer.apple.com/documentation/healthkit/hkweathercondition
|
|
2
|
-
export var
|
|
3
|
-
(function (
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
})(
|
|
2
|
+
export var WeatherCondition;
|
|
3
|
+
(function (WeatherCondition) {
|
|
4
|
+
WeatherCondition[WeatherCondition["none"] = 0] = "none";
|
|
5
|
+
WeatherCondition[WeatherCondition["clear"] = 1] = "clear";
|
|
6
|
+
WeatherCondition[WeatherCondition["fair"] = 2] = "fair";
|
|
7
|
+
WeatherCondition[WeatherCondition["partlyCloudy"] = 3] = "partlyCloudy";
|
|
8
|
+
WeatherCondition[WeatherCondition["mostlyCloudy"] = 4] = "mostlyCloudy";
|
|
9
|
+
WeatherCondition[WeatherCondition["cloudy"] = 5] = "cloudy";
|
|
10
|
+
WeatherCondition[WeatherCondition["foggy"] = 6] = "foggy";
|
|
11
|
+
WeatherCondition[WeatherCondition["haze"] = 7] = "haze";
|
|
12
|
+
WeatherCondition[WeatherCondition["windy"] = 8] = "windy";
|
|
13
|
+
WeatherCondition[WeatherCondition["blustery"] = 9] = "blustery";
|
|
14
|
+
WeatherCondition[WeatherCondition["smoky"] = 10] = "smoky";
|
|
15
|
+
WeatherCondition[WeatherCondition["dust"] = 11] = "dust";
|
|
16
|
+
WeatherCondition[WeatherCondition["snow"] = 12] = "snow";
|
|
17
|
+
WeatherCondition[WeatherCondition["hail"] = 13] = "hail";
|
|
18
|
+
WeatherCondition[WeatherCondition["sleet"] = 14] = "sleet";
|
|
19
|
+
WeatherCondition[WeatherCondition["freezingDrizzle"] = 15] = "freezingDrizzle";
|
|
20
|
+
WeatherCondition[WeatherCondition["freezingRain"] = 16] = "freezingRain";
|
|
21
|
+
WeatherCondition[WeatherCondition["mixedRainAndHail"] = 17] = "mixedRainAndHail";
|
|
22
|
+
WeatherCondition[WeatherCondition["mixedRainAndSnow"] = 18] = "mixedRainAndSnow";
|
|
23
|
+
WeatherCondition[WeatherCondition["mixedRainAndSleet"] = 19] = "mixedRainAndSleet";
|
|
24
|
+
WeatherCondition[WeatherCondition["mixedSnowAndSleet"] = 20] = "mixedSnowAndSleet";
|
|
25
|
+
WeatherCondition[WeatherCondition["drizzle"] = 21] = "drizzle";
|
|
26
|
+
WeatherCondition[WeatherCondition["scatteredShowers"] = 22] = "scatteredShowers";
|
|
27
|
+
WeatherCondition[WeatherCondition["showers"] = 23] = "showers";
|
|
28
|
+
WeatherCondition[WeatherCondition["thunderstorms"] = 24] = "thunderstorms";
|
|
29
|
+
WeatherCondition[WeatherCondition["tropicalStorm"] = 25] = "tropicalStorm";
|
|
30
|
+
WeatherCondition[WeatherCondition["hurricane"] = 26] = "hurricane";
|
|
31
|
+
WeatherCondition[WeatherCondition["tornado"] = 27] = "tornado";
|
|
32
|
+
})(WeatherCondition || (WeatherCondition = {}));
|
|
@@ -85,38 +85,6 @@ export var WorkoutActivityType;
|
|
|
85
85
|
WorkoutActivityType[WorkoutActivityType["underwaterDiving"] = 84] = "underwaterDiving";
|
|
86
86
|
WorkoutActivityType[WorkoutActivityType["other"] = 3000] = "other";
|
|
87
87
|
})(WorkoutActivityType || (WorkoutActivityType = {}));
|
|
88
|
-
// documented at https://developer.apple.com/documentation/healthkit/hkweathercondition
|
|
89
|
-
export var WeatherCondition;
|
|
90
|
-
(function (WeatherCondition) {
|
|
91
|
-
WeatherCondition[WeatherCondition["none"] = 0] = "none";
|
|
92
|
-
WeatherCondition[WeatherCondition["clear"] = 1] = "clear";
|
|
93
|
-
WeatherCondition[WeatherCondition["fair"] = 2] = "fair";
|
|
94
|
-
WeatherCondition[WeatherCondition["partlyCloudy"] = 3] = "partlyCloudy";
|
|
95
|
-
WeatherCondition[WeatherCondition["mostlyCloudy"] = 4] = "mostlyCloudy";
|
|
96
|
-
WeatherCondition[WeatherCondition["cloudy"] = 5] = "cloudy";
|
|
97
|
-
WeatherCondition[WeatherCondition["foggy"] = 6] = "foggy";
|
|
98
|
-
WeatherCondition[WeatherCondition["haze"] = 7] = "haze";
|
|
99
|
-
WeatherCondition[WeatherCondition["windy"] = 8] = "windy";
|
|
100
|
-
WeatherCondition[WeatherCondition["blustery"] = 9] = "blustery";
|
|
101
|
-
WeatherCondition[WeatherCondition["smoky"] = 10] = "smoky";
|
|
102
|
-
WeatherCondition[WeatherCondition["dust"] = 11] = "dust";
|
|
103
|
-
WeatherCondition[WeatherCondition["snow"] = 12] = "snow";
|
|
104
|
-
WeatherCondition[WeatherCondition["hail"] = 13] = "hail";
|
|
105
|
-
WeatherCondition[WeatherCondition["sleet"] = 14] = "sleet";
|
|
106
|
-
WeatherCondition[WeatherCondition["freezingDrizzle"] = 15] = "freezingDrizzle";
|
|
107
|
-
WeatherCondition[WeatherCondition["freezingRain"] = 16] = "freezingRain";
|
|
108
|
-
WeatherCondition[WeatherCondition["mixedRainAndHail"] = 17] = "mixedRainAndHail";
|
|
109
|
-
WeatherCondition[WeatherCondition["mixedRainAndSnow"] = 18] = "mixedRainAndSnow";
|
|
110
|
-
WeatherCondition[WeatherCondition["mixedRainAndSleet"] = 19] = "mixedRainAndSleet";
|
|
111
|
-
WeatherCondition[WeatherCondition["mixedSnowAndSleet"] = 20] = "mixedSnowAndSleet";
|
|
112
|
-
WeatherCondition[WeatherCondition["drizzle"] = 21] = "drizzle";
|
|
113
|
-
WeatherCondition[WeatherCondition["scatteredShowers"] = 22] = "scatteredShowers";
|
|
114
|
-
WeatherCondition[WeatherCondition["showers"] = 23] = "showers";
|
|
115
|
-
WeatherCondition[WeatherCondition["thunderstorms"] = 24] = "thunderstorms";
|
|
116
|
-
WeatherCondition[WeatherCondition["tropicalStorm"] = 25] = "tropicalStorm";
|
|
117
|
-
WeatherCondition[WeatherCondition["hurricane"] = 26] = "hurricane";
|
|
118
|
-
WeatherCondition[WeatherCondition["tornado"] = 27] = "tornado";
|
|
119
|
-
})(WeatherCondition || (WeatherCondition = {}));
|
|
120
88
|
export var WorkoutEventType;
|
|
121
89
|
(function (WorkoutEventType) {
|
|
122
90
|
WorkoutEventType[WorkoutEventType["pause"] = 1] = "pause";
|
|
@@ -128,20 +96,3 @@ export var WorkoutEventType;
|
|
|
128
96
|
WorkoutEventType[WorkoutEventType["segment"] = 7] = "segment";
|
|
129
97
|
WorkoutEventType[WorkoutEventType["pauseOrResumeRequest"] = 8] = "pauseOrResumeRequest";
|
|
130
98
|
})(WorkoutEventType || (WorkoutEventType = {}));
|
|
131
|
-
var ComparisonPredicateOperator;
|
|
132
|
-
(function (ComparisonPredicateOperator) {
|
|
133
|
-
ComparisonPredicateOperator[ComparisonPredicateOperator["lessThan"] = 0] = "lessThan";
|
|
134
|
-
ComparisonPredicateOperator[ComparisonPredicateOperator["lessThanOrEqualTo"] = 1] = "lessThanOrEqualTo";
|
|
135
|
-
ComparisonPredicateOperator[ComparisonPredicateOperator["greaterThan"] = 2] = "greaterThan";
|
|
136
|
-
ComparisonPredicateOperator[ComparisonPredicateOperator["greaterThanOrEqualTo"] = 3] = "greaterThanOrEqualTo";
|
|
137
|
-
ComparisonPredicateOperator[ComparisonPredicateOperator["equalTo"] = 4] = "equalTo";
|
|
138
|
-
ComparisonPredicateOperator[ComparisonPredicateOperator["notEqualTo"] = 5] = "notEqualTo";
|
|
139
|
-
ComparisonPredicateOperator[ComparisonPredicateOperator["matches"] = 6] = "matches";
|
|
140
|
-
ComparisonPredicateOperator[ComparisonPredicateOperator["like"] = 7] = "like";
|
|
141
|
-
ComparisonPredicateOperator[ComparisonPredicateOperator["beginsWith"] = 8] = "beginsWith";
|
|
142
|
-
ComparisonPredicateOperator[ComparisonPredicateOperator["endsWith"] = 9] = "endsWith";
|
|
143
|
-
ComparisonPredicateOperator[ComparisonPredicateOperator["in"] = 10] = "in";
|
|
144
|
-
ComparisonPredicateOperator[ComparisonPredicateOperator["customSelector"] = 11] = "customSelector";
|
|
145
|
-
ComparisonPredicateOperator[ComparisonPredicateOperator["contains"] = 99] = "contains";
|
|
146
|
-
ComparisonPredicateOperator[ComparisonPredicateOperator["between"] = 100] = "between";
|
|
147
|
-
})(ComparisonPredicateOperator || (ComparisonPredicateOperator = {}));
|
|
@@ -2,7 +2,7 @@ import { CategoryTypes } from '../modules';
|
|
|
2
2
|
export async function getCategorySampleById(identifier, uuid) {
|
|
3
3
|
const samples = await CategoryTypes.queryCategorySamples(identifier, {
|
|
4
4
|
limit: 1,
|
|
5
|
-
filter: {
|
|
5
|
+
filter: { uuids: [uuid] },
|
|
6
6
|
});
|
|
7
7
|
return samples[0];
|
|
8
8
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CategoryTypes } from '../modules';
|
|
2
|
+
import { subscribeToChanges } from './subscribeToChanges';
|
|
3
|
+
export function subscribeToCategorySamples(identifier, callback, after = new Date()) {
|
|
4
|
+
return subscribeToChanges(identifier, async ({ errorMessage }) => {
|
|
5
|
+
if (errorMessage) {
|
|
6
|
+
return callback({
|
|
7
|
+
typeIdentifier: identifier,
|
|
8
|
+
errorMessage,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
const samplesAfterLast = await CategoryTypes.queryCategorySamples(identifier, {
|
|
12
|
+
limit: 0,
|
|
13
|
+
filter: {
|
|
14
|
+
date: {
|
|
15
|
+
startDate: after,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
if (samplesAfterLast.length > 0) {
|
|
20
|
+
callback({
|
|
21
|
+
typeIdentifier: identifier,
|
|
22
|
+
samples: samplesAfterLast,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
import { QuantityTypes } from '../modules';
|
|
2
2
|
import { subscribeToChanges } from './subscribeToChanges';
|
|
3
|
-
export const subscribeToQuantitySamples = (identifier, callback, after) => {
|
|
4
|
-
let anchor;
|
|
5
|
-
const afterDate = after ?? new Date();
|
|
6
|
-
const init = async () => {
|
|
7
|
-
// we need to do an initial query to get a handle for the deletedSamples
|
|
8
|
-
const { newAnchor } = await QuantityTypes.queryQuantitySamplesWithAnchor(identifier, {
|
|
9
|
-
filter: {
|
|
10
|
-
startDate: afterDate,
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
anchor = newAnchor;
|
|
14
|
-
};
|
|
15
|
-
init();
|
|
3
|
+
export const subscribeToQuantitySamples = (identifier, callback, after = new Date()) => {
|
|
16
4
|
return subscribeToChanges(identifier, async ({ errorMessage }) => {
|
|
17
5
|
if (errorMessage) {
|
|
18
6
|
return callback({
|
|
@@ -20,23 +8,18 @@ export const subscribeToQuantitySamples = (identifier, callback, after) => {
|
|
|
20
8
|
errorMessage,
|
|
21
9
|
});
|
|
22
10
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const { samples, newAnchor, deletedSamples } = await QuantityTypes.queryQuantitySamplesWithAnchor(identifier, {
|
|
26
|
-
anchor,
|
|
11
|
+
const samplesAfterLast = await QuantityTypes.queryQuantitySamples(identifier, {
|
|
12
|
+
limit: 0,
|
|
27
13
|
filter: {
|
|
28
|
-
|
|
14
|
+
date: {
|
|
15
|
+
startDate: after,
|
|
16
|
+
},
|
|
29
17
|
},
|
|
30
18
|
});
|
|
31
|
-
|
|
32
|
-
const hasNewSamples = samples.length > 0 ||
|
|
33
|
-
(deletedSamples.length > 0 && hadAnchorWhenDoingQuery);
|
|
34
|
-
if (hasNewSamples) {
|
|
19
|
+
if (samplesAfterLast.length > 0) {
|
|
35
20
|
callback({
|
|
36
21
|
typeIdentifier: identifier,
|
|
37
|
-
samples,
|
|
38
|
-
anchor: newAnchor,
|
|
39
|
-
deletedSamples: hadAnchorWhenDoingQuery ? deletedSamples : [],
|
|
22
|
+
samples: samplesAfterLast,
|
|
40
23
|
});
|
|
41
24
|
}
|
|
42
25
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type ReactNativeHealthkit from './healthkit.ios';
|
|
2
|
+
import type { SourceProxy } from './specs/SourceProxy.nitro';
|
|
2
3
|
import type { WorkoutProxy } from './specs/WorkoutProxy.nitro';
|
|
3
4
|
import { AuthorizationRequestStatus, AuthorizationStatus } from './types/Auth';
|
|
4
5
|
import type { CategorySamplesWithAnchorResponseTyped, CategorySampleTyped } from './types/CategoryType';
|
|
@@ -15,7 +16,7 @@ export declare const getPreferredUnits: (identifiers: readonly import("./types")
|
|
|
15
16
|
export declare const getRequestStatusForAuthorization: (toCheck: import("./specs/CoreModule.nitro").AuthDataTypes) => Promise<AuthorizationRequestStatus>;
|
|
16
17
|
export declare const isHealthDataAvailable: () => boolean;
|
|
17
18
|
export declare const isHealthDataAvailableAsync: () => Promise<boolean>;
|
|
18
|
-
export declare const querySources: (identifier: import("./types").SampleTypeIdentifier
|
|
19
|
+
export declare const querySources: (identifier: import("./types").SampleTypeIdentifier, filter?: import("./types").FilterForSamples) => Promise<readonly SourceProxy[]>;
|
|
19
20
|
export declare const requestAuthorization: (toRequest: import("./specs/CoreModule.nitro").AuthDataTypes) => Promise<boolean>;
|
|
20
21
|
export declare const deleteObjects: (objectTypeIdentifier: import("./types").ObjectTypeIdentifier, filter: import("./types").FilterForSamples) => Promise<number>;
|
|
21
22
|
export declare const subscribeToChanges: (identifier: import("./types").SampleTypeIdentifier, callback: (args: import("./types").OnChangeCallbackArgs) => void) => {
|
|
@@ -31,26 +32,28 @@ export declare const getBloodType: () => BloodType;
|
|
|
31
32
|
export declare const getDateOfBirth: () => Date | undefined;
|
|
32
33
|
export declare const getFitzpatrickSkinType: () => FitzpatrickSkinType;
|
|
33
34
|
export declare const getWheelchairUse: () => WheelchairUse;
|
|
34
|
-
export declare const queryQuantitySamples: (identifier: import("./types").QuantityTypeIdentifier, options
|
|
35
|
+
export declare const queryQuantitySamples: (identifier: import("./types").QuantityTypeIdentifier, options: import("./types").QueryOptionsWithSortOrderAndUnit) => Promise<readonly QuantitySample[]>;
|
|
35
36
|
export declare const queryQuantitySamplesWithAnchor: (identifier: import("./types").QuantityTypeIdentifier, options: import("./types").QueryOptionsWithAnchorAndUnit) => Promise<import("./types").QuantitySamplesWithAnchorResponse>;
|
|
36
37
|
export declare const queryStatisticsForQuantity: (identifier: import("./types").QuantityTypeIdentifier, statistics: readonly import("./types").StatisticsOptions[], options?: import("./types").StatisticsQueryOptions) => Promise<import("./types").QueryStatisticsResponse>;
|
|
37
38
|
export declare const queryStatisticsCollectionForQuantity: (identifier: import("./types").QuantityTypeIdentifier, statistics: readonly import("./types").StatisticsOptions[], anchorDate: Date, intervalComponents: import("./types").IntervalComponents, options?: import("./types").StatisticsQueryOptions) => Promise<readonly import("./types").QueryStatisticsResponse[]>;
|
|
38
39
|
export declare const saveQuantitySample: (identifier: import("./types").QuantityTypeIdentifier, unit: string, value: number, start: Date, end: Date, metadata: import("react-native-nitro-modules").AnyMap) => Promise<boolean>;
|
|
39
40
|
export declare const isQuantityCompatibleWithUnit: (identifier: import("./types").QuantityTypeIdentifier, unit: string) => boolean;
|
|
40
|
-
export declare function queryCategorySamples<T extends CategoryTypeIdentifier>(_categoryTypeIdentifier: T, _options
|
|
41
|
+
export declare function queryCategorySamples<T extends CategoryTypeIdentifier>(_categoryTypeIdentifier: T, _options: QueryOptionsWithSortOrder): Promise<CategorySampleTyped<T>[]>;
|
|
41
42
|
export declare function queryCategorySamplesWithAnchor<T extends CategoryTypeIdentifier>(_categoryTypeIdentifier: T, _options: QueryOptionsWithAnchor): Promise<CategorySamplesWithAnchorResponseTyped<T>>;
|
|
42
43
|
export declare const saveCategorySample: <T extends CategoryTypeIdentifier>(identifier: T, value: import("./types").CategoryValueForIdentifier, startDate: Date, endDate: Date, metadata: import("./types").MetadataForCategoryIdentifier<T>) => Promise<boolean>;
|
|
43
|
-
export declare const queryCorrelationSamples: (typeIdentifier: import("./types").CorrelationTypeIdentifier,
|
|
44
|
+
export declare const queryCorrelationSamples: (typeIdentifier: import("./types").CorrelationTypeIdentifier, options: QueryOptionsWithSortOrder) => Promise<readonly import("./types").CorrelationSample[]>;
|
|
44
45
|
export declare const saveCorrelationSample: (typeIdentifier: import("./types").CorrelationTypeIdentifier, samples: import("./types").SampleForSaving[], start: Date, end: Date, metadata: import("react-native-nitro-modules").AnyMap) => Promise<boolean>;
|
|
45
|
-
export declare const queryHeartbeatSeriesSamples: (options
|
|
46
|
+
export declare const queryHeartbeatSeriesSamples: (options: QueryOptionsWithSortOrder) => Promise<readonly import("./types").HeartbeatSeriesSample[]>;
|
|
46
47
|
export declare const queryHeartbeatSeriesSamplesWithAnchor: (options: QueryOptionsWithAnchor) => Promise<import("./types").HeartbeatSeriesSamplesWithAnchorResponse>;
|
|
47
|
-
export declare const queryElectrocardiogramSamples: (options
|
|
48
|
+
export declare const queryElectrocardiogramSamples: (options: import("./types/ElectrocardiogramSample").ECGQueryOptionsWithSortOrder) => Promise<readonly import("./types/ElectrocardiogramSample").ElectrocardiogramSample[]>;
|
|
48
49
|
export declare const queryElectrocardiogramSamplesWithAnchor: (options: import("./types/ElectrocardiogramSample").ECGQueryOptionsWithAnchor) => Promise<import("./types/ElectrocardiogramSample").ElectrocardiogramSamplesWithAnchorResponse>;
|
|
49
50
|
export declare const queryWorkoutSamples: (options: import("./types").WorkoutQueryOptions) => Promise<WorkoutProxy[]>;
|
|
50
51
|
export declare const queryWorkoutSamplesWithAnchor: (options: import("./types").WorkoutQueryOptionsWithAnchor) => Promise<import("./types").QueryWorkoutSamplesWithAnchorResponse>;
|
|
51
52
|
export declare const saveWorkoutSample: (workoutActivityType: import("./types").WorkoutActivityType, quantities: readonly import("./types").QuantitySampleForSaving[], startDate: Date, endDate: Date, totals?: import("./types").WorkoutTotals, metadata?: import("react-native-nitro-modules").AnyMap) => Promise<WorkoutProxy>;
|
|
52
53
|
export declare const startWatchApp: (workoutConfiguration: import("./types").WorkoutConfiguration) => Promise<boolean>;
|
|
53
|
-
export declare const queryStateOfMindSamples: (options
|
|
54
|
+
export declare const queryStateOfMindSamples: (options: QueryOptionsWithSortOrder) => Promise<readonly import("./types").StateOfMindSample[]>;
|
|
55
|
+
export declare const queryStateOfMindSamplesWithAnchor: (options: QueryOptionsWithAnchor) => Promise<import("./types").StateOfMindSamplesWithAnchorResponse>;
|
|
56
|
+
export declare const queryCorrelationSamplesWithAnchor: (typeIdentifier: import("./types").CorrelationTypeIdentifier, options: QueryOptionsWithAnchor) => Promise<import("./types").QueryCorrelationSamplesWithAnchorResponse>;
|
|
54
57
|
export declare const saveStateOfMindSample: (date: Date, kind: import("./types").StateOfMindKind, valence: number, labels: readonly import("./types").StateOfMindLabel[], associations: readonly import("./types").StateOfMindAssociation[], metadata?: import("react-native-nitro-modules").AnyMap) => Promise<boolean>;
|
|
55
58
|
export declare function getMostRecentCategorySample<T extends CategoryTypeIdentifier>(_identifier: T): Promise<CategorySampleTyped<T> | undefined>;
|
|
56
59
|
export declare const getMostRecentQuantitySample: typeof import("./healthkit.ios").getMostRecentQuantitySample;
|
|
@@ -76,7 +79,13 @@ declare const subscribeToQuantitySamples: (identifier: import("./types").Quantit
|
|
|
76
79
|
remove: () => boolean;
|
|
77
80
|
};
|
|
78
81
|
export { subscribeToQuantitySamples };
|
|
79
|
-
declare const
|
|
80
|
-
export
|
|
82
|
+
export declare const currentAppSource: () => SourceProxy;
|
|
83
|
+
export declare const queryMedications: () => Promise<readonly import("./specs/MedicationModule.nitro").UserAnnotatedMedication[]>;
|
|
84
|
+
export declare const queryMedicationEvents: (options: QueryOptionsWithSortOrder) => Promise<readonly import("./specs/MedicationModule.nitro").MedicationDoseEvent[]>;
|
|
85
|
+
export declare const queryMedicationEventsWithAnchor: (options: QueryOptionsWithAnchor) => Promise<import("./specs/MedicationModule.nitro").MedicationDoseEventsWithAnchorResponse>;
|
|
86
|
+
export declare const useSubscribeToQuantitySamples: typeof import("./healthkit.ios").useSubscribeToQuantitySamples;
|
|
87
|
+
export declare const useSubscribeToCategorySamples: typeof import("./healthkit.ios").useSubscribeToCategorySamples;
|
|
88
|
+
export declare const subscribeToCategorySamples: typeof import("./healthkit.ios").subscribeToCategorySamples;
|
|
89
|
+
export declare const requestMedicationsAuthorization: () => Promise<boolean>;
|
|
81
90
|
declare const _default: typeof ReactNativeHealthkit;
|
|
82
91
|
export default _default;
|
|
@@ -5,6 +5,7 @@ import useMostRecentQuantitySample from './hooks/useMostRecentQuantitySample';
|
|
|
5
5
|
import useMostRecentWorkout from './hooks/useMostRecentWorkout';
|
|
6
6
|
import useSources from './hooks/useSources';
|
|
7
7
|
import useStatisticsForQuantity from './hooks/useStatisticsForQuantity';
|
|
8
|
+
import useSubscribeToCategorySamples from './hooks/useSubscribeToCategorySamples';
|
|
8
9
|
import useSubscribeToChanges from './hooks/useSubscribeToChanges';
|
|
9
10
|
import useSubscribeToQuantitySamples from './hooks/useSubscribeToQuantitySamples';
|
|
10
11
|
import type { QuantityTypeIdentifier } from './types/QuantityTypeIdentifier';
|
|
@@ -12,6 +13,7 @@ import getMostRecentCategorySample from './utils/getMostRecentCategorySample';
|
|
|
12
13
|
import getMostRecentQuantitySample from './utils/getMostRecentQuantitySample';
|
|
13
14
|
import getMostRecentWorkout from './utils/getMostRecentWorkout';
|
|
14
15
|
import getPreferredUnit from './utils/getPreferredUnit';
|
|
16
|
+
import { subscribeToCategorySamples } from './utils/subscribeToCategorySamples';
|
|
15
17
|
import { subscribeToChanges } from './utils/subscribeToChanges';
|
|
16
18
|
import { subscribeToQuantitySamples } from './utils/subscribeToQuantitySamples';
|
|
17
19
|
export * from './types';
|
|
@@ -24,7 +26,7 @@ type QuantityTypesIOS17Plus = 'HKQuantityTypeIdentifierCyclingCadence' | 'HKQuan
|
|
|
24
26
|
* Available quantity types for iOS versions before iOS 17
|
|
25
27
|
*/
|
|
26
28
|
export type AvailableQuantityTypesBeforeIOS17 = Exclude<QuantityTypeIdentifier, QuantityTypesIOS17Plus>;
|
|
27
|
-
export { getMostRecentCategorySample, getMostRecentQuantitySample, getMostRecentWorkout, getPreferredUnit, subscribeToChanges, subscribeToQuantitySamples, useHealthkitAuthorization, useIsHealthDataAvailable, useMostRecentCategorySample, useMostRecentQuantitySample, useMostRecentWorkout, useSources, useStatisticsForQuantity, useSubscribeToChanges, useSubscribeToQuantitySamples, };
|
|
29
|
+
export { getMostRecentCategorySample, getMostRecentQuantitySample, getMostRecentWorkout, getPreferredUnit, subscribeToCategorySamples, subscribeToChanges, subscribeToQuantitySamples, useHealthkitAuthorization, useIsHealthDataAvailable, useMostRecentCategorySample, useMostRecentQuantitySample, useMostRecentWorkout, useSources, useStatisticsForQuantity, useSubscribeToCategorySamples, useSubscribeToChanges, useSubscribeToQuantitySamples, };
|
|
28
30
|
/**
|
|
29
31
|
* Available quantity types for iOS 17 and later (all quantity types)
|
|
30
32
|
*/
|
|
@@ -48,20 +50,21 @@ export declare const getRequestStatusForAuthorization: (toCheck: import("./specs
|
|
|
48
50
|
export declare const getWheelchairUse: () => import("./types").WheelchairUse;
|
|
49
51
|
export declare const isHealthDataAvailable: () => boolean;
|
|
50
52
|
export declare const isHealthDataAvailableAsync: () => Promise<boolean>;
|
|
51
|
-
export declare const queryCategorySamples: <T extends import("./types").CategoryTypeIdentifier>(identifier: T, options
|
|
53
|
+
export declare const queryCategorySamples: <T extends import("./types").CategoryTypeIdentifier>(identifier: T, options: import("./types").QueryOptionsWithSortOrder) => Promise<readonly import("./types").CategorySampleTyped<T>[]>;
|
|
52
54
|
export declare const queryCategorySamplesWithAnchor: <T extends import("./types").CategoryTypeIdentifier>(identifier: T, options: import("./types").QueryOptionsWithAnchor) => Promise<import("./types").CategorySamplesWithAnchorResponseTyped<T>>;
|
|
53
|
-
export declare const queryCorrelationSamples: (typeIdentifier: import("./types").CorrelationTypeIdentifier,
|
|
54
|
-
export declare const
|
|
55
|
+
export declare const queryCorrelationSamples: (typeIdentifier: import("./types").CorrelationTypeIdentifier, options: import("./types").QueryOptionsWithSortOrder) => Promise<readonly import("./types").CorrelationSample[]>;
|
|
56
|
+
export declare const queryCorrelationSamplesWithAnchor: (typeIdentifier: import("./types").CorrelationTypeIdentifier, options: import("./types").QueryOptionsWithAnchor) => Promise<import("./types").QueryCorrelationSamplesWithAnchorResponse>;
|
|
57
|
+
export declare const queryHeartbeatSeriesSamples: (options: import("./types").QueryOptionsWithSortOrder) => Promise<readonly import("./types").HeartbeatSeriesSample[]>;
|
|
55
58
|
export declare const queryHeartbeatSeriesSamplesWithAnchor: (options: import("./types").QueryOptionsWithAnchor) => Promise<import("./types").HeartbeatSeriesSamplesWithAnchorResponse>;
|
|
56
|
-
export declare const queryElectrocardiogramSamples: (options
|
|
59
|
+
export declare const queryElectrocardiogramSamples: (options: import("./types/ElectrocardiogramSample").ECGQueryOptionsWithSortOrder) => Promise<readonly import("./types/ElectrocardiogramSample").ElectrocardiogramSample[]>;
|
|
57
60
|
export declare const queryElectrocardiogramSamplesWithAnchor: (options: import("./types/ElectrocardiogramSample").ECGQueryOptionsWithAnchor) => Promise<import("./types/ElectrocardiogramSample").ElectrocardiogramSamplesWithAnchorResponse>;
|
|
58
|
-
export declare const queryQuantitySamples: (identifier: QuantityTypeIdentifier, options
|
|
61
|
+
export declare const queryQuantitySamples: (identifier: QuantityTypeIdentifier, options: import("./types").QueryOptionsWithSortOrderAndUnit) => Promise<readonly import("./types").QuantitySample[]>;
|
|
59
62
|
export declare const queryQuantitySamplesWithAnchor: (identifier: QuantityTypeIdentifier, options: import("./types").QueryOptionsWithAnchorAndUnit) => Promise<import("./types").QuantitySamplesWithAnchorResponse>;
|
|
60
63
|
export declare const queryStatisticsForQuantity: (identifier: QuantityTypeIdentifier, statistics: readonly import("./types").StatisticsOptions[], options?: import("./types").StatisticsQueryOptions) => Promise<import("./types").QueryStatisticsResponse>;
|
|
61
64
|
export declare const queryStatisticsCollectionForQuantity: (identifier: QuantityTypeIdentifier, statistics: readonly import("./types").StatisticsOptions[], anchorDate: Date, intervalComponents: import("./types").IntervalComponents, options?: import("./types").StatisticsQueryOptions) => Promise<readonly import("./types").QueryStatisticsResponse[]>;
|
|
62
65
|
export declare const queryWorkoutSamples: (options: import("./types").WorkoutQueryOptions) => Promise<import("./specs/WorkoutProxy.nitro").WorkoutProxy[]>;
|
|
63
66
|
export declare const queryWorkoutSamplesWithAnchor: (options: import("./types").WorkoutQueryOptionsWithAnchor) => Promise<import("./types").QueryWorkoutSamplesWithAnchorResponse>;
|
|
64
|
-
export declare const querySources: (identifier: import("./types").SampleTypeIdentifier) => Promise<readonly import("./specs/SourceProxy.nitro").SourceProxy[]>;
|
|
67
|
+
export declare const querySources: (identifier: import("./types").SampleTypeIdentifier, filter?: import("./types").FilterForSamples) => Promise<readonly import("./specs/SourceProxy.nitro").SourceProxy[]>;
|
|
65
68
|
export declare const requestAuthorization: (toRequest: import("./specs/CoreModule.nitro").AuthDataTypes) => Promise<boolean>;
|
|
66
69
|
export declare const deleteObjects: (objectTypeIdentifier: import("./types").ObjectTypeIdentifier, filter: import("./types").FilterForSamples) => Promise<number>;
|
|
67
70
|
export declare const saveCategorySample: <T extends import("./types").CategoryTypeIdentifier>(identifier: T, value: import("./types").CategoryValueForIdentifier, startDate: Date, endDate: Date, metadata: import("./types").MetadataForCategoryIdentifier<T>) => Promise<boolean>;
|
|
@@ -70,13 +73,19 @@ export declare const saveQuantitySample: (identifier: QuantityTypeIdentifier, un
|
|
|
70
73
|
export declare const saveWorkoutSample: (workoutActivityType: import("./types").WorkoutActivityType, quantities: readonly import("./types").QuantitySampleForSaving[], startDate: Date, endDate: Date, totals?: import("./types").WorkoutTotals, metadata?: import("react-native-nitro-modules").AnyMap) => Promise<import("./specs/WorkoutProxy.nitro").WorkoutProxy>;
|
|
71
74
|
export declare const startWatchApp: (workoutConfiguration: import("./types").WorkoutConfiguration) => Promise<boolean>;
|
|
72
75
|
export declare const isProtectedDataAvailable: () => boolean;
|
|
73
|
-
export declare const queryStateOfMindSamples: (options
|
|
76
|
+
export declare const queryStateOfMindSamples: (options: import("./types").QueryOptionsWithSortOrder) => Promise<readonly import("./types").StateOfMindSample[]>;
|
|
77
|
+
export declare const queryStateOfMindSamplesWithAnchor: (options: import("./types").QueryOptionsWithAnchor) => Promise<import("./types").StateOfMindSamplesWithAnchorResponse>;
|
|
74
78
|
export declare const saveStateOfMindSample: (date: Date, kind: import("./types").StateOfMindKind, valence: number, labels: readonly import("./types").StateOfMindLabel[], associations: readonly import("./types").StateOfMindAssociation[], metadata?: import("react-native-nitro-modules").AnyMap) => Promise<boolean>;
|
|
75
79
|
export declare const isQuantityCompatibleWithUnit: (identifier: QuantityTypeIdentifier, unit: string) => boolean;
|
|
76
80
|
export declare const isObjectTypeAvailable: (objectTypeIdentifier: import("./types").ObjectTypeIdentifier) => boolean;
|
|
77
81
|
export declare const isObjectTypeAvailableAsync: (objectTypeIdentifier: import("./types").ObjectTypeIdentifier) => Promise<boolean>;
|
|
78
82
|
export declare const areObjectTypesAvailable: (objectTypeIdentifiers: readonly import("./types").ObjectTypeIdentifier[]) => Record<string, boolean>;
|
|
79
83
|
export declare const areObjectTypesAvailableAsync: (objectTypeIdentifiers: import("./types").ObjectTypeIdentifier[]) => Promise<Record<string, boolean>>;
|
|
84
|
+
export declare const requestMedicationsAuthorization: () => Promise<boolean>;
|
|
85
|
+
export declare const queryMedications: () => Promise<readonly import("./specs/MedicationModule.nitro").UserAnnotatedMedication[]>;
|
|
86
|
+
export declare const queryMedicationEvents: (options: import("./types").QueryOptionsWithSortOrder) => Promise<readonly import("./specs/MedicationModule.nitro").MedicationDoseEvent[]>;
|
|
87
|
+
export declare const queryMedicationEventsWithAnchor: (options: import("./types").QueryOptionsWithAnchor) => Promise<import("./specs/MedicationModule.nitro").MedicationDoseEventsWithAnchorResponse>;
|
|
88
|
+
export declare const currentAppSource: () => import("./specs/SourceProxy.nitro").SourceProxy;
|
|
80
89
|
export declare const getBiologicalSexAsync: () => Promise<import("./types").BiologicalSex>;
|
|
81
90
|
export declare const getBloodTypeAsync: () => Promise<import("./types").BloodType>;
|
|
82
91
|
export declare const getDateOfBirthAsync: () => Promise<Date | undefined>;
|
|
@@ -110,20 +119,21 @@ declare const _default: {
|
|
|
110
119
|
getWheelchairUse: () => import("./types").WheelchairUse;
|
|
111
120
|
isHealthDataAvailable: () => boolean;
|
|
112
121
|
isHealthDataAvailableAsync: () => Promise<boolean>;
|
|
113
|
-
queryCategorySamples: <T extends import("./types").CategoryTypeIdentifier>(identifier: T, options
|
|
122
|
+
queryCategorySamples: <T extends import("./types").CategoryTypeIdentifier>(identifier: T, options: import("./types").QueryOptionsWithSortOrder) => Promise<readonly import("./types").CategorySampleTyped<T>[]>;
|
|
114
123
|
queryCategorySamplesWithAnchor: <T extends import("./types").CategoryTypeIdentifier>(identifier: T, options: import("./types").QueryOptionsWithAnchor) => Promise<import("./types").CategorySamplesWithAnchorResponseTyped<T>>;
|
|
115
|
-
queryCorrelationSamples: (typeIdentifier: import("./types").CorrelationTypeIdentifier,
|
|
116
|
-
|
|
124
|
+
queryCorrelationSamples: (typeIdentifier: import("./types").CorrelationTypeIdentifier, options: import("./types").QueryOptionsWithSortOrder) => Promise<readonly import("./types").CorrelationSample[]>;
|
|
125
|
+
queryCorrelationSamplesWithAnchor: (typeIdentifier: import("./types").CorrelationTypeIdentifier, options: import("./types").QueryOptionsWithAnchor) => Promise<import("./types").QueryCorrelationSamplesWithAnchorResponse>;
|
|
126
|
+
queryHeartbeatSeriesSamples: (options: import("./types").QueryOptionsWithSortOrder) => Promise<readonly import("./types").HeartbeatSeriesSample[]>;
|
|
117
127
|
queryHeartbeatSeriesSamplesWithAnchor: (options: import("./types").QueryOptionsWithAnchor) => Promise<import("./types").HeartbeatSeriesSamplesWithAnchorResponse>;
|
|
118
|
-
queryElectrocardiogramSamples: (options
|
|
128
|
+
queryElectrocardiogramSamples: (options: import("./types/ElectrocardiogramSample").ECGQueryOptionsWithSortOrder) => Promise<readonly import("./types/ElectrocardiogramSample").ElectrocardiogramSample[]>;
|
|
119
129
|
queryElectrocardiogramSamplesWithAnchor: (options: import("./types/ElectrocardiogramSample").ECGQueryOptionsWithAnchor) => Promise<import("./types/ElectrocardiogramSample").ElectrocardiogramSamplesWithAnchorResponse>;
|
|
120
|
-
queryQuantitySamples: (identifier: QuantityTypeIdentifier, options
|
|
130
|
+
queryQuantitySamples: (identifier: QuantityTypeIdentifier, options: import("./types").QueryOptionsWithSortOrderAndUnit) => Promise<readonly import("./types").QuantitySample[]>;
|
|
121
131
|
queryQuantitySamplesWithAnchor: (identifier: QuantityTypeIdentifier, options: import("./types").QueryOptionsWithAnchorAndUnit) => Promise<import("./types").QuantitySamplesWithAnchorResponse>;
|
|
122
132
|
queryStatisticsForQuantity: (identifier: QuantityTypeIdentifier, statistics: readonly import("./types").StatisticsOptions[], options?: import("./types").StatisticsQueryOptions) => Promise<import("./types").QueryStatisticsResponse>;
|
|
123
133
|
queryStatisticsCollectionForQuantity: (identifier: QuantityTypeIdentifier, statistics: readonly import("./types").StatisticsOptions[], anchorDate: Date, intervalComponents: import("./types").IntervalComponents, options?: import("./types").StatisticsQueryOptions) => Promise<readonly import("./types").QueryStatisticsResponse[]>;
|
|
124
134
|
queryWorkoutSamples: (options: import("./types").WorkoutQueryOptions) => Promise<import("./specs/WorkoutProxy.nitro").WorkoutProxy[]>;
|
|
125
135
|
queryWorkoutSamplesWithAnchor: (options: import("./types").WorkoutQueryOptionsWithAnchor) => Promise<import("./types").QueryWorkoutSamplesWithAnchorResponse>;
|
|
126
|
-
querySources: (identifier: import("./types").SampleTypeIdentifier) => Promise<readonly import("./specs/SourceProxy.nitro").SourceProxy[]>;
|
|
136
|
+
querySources: (identifier: import("./types").SampleTypeIdentifier, filter?: import("./types").FilterForSamples) => Promise<readonly import("./specs/SourceProxy.nitro").SourceProxy[]>;
|
|
127
137
|
requestAuthorization: (toRequest: import("./specs/CoreModule.nitro").AuthDataTypes) => Promise<boolean>;
|
|
128
138
|
deleteObjects: (objectTypeIdentifier: import("./types").ObjectTypeIdentifier, filter: import("./types").FilterForSamples) => Promise<number>;
|
|
129
139
|
saveCategorySample: <T extends import("./types").CategoryTypeIdentifier>(identifier: T, value: import("./types").CategoryValueForIdentifier, startDate: Date, endDate: Date, metadata: import("./types").MetadataForCategoryIdentifier<T>) => Promise<boolean>;
|
|
@@ -138,8 +148,16 @@ declare const _default: {
|
|
|
138
148
|
};
|
|
139
149
|
startWatchApp: (workoutConfiguration: import("./types").WorkoutConfiguration) => Promise<boolean>;
|
|
140
150
|
isProtectedDataAvailable: () => boolean;
|
|
141
|
-
queryStateOfMindSamples: (options
|
|
151
|
+
queryStateOfMindSamples: (options: import("./types").QueryOptionsWithSortOrder) => Promise<readonly import("./types").StateOfMindSample[]>;
|
|
152
|
+
queryStateOfMindSamplesWithAnchor: (options: import("./types").QueryOptionsWithAnchor) => Promise<import("./types").StateOfMindSamplesWithAnchorResponse>;
|
|
142
153
|
saveStateOfMindSample: (date: Date, kind: import("./types").StateOfMindKind, valence: number, labels: readonly import("./types").StateOfMindLabel[], associations: readonly import("./types").StateOfMindAssociation[], metadata?: import("react-native-nitro-modules").AnyMap) => Promise<boolean>;
|
|
154
|
+
requestMedicationsAuthorization: () => Promise<boolean>;
|
|
155
|
+
currentAppSource: () => import("./specs/SourceProxy.nitro").SourceProxy;
|
|
156
|
+
queryMedicationEventsWithAnchor: (options: import("./types").QueryOptionsWithAnchor) => Promise<import("./specs/MedicationModule.nitro").MedicationDoseEventsWithAnchorResponse>;
|
|
157
|
+
queryMedicationEvents: (options: import("./types").QueryOptionsWithSortOrder) => Promise<readonly import("./specs/MedicationModule.nitro").MedicationDoseEvent[]>;
|
|
158
|
+
queryMedications: () => Promise<readonly import("./specs/MedicationModule.nitro").UserAnnotatedMedication[]>;
|
|
159
|
+
subscribeToCategorySamples: typeof subscribeToCategorySamples;
|
|
160
|
+
useSubscribeToCategorySamples: typeof useSubscribeToCategorySamples;
|
|
143
161
|
useMostRecentCategorySample: typeof useMostRecentCategorySample;
|
|
144
162
|
useMostRecentQuantitySample: typeof useMostRecentQuantitySample;
|
|
145
163
|
useMostRecentWorkout: typeof useMostRecentWorkout;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { CategoryTypeIdentifier, OnCategorySamplesCallback } from '../types';
|
|
2
|
+
export declare function useSubscribeToCategorySamples<TIdentifier extends CategoryTypeIdentifier>(identifier: TIdentifier, onChange: (args: OnCategorySamplesCallback<TIdentifier>) => void): void;
|
|
3
|
+
export default useSubscribeToCategorySamples;
|
|
@@ -4,10 +4,12 @@ import type { CoreModule } from './specs/CoreModule.nitro';
|
|
|
4
4
|
import type { CorrelationTypeModule } from './specs/CorrelationTypeModule.nitro';
|
|
5
5
|
import type { ElectrocardiogramModule } from './specs/ElectrocardiogramModule.nitro';
|
|
6
6
|
import type { HeartbeatSeriesModule } from './specs/HeartbeatSeriesModule.nitro';
|
|
7
|
+
import type { MedicationModule } from './specs/MedicationModule.nitro';
|
|
7
8
|
import type { QuantityTypeModule } from './specs/QuantityTypeModule.nitro';
|
|
8
9
|
import type { StateOfMindModule } from './specs/StateOfMindModule.nitro';
|
|
9
10
|
import type { WorkoutsModule } from './specs/WorkoutsModule.nitro';
|
|
10
11
|
export declare const Core: CoreModule;
|
|
12
|
+
export declare const Medication: MedicationModule;
|
|
11
13
|
export declare const Workouts: WorkoutsModule;
|
|
12
14
|
export declare const Characteristics: CharacteristicTypeModule;
|
|
13
15
|
export declare const QuantityTypes: QuantityTypeModule;
|
|
@@ -6,11 +6,11 @@ export interface CategoryTypeModule extends HybridObject<{
|
|
|
6
6
|
ios: 'swift';
|
|
7
7
|
}> {
|
|
8
8
|
saveCategorySample(identifier: CategoryTypeIdentifier, value: CategoryValueForIdentifier, startDate: Date, endDate: Date, metadata: AnyMap): Promise<boolean>;
|
|
9
|
-
queryCategorySamples(identifier: CategoryTypeIdentifier, options
|
|
9
|
+
queryCategorySamples(identifier: CategoryTypeIdentifier, options: QueryOptionsWithSortOrder): Promise<readonly CategorySample[]>;
|
|
10
10
|
queryCategorySamplesWithAnchor(identifier: CategoryTypeIdentifier, options: QueryOptionsWithAnchor): Promise<CategorySamplesWithAnchorResponse>;
|
|
11
11
|
}
|
|
12
12
|
export interface CategoryTypeModuleTyped {
|
|
13
13
|
saveCategorySample<T extends CategoryTypeIdentifier>(identifier: T, value: CategoryValueForIdentifier, startDate: Date, endDate: Date, metadata: MetadataForCategoryIdentifier<T>): Promise<boolean>;
|
|
14
|
-
queryCategorySamples<T extends CategoryTypeIdentifier>(identifier: T, options
|
|
14
|
+
queryCategorySamples<T extends CategoryTypeIdentifier>(identifier: T, options: QueryOptionsWithSortOrder): Promise<readonly CategorySampleTyped<T>[]>;
|
|
15
15
|
queryCategorySamplesWithAnchor<T extends CategoryTypeIdentifier>(identifier: T, options: QueryOptionsWithAnchor): Promise<CategorySamplesWithAnchorResponseTyped<T>>;
|
|
16
16
|
}
|
|
@@ -33,8 +33,9 @@ export interface CoreModule extends HybridObject<{
|
|
|
33
33
|
isHealthDataAvailableAsync(): Promise<boolean>;
|
|
34
34
|
isProtectedDataAvailable(): boolean;
|
|
35
35
|
isProtectedDataAvailableAsync(): Promise<boolean>;
|
|
36
|
+
currentAppSource(): SourceProxy;
|
|
36
37
|
getPreferredUnits(identifiers: readonly QuantityTypeIdentifier[], forceUpdate?: boolean): Promise<IdentifierWithUnit[]>;
|
|
37
|
-
querySources(identifier: SampleTypeIdentifier): Promise<readonly SourceProxy[]>;
|
|
38
|
+
querySources(identifier: SampleTypeIdentifier, filter?: FilterForSamples): Promise<readonly SourceProxy[]>;
|
|
38
39
|
/** @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-requestauthorizationtoaccess Apple Docs }
|
|
39
40
|
* @param {SampleTypeIdentifier} typeIdentifier - The type identifier of the sample to request authorization for.
|
|
40
41
|
* @param {(args: OnChangeCallbackArgs) => void} callback - An array of type identifiers that the app wants to write.
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { AnyMap, HybridObject } from 'react-native-nitro-modules';
|
|
2
|
-
import type {
|
|
2
|
+
import type { QueryOptionsWithAnchor, QueryOptionsWithSortOrder } from '../types';
|
|
3
|
+
import type { CorrelationSample, CorrelationTypeIdentifier, QueryCorrelationSamplesWithAnchorResponse, SampleForSaving } from '../types/CorrelationType';
|
|
3
4
|
export interface CorrelationTypeModule extends HybridObject<{
|
|
4
5
|
ios: 'swift';
|
|
5
6
|
}> {
|
|
6
7
|
saveCorrelationSample(typeIdentifier: CorrelationTypeIdentifier, samples: SampleForSaving[], start: Date, end: Date, metadata: AnyMap): Promise<boolean>;
|
|
7
|
-
queryCorrelationSamples(typeIdentifier: CorrelationTypeIdentifier,
|
|
8
|
+
queryCorrelationSamples(typeIdentifier: CorrelationTypeIdentifier, options: QueryOptionsWithSortOrder): Promise<readonly CorrelationSample[]>;
|
|
9
|
+
queryCorrelationSamplesWithAnchor(typeIdentifier: CorrelationTypeIdentifier, options: QueryOptionsWithAnchor): Promise<QueryCorrelationSamplesWithAnchorResponse>;
|
|
8
10
|
}
|