@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,140 @@
|
|
|
1
|
+
import type { AnyMap, HybridObject } from 'react-native-nitro-modules'
|
|
2
|
+
import type {
|
|
3
|
+
BaseSample,
|
|
4
|
+
DeletedSample,
|
|
5
|
+
Device,
|
|
6
|
+
SourceRevision,
|
|
7
|
+
} from '../types'
|
|
8
|
+
import type {
|
|
9
|
+
QueryOptionsWithAnchor,
|
|
10
|
+
QueryOptionsWithSortOrder,
|
|
11
|
+
} from '../types/QueryOptions'
|
|
12
|
+
|
|
13
|
+
enum MedicationDoseEventScheduleType {
|
|
14
|
+
asNeeded = 1,
|
|
15
|
+
/// The person logged this dose event in response to a scheduled medication reminder.
|
|
16
|
+
schedule = 2,
|
|
17
|
+
}
|
|
18
|
+
enum MedicationDoseEventLogStatus {
|
|
19
|
+
notInteracted = 1,
|
|
20
|
+
/// The system assigns this status when it fails to deliver a scheduled medication notification.
|
|
21
|
+
///
|
|
22
|
+
/// The system can generate this status because of a person's notification
|
|
23
|
+
/// restrictions or issues with notification delivery.
|
|
24
|
+
notificationNotSent = 2,
|
|
25
|
+
/// The person snoozes a scheduled medication notification.
|
|
26
|
+
snoozed = 3,
|
|
27
|
+
/// The person logs that they took the medication dose.
|
|
28
|
+
taken = 4,
|
|
29
|
+
/// The person logs that they skipped the medication dose.
|
|
30
|
+
skipped = 5,
|
|
31
|
+
/// The person undoes a previously logged medication status.
|
|
32
|
+
///
|
|
33
|
+
/// The system clears the prior status.
|
|
34
|
+
notLogged = 6,
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface RelatedCoding {
|
|
38
|
+
system: string
|
|
39
|
+
code: string
|
|
40
|
+
version?: string
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
type GeneralForm =
|
|
44
|
+
/// The medication comes in capsule form, such as a hard-shell capsule or softgel.
|
|
45
|
+
| 'capsule'
|
|
46
|
+
|
|
47
|
+
/// The medication is applied as a cream.
|
|
48
|
+
| 'cream'
|
|
49
|
+
|
|
50
|
+
/// The medication is administered through a device, such as an infusion pump for controlled fluid delivery.
|
|
51
|
+
| 'device'
|
|
52
|
+
|
|
53
|
+
/// The medication is taken as drops, for example eye drops or ear drops.
|
|
54
|
+
| 'drops'
|
|
55
|
+
|
|
56
|
+
/// The medication is applied as a foam.
|
|
57
|
+
| 'foam'
|
|
58
|
+
|
|
59
|
+
/// The medication is applied as a gel.
|
|
60
|
+
| 'gel'
|
|
61
|
+
|
|
62
|
+
/// The medication is delivered through an inhaler.
|
|
63
|
+
| 'inhaler'
|
|
64
|
+
|
|
65
|
+
/// The medication is given as an injection.
|
|
66
|
+
| 'injection'
|
|
67
|
+
|
|
68
|
+
/// The medication is taken as a liquid, such as a syrup.
|
|
69
|
+
| 'liquid'
|
|
70
|
+
|
|
71
|
+
/// The medication is applied as a lotion.
|
|
72
|
+
| 'lotion'
|
|
73
|
+
|
|
74
|
+
/// The medication is applied as an ointment.
|
|
75
|
+
| 'ointment'
|
|
76
|
+
|
|
77
|
+
/// The medication is applied as a patch worn on the skin.
|
|
78
|
+
| 'patch'
|
|
79
|
+
|
|
80
|
+
/// The medication is taken as a powder.
|
|
81
|
+
| 'powder'
|
|
82
|
+
|
|
83
|
+
/// The medication is delivered as a spray, for example a nasal spray or throat spray.
|
|
84
|
+
| 'spray'
|
|
85
|
+
|
|
86
|
+
/// The medication is delivered as a suppository.
|
|
87
|
+
| 'suppository'
|
|
88
|
+
|
|
89
|
+
/// The medication is taken as a tablet.
|
|
90
|
+
| 'tablet'
|
|
91
|
+
|
|
92
|
+
/// The medication is applied topically in a form that wasn't specified.
|
|
93
|
+
| 'topical'
|
|
94
|
+
|
|
95
|
+
/// The system doesn't know the general form of the medication.
|
|
96
|
+
| 'unknown'
|
|
97
|
+
|
|
98
|
+
interface MedicationConcept {
|
|
99
|
+
identifier: string
|
|
100
|
+
displayText: string
|
|
101
|
+
generalForm: GeneralForm
|
|
102
|
+
relatedCodings: RelatedCoding[]
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface UserAnnotatedMedication {
|
|
106
|
+
isArchived: boolean
|
|
107
|
+
hasSchedule: boolean
|
|
108
|
+
nickname?: string
|
|
109
|
+
medication: MedicationConcept
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface MedicationDoseEvent extends BaseSample {
|
|
113
|
+
scheduleType: MedicationDoseEventScheduleType
|
|
114
|
+
medicationConceptIdentifier: string // not sure here
|
|
115
|
+
scheduledDate?: Date
|
|
116
|
+
scheduledDoseQuantity?: number
|
|
117
|
+
doseQuantity?: number
|
|
118
|
+
logStatus: MedicationDoseEventLogStatus
|
|
119
|
+
unit: string
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface MedicationDoseEventsWithAnchorResponse {
|
|
123
|
+
readonly samples: readonly MedicationDoseEvent[]
|
|
124
|
+
readonly deletedSamples: readonly DeletedSample[]
|
|
125
|
+
readonly newAnchor: string
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface MedicationModule extends HybridObject<{ ios: 'swift' }> {
|
|
129
|
+
queryMedications(): Promise<readonly UserAnnotatedMedication[]>
|
|
130
|
+
|
|
131
|
+
requestMedicationsAuthorization(): Promise<boolean>
|
|
132
|
+
|
|
133
|
+
queryMedicationEvents(
|
|
134
|
+
options: QueryOptionsWithSortOrder,
|
|
135
|
+
): Promise<readonly MedicationDoseEvent[]>
|
|
136
|
+
|
|
137
|
+
queryMedicationEventsWithAnchor(
|
|
138
|
+
options: QueryOptionsWithAnchor,
|
|
139
|
+
): Promise<MedicationDoseEventsWithAnchorResponse>
|
|
140
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AnyMap, HybridObject } from 'react-native-nitro-modules'
|
|
2
2
|
import type { QuantitySample } from '../types/QuantitySample'
|
|
3
3
|
import type {
|
|
4
|
+
AggregationStyle,
|
|
4
5
|
IntervalComponents,
|
|
5
6
|
QuantitySamplesWithAnchorResponse,
|
|
6
7
|
QueryStatisticsResponse,
|
|
@@ -9,7 +10,6 @@ import type {
|
|
|
9
10
|
} from '../types/QuantityType'
|
|
10
11
|
import type { QuantityTypeIdentifier } from '../types/QuantityTypeIdentifier'
|
|
11
12
|
import type {
|
|
12
|
-
FilterForSamples,
|
|
13
13
|
QueryOptionsWithAnchorAndUnit,
|
|
14
14
|
QueryOptionsWithSortOrderAndUnit,
|
|
15
15
|
} from '../types/QueryOptions'
|
|
@@ -20,6 +20,8 @@ export interface QuantityTypeModule extends HybridObject<{ ios: 'swift' }> {
|
|
|
20
20
|
unit: string,
|
|
21
21
|
): boolean
|
|
22
22
|
|
|
23
|
+
aggregationStyle(identifier: QuantityTypeIdentifier): AggregationStyle
|
|
24
|
+
|
|
23
25
|
saveQuantitySample(
|
|
24
26
|
identifier: QuantityTypeIdentifier,
|
|
25
27
|
unit: string,
|
|
@@ -29,14 +31,9 @@ export interface QuantityTypeModule extends HybridObject<{ ios: 'swift' }> {
|
|
|
29
31
|
metadata: AnyMap,
|
|
30
32
|
): Promise<boolean>
|
|
31
33
|
|
|
32
|
-
deleteQuantitySamples(
|
|
33
|
-
identifier: QuantityTypeIdentifier,
|
|
34
|
-
filter: FilterForSamples,
|
|
35
|
-
): Promise<boolean>
|
|
36
|
-
|
|
37
34
|
queryQuantitySamples(
|
|
38
35
|
identifier: QuantityTypeIdentifier,
|
|
39
|
-
options
|
|
36
|
+
options: QueryOptionsWithSortOrderAndUnit,
|
|
40
37
|
): Promise<readonly QuantitySample[]>
|
|
41
38
|
|
|
42
39
|
queryStatisticsForQuantity(
|
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import type { AnyMap, HybridObject } from 'react-native-nitro-modules'
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
QueryOptionsWithAnchor,
|
|
4
|
+
QueryOptionsWithSortOrder,
|
|
5
|
+
} from '../types/QueryOptions'
|
|
3
6
|
import type {
|
|
4
7
|
StateOfMindAssociation,
|
|
5
8
|
StateOfMindKind,
|
|
6
9
|
StateOfMindLabel,
|
|
7
10
|
StateOfMindSample,
|
|
11
|
+
StateOfMindSamplesWithAnchorResponse,
|
|
8
12
|
} from '../types/StateOfMind'
|
|
9
13
|
|
|
10
14
|
export interface StateOfMindModule extends HybridObject<{ ios: 'swift' }> {
|
|
11
15
|
queryStateOfMindSamples(
|
|
12
|
-
options
|
|
16
|
+
options: QueryOptionsWithSortOrder,
|
|
13
17
|
): Promise<readonly StateOfMindSample[]>
|
|
14
18
|
|
|
19
|
+
queryStateOfMindSamplesWithAnchor(
|
|
20
|
+
options: QueryOptionsWithAnchor,
|
|
21
|
+
): Promise<StateOfMindSamplesWithAnchorResponse>
|
|
22
|
+
|
|
15
23
|
saveStateOfMindSample(
|
|
16
24
|
date: Date,
|
|
17
25
|
kind: StateOfMindKind,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { AnyMap } from 'react-native-nitro-modules'
|
|
2
2
|
import type { CategoryTypeIdentifier } from './CategoryTypeIdentifier'
|
|
3
|
-
import type {
|
|
4
|
-
import type { DeletedSample, GenericMetadata } from './Shared'
|
|
3
|
+
import type { BaseSample, DeletedSample, GenericMetadata } from './Shared'
|
|
5
4
|
import type { SourceRevision } from './Source'
|
|
6
5
|
|
|
7
6
|
export type CategoryTypePresenceIdentifier =
|
|
@@ -180,15 +179,9 @@ export interface CategorySamplesWithAnchorResponse {
|
|
|
180
179
|
readonly newAnchor: string
|
|
181
180
|
}
|
|
182
181
|
|
|
183
|
-
export interface CategorySample {
|
|
184
|
-
readonly uuid: string
|
|
185
|
-
readonly device?: Device
|
|
182
|
+
export interface CategorySample extends BaseSample {
|
|
186
183
|
readonly categoryType: CategoryTypeIdentifier
|
|
187
|
-
readonly startDate: Date
|
|
188
|
-
readonly endDate: Date
|
|
189
184
|
readonly value: CategoryValueForIdentifier
|
|
190
|
-
readonly metadata: AnyMap
|
|
191
|
-
readonly sourceRevision?: SourceRevision
|
|
192
185
|
}
|
|
193
186
|
|
|
194
187
|
export interface CategorySamplesWithAnchorResponseTyped<
|
|
@@ -199,29 +192,29 @@ export interface CategorySamplesWithAnchorResponseTyped<
|
|
|
199
192
|
readonly newAnchor: string
|
|
200
193
|
}
|
|
201
194
|
|
|
202
|
-
export interface CategorySampleTyped<T extends CategoryTypeIdentifier> {
|
|
203
|
-
readonly uuid: string
|
|
204
|
-
readonly device?: Device
|
|
205
|
-
readonly categoryType: T
|
|
206
|
-
readonly startDate: Date
|
|
207
|
-
readonly endDate: Date
|
|
208
|
-
readonly value: CategoryValueForIdentifier<T>
|
|
209
|
-
readonly metadata: MetadataForCategoryIdentifier<T>
|
|
210
|
-
readonly sourceRevision?: SourceRevision
|
|
211
|
-
}
|
|
212
|
-
|
|
213
195
|
export type MetadataForCategoryIdentifier<
|
|
214
196
|
T extends CategoryTypeIdentifier = CategoryTypeIdentifier,
|
|
215
197
|
> = T extends 'HKCategoryTypeIdentifierSexualActivity'
|
|
216
198
|
? GenericMetadata & {
|
|
217
|
-
readonly HKSexualActivityProtectionUsed
|
|
199
|
+
readonly HKSexualActivityProtectionUsed?: boolean
|
|
218
200
|
}
|
|
219
201
|
: T extends 'HKCategoryTypeIdentifierMenstrualFlow'
|
|
220
202
|
? GenericMetadata & {
|
|
221
|
-
readonly HKMenstrualCycleStart
|
|
203
|
+
readonly HKMenstrualCycleStart?: boolean
|
|
222
204
|
}
|
|
223
205
|
: GenericMetadata
|
|
224
206
|
|
|
207
|
+
export interface CategorySampleTyped<T extends CategoryTypeIdentifier>
|
|
208
|
+
extends Omit<BaseSample, 'metadata'> {
|
|
209
|
+
readonly categoryType: T
|
|
210
|
+
readonly value: CategoryValueForIdentifier<T>
|
|
211
|
+
|
|
212
|
+
readonly metadata: MetadataForCategoryIdentifier<T>
|
|
213
|
+
|
|
214
|
+
readonly metadataSexualActivityProtectionUsed?: boolean
|
|
215
|
+
readonly metadataMenstrualCycleStart?: boolean
|
|
216
|
+
}
|
|
217
|
+
|
|
225
218
|
export type CategoryValueForIdentifier<
|
|
226
219
|
T extends CategoryTypeIdentifier = CategoryTypeIdentifier,
|
|
227
220
|
> = T extends 'HKCategoryTypeIdentifierCervicalMucusQuality'
|
package/src/types/Constants.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { AnyMap } from 'react-native-nitro-modules'
|
|
2
1
|
import type { CategorySample, CategorySampleForSaving } from './CategoryType'
|
|
3
2
|
import type { QuantitySample, QuantitySampleForSaving } from './QuantitySample'
|
|
4
|
-
import type {
|
|
3
|
+
import type { BaseSample, DeletedSample } from './Shared'
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* @see {@link https://developer.apple.com/documentation/healthkit/hkcorrelationtypeidentifier Apple Docs }
|
|
@@ -12,21 +11,17 @@ export type CorrelationTypeIdentifier =
|
|
|
12
11
|
|
|
13
12
|
type CorrelationObject = CategorySample | QuantitySample
|
|
14
13
|
|
|
15
|
-
export interface CorrelationSample {
|
|
16
|
-
readonly uuid: string
|
|
14
|
+
export interface CorrelationSample extends BaseSample {
|
|
17
15
|
readonly correlationType: CorrelationTypeIdentifier
|
|
18
16
|
readonly objects: readonly CorrelationObject[]
|
|
19
|
-
readonly metadata: AnyMap
|
|
20
|
-
readonly startDate: Date
|
|
21
|
-
readonly endDate: Date
|
|
22
|
-
}
|
|
23
17
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
> = TCorrelationTypeIdentifier extends 'CorrelationTypeIdentifierFood'
|
|
27
|
-
? GenericMetadata & {
|
|
28
|
-
readonly HKFoodType?: string
|
|
29
|
-
}
|
|
30
|
-
: GenericMetadata
|
|
18
|
+
readonly metadataFoodType?: string
|
|
19
|
+
}
|
|
31
20
|
|
|
32
21
|
export type SampleForSaving = CategorySampleForSaving | QuantitySampleForSaving
|
|
22
|
+
|
|
23
|
+
export interface QueryCorrelationSamplesWithAnchorResponse {
|
|
24
|
+
readonly correlations: readonly CorrelationSample[]
|
|
25
|
+
readonly deletedSamples: readonly DeletedSample[]
|
|
26
|
+
readonly newAnchor: string
|
|
27
|
+
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import type { AnyMap } from 'react-native-nitro-modules'
|
|
2
1
|
import type {
|
|
3
2
|
QueryOptionsWithAnchor,
|
|
4
3
|
QueryOptionsWithSortOrder,
|
|
5
4
|
} from '../types/QueryOptions'
|
|
6
|
-
import type {
|
|
7
|
-
import type { DeletedSample } from './Shared'
|
|
8
|
-
import type { SourceRevision } from './Source'
|
|
5
|
+
import type { BaseSample, DeletedSample } from './Shared'
|
|
9
6
|
|
|
10
7
|
// Enums mirror HealthKit; keep the union literal names stable.
|
|
11
8
|
export type ElectrocardiogramClassification =
|
|
@@ -26,23 +23,14 @@ export interface ElectrocardiogramVoltage {
|
|
|
26
23
|
readonly lead: ElectrocardiogramLead
|
|
27
24
|
}
|
|
28
25
|
|
|
29
|
-
export interface ElectrocardiogramSample {
|
|
30
|
-
readonly uuid: string
|
|
31
|
-
readonly device?: Device
|
|
32
|
-
readonly startDate: Date
|
|
33
|
-
readonly endDate: Date
|
|
34
|
-
|
|
26
|
+
export interface ElectrocardiogramSample extends BaseSample {
|
|
35
27
|
readonly classification: ElectrocardiogramClassification
|
|
36
28
|
readonly symptomsStatus: ElectrocardiogramSymptomsStatus
|
|
37
29
|
|
|
38
30
|
readonly averageHeartRateBpm?: number // HKQuantity (count/min)
|
|
39
31
|
readonly samplingFrequencyHz?: number // HKQuantity (Hz)
|
|
40
32
|
readonly numberOfVoltageMeasurements: number
|
|
41
|
-
readonly algorithmVersion?: string
|
|
42
33
|
readonly voltages?: readonly ElectrocardiogramVoltage[]
|
|
43
|
-
|
|
44
|
-
readonly metadata?: AnyMap
|
|
45
|
-
readonly sourceRevision?: SourceRevision
|
|
46
34
|
}
|
|
47
35
|
|
|
48
36
|
export interface ElectrocardiogramSamplesWithAnchorResponse {
|
|
@@ -1,25 +1,12 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Device } from './Device'
|
|
3
|
-
import type { DeletedSample, GenericMetadata } from './Shared'
|
|
4
|
-
import type { SourceRevision } from './Source'
|
|
5
|
-
|
|
6
|
-
export interface HeartbeatSeriesSampleMetadata extends GenericMetadata {
|
|
7
|
-
readonly HKMetadataKeyAlgorithmVersion: string
|
|
8
|
-
}
|
|
1
|
+
import type { BaseSample, DeletedSample } from './Shared'
|
|
9
2
|
|
|
10
3
|
export interface Heartbeat {
|
|
11
4
|
readonly timeSinceSeriesStart: number
|
|
12
5
|
readonly precededByGap: boolean
|
|
13
6
|
}
|
|
14
7
|
|
|
15
|
-
export interface HeartbeatSeriesSample {
|
|
16
|
-
readonly uuid: string
|
|
17
|
-
readonly device?: Device
|
|
18
|
-
readonly startDate: Date
|
|
19
|
-
readonly endDate: Date
|
|
8
|
+
export interface HeartbeatSeriesSample extends BaseSample {
|
|
20
9
|
readonly heartbeats: readonly Heartbeat[]
|
|
21
|
-
readonly metadata?: AnyMap
|
|
22
|
-
readonly sourceRevision?: SourceRevision
|
|
23
10
|
}
|
|
24
11
|
|
|
25
12
|
export interface HeartbeatSeriesSamplesWithAnchorResponse {
|
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
import type { AnyMap } from 'react-native-nitro-modules'
|
|
2
2
|
|
|
3
|
-
import type { Device } from './Device'
|
|
4
3
|
import type { QuantityTypeIdentifier } from './QuantityTypeIdentifier'
|
|
4
|
+
import type { BaseSample } from './Shared'
|
|
5
5
|
import type { SourceRevision } from './Source'
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @see {@link https://developer.apple.com/documentation/healthkit/hkquantitysample Apple Docs }
|
|
9
9
|
*/
|
|
10
|
-
export interface QuantitySample {
|
|
11
|
-
readonly uuid: string
|
|
12
|
-
readonly device?: Device
|
|
10
|
+
export interface QuantitySample extends BaseSample {
|
|
13
11
|
readonly quantityType: QuantityTypeIdentifier
|
|
14
|
-
readonly startDate: Date
|
|
15
|
-
readonly endDate: Date
|
|
16
12
|
readonly quantity: number
|
|
17
13
|
readonly unit: string
|
|
18
|
-
readonly metadata: AnyMap
|
|
19
|
-
readonly sourceRevision?: SourceRevision
|
|
20
14
|
}
|
|
21
15
|
|
|
22
16
|
export interface QuantitySampleForSaving {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { QuantitySample } from './QuantitySample'
|
|
2
2
|
import type { QuantityTypeIdentifier } from './QuantityTypeIdentifier'
|
|
3
3
|
import type { FilterForSamples } from './QueryOptions'
|
|
4
|
-
import type { DeletedSample
|
|
4
|
+
import type { DeletedSample } from './Shared'
|
|
5
5
|
import type {
|
|
6
6
|
BloodGlucoseUnit,
|
|
7
7
|
CountPerTime,
|
|
@@ -32,6 +32,13 @@ export interface QueryStatisticsResponse {
|
|
|
32
32
|
readonly endDate?: Date
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
export enum AggregationStyle {
|
|
36
|
+
cumulative = 0,
|
|
37
|
+
discreteArithmetic = 1,
|
|
38
|
+
discreteTemporallyWeighted = 2,
|
|
39
|
+
discreteEquivalentContinuousLevel = 3,
|
|
40
|
+
}
|
|
41
|
+
|
|
35
42
|
export interface QuantitySamplesWithAnchorResponse {
|
|
36
43
|
readonly samples: readonly QuantitySample[]
|
|
37
44
|
readonly deletedSamples: readonly DeletedSample[]
|
|
@@ -82,22 +89,6 @@ export type StatisticsOptions =
|
|
|
82
89
|
| 'mostRecent'
|
|
83
90
|
| 'separateBySource'
|
|
84
91
|
|
|
85
|
-
export type MetadataMapperForQuantityIdentifier<
|
|
86
|
-
TQuantityTypeIdentifier = QuantityTypeIdentifier,
|
|
87
|
-
> = TQuantityTypeIdentifier extends 'QuantityTypeIdentifierInsulinDelivery'
|
|
88
|
-
? GenericMetadata & {
|
|
89
|
-
readonly HKInsulinDeliveryReason: InsulinDeliveryReason
|
|
90
|
-
}
|
|
91
|
-
: TQuantityTypeIdentifier extends 'QuantityTypeIdentifierBloodGlucose'
|
|
92
|
-
? GenericMetadata & {
|
|
93
|
-
readonly HKBloodGlucoseMealTime?: number
|
|
94
|
-
}
|
|
95
|
-
: TQuantityTypeIdentifier extends 'QuantityTypeIdentifierHeartRate'
|
|
96
|
-
? GenericMetadata & {
|
|
97
|
-
readonly HKHeartRateMotionContext?: HeartRateMotionContext
|
|
98
|
-
}
|
|
99
|
-
: GenericMetadata
|
|
100
|
-
|
|
101
92
|
export type UnitForIdentifier<
|
|
102
93
|
T extends QuantityTypeIdentifier = QuantityTypeIdentifier,
|
|
103
94
|
> = T extends 'QuantityTypeIdentifierBloodGlucose'
|
|
@@ -8,7 +8,31 @@ export type QuantityTypeIdentifierReadOnly =
|
|
|
8
8
|
* @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierwalkingheartrateaverage Apple Docs HKQuantityTypeIdentifierWalkingHeartRateAverage}
|
|
9
9
|
* @since iOS 11.0
|
|
10
10
|
*/
|
|
11
|
-
'HKQuantityTypeIdentifierWalkingHeartRateAverage'
|
|
11
|
+
| 'HKQuantityTypeIdentifierWalkingHeartRateAverage'
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Atrial Fibrillation Burden
|
|
15
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifieratrialfibrillationburden Apple Docs HKQuantityTypeIdentifierAtrialFibrillationBurden}
|
|
16
|
+
* @since iOS 16
|
|
17
|
+
*/
|
|
18
|
+
| 'HKQuantityTypeIdentifierAtrialFibrillationBurden' // Scalar(Percent, 0.0 - 1.0), Discrete
|
|
19
|
+
/**
|
|
20
|
+
* Apple Exercise Time
|
|
21
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierappleexercisetime Apple Docs HKQuantityTypeIdentifierAppleExerciseTime}
|
|
22
|
+
*/
|
|
23
|
+
| 'HKQuantityTypeIdentifierAppleExerciseTime'
|
|
24
|
+
/**
|
|
25
|
+
* Apple Stand Time
|
|
26
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierapplestandtime Apple Docs HKQuantityTypeIdentifierAppleStandTime}
|
|
27
|
+
*/
|
|
28
|
+
| 'HKQuantityTypeIdentifierAppleStandTime'
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Apple Walking Steadiness
|
|
32
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierapplewalkingsteadiness Apple Docs HKQuantityTypeIdentifierAppleWalkingSteadiness}
|
|
33
|
+
* @since iOS 15
|
|
34
|
+
*/
|
|
35
|
+
| 'HKQuantityTypeIdentifierAppleWalkingSteadiness' // Scalar(Percent, 0.0 - 1.0), Discrete
|
|
12
36
|
|
|
13
37
|
/**
|
|
14
38
|
* Represents a quantity type identifier.
|
|
@@ -94,11 +118,6 @@ export type QuantityTypeIdentifierWriteable =
|
|
|
94
118
|
* @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifiernikefuel Apple Docs HKQuantityTypeIdentifierNikeFuel}
|
|
95
119
|
*/
|
|
96
120
|
| 'HKQuantityTypeIdentifierNikeFuel'
|
|
97
|
-
/**
|
|
98
|
-
* Apple Exercise Time
|
|
99
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierappleexercisetime Apple Docs HKQuantityTypeIdentifierAppleExerciseTime}
|
|
100
|
-
*/
|
|
101
|
-
| 'HKQuantityTypeIdentifierAppleExerciseTime'
|
|
102
121
|
/**
|
|
103
122
|
* Push Count
|
|
104
123
|
* @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierpushcount Apple Docs HKQuantityTypeIdentifierPushCount}
|
|
@@ -125,11 +144,6 @@ export type QuantityTypeIdentifierWriteable =
|
|
|
125
144
|
*/
|
|
126
145
|
| 'HKQuantityTypeIdentifierDistanceDownhillSnowSports'
|
|
127
146
|
|
|
128
|
-
/**
|
|
129
|
-
* Apple Stand Time
|
|
130
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierapplestandtime Apple Docs HKQuantityTypeIdentifierAppleStandTime}
|
|
131
|
-
*/
|
|
132
|
-
| 'HKQuantityTypeIdentifierAppleStandTime'
|
|
133
147
|
// Vitals
|
|
134
148
|
/**
|
|
135
149
|
* Heart Rate
|
|
@@ -557,13 +571,6 @@ export type QuantityTypeIdentifierWriteable =
|
|
|
557
571
|
*/
|
|
558
572
|
| 'HKQuantityTypeIdentifierAppleMoveTime' // Time, Cumulative
|
|
559
573
|
|
|
560
|
-
/**
|
|
561
|
-
* Apple Walking Steadiness
|
|
562
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierapplewalkingsteadiness Apple Docs HKQuantityTypeIdentifierAppleWalkingSteadiness}
|
|
563
|
-
* @since iOS 15
|
|
564
|
-
*/
|
|
565
|
-
| 'HKQuantityTypeIdentifierAppleWalkingSteadiness' // Scalar(Percent, 0.0 - 1.0), Discrete
|
|
566
|
-
|
|
567
574
|
/**
|
|
568
575
|
* Number Of Alcoholic Beverages
|
|
569
576
|
* @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifiernumberofalcoholicbeverages Apple Docs HKQuantityTypeIdentifierNumberOfAlcoholicBeverages}
|
|
@@ -571,13 +578,6 @@ export type QuantityTypeIdentifierWriteable =
|
|
|
571
578
|
*/
|
|
572
579
|
| 'HKQuantityTypeIdentifierNumberOfAlcoholicBeverages' // Scalar(Count), Cumulative
|
|
573
580
|
|
|
574
|
-
/**
|
|
575
|
-
* Atrial Fibrillation Burden
|
|
576
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifieratrialfibrillationburden Apple Docs HKQuantityTypeIdentifierAtrialFibrillationBurden}
|
|
577
|
-
* @since iOS 16
|
|
578
|
-
*/
|
|
579
|
-
| 'HKQuantityTypeIdentifierAtrialFibrillationBurden' // Scalar(Percent, 0.0 - 1.0), Discrete
|
|
580
|
-
|
|
581
581
|
/**
|
|
582
582
|
* Underwater Depth
|
|
583
583
|
* @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierunderwaterdepth Apple Docs HKQuantityTypeIdentifierUnderwaterDepth}
|
|
@@ -1,46 +1,43 @@
|
|
|
1
|
+
import type { SourceProxy } from '../specs/SourceProxy.nitro'
|
|
1
2
|
import type { WorkoutProxy } from '../specs/WorkoutProxy.nitro'
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
4
|
+
export enum ComparisonPredicateOperator {
|
|
5
|
+
lessThan = 0,
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
readonly uuids: readonly string[]
|
|
9
|
-
}
|
|
7
|
+
lessThanOrEqualTo = 1,
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
readonly startDate?: Date
|
|
13
|
-
readonly endDate?: Date
|
|
14
|
-
readonly strictEndDate?: boolean
|
|
15
|
-
readonly strictStartDate?: boolean
|
|
16
|
-
}
|
|
9
|
+
greaterThan = 2,
|
|
17
10
|
|
|
18
|
-
|
|
19
|
-
| 'equalTo'
|
|
20
|
-
| 'notEqualTo'
|
|
21
|
-
| 'greaterThan'
|
|
22
|
-
| 'lessThan'
|
|
11
|
+
greaterThanOrEqualTo = 3,
|
|
23
12
|
|
|
24
|
-
|
|
13
|
+
equalTo = 4,
|
|
25
14
|
|
|
26
|
-
|
|
27
|
-
readonly withMetadataKey: string
|
|
28
|
-
readonly operatorType?: PredicateWithMetadataOperator
|
|
29
|
-
readonly value?: PredicateWithMetadataValue
|
|
30
|
-
}
|
|
15
|
+
notEqualTo = 5,
|
|
31
16
|
|
|
32
|
-
|
|
33
|
-
readonly AND: PredicateForSamples[]
|
|
34
|
-
}
|
|
17
|
+
matches = 6,
|
|
35
18
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
19
|
+
like = 7,
|
|
20
|
+
|
|
21
|
+
beginsWith = 8,
|
|
22
|
+
|
|
23
|
+
endsWith = 9,
|
|
24
|
+
|
|
25
|
+
IN = 10,
|
|
26
|
+
|
|
27
|
+
customSelector = 11,
|
|
39
28
|
|
|
40
|
-
|
|
41
|
-
|
|
29
|
+
contains = 99,
|
|
30
|
+
|
|
31
|
+
between = 100,
|
|
42
32
|
}
|
|
43
33
|
|
|
34
|
+
type PredicateWithMetadataValue = string | number | Date | boolean
|
|
35
|
+
|
|
36
|
+
export interface PredicateWithMetadataKey {
|
|
37
|
+
readonly withMetadataKey: string
|
|
38
|
+
readonly operatorType?: ComparisonPredicateOperator
|
|
39
|
+
readonly value?: PredicateWithMetadataValue
|
|
40
|
+
}
|
|
44
41
|
// Computes and flattens object types
|
|
45
42
|
// biome-ignore lint/complexity/noBannedTypes: it works
|
|
46
43
|
type ComputeRaw<A> = A extends Function ? A : { [K in keyof A]: A[K] } & {}
|
|
@@ -63,23 +60,37 @@ type _Strict<U, UAll extends U = U> = U extends any
|
|
|
63
60
|
// The exported type you can copy into your codebase
|
|
64
61
|
export type StrictUnion<U extends object> = _Strict<U>
|
|
65
62
|
|
|
66
|
-
export
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
63
|
+
export interface DateFilter {
|
|
64
|
+
readonly startDate?: Date
|
|
65
|
+
readonly endDate?: Date
|
|
66
|
+
readonly strictEndDate?: boolean
|
|
67
|
+
readonly strictStartDate?: boolean
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface FilterForSamplesBase {
|
|
71
|
+
readonly uuid?: string
|
|
72
|
+
readonly uuids?: string[]
|
|
73
|
+
readonly metadata?: PredicateWithMetadataKey
|
|
74
|
+
readonly date?: DateFilter
|
|
75
|
+
readonly workout?: WorkoutProxy
|
|
76
|
+
readonly sources?: SourceProxy[]
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface FilterForSamples extends FilterForSamplesBase {
|
|
80
|
+
readonly OR?: FilterForSamplesBase[]
|
|
81
|
+
readonly NOT?: FilterForSamplesBase[]
|
|
82
|
+
readonly AND?: FilterForSamplesBase[]
|
|
83
|
+
}
|
|
84
|
+
|
|
77
85
|
/**
|
|
78
86
|
* Generic options for querying.
|
|
79
87
|
*/
|
|
80
88
|
export interface GenericQueryOptions {
|
|
81
89
|
filter?: FilterForSamples
|
|
82
|
-
|
|
90
|
+
/**
|
|
91
|
+
* Specify -1, 0 or any non-positive number for fetching all samples
|
|
92
|
+
* */
|
|
93
|
+
readonly limit: number
|
|
83
94
|
}
|
|
84
95
|
|
|
85
96
|
export interface QueryOptionsWithAnchor extends GenericQueryOptions {
|