@kingstinct/react-native-healthkit 14.1.0 → 15.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -2
- package/app.plugin.js +49 -94
- package/app.plugin.ts +6 -56
- package/ios/BackgroundDeliveryManager.swift +13 -6
- package/ios/BackgroundLaunchHook.mm +41 -0
- package/ios/Constants.swift +24 -0
- package/ios/CoreModule.swift +5 -1
- package/ios/Helpers.swift +29 -1
- package/ios/MemoryEstimation.swift +83 -0
- package/ios/QuantityTypeModule.swift +34 -26
- package/ios/Serializers.swift +18 -3
- package/ios/SourceProxy.swift +14 -5
- package/ios/WorkoutProxy.swift +28 -11
- package/lib/commonjs/generated/healthkit.generated.js +13 -3
- package/lib/commonjs/healthkit.ios.js +3 -1
- package/lib/commonjs/healthkit.js +4 -2
- package/lib/module/generated/healthkit.generated.js +12 -2
- package/lib/module/healthkit.ios.js +2 -0
- package/lib/module/healthkit.js +2 -0
- package/lib/typescript/generated/healthkit.generated.d.ts +17 -7
- package/lib/typescript/healthkit.d.ts +1 -0
- package/lib/typescript/healthkit.ios.d.ts +2 -0
- package/lib/typescript/specs/CoreModule.nitro.d.ts +6 -4
- package/lib/typescript/specs/SourceProxy.nitro.d.ts +1 -2
- package/lib/typescript/types/QuantityType.d.ts +3 -3
- package/lib/typescript/types/Source.d.ts +2 -2
- package/lib/typescript/types/Units.d.ts +1 -1
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.cpp +16 -16
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.hpp +23 -12
- package/nitrogen/generated/ios/c++/HybridCategoryTypeModuleSpecSwift.hpp +7 -4
- package/nitrogen/generated/ios/c++/HybridCorrelationTypeModuleSpecSwift.hpp +7 -4
- package/nitrogen/generated/ios/c++/HybridElectrocardiogramModuleSpecSwift.hpp +7 -4
- package/nitrogen/generated/ios/c++/HybridHeartbeatSeriesModuleSpecSwift.hpp +7 -4
- package/nitrogen/generated/ios/c++/HybridMedicationModuleSpecSwift.hpp +7 -4
- package/nitrogen/generated/ios/c++/HybridQuantityTypeModuleSpecSwift.hpp +7 -4
- package/nitrogen/generated/ios/c++/HybridStateOfMindModuleSpecSwift.hpp +7 -4
- package/nitrogen/generated/ios/c++/HybridWorkoutProxySpecSwift.hpp +3 -4
- package/nitrogen/generated/ios/c++/HybridWorkoutsModuleSpecSwift.hpp +6 -3
- package/nitrogen/generated/ios/swift/CategoryTypeIdentifier.swift +8 -0
- package/nitrogen/generated/ios/swift/CategoryTypeIdentifierWriteable.swift +8 -0
- package/nitrogen/generated/ios/swift/ObjectTypeIdentifier.swift +8 -4
- package/nitrogen/generated/ios/swift/QuantityTypeIdentifier.swift +0 -4
- package/nitrogen/generated/ios/swift/QuantityTypeIdentifierWriteable.swift +0 -4
- package/nitrogen/generated/ios/swift/QueryStatisticsResponse.swift +6 -13
- package/nitrogen/generated/ios/swift/QueryStatisticsResponseFromSingleSource.swift +4 -11
- package/nitrogen/generated/ios/swift/SampleTypeIdentifier.swift +8 -4
- package/nitrogen/generated/ios/swift/SampleTypeIdentifierWriteable.swift +8 -4
- package/nitrogen/generated/ios/swift/SourceRevision.swift +4 -11
- package/nitrogen/generated/ios/swift/WorkoutActivityType.swift +8 -0
- package/nitrogen/generated/shared/c++/CategoryTypeIdentifier.hpp +67 -59
- package/nitrogen/generated/shared/c++/CategoryTypeIdentifierWriteable.hpp +67 -59
- package/nitrogen/generated/shared/c++/ObjectTypeIdentifier.hpp +202 -198
- package/nitrogen/generated/shared/c++/QuantityTypeIdentifier.hpp +107 -111
- package/nitrogen/generated/shared/c++/QuantityTypeIdentifierWriteable.hpp +107 -111
- package/nitrogen/generated/shared/c++/QueryStatisticsResponse.hpp +8 -9
- package/nitrogen/generated/shared/c++/QueryStatisticsResponseFromSingleSource.hpp +8 -9
- package/nitrogen/generated/shared/c++/SampleTypeIdentifier.hpp +195 -191
- package/nitrogen/generated/shared/c++/SampleTypeIdentifierWriteable.hpp +189 -185
- package/nitrogen/generated/shared/c++/SourceRevision.hpp +8 -9
- package/nitrogen/generated/shared/c++/WorkoutActivityType.hpp +4 -0
- package/package.json +5 -3
- package/src/generated/healthkit-schema.json +45 -8
- package/src/generated/healthkit.generated.ts +18 -6
- package/src/healthkit.ios.ts +3 -0
- package/src/healthkit.ts +5 -0
- package/src/specs/CoreModule.nitro.ts +6 -4
- package/src/specs/SourceProxy.nitro.ts +1 -1
- package/src/type-tests/generated-typing.ts +30 -8
- package/src/types/QuantityType.ts +3 -3
- package/src/types/Source.ts +2 -2
- package/src/types/Units.ts +1 -1
|
@@ -96,14 +96,6 @@
|
|
|
96
96
|
"writeable": true,
|
|
97
97
|
"legacy": false
|
|
98
98
|
},
|
|
99
|
-
{
|
|
100
|
-
"name": "HKQuantityTypeIdentifierBloodKetones",
|
|
101
|
-
"ios": "8.0",
|
|
102
|
-
"canonicalUnit": "mmol/L",
|
|
103
|
-
"aggregationStyle": "Discrete (Arithmetic)",
|
|
104
|
-
"writeable": true,
|
|
105
|
-
"legacy": false
|
|
106
|
-
},
|
|
107
99
|
{
|
|
108
100
|
"name": "HKQuantityTypeIdentifierBloodPressureDiastolic",
|
|
109
101
|
"ios": "8.0",
|
|
@@ -1019,6 +1011,13 @@
|
|
|
1019
1011
|
"writeable": true,
|
|
1020
1012
|
"legacy": false
|
|
1021
1013
|
},
|
|
1014
|
+
{
|
|
1015
|
+
"name": "HKCategoryTypeIdentifierBleedingAfterMenopause",
|
|
1016
|
+
"ios": "27.0",
|
|
1017
|
+
"valueEnum": "HKCategoryValueVaginalBleeding",
|
|
1018
|
+
"writeable": true,
|
|
1019
|
+
"legacy": false
|
|
1020
|
+
},
|
|
1022
1021
|
{
|
|
1023
1022
|
"name": "HKCategoryTypeIdentifierBleedingAfterPregnancy",
|
|
1024
1023
|
"ios": "18.0",
|
|
@@ -1278,6 +1277,13 @@
|
|
|
1278
1277
|
"writeable": true,
|
|
1279
1278
|
"legacy": false
|
|
1280
1279
|
},
|
|
1280
|
+
{
|
|
1281
|
+
"name": "HKCategoryTypeIdentifierMenopausalState",
|
|
1282
|
+
"ios": "27.0",
|
|
1283
|
+
"valueEnum": "HKCategoryValueMenopausalState",
|
|
1284
|
+
"writeable": true,
|
|
1285
|
+
"legacy": false
|
|
1286
|
+
},
|
|
1281
1287
|
{
|
|
1282
1288
|
"name": "HKCategoryTypeIdentifierMenstrualFlow",
|
|
1283
1289
|
"ios": "9.0",
|
|
@@ -1755,6 +1761,27 @@
|
|
|
1755
1761
|
}
|
|
1756
1762
|
]
|
|
1757
1763
|
},
|
|
1764
|
+
{
|
|
1765
|
+
"name": "CategoryValueMenopausalState",
|
|
1766
|
+
"ios": "27.0",
|
|
1767
|
+
"members": [
|
|
1768
|
+
{
|
|
1769
|
+
"name": "menopause",
|
|
1770
|
+
"swiftName": "HKCategoryValueMenopausalStateMenopause",
|
|
1771
|
+
"rawValue": 1
|
|
1772
|
+
},
|
|
1773
|
+
{
|
|
1774
|
+
"name": "perimenopause",
|
|
1775
|
+
"swiftName": "HKCategoryValueMenopausalStatePerimenopause",
|
|
1776
|
+
"rawValue": 2
|
|
1777
|
+
},
|
|
1778
|
+
{
|
|
1779
|
+
"name": "none",
|
|
1780
|
+
"swiftName": "HKCategoryValueMenopausalStateNone",
|
|
1781
|
+
"rawValue": 3
|
|
1782
|
+
}
|
|
1783
|
+
]
|
|
1784
|
+
},
|
|
1758
1785
|
{
|
|
1759
1786
|
"name": "CategoryValueMenstrualFlow",
|
|
1760
1787
|
"ios": "9.0",
|
|
@@ -2814,6 +2841,16 @@
|
|
|
2814
2841
|
"swiftName": "HKWorkoutActivityTypeUnderwaterDiving",
|
|
2815
2842
|
"rawValue": 84
|
|
2816
2843
|
},
|
|
2844
|
+
{
|
|
2845
|
+
"name": "rest",
|
|
2846
|
+
"swiftName": "HKWorkoutActivityTypeRest",
|
|
2847
|
+
"rawValue": 2998
|
|
2848
|
+
},
|
|
2849
|
+
{
|
|
2850
|
+
"name": "group",
|
|
2851
|
+
"swiftName": "HKWorkoutActivityTypeGroup",
|
|
2852
|
+
"rawValue": 2999
|
|
2853
|
+
},
|
|
2817
2854
|
{
|
|
2818
2855
|
"name": "other",
|
|
2819
2856
|
"swiftName": "HKWorkoutActivityTypeOther",
|
|
@@ -30,7 +30,6 @@ export type QuantityTypeIdentifierWriteable =
|
|
|
30
30
|
| 'HKQuantityTypeIdentifierBasalEnergyBurned'
|
|
31
31
|
| 'HKQuantityTypeIdentifierBloodAlcoholContent'
|
|
32
32
|
| 'HKQuantityTypeIdentifierBloodGlucose'
|
|
33
|
-
| 'HKQuantityTypeIdentifierBloodKetones'
|
|
34
33
|
| 'HKQuantityTypeIdentifierBloodPressureDiastolic'
|
|
35
34
|
| 'HKQuantityTypeIdentifierBloodPressureSystolic'
|
|
36
35
|
| 'HKQuantityTypeIdentifierBodyFatPercentage'
|
|
@@ -154,6 +153,7 @@ export type CategoryTypeIdentifierWriteable =
|
|
|
154
153
|
| 'HKCategoryTypeIdentifierAppleWalkingSteadinessEvent'
|
|
155
154
|
| 'HKCategoryTypeIdentifierAudioExposureEvent'
|
|
156
155
|
| 'HKCategoryTypeIdentifierBladderIncontinence'
|
|
156
|
+
| 'HKCategoryTypeIdentifierBleedingAfterMenopause'
|
|
157
157
|
| 'HKCategoryTypeIdentifierBleedingAfterPregnancy'
|
|
158
158
|
| 'HKCategoryTypeIdentifierBleedingDuringPregnancy'
|
|
159
159
|
| 'HKCategoryTypeIdentifierBloating'
|
|
@@ -187,6 +187,7 @@ export type CategoryTypeIdentifierWriteable =
|
|
|
187
187
|
| 'HKCategoryTypeIdentifierLowCardioFitnessEvent'
|
|
188
188
|
| 'HKCategoryTypeIdentifierLowerBackPain'
|
|
189
189
|
| 'HKCategoryTypeIdentifierMemoryLapse'
|
|
190
|
+
| 'HKCategoryTypeIdentifierMenopausalState'
|
|
190
191
|
| 'HKCategoryTypeIdentifierMenstrualFlow'
|
|
191
192
|
| 'HKCategoryTypeIdentifierMindfulSession'
|
|
192
193
|
| 'HKCategoryTypeIdentifierMoodChanges'
|
|
@@ -229,7 +230,6 @@ export const QUANTITY_IDENTIFIER_IOS_AVAILABILITY = {
|
|
|
229
230
|
HKQuantityTypeIdentifierBasalEnergyBurned: '8.0',
|
|
230
231
|
HKQuantityTypeIdentifierBloodAlcoholContent: '8.0',
|
|
231
232
|
HKQuantityTypeIdentifierBloodGlucose: '8.0',
|
|
232
|
-
HKQuantityTypeIdentifierBloodKetones: '8.0',
|
|
233
233
|
HKQuantityTypeIdentifierBloodPressureDiastolic: '8.0',
|
|
234
234
|
HKQuantityTypeIdentifierBloodPressureSystolic: '8.0',
|
|
235
235
|
HKQuantityTypeIdentifierBodyFatPercentage: '8.0',
|
|
@@ -347,6 +347,7 @@ export const CATEGORY_IDENTIFIER_IOS_AVAILABILITY = {
|
|
|
347
347
|
HKCategoryTypeIdentifierAppleWalkingSteadinessEvent: '15.0',
|
|
348
348
|
HKCategoryTypeIdentifierAudioExposureEvent: '13.0',
|
|
349
349
|
HKCategoryTypeIdentifierBladderIncontinence: '14.0',
|
|
350
|
+
HKCategoryTypeIdentifierBleedingAfterMenopause: '27.0',
|
|
350
351
|
HKCategoryTypeIdentifierBleedingAfterPregnancy: '18.0',
|
|
351
352
|
HKCategoryTypeIdentifierBleedingDuringPregnancy: '18.0',
|
|
352
353
|
HKCategoryTypeIdentifierBloating: '13.6',
|
|
@@ -384,6 +385,7 @@ export const CATEGORY_IDENTIFIER_IOS_AVAILABILITY = {
|
|
|
384
385
|
HKCategoryTypeIdentifierLowerBackPain: '13.6',
|
|
385
386
|
HKCategoryTypeIdentifierLowHeartRateEvent: '12.2',
|
|
386
387
|
HKCategoryTypeIdentifierMemoryLapse: '14.0',
|
|
388
|
+
HKCategoryTypeIdentifierMenopausalState: '27.0',
|
|
387
389
|
HKCategoryTypeIdentifierMenstrualFlow: '9.0',
|
|
388
390
|
HKCategoryTypeIdentifierMindfulSession: '10.0',
|
|
389
391
|
HKCategoryTypeIdentifierMoodChanges: '13.6',
|
|
@@ -424,7 +426,6 @@ export const QUANTITY_IDENTIFIER_CANONICAL_UNITS = {
|
|
|
424
426
|
HKQuantityTypeIdentifierBasalEnergyBurned: 'kcal',
|
|
425
427
|
HKQuantityTypeIdentifierBloodAlcoholContent: '%',
|
|
426
428
|
HKQuantityTypeIdentifierBloodGlucose: 'mg/dL',
|
|
427
|
-
HKQuantityTypeIdentifierBloodKetones: 'mmol/L',
|
|
428
429
|
HKQuantityTypeIdentifierBloodPressureDiastolic: 'mmHg',
|
|
429
430
|
HKQuantityTypeIdentifierBloodPressureSystolic: 'mmHg',
|
|
430
431
|
HKQuantityTypeIdentifierBodyFatPercentage: '%',
|
|
@@ -543,6 +544,8 @@ export const CATEGORY_IDENTIFIER_VALUE_ENUMS = {
|
|
|
543
544
|
'CategoryValueAppleWalkingSteadinessEvent',
|
|
544
545
|
HKCategoryTypeIdentifierAudioExposureEvent: null,
|
|
545
546
|
HKCategoryTypeIdentifierBladderIncontinence: 'CategoryValueSeverity',
|
|
547
|
+
HKCategoryTypeIdentifierBleedingAfterMenopause:
|
|
548
|
+
'CategoryValueVaginalBleeding',
|
|
546
549
|
HKCategoryTypeIdentifierBleedingAfterPregnancy:
|
|
547
550
|
'CategoryValueVaginalBleeding',
|
|
548
551
|
HKCategoryTypeIdentifierBleedingDuringPregnancy:
|
|
@@ -586,6 +589,7 @@ export const CATEGORY_IDENTIFIER_VALUE_ENUMS = {
|
|
|
586
589
|
HKCategoryTypeIdentifierLowerBackPain: 'CategoryValueSeverity',
|
|
587
590
|
HKCategoryTypeIdentifierLowHeartRateEvent: 'CategoryValue',
|
|
588
591
|
HKCategoryTypeIdentifierMemoryLapse: 'CategoryValueSeverity',
|
|
592
|
+
HKCategoryTypeIdentifierMenopausalState: 'CategoryValueMenopausalState',
|
|
589
593
|
HKCategoryTypeIdentifierMenstrualFlow: 'CategoryValueMenstrualFlow',
|
|
590
594
|
HKCategoryTypeIdentifierMindfulSession: 'CategoryValue',
|
|
591
595
|
HKCategoryTypeIdentifierMoodChanges: 'CategoryValuePresence',
|
|
@@ -686,6 +690,11 @@ export enum CategoryValueHeadphoneAudioExposureEvent {
|
|
|
686
690
|
export enum CategoryValueLowCardioFitnessEvent {
|
|
687
691
|
lowFitness = 1,
|
|
688
692
|
}
|
|
693
|
+
export enum CategoryValueMenopausalState {
|
|
694
|
+
menopause = 1,
|
|
695
|
+
perimenopause = 2,
|
|
696
|
+
none = 3,
|
|
697
|
+
}
|
|
689
698
|
export enum CategoryValueMenstrualFlow {
|
|
690
699
|
unspecified = 1,
|
|
691
700
|
light = 2,
|
|
@@ -914,6 +923,8 @@ export enum WorkoutActivityType {
|
|
|
914
923
|
swimBikeRun = 82,
|
|
915
924
|
transition = 83,
|
|
916
925
|
underwaterDiving = 84,
|
|
926
|
+
rest = 2998,
|
|
927
|
+
group = 2999,
|
|
917
928
|
other = 3000,
|
|
918
929
|
}
|
|
919
930
|
export enum WorkoutEventType {
|
|
@@ -938,6 +949,7 @@ export interface CategoryValueByIdentifierMap {
|
|
|
938
949
|
readonly HKCategoryTypeIdentifierAppleStandHour: CategoryValueAppleStandHour
|
|
939
950
|
readonly HKCategoryTypeIdentifierAppleWalkingSteadinessEvent: CategoryValueAppleWalkingSteadinessEvent
|
|
940
951
|
readonly HKCategoryTypeIdentifierBladderIncontinence: CategoryValueSeverity
|
|
952
|
+
readonly HKCategoryTypeIdentifierBleedingAfterMenopause: CategoryValueVaginalBleeding
|
|
941
953
|
readonly HKCategoryTypeIdentifierBleedingAfterPregnancy: CategoryValueVaginalBleeding
|
|
942
954
|
readonly HKCategoryTypeIdentifierBleedingDuringPregnancy: CategoryValueVaginalBleeding
|
|
943
955
|
readonly HKCategoryTypeIdentifierBloating: CategoryValueSeverity
|
|
@@ -975,6 +987,7 @@ export interface CategoryValueByIdentifierMap {
|
|
|
975
987
|
readonly HKCategoryTypeIdentifierLowerBackPain: CategoryValueSeverity
|
|
976
988
|
readonly HKCategoryTypeIdentifierLowHeartRateEvent: CategoryValue
|
|
977
989
|
readonly HKCategoryTypeIdentifierMemoryLapse: CategoryValueSeverity
|
|
990
|
+
readonly HKCategoryTypeIdentifierMenopausalState: CategoryValueMenopausalState
|
|
978
991
|
readonly HKCategoryTypeIdentifierMenstrualFlow: CategoryValueMenstrualFlow
|
|
979
992
|
readonly HKCategoryTypeIdentifierMindfulSession: CategoryValue
|
|
980
993
|
readonly HKCategoryTypeIdentifierMoodChanges: CategoryValuePresence
|
|
@@ -1128,7 +1141,7 @@ export type CategoryTypedMetadataForIdentifierGenerated<
|
|
|
1128
1141
|
> = KnownSampleMetadata &
|
|
1129
1142
|
(T extends keyof CategorySpecificMetadataByIdentifierMap
|
|
1130
1143
|
? CategorySpecificMetadataByIdentifierMap[T]
|
|
1131
|
-
:
|
|
1144
|
+
: unknown)
|
|
1132
1145
|
export interface QuantitySpecificMetadataByIdentifierMap {
|
|
1133
1146
|
readonly HKQuantityTypeIdentifierBasalBodyTemperature: Pick<
|
|
1134
1147
|
QuantityTypedMetadata,
|
|
@@ -1168,7 +1181,7 @@ export type QuantityTypedMetadataForIdentifierGenerated<
|
|
|
1168
1181
|
> &
|
|
1169
1182
|
(T extends keyof QuantitySpecificMetadataByIdentifierMap
|
|
1170
1183
|
? QuantitySpecificMetadataByIdentifierMap[T]
|
|
1171
|
-
:
|
|
1184
|
+
: unknown)
|
|
1172
1185
|
export interface QuantityUnitByIdentifierMap {
|
|
1173
1186
|
readonly HKQuantityTypeIdentifierActiveEnergyBurned: EnergyUnit
|
|
1174
1187
|
readonly HKQuantityTypeIdentifierAppleExerciseTime: TimeUnit
|
|
@@ -1182,7 +1195,6 @@ export interface QuantityUnitByIdentifierMap {
|
|
|
1182
1195
|
readonly HKQuantityTypeIdentifierBasalEnergyBurned: EnergyUnit
|
|
1183
1196
|
readonly HKQuantityTypeIdentifierBloodAlcoholContent: '%'
|
|
1184
1197
|
readonly HKQuantityTypeIdentifierBloodGlucose: BloodGlucoseUnit
|
|
1185
|
-
readonly HKQuantityTypeIdentifierBloodKetones: BloodGlucoseUnit
|
|
1186
1198
|
readonly HKQuantityTypeIdentifierBloodPressureDiastolic: PressureUnit
|
|
1187
1199
|
readonly HKQuantityTypeIdentifierBloodPressureSystolic: PressureUnit
|
|
1188
1200
|
readonly HKQuantityTypeIdentifierBodyFatPercentage: '%'
|
package/src/healthkit.ios.ts
CHANGED
|
@@ -368,6 +368,8 @@ export const saveWorkoutSample = WorkoutBindings.saveWorkoutSample
|
|
|
368
368
|
export const startWatchApp =
|
|
369
369
|
Workouts.startWatchAppWithWorkoutConfiguration.bind(Workouts)
|
|
370
370
|
export const isProtectedDataAvailable = Core.isProtectedDataAvailable.bind(Core)
|
|
371
|
+
export const isProtectedDataAvailableAsync =
|
|
372
|
+
Core.isProtectedDataAvailableAsync.bind(Core)
|
|
371
373
|
export const queryStateOfMindSamples =
|
|
372
374
|
StateOfMindBindings.queryStateOfMindSamples
|
|
373
375
|
export const queryStateOfMindSamplesWithAnchor =
|
|
@@ -461,6 +463,7 @@ export default {
|
|
|
461
463
|
subscribeToQuantitySamples,
|
|
462
464
|
startWatchApp,
|
|
463
465
|
isProtectedDataAvailable,
|
|
466
|
+
isProtectedDataAvailableAsync,
|
|
464
467
|
queryStateOfMindSamples,
|
|
465
468
|
queryStateOfMindSamplesWithAnchor,
|
|
466
469
|
saveStateOfMindSample,
|
package/src/healthkit.ts
CHANGED
|
@@ -137,6 +137,10 @@ export const isProtectedDataAvailable = UnavailableFnFromModule(
|
|
|
137
137
|
'isProtectedDataAvailable',
|
|
138
138
|
false,
|
|
139
139
|
)
|
|
140
|
+
export const isProtectedDataAvailableAsync = UnavailableFnFromModule(
|
|
141
|
+
'isProtectedDataAvailableAsync',
|
|
142
|
+
Promise.resolve(false),
|
|
143
|
+
)
|
|
140
144
|
export const isObjectTypeAvailable = UnavailableFnFromModule(
|
|
141
145
|
'isObjectTypeAvailable',
|
|
142
146
|
false,
|
|
@@ -630,6 +634,7 @@ const HealthkitModule = {
|
|
|
630
634
|
subscribeToChanges,
|
|
631
635
|
startWatchApp,
|
|
632
636
|
isProtectedDataAvailable,
|
|
637
|
+
isProtectedDataAvailableAsync,
|
|
633
638
|
queryStateOfMindSamples,
|
|
634
639
|
queryStateOfMindSamplesWithAnchor,
|
|
635
640
|
saveStateOfMindSample,
|
|
@@ -41,13 +41,15 @@ export interface CoreModule extends HybridObject<{ ios: 'swift' }> {
|
|
|
41
41
|
disableAllBackgroundDelivery(): Promise<boolean>
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
-
* Configure background delivery types
|
|
45
|
-
*
|
|
44
|
+
* Configure background delivery types whose observer queries are registered
|
|
45
|
+
* natively at launch (during didFinishLaunchingWithOptions), so background
|
|
46
|
+
* delivery survives app termination.
|
|
46
47
|
* Types and frequency are persisted to UserDefaults so they're available
|
|
47
48
|
* before the JS bridge boots on subsequent cold launches.
|
|
48
49
|
*
|
|
49
|
-
* Requires the
|
|
50
|
-
*
|
|
50
|
+
* Requires the background-delivery entitlement (added by the config plugin
|
|
51
|
+
* unless `background: false`). No AppDelegate change is needed; the pod
|
|
52
|
+
* registers the observers on UIApplicationDidFinishLaunchingNotification.
|
|
51
53
|
*/
|
|
52
54
|
configureBackgroundTypes(
|
|
53
55
|
typeIdentifiers: string[],
|
|
@@ -7,14 +7,18 @@ import type {
|
|
|
7
7
|
CategoryValueSleepAnalysis,
|
|
8
8
|
CorrelationSampleTyped,
|
|
9
9
|
HeartRateMotionContext,
|
|
10
|
+
InsulinDeliveryReason,
|
|
11
|
+
MetadataForQuantityIdentifier,
|
|
10
12
|
Quantity,
|
|
11
13
|
QuantitySampleTyped,
|
|
12
14
|
QuantityTypeIdentifier,
|
|
15
|
+
QuantityTypeIdentifierWriteable,
|
|
13
16
|
QueryOptionsWithAnchorAndUnit,
|
|
14
17
|
QueryOptionsWithSortOrderAndUnit,
|
|
15
18
|
StateOfMindSampleTyped,
|
|
16
19
|
StatisticsQueryOptions,
|
|
17
20
|
SwimmingStrokeStyle,
|
|
21
|
+
UnitForIdentifier,
|
|
18
22
|
WorkoutEventTyped,
|
|
19
23
|
WorkoutSampleTyped,
|
|
20
24
|
} from '../types'
|
|
@@ -26,6 +30,13 @@ type Equal<A, B> =
|
|
|
26
30
|
|
|
27
31
|
type Assert<T extends true> = T
|
|
28
32
|
|
|
33
|
+
// Mirrors saveQuantitySample(identifier, unit, value, start, end, metadata?).
|
|
34
|
+
type AssertSaveQuantitySampleCall<
|
|
35
|
+
T extends QuantityTypeIdentifierWriteable,
|
|
36
|
+
_TUnit extends UnitForIdentifier<T>,
|
|
37
|
+
_TMetadata extends MetadataForQuantityIdentifier<T>,
|
|
38
|
+
> = true
|
|
39
|
+
|
|
29
40
|
type _sleepAnalysisValuesAreTyped = Assert<
|
|
30
41
|
Equal<
|
|
31
42
|
CategoryValueForIdentifier<'HKCategoryTypeIdentifierSleepAnalysis'>,
|
|
@@ -39,10 +50,11 @@ type _newCategoryIdentifierFromSdkIsPresent = Assert<
|
|
|
39
50
|
: false
|
|
40
51
|
>
|
|
41
52
|
|
|
42
|
-
type
|
|
53
|
+
// Apple has never shipped a blood ketones quantity type (see issue #379).
|
|
54
|
+
type _bloodKetonesIdentifierIsAbsent = Assert<
|
|
43
55
|
'HKQuantityTypeIdentifierBloodKetones' extends QuantityTypeIdentifier
|
|
44
|
-
?
|
|
45
|
-
:
|
|
56
|
+
? false
|
|
57
|
+
: true
|
|
46
58
|
>
|
|
47
59
|
|
|
48
60
|
type _heartRateMetadataNarrowsToEnum = Assert<
|
|
@@ -87,12 +99,22 @@ type _bloodGlucoseUnitNarrows = Assert<
|
|
|
87
99
|
>
|
|
88
100
|
>
|
|
89
101
|
|
|
90
|
-
type
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
102
|
+
type _saveQuantitySampleBodyMassAcceptsAppSpecificMetadata =
|
|
103
|
+
AssertSaveQuantitySampleCall<
|
|
104
|
+
'HKQuantityTypeIdentifierBodyMass',
|
|
105
|
+
'kg',
|
|
106
|
+
{ APP_CUSTOM_KEY: 'v1'; HKWasUserEntered: true }
|
|
107
|
+
>
|
|
108
|
+
|
|
109
|
+
type _saveQuantitySampleInsulinAcceptsOfficialAndAppSpecificMetadata =
|
|
110
|
+
AssertSaveQuantitySampleCall<
|
|
111
|
+
'HKQuantityTypeIdentifierInsulinDelivery',
|
|
112
|
+
'IU',
|
|
113
|
+
{
|
|
114
|
+
HKInsulinDeliveryReason: InsulinDeliveryReason.basal
|
|
115
|
+
APP_CUSTOM_KEY: 'v1'
|
|
116
|
+
}
|
|
94
117
|
>
|
|
95
|
-
>
|
|
96
118
|
|
|
97
119
|
type _quantityQueryOptionsUnitNarrows = Assert<
|
|
98
120
|
Equal<
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
HeartRateMotionContext,
|
|
4
4
|
InsulinDeliveryReason,
|
|
5
5
|
} from '../generated/healthkit.generated'
|
|
6
|
-
import type {
|
|
6
|
+
import type { Source } from '../specs/SourceProxy.nitro'
|
|
7
7
|
import type { QuantitySample, QuantitySampleTyped } from './QuantitySample'
|
|
8
8
|
import type { QuantityTypeIdentifier } from './QuantityTypeIdentifier'
|
|
9
9
|
import type { FilterForSamples } from './QueryOptions'
|
|
@@ -26,12 +26,12 @@ export interface QueryStatisticsResponse {
|
|
|
26
26
|
readonly duration?: Quantity
|
|
27
27
|
readonly startDate?: Date
|
|
28
28
|
readonly endDate?: Date
|
|
29
|
-
sources:
|
|
29
|
+
readonly sources: readonly Source[]
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export interface QueryStatisticsResponseFromSingleSource
|
|
33
33
|
extends Omit<QueryStatisticsResponse, 'sources'> {
|
|
34
|
-
readonly source:
|
|
34
|
+
readonly source: Source
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
export enum AggregationStyle {
|
package/src/types/Source.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Source } from '../specs/SourceProxy.nitro'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @see {@link https://developer.apple.com/documentation/healthkit/hkobject/1615483-sourcerevision Apple Docs }
|
|
5
5
|
*/
|
|
6
6
|
export interface SourceRevision {
|
|
7
|
-
readonly source:
|
|
7
|
+
readonly source: Source
|
|
8
8
|
readonly version?: string
|
|
9
9
|
readonly operatingSystemVersion: string
|
|
10
10
|
readonly productType?: string
|
package/src/types/Units.ts
CHANGED
|
@@ -161,7 +161,7 @@ export type UnitOfEnergy = 'kcal' | 'Cal' | 'cal' | 'J'
|
|
|
161
161
|
|
|
162
162
|
export type EnergyUnit = JouleUnit<MetricPrefix> | UnitOfEnergy
|
|
163
163
|
|
|
164
|
-
export type BloodGlucoseUnit = 'mmol<180.15588000005408>/l' | '
|
|
164
|
+
export type BloodGlucoseUnit = 'mmol<180.15588000005408>/l' | 'mg/dL'
|
|
165
165
|
|
|
166
166
|
export type SpeedUnit<
|
|
167
167
|
TLength extends LengthUnit,
|