@kingstinct/react-native-healthkit 4.4.4 → 5.0.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.
Files changed (235) hide show
  1. package/README.md +1 -1
  2. package/ios/ReactNativeHealthkit.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  3. package/ios/ReactNativeHealthkit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  4. package/ios/ReactNativeHealthkit.xcodeproj/project.xcworkspace/xcuserdata/robertherber.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  5. package/ios/ReactNativeHealthkit.xcodeproj/xcuserdata/robertherber.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
  6. package/lib/commonjs/hooks/useHealthkitAuthorization.js +41 -0
  7. package/lib/commonjs/hooks/useHealthkitAuthorization.js.map +1 -0
  8. package/lib/commonjs/hooks/useIsHealthDataAvailable.js +29 -0
  9. package/lib/commonjs/hooks/useIsHealthDataAvailable.js.map +1 -0
  10. package/lib/commonjs/hooks/useMostRecentCategorySample.js +27 -0
  11. package/lib/commonjs/hooks/useMostRecentCategorySample.js.map +1 -0
  12. package/lib/commonjs/hooks/useMostRecentQuantitySample.js +43 -0
  13. package/lib/commonjs/hooks/useMostRecentQuantitySample.js.map +1 -0
  14. package/lib/commonjs/hooks/useMostRecentWorkout.js +60 -0
  15. package/lib/commonjs/hooks/useMostRecentWorkout.js.map +1 -0
  16. package/lib/commonjs/hooks/useStatisticsForQuantity.js +35 -0
  17. package/lib/commonjs/hooks/useStatisticsForQuantity.js.map +1 -0
  18. package/lib/commonjs/hooks/useSubscribeToChanges.js +37 -0
  19. package/lib/commonjs/hooks/useSubscribeToChanges.js.map +1 -0
  20. package/lib/commonjs/index.ios.js +66 -394
  21. package/lib/commonjs/index.ios.js.map +1 -1
  22. package/lib/commonjs/index.js +9 -17
  23. package/lib/commonjs/index.js.map +1 -1
  24. package/lib/commonjs/native-types.js +249 -78
  25. package/lib/commonjs/native-types.js.map +1 -1
  26. package/lib/commonjs/types.js +13 -0
  27. package/lib/commonjs/types.js.map +1 -1
  28. package/lib/commonjs/utils/deserializeCategorySample.js +15 -0
  29. package/lib/commonjs/utils/deserializeCategorySample.js.map +1 -0
  30. package/lib/commonjs/utils/deserializeCorrelation.js +32 -0
  31. package/lib/commonjs/utils/deserializeCorrelation.js.map +1 -0
  32. package/lib/commonjs/utils/deserializeSample.js +17 -0
  33. package/lib/commonjs/utils/deserializeSample.js.map +1 -0
  34. package/lib/commonjs/utils/deserializeWorkout.js +17 -0
  35. package/lib/commonjs/utils/deserializeWorkout.js.map +1 -0
  36. package/lib/commonjs/utils/ensureMetadata.js +14 -0
  37. package/lib/commonjs/utils/ensureMetadata.js.map +1 -0
  38. package/lib/commonjs/utils/ensureUnit.js +23 -0
  39. package/lib/commonjs/utils/ensureUnit.js.map +1 -0
  40. package/lib/commonjs/utils/getDateOfBirth.js +19 -0
  41. package/lib/commonjs/utils/getDateOfBirth.js.map +1 -0
  42. package/lib/commonjs/utils/getMostRecentCategorySample.js +22 -0
  43. package/lib/commonjs/utils/getMostRecentCategorySample.js.map +1 -0
  44. package/lib/commonjs/utils/getMostRecentQuantitySample.js +22 -0
  45. package/lib/commonjs/utils/getMostRecentQuantitySample.js.map +1 -0
  46. package/lib/commonjs/utils/getMostRecentWorkout.js +24 -0
  47. package/lib/commonjs/utils/getMostRecentWorkout.js.map +1 -0
  48. package/lib/commonjs/utils/getPreferredUnit.js +19 -0
  49. package/lib/commonjs/utils/getPreferredUnit.js.map +1 -0
  50. package/lib/commonjs/utils/getPreferredUnits.js +19 -0
  51. package/lib/commonjs/utils/getPreferredUnits.js.map +1 -0
  52. package/lib/commonjs/utils/getPreferredUnitsTyped.js +46 -0
  53. package/lib/commonjs/utils/getPreferredUnitsTyped.js.map +1 -0
  54. package/lib/commonjs/utils/getRequestStatusForAuthorization.js +25 -0
  55. package/lib/commonjs/utils/getRequestStatusForAuthorization.js.map +1 -0
  56. package/lib/commonjs/utils/prepareOptions.js +27 -0
  57. package/lib/commonjs/utils/prepareOptions.js.map +1 -0
  58. package/lib/commonjs/utils/queryCategorySamples.js +24 -0
  59. package/lib/commonjs/utils/queryCategorySamples.js.map +1 -0
  60. package/lib/commonjs/utils/queryCorrelationSamples.js +24 -0
  61. package/lib/commonjs/utils/queryCorrelationSamples.js.map +1 -0
  62. package/lib/commonjs/utils/queryQuantitySamples.js +27 -0
  63. package/lib/commonjs/utils/queryQuantitySamples.js.map +1 -0
  64. package/lib/commonjs/utils/queryStatisticsForQuantity.js +34 -0
  65. package/lib/commonjs/utils/queryStatisticsForQuantity.js.map +1 -0
  66. package/lib/commonjs/utils/queryWorkouts.js +30 -0
  67. package/lib/commonjs/utils/queryWorkouts.js.map +1 -0
  68. package/lib/commonjs/utils/requestAuthorization.js +25 -0
  69. package/lib/commonjs/utils/requestAuthorization.js.map +1 -0
  70. package/lib/commonjs/utils/saveCategorySample.js +21 -0
  71. package/lib/commonjs/utils/saveCategorySample.js.map +1 -0
  72. package/lib/commonjs/utils/saveCorrelationSample.js +24 -0
  73. package/lib/commonjs/utils/saveCorrelationSample.js.map +1 -0
  74. package/lib/commonjs/utils/saveQuantitySample.js +21 -0
  75. package/lib/commonjs/utils/saveQuantitySample.js.map +1 -0
  76. package/lib/commonjs/utils/saveWorkoutSample.js +25 -0
  77. package/lib/commonjs/utils/saveWorkoutSample.js.map +1 -0
  78. package/lib/commonjs/utils/serializeDate.js +12 -0
  79. package/lib/commonjs/utils/serializeDate.js.map +1 -0
  80. package/lib/commonjs/utils/subscribeToChanges.js +37 -0
  81. package/lib/commonjs/utils/subscribeToChanges.js.map +1 -0
  82. package/lib/module/hooks/useHealthkitAuthorization.js +29 -0
  83. package/lib/module/hooks/useHealthkitAuthorization.js.map +1 -0
  84. package/lib/module/hooks/useIsHealthDataAvailable.js +18 -0
  85. package/lib/module/hooks/useIsHealthDataAvailable.js.map +1 -0
  86. package/lib/module/hooks/useMostRecentCategorySample.js +15 -0
  87. package/lib/module/hooks/useMostRecentCategorySample.js.map +1 -0
  88. package/lib/module/hooks/useMostRecentQuantitySample.js +30 -0
  89. package/lib/module/hooks/useMostRecentQuantitySample.js.map +1 -0
  90. package/lib/module/hooks/useMostRecentWorkout.js +47 -0
  91. package/lib/module/hooks/useMostRecentWorkout.js.map +1 -0
  92. package/lib/module/hooks/useStatisticsForQuantity.js +23 -0
  93. package/lib/module/hooks/useStatisticsForQuantity.js.map +1 -0
  94. package/lib/module/hooks/useSubscribeToChanges.js +26 -0
  95. package/lib/module/hooks/useSubscribeToChanges.js.map +1 -0
  96. package/lib/module/index.ios.js +32 -370
  97. package/lib/module/index.ios.js.map +1 -1
  98. package/lib/module/index.js +10 -7
  99. package/lib/module/index.js.map +1 -1
  100. package/lib/module/native-types.js +232 -74
  101. package/lib/module/native-types.js.map +1 -1
  102. package/lib/module/types.js +15 -0
  103. package/lib/module/types.js.map +1 -1
  104. package/lib/module/utils/deserializeCategorySample.js +7 -0
  105. package/lib/module/utils/deserializeCategorySample.js.map +1 -0
  106. package/lib/module/utils/deserializeCorrelation.js +21 -0
  107. package/lib/module/utils/deserializeCorrelation.js.map +1 -0
  108. package/lib/module/utils/deserializeSample.js +9 -0
  109. package/lib/module/utils/deserializeSample.js.map +1 -0
  110. package/lib/module/utils/deserializeWorkout.js +9 -0
  111. package/lib/module/utils/deserializeWorkout.js.map +1 -0
  112. package/lib/module/utils/ensureMetadata.js +6 -0
  113. package/lib/module/utils/ensureMetadata.js.map +1 -0
  114. package/lib/module/utils/ensureUnit.js +13 -0
  115. package/lib/module/utils/ensureUnit.js.map +1 -0
  116. package/lib/module/utils/getDateOfBirth.js +9 -0
  117. package/lib/module/utils/getDateOfBirth.js.map +1 -0
  118. package/lib/module/utils/getMostRecentCategorySample.js +12 -0
  119. package/lib/module/utils/getMostRecentCategorySample.js.map +1 -0
  120. package/lib/module/utils/getMostRecentQuantitySample.js +12 -0
  121. package/lib/module/utils/getMostRecentQuantitySample.js.map +1 -0
  122. package/lib/module/utils/getMostRecentWorkout.js +14 -0
  123. package/lib/module/utils/getMostRecentWorkout.js.map +1 -0
  124. package/lib/module/utils/getPreferredUnit.js +9 -0
  125. package/lib/module/utils/getPreferredUnit.js.map +1 -0
  126. package/lib/module/utils/getPreferredUnits.js +9 -0
  127. package/lib/module/utils/getPreferredUnits.js.map +1 -0
  128. package/lib/module/utils/getPreferredUnitsTyped.js +34 -0
  129. package/lib/module/utils/getPreferredUnitsTyped.js.map +1 -0
  130. package/lib/module/utils/getRequestStatusForAuthorization.js +15 -0
  131. package/lib/module/utils/getRequestStatusForAuthorization.js.map +1 -0
  132. package/lib/module/utils/prepareOptions.js +17 -0
  133. package/lib/module/utils/prepareOptions.js.map +1 -0
  134. package/lib/module/utils/queryCategorySamples.js +12 -0
  135. package/lib/module/utils/queryCategorySamples.js.map +1 -0
  136. package/lib/module/utils/queryCorrelationSamples.js +12 -0
  137. package/lib/module/utils/queryCorrelationSamples.js.map +1 -0
  138. package/lib/module/utils/queryQuantitySamples.js +14 -0
  139. package/lib/module/utils/queryQuantitySamples.js.map +1 -0
  140. package/lib/module/utils/queryStatisticsForQuantity.js +23 -0
  141. package/lib/module/utils/queryStatisticsForQuantity.js.map +1 -0
  142. package/lib/module/utils/queryWorkouts.js +17 -0
  143. package/lib/module/utils/queryWorkouts.js.map +1 -0
  144. package/lib/module/utils/requestAuthorization.js +15 -0
  145. package/lib/module/utils/requestAuthorization.js.map +1 -0
  146. package/lib/module/utils/saveCategorySample.js +11 -0
  147. package/lib/module/utils/saveCategorySample.js.map +1 -0
  148. package/lib/module/utils/saveCorrelationSample.js +13 -0
  149. package/lib/module/utils/saveCorrelationSample.js.map +1 -0
  150. package/lib/module/utils/saveQuantitySample.js +11 -0
  151. package/lib/module/utils/saveQuantitySample.js.map +1 -0
  152. package/lib/module/utils/saveWorkoutSample.js +14 -0
  153. package/lib/module/utils/saveWorkoutSample.js.map +1 -0
  154. package/lib/module/utils/serializeDate.js +4 -0
  155. package/lib/module/utils/serializeDate.js.map +1 -0
  156. package/lib/module/utils/subscribeToChanges.js +25 -0
  157. package/lib/module/utils/subscribeToChanges.js.map +1 -0
  158. package/lib/typescript/example-expo/App.d.ts +2 -0
  159. package/lib/typescript/src/hooks/useHealthkitAuthorization.d.ts +3 -0
  160. package/lib/typescript/src/hooks/useIsHealthDataAvailable.d.ts +2 -0
  161. package/lib/typescript/src/hooks/useMostRecentCategorySample.d.ts +4 -0
  162. package/lib/typescript/src/hooks/useMostRecentQuantitySample.d.ts +4 -0
  163. package/lib/typescript/src/hooks/useMostRecentWorkout.d.ts +7 -0
  164. package/lib/typescript/src/hooks/useStatisticsForQuantity.d.ts +4 -0
  165. package/lib/typescript/src/hooks/useSubscribeToChanges.d.ts +3 -0
  166. package/lib/typescript/src/index.d.ts +2 -3
  167. package/lib/typescript/src/index.ios.d.ts +48 -3
  168. package/lib/typescript/src/native-types.d.ts +235 -70
  169. package/lib/typescript/src/types.d.ts +14 -90
  170. package/lib/typescript/src/utils/deserializeCategorySample.d.ts +4 -0
  171. package/lib/typescript/src/utils/deserializeCorrelation.d.ts +4 -0
  172. package/lib/typescript/src/utils/deserializeSample.d.ts +4 -0
  173. package/lib/typescript/src/utils/deserializeWorkout.d.ts +4 -0
  174. package/lib/typescript/src/utils/ensureMetadata.d.ts +2 -0
  175. package/lib/typescript/src/utils/ensureUnit.d.ts +3 -0
  176. package/lib/typescript/src/utils/getDateOfBirth.d.ts +2 -0
  177. package/lib/typescript/src/utils/getMostRecentCategorySample.d.ts +3 -0
  178. package/lib/typescript/src/utils/getMostRecentQuantitySample.d.ts +3 -0
  179. package/lib/typescript/src/utils/getMostRecentWorkout.d.ts +5 -0
  180. package/lib/typescript/src/utils/getPreferredUnit.d.ts +4 -0
  181. package/lib/typescript/src/utils/getPreferredUnits.d.ts +4 -0
  182. package/lib/typescript/src/utils/getPreferredUnitsTyped.d.ts +9 -0
  183. package/lib/typescript/src/utils/getRequestStatusForAuthorization.d.ts +3 -0
  184. package/lib/typescript/src/utils/prepareOptions.d.ts +8 -0
  185. package/lib/typescript/src/utils/queryCategorySamples.d.ts +5 -0
  186. package/lib/typescript/src/utils/queryCorrelationSamples.d.ts +5 -0
  187. package/lib/typescript/src/utils/queryQuantitySamples.d.ts +7 -0
  188. package/lib/typescript/src/utils/queryStatisticsForQuantity.d.ts +14 -0
  189. package/lib/typescript/src/utils/queryWorkouts.d.ts +4 -0
  190. package/lib/typescript/src/utils/requestAuthorization.d.ts +3 -0
  191. package/lib/typescript/src/utils/saveCategorySample.d.ts +7 -0
  192. package/lib/typescript/src/utils/saveCorrelationSample.d.ts +8 -0
  193. package/lib/typescript/src/utils/saveQuantitySample.d.ts +7 -0
  194. package/lib/typescript/src/utils/saveWorkoutSample.d.ts +7 -0
  195. package/lib/typescript/src/utils/serializeDate.d.ts +2 -0
  196. package/lib/typescript/src/utils/subscribeToChanges.d.ts +3 -0
  197. package/package.json +17 -6
  198. package/src/hooks/useHealthkitAuthorization.ts +39 -0
  199. package/src/hooks/useIsHealthDataAvailable.ts +17 -0
  200. package/src/hooks/useMostRecentCategorySample.ts +24 -0
  201. package/src/hooks/useMostRecentQuantitySample.ts +39 -0
  202. package/src/hooks/useMostRecentWorkout.ts +60 -0
  203. package/src/hooks/useStatisticsForQuantity.ts +42 -0
  204. package/src/hooks/useSubscribeToChanges.ts +31 -0
  205. package/src/index.ios.tsx +36 -569
  206. package/src/index.tsx +12 -9
  207. package/src/native-types.ts +323 -93
  208. package/src/types.ts +41 -152
  209. package/src/utils/deserializeCategorySample.ts +12 -0
  210. package/src/utils/deserializeCorrelation.ts +28 -0
  211. package/src/utils/deserializeSample.ts +17 -0
  212. package/src/utils/deserializeWorkout.ts +14 -0
  213. package/src/utils/ensureMetadata.ts +5 -0
  214. package/src/utils/ensureUnit.ts +19 -0
  215. package/src/utils/getDateOfBirth.ts +8 -0
  216. package/src/utils/getMostRecentCategorySample.ts +18 -0
  217. package/src/utils/getMostRecentQuantitySample.ts +19 -0
  218. package/src/utils/getMostRecentWorkout.ts +27 -0
  219. package/src/utils/getPreferredUnit.ts +14 -0
  220. package/src/utils/getPreferredUnits.ts +14 -0
  221. package/src/utils/getPreferredUnitsTyped.ts +38 -0
  222. package/src/utils/getRequestStatusForAuthorization.ts +21 -0
  223. package/src/utils/prepareOptions.ts +15 -0
  224. package/src/utils/queryCategorySamples.ts +29 -0
  225. package/src/utils/queryCorrelationSamples.ts +29 -0
  226. package/src/utils/queryQuantitySamples.ts +36 -0
  227. package/src/utils/queryStatisticsForQuantity.ts +38 -0
  228. package/src/utils/queryWorkouts.ts +28 -0
  229. package/src/utils/requestAuthorization.ts +18 -0
  230. package/src/utils/saveCategorySample.ts +27 -0
  231. package/src/utils/saveCorrelationSample.ts +34 -0
  232. package/src/utils/saveQuantitySample.ts +29 -0
  233. package/src/utils/saveWorkoutSample.ts +28 -0
  234. package/src/utils/serializeDate.ts +3 -0
  235. package/src/utils/subscribeToChanges.ts +32 -0
@@ -94,11 +94,17 @@ export declare enum HKQuantityTypeIdentifier {
94
94
  walkingDoubleSupportPercentage = "HKQuantityTypeIdentifierWalkingDoubleSupportPercentage",
95
95
  stairAscentSpeed = "HKQuantityTypeIdentifierStairAscentSpeed",
96
96
  stairDescentSpeed = "HKQuantityTypeIdentifierStairDescentSpeed",
97
- uvExposure = "HKQuantityTypeIdentifierUvExposure"
97
+ uvExposure = "HKQuantityTypeIdentifierUvExposure",
98
+ appleMoveTime = "HKQuantityTypeIdentifierAppleMoveTime",
99
+ appleWalkingSteadiness = "HKQuantityTypeIdentifierAppleWalkingSteadiness",
100
+ numberOfAlcoholicBeverages = "HKQuantityTypeIdentifierNumberOfAlcoholicBeverages"
98
101
  }
99
102
  export declare type TypeToUnitMapping = {
100
103
  readonly [key in HKQuantityTypeIdentifier]: HKUnit;
101
104
  };
105
+ export declare enum HKCategoryValueLowCardioFitnessEvent {
106
+ lowFitness = 1
107
+ }
102
108
  export declare enum HKHeartRateMotionContext {
103
109
  active = 2,
104
110
  notSet = 0,
@@ -121,7 +127,56 @@ export declare enum HKCategoryTypeIdentifier {
121
127
  lowHeartRateEvent = "HKCategoryTypeIdentifierLowHeartRateEvent",
122
128
  irregularHeartRhythmEvent = "HKCategoryTypeIdentifierIrregularHeartRhythmEvent",
123
129
  audioExposureEvent = "HKCategoryTypeIdentifierAudioExposureEvent",
124
- toothbrushingEvent = "HKCategoryTypeIdentifierToothbrushingEvent"
130
+ toothbrushingEvent = "HKCategoryTypeIdentifierToothbrushingEvent",
131
+ lowCardioFitnessEvent = "HKCategoryTypeIdentifierLowCardioFitnessEvent",
132
+ contraceptive = "HKCategoryTypeIdentifierContraceptive",
133
+ lactation = "HKCategoryTypeIdentifierLactation",
134
+ pregnancy = "HKCategoryTypeIdentifierPregnancy",
135
+ pregnancyTestResult = "HKCategoryTypeIdentifierPregnancyTestResult",
136
+ progesteroneTestResult = "HKCategoryTypeIdentifierProgesteroneTestResult",
137
+ environmentalAudioExposureEvent = "HKCategoryTypeIdentifierEnvironmentalAudioExposureEvent",
138
+ headphoneAudioExposureEvent = "HKCategoryTypeIdentifierHeadphoneAudioExposureEvent",
139
+ appleWalkingSteadinessEvent = "HKCategoryTypeIdentifierAppleWalkingSteadinessEvent",
140
+ handwashingEvent = "HKCategoryTypeIdentifierHandwashingEvent",
141
+ abdominalCramps = "HKCategoryTypeIdentifierAbdominalCramps",
142
+ acne = "HKCategoryTypeIdentifierAcne",
143
+ appetiteChanges = "HKCategoryTypeIdentifierAppetiteChanges",
144
+ bladderIncontinence = "HKCategoryTypeIdentifierBladderIncontinence",
145
+ bloating = "HKCategoryTypeIdentifierBloating",
146
+ breastPain = "HKCategoryTypeIdentifierBreastPain",
147
+ chestTightnessOrPain = "HKCategoryTypeIdentifierChestTightnessOrPain",
148
+ chills = "HKCategoryTypeIdentifierChills",
149
+ constipation = "HKCategoryTypeIdentifierConstipation",
150
+ coughing = "HKCategoryTypeIdentifierCoughing",
151
+ diarrhea = "HKCategoryTypeIdentifierDiarrhea",
152
+ dizziness = "HKCategoryTypeIdentifierDizziness",
153
+ drySkin = "HKCategoryTypeIdentifierDrySkin",
154
+ fainting = "HKCategoryTypeIdentifierFainting",
155
+ fatigue = "HKCategoryTypeIdentifierFatigue",
156
+ fever = "HKCategoryTypeIdentifierFever",
157
+ generalizedBodyAche = "HKCategoryTypeIdentifierGeneralizedBodyAche",
158
+ hairLoss = "HKCategoryTypeIdentifierHairLoss",
159
+ headache = "HKCategoryTypeIdentifierHeadache",
160
+ heartburn = "HKCategoryTypeIdentifierHeartburn",
161
+ hotFlashes = "HKCategoryTypeIdentifierHotFlashes",
162
+ lossOfSmell = "HKCategoryTypeIdentifierLossOfSmell",
163
+ lossOfTaste = "HKCategoryTypeIdentifierLossOfTaste",
164
+ lowerBackPain = "HKCategoryTypeIdentifierLowerBackPain",
165
+ memoryLapse = "HKCategoryTypeIdentifierMemoryLapse",
166
+ moodChanges = "HKCategoryTypeIdentifierMoodChanges",
167
+ nausea = "HKCategoryTypeIdentifierNausea",
168
+ nightSweats = "HKCategoryTypeIdentifierNightSweats",
169
+ pelvicPain = "HKCategoryTypeIdentifierPelvicPain",
170
+ rapidPoundingOrFlutteringHeartbeat = "HKCategoryTypeIdentifierRapidPoundingOrFlutteringHeartbeat",
171
+ runnyNose = "HKCategoryTypeIdentifierRunnyNose",
172
+ shortnessOfBreath = "HKCategoryTypeIdentifierShortnessOfBreath",
173
+ sinusCongestion = "HKCategoryTypeIdentifierSinusCongestion",
174
+ skippedHeartbeat = "HKCategoryTypeIdentifierSkippedHeartbeat",
175
+ sleepChanges = "HKCategoryTypeIdentifierSleepChanges",
176
+ soreThroat = "HKCategoryTypeIdentifierSoreThroat",
177
+ vaginalDryness = "HKCategoryTypeIdentifierVaginalDryness",
178
+ vomiting = "HKCategoryTypeIdentifierVomiting",
179
+ wheezing = "HKCategoryTypeIdentifierWheezing"
125
180
  }
126
181
  export declare type HKSampleTypeIdentifier = HKCategoryTypeIdentifier | HKCorrelationTypeIdentifier | HKQuantityTypeIdentifier | typeof HKAudiogramTypeIdentifier | typeof HKDataTypeIdentifierHeartbeatSeries | typeof HKWorkoutRouteTypeIdentifier | typeof HKWorkoutTypeIdentifier | `${HKCategoryTypeIdentifier}` | `${HKCorrelationTypeIdentifier}` | `${HKQuantityTypeIdentifier}`;
127
182
  export declare type HealthkitReadAuthorization = HKCharacteristicTypeIdentifier | HKSampleTypeIdentifier | `${HKCharacteristicTypeIdentifier}` | `${HKSampleTypeIdentifier}`;
@@ -262,9 +317,9 @@ declare enum HKIndoorWorkout {
262
317
  }
263
318
  export interface HKWorkoutMetadata extends HKGenericMetadata {
264
319
  readonly HKWeatherCondition?: HKWeatherCondition;
265
- readonly HKWeatherHumidity?: HKQuantity<HKUnit.Percent>;
266
- readonly HKAverageMETs?: HKQuantity<HKUnit>;
267
- readonly HKElevationAscended?: HKQuantity<HKUnit.Meters>;
320
+ readonly HKWeatherHumidity?: HKQuantity<HKQuantityTypeIdentifier, HKUnits.Percent>;
321
+ readonly HKAverageMETs?: HKQuantity<HKQuantityTypeIdentifier, HKUnit>;
322
+ readonly HKElevationAscended?: HKQuantity<HKQuantityTypeIdentifier, LengthUnit>;
268
323
  readonly HKIndoorWorkout?: HKIndoorWorkout;
269
324
  }
270
325
  export declare enum HKAuthorizationRequestStatus {
@@ -277,8 +332,8 @@ export declare enum HKAuthorizationStatus {
277
332
  sharingDenied = 1,
278
333
  sharingAuthorized = 2
279
334
  }
280
- export declare type HKQuantity<T extends HKUnit = HKUnit> = {
281
- readonly unit: T;
335
+ export declare type HKQuantity<TIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier> = UnitForIdentifier<TIdentifier>> = {
336
+ readonly unit: TUnit;
282
337
  readonly quantity: number;
283
338
  };
284
339
  export declare enum HKBloodType {
@@ -317,17 +372,17 @@ export declare enum HKStatisticsOptions {
317
372
  mostRecent = "mostRecent",
318
373
  separateBySource = "separateBySource"
319
374
  }
320
- export declare type QueryStatisticsResponseRaw<TUnit extends HKUnit = HKUnit> = {
321
- readonly averageQuantity?: HKQuantity<TUnit>;
322
- readonly maximumQuantity?: HKQuantity<TUnit>;
323
- readonly minimumQuantity?: HKQuantity<TUnit>;
324
- readonly sumQuantity?: HKQuantity<TUnit>;
325
- readonly mostRecentQuantity?: HKQuantity<TUnit>;
375
+ export declare type QueryStatisticsResponseRaw<TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier>> = {
376
+ readonly averageQuantity?: HKQuantity<TIdentifier, TUnit>;
377
+ readonly maximumQuantity?: HKQuantity<TIdentifier, TUnit>;
378
+ readonly minimumQuantity?: HKQuantity<TIdentifier, TUnit>;
379
+ readonly sumQuantity?: HKQuantity<TIdentifier, TUnit>;
380
+ readonly mostRecentQuantity?: HKQuantity<TIdentifier, TUnit>;
326
381
  readonly mostRecentQuantityDateInterval?: {
327
382
  readonly from: string;
328
383
  readonly to: string;
329
384
  };
330
- readonly duration?: HKQuantity<HKUnit.Seconds>;
385
+ readonly duration?: HKQuantity<HKQuantityTypeIdentifier, TimeUnit>;
331
386
  };
332
387
  export declare enum HKCategoryValueCervicalMucusQuality {
333
388
  dry = 1,
@@ -374,7 +429,7 @@ export declare enum HKCategoryValueSeverity {
374
429
  export declare enum HKCategoryValueNotApplicable {
375
430
  notApplicable = 0
376
431
  }
377
- export declare type HKCategoryValue = HKCategoryValueAppetiteChanges | HKCategoryValueCervicalMucusQuality | HKCategoryValueMenstrualFlow | HKCategoryValueOvulationTestResult | HKCategoryValuePresence | HKCategoryValuePresence | HKCategoryValueSeverity | HKCategoryValueSleepAnalysis | number;
432
+ export declare type HKCategoryValue = HKCategoryValueAppetiteChanges | HKCategoryValueCervicalMucusQuality | HKCategoryValueLowCardioFitnessEvent | HKCategoryValueMenstrualFlow | HKCategoryValueOvulationTestResult | HKCategoryValuePresence | HKCategoryValueSeverity | HKCategoryValueSleepAnalysis | number;
378
433
  export declare enum HKInsulinDeliveryReason {
379
434
  basal = 1,
380
435
  bolus = 2
@@ -389,7 +444,13 @@ export declare type MetadataMapperForQuantityIdentifier<TQuantityTypeIdentifier
389
444
  export declare type MetadataMapperForCorrelationIdentifier<TCorrelationTypeIdentifier = HKCorrelationTypeIdentifier> = TCorrelationTypeIdentifier extends HKCorrelationTypeIdentifier.food ? HKGenericMetadata & {
390
445
  readonly HKFoodType?: string;
391
446
  } : HKGenericMetadata;
392
- export declare type HKCategoryValueForIdentifier<T extends HKCategoryTypeIdentifier> = T extends HKCategoryTypeIdentifier.cervicalMucusQuality ? HKCategoryValueCervicalMucusQuality : T extends HKCategoryTypeIdentifier.menstrualFlow ? HKCategoryValueMenstrualFlow : T extends HKCategoryTypeIdentifier.ovulationTestResult ? HKCategoryValueOvulationTestResult : T extends HKCategoryTypeIdentifier.sleepAnalysis ? HKCategoryValueSleepAnalysis : T extends HKCategoryTypeIdentifier.mindfulSession ? HKCategoryValueNotApplicable : T extends HKCategoryTypeIdentifier.intermenstrualBleeding ? HKCategoryValueNotApplicable : T extends HKCategoryTypeIdentifier.highHeartRateEvent ? HKCategoryValueNotApplicable : T extends HKCategoryTypeIdentifier.sexualActivity ? HKCategoryValueNotApplicable : T extends HKCategoryTypeIdentifier.appleStandHour ? HKCategoryValueAppleStandHour : number;
447
+ export declare type UnitForIdentifier<T extends HKQuantityTypeIdentifier> = T extends HKQuantityTypeIdentifier.bloodGlucose ? BloodGlucoseUnit : T extends HKQuantityTypeIdentifier.appleExerciseTime | HKQuantityTypeIdentifier.appleMoveTime | HKQuantityTypeIdentifier.appleStandTime ? TimeUnit : T extends HKQuantityTypeIdentifier.activeEnergyBurned | HKQuantityTypeIdentifier.basalEnergyBurned | HKQuantityTypeIdentifier.dietaryEnergyConsumed ? EnergyUnit : T extends HKQuantityTypeIdentifier.distanceCycling | HKQuantityTypeIdentifier.distanceDownhillSnowSports | HKQuantityTypeIdentifier.distanceSwimming | HKQuantityTypeIdentifier.distanceWalkingRunning | HKQuantityTypeIdentifier.distanceWheelchair | HKQuantityTypeIdentifier.sixMinuteWalkTestDistance | HKQuantityTypeIdentifier.waistCircumference ? LengthUnit : T extends HKQuantityTypeIdentifier.bodyFatPercentage | HKQuantityTypeIdentifier.oxygenSaturation | HKQuantityTypeIdentifier.walkingAsymmetryPercentage | HKQuantityTypeIdentifier.walkingDoubleSupportPercentage ? HKUnits.Percent : T extends HKQuantityTypeIdentifier.basalBodyTemperature | HKQuantityTypeIdentifier.basalBodyTemperature ? TemperatureUnit : T extends HKQuantityTypeIdentifier.stairAscentSpeed | HKQuantityTypeIdentifier.stairDescentSpeed | HKQuantityTypeIdentifier.walkingSpeed | HKQuantityTypeIdentifier.walkingSpeed ? SpeedUnit<LengthUnit, TimeUnit> : T extends HKQuantityTypeIdentifier.flightsClimbed | HKQuantityTypeIdentifier.numberOfAlcoholicBeverages | HKQuantityTypeIdentifier.numberOfTimesFallen | HKQuantityTypeIdentifier.pushCount | HKQuantityTypeIdentifier.stepCount | HKQuantityTypeIdentifier.swimmingStrokeCount ? HKUnits.Count : T extends HKQuantityTypeIdentifier.dietaryBiotin | HKQuantityTypeIdentifier.dietaryCaffeine | HKQuantityTypeIdentifier.dietaryCalcium | HKQuantityTypeIdentifier.dietaryCarbohydrates | HKQuantityTypeIdentifier.dietaryChloride | HKQuantityTypeIdentifier.dietaryCholesterol | HKQuantityTypeIdentifier.dietaryChromium | HKQuantityTypeIdentifier.dietaryCopper | HKQuantityTypeIdentifier.dietaryFatMonounsaturated | HKQuantityTypeIdentifier.dietaryFatPolyunsaturated | HKQuantityTypeIdentifier.dietaryFatSaturated | HKQuantityTypeIdentifier.dietaryFatTotal | HKQuantityTypeIdentifier.dietaryFiber | HKQuantityTypeIdentifier.dietaryFolate | HKQuantityTypeIdentifier.dietaryIodine | HKQuantityTypeIdentifier.dietaryIodine | HKQuantityTypeIdentifier.dietaryIron | HKQuantityTypeIdentifier.dietaryMagnesium | HKQuantityTypeIdentifier.dietaryManganese | HKQuantityTypeIdentifier.dietaryMolybdenum | HKQuantityTypeIdentifier.dietaryNiacin | HKQuantityTypeIdentifier.dietaryPantothenicAcid | HKQuantityTypeIdentifier.dietaryPhosphorus | HKQuantityTypeIdentifier.dietaryPotassium | HKQuantityTypeIdentifier.dietaryProtein | HKQuantityTypeIdentifier.dietaryRiboflavin | HKQuantityTypeIdentifier.dietarySelenium | HKQuantityTypeIdentifier.dietarySodium | HKQuantityTypeIdentifier.dietarySugar | HKQuantityTypeIdentifier.dietaryThiamin | HKQuantityTypeIdentifier.dietaryVitaminA | HKQuantityTypeIdentifier.dietaryVitaminB6 | HKQuantityTypeIdentifier.dietaryVitaminB12 | HKQuantityTypeIdentifier.dietaryVitaminC | HKQuantityTypeIdentifier.dietaryVitaminD | HKQuantityTypeIdentifier.dietaryVitaminE | HKQuantityTypeIdentifier.dietaryVitaminK | HKQuantityTypeIdentifier.dietaryZinc ? MassUnit : T extends HKQuantityTypeIdentifier.dietaryWater ? VolumeUnit : T extends HKQuantityTypeIdentifier.insulinDelivery ? HKUnits.InternationalUnit | `${HKUnits.InternationalUnit}` : T extends HKQuantityTypeIdentifier.heartRate | HKQuantityTypeIdentifier.restingHeartRate | HKQuantityTypeIdentifier.walkingHeartRateAverage ? CountPerTime<TimeUnit> : HKUnit;
448
+ export declare type HKCategoryValueForIdentifier<T extends HKCategoryTypeIdentifier> = T extends HKCategoryTypeIdentifier.cervicalMucusQuality ? HKCategoryValueCervicalMucusQuality : T extends HKCategoryTypeIdentifier.menstrualFlow ? HKCategoryValueMenstrualFlow : T extends HKCategoryTypeIdentifier.ovulationTestResult ? HKCategoryValueOvulationTestResult : T extends HKCategoryTypeIdentifier.sleepAnalysis ? HKCategoryValueSleepAnalysis : T extends (HKCategoryTypeIdentifier.highHeartRateEvent | HKCategoryTypeIdentifier.intermenstrualBleeding | HKCategoryTypeIdentifier.mindfulSession | HKCategoryTypeIdentifier.sexualActivity) ? HKCategoryValueNotApplicable : T extends (HKCategoryTypeIdentifier.abdominalCramps | HKCategoryTypeIdentifier.abdominalCramps | HKCategoryTypeIdentifier.acne | HKCategoryTypeIdentifier.bladderIncontinence | HKCategoryTypeIdentifier.bloating | HKCategoryTypeIdentifier.breastPain | HKCategoryTypeIdentifier.chestTightnessOrPain | HKCategoryTypeIdentifier.chills | HKCategoryTypeIdentifier.constipation | HKCategoryTypeIdentifier.coughing | HKCategoryTypeIdentifier.diarrhea | HKCategoryTypeIdentifier.dizziness | HKCategoryTypeIdentifier.drySkin | HKCategoryTypeIdentifier.fainting | HKCategoryTypeIdentifier.fatigue | HKCategoryTypeIdentifier.fever | HKCategoryTypeIdentifier.generalizedBodyAche | HKCategoryTypeIdentifier.hairLoss | HKCategoryTypeIdentifier.headache | HKCategoryTypeIdentifier.heartburn | HKCategoryTypeIdentifier.hotFlashes | HKCategoryTypeIdentifier.lossOfSmell | HKCategoryTypeIdentifier.lossOfTaste | HKCategoryTypeIdentifier.lowerBackPain | HKCategoryTypeIdentifier.memoryLapse | HKCategoryTypeIdentifier.moodChanges | HKCategoryTypeIdentifier.nausea | HKCategoryTypeIdentifier.nightSweats | HKCategoryTypeIdentifier.pelvicPain | HKCategoryTypeIdentifier.rapidPoundingOrFlutteringHeartbeat | HKCategoryTypeIdentifier.runnyNose | HKCategoryTypeIdentifier.shortnessOfBreath | HKCategoryTypeIdentifier.sinusCongestion | HKCategoryTypeIdentifier.skippedHeartbeat | HKCategoryTypeIdentifier.soreThroat | HKCategoryTypeIdentifier.vaginalDryness | HKCategoryTypeIdentifier.vomiting | HKCategoryTypeIdentifier.wheezing) ? HKCategoryValueSeverity : T extends (HKCategoryTypeIdentifier.appetiteChanges | HKCategoryTypeIdentifier.sleepChanges) ? HKCategoryValuePresence : T extends HKCategoryTypeIdentifier.lowCardioFitnessEvent ? HKCategoryValueLowCardioFitnessEvent : T extends HKCategoryTypeIdentifier.pregnancyTestResult ? HKCategoryValuePregnancyTestResult : T extends HKCategoryTypeIdentifier.pregnancyTestResult ? HKCategoryValuePregnancyTestResult : T extends HKCategoryTypeIdentifier.appleStandHour ? HKCategoryValueAppleStandHour : number;
449
+ declare enum HKCategoryValuePregnancyTestResult {
450
+ positive = 2,
451
+ negative = 1,
452
+ indeterminate = 3
453
+ }
393
454
  export declare type MetadataMapperForCategoryIdentifier<T extends HKCategoryTypeIdentifier> = T extends HKCategoryTypeIdentifier.sexualActivity ? HKGenericMetadata & {
394
455
  readonly HKSexualActivityProtectionUsed: boolean;
395
456
  } : T extends HKCategoryTypeIdentifier.menstrualFlow ? HKGenericMetadata & {
@@ -400,7 +461,8 @@ export declare enum HKWheelchairUse {
400
461
  no = 1,
401
462
  yes = 2
402
463
  }
403
- export declare enum HKUnitSIPrefix {
464
+ export declare enum HKMetricPrefix {
465
+ None = "",
404
466
  Pico = "p",
405
467
  Nano = "n",
406
468
  Micro = "mc",
@@ -412,60 +474,160 @@ export declare enum HKUnitSIPrefix {
412
474
  Kilo = "k",
413
475
  Mega = "M",
414
476
  Giga = "G",
415
- Tera = "T"
477
+ Tera = "T",
478
+ Femto = "f"
416
479
  }
417
- export declare enum HKUnitSI {
418
- Grams = "g",
419
- Joules = "J",
480
+ export declare enum HKUnitMetric {
481
+ Gram = "g",
482
+ Joule = "J",
420
483
  Kelvin = "K",
421
- Liters = "l",
422
- Meters = "m",
423
- Pascals = "Pa",
424
- Seconds = "s",
425
- Siemens = "S"
426
- }
427
- export declare enum HKUnit {
428
- Grams = "g",
429
- Joules = "J",
430
- Kelvin = "K",
431
- Liters = "l",
432
- Meters = "m",
433
- Pascals = "Pa",
434
- Seconds = "s",
435
- Siemens = "S",
436
- Atmospheres = "atm",
437
- CentimetersOfWater = "cmAq",
438
- Count = "count",
439
- Days = "d",
484
+ Liter = "l",
485
+ Meter = "m",
486
+ Pascal = "Pa",
487
+ Second = "s",
488
+ Siemen = "S",
489
+ Hertz = "Hz",
490
+ Volt = "V"
491
+ }
492
+ export declare enum HKUnits {
440
493
  DecibelHearingLevel = "dBHL",
441
494
  DecibelSoundPressureLevel = "dBASPL",
442
- DegreesCelsius = "degC",
443
- DegreesFahrenheit = "degF",
495
+ Percent = "%",
496
+ Count = "count",
497
+ InternationalUnit = "IU"
498
+ }
499
+ export declare type MeterUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> = `${Prefix}${HKUnitMetric.Meter}`;
500
+ export declare type LiterUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> = `${Prefix}${HKUnitMetric.Liter}`;
501
+ export declare type GramUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> = `${Prefix}${HKUnitMetric.Gram}`;
502
+ export declare type PascalUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> = `${Prefix}${HKUnitMetric.Pascal}`;
503
+ export declare type SecondUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> = `${Prefix}${HKUnitMetric.Second}`;
504
+ export declare type JouleUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> = `${Prefix}${HKUnitMetric.Joule}`;
505
+ export declare type HertzUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> = `${Prefix}${HKUnitMetric.Hertz}`;
506
+ export declare type VoltUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> = `${Prefix}${HKUnitMetric.Volt}`;
507
+ export declare type SiemenUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> = `${Prefix}${HKUnitMetric.Siemen}`;
508
+ export declare type MoleUnit<MolarMass extends number> = `mol<${MolarMass}>`;
509
+ export declare type MoleUnitWith<MolarMass extends number, Prefix extends HKMetricPrefix = HKMetricPrefix.None> = `${Prefix}mol<${MolarMass}>`;
510
+ export declare type FrequencyUnit = HertzUnit<HKMetricPrefix>;
511
+ /**
512
+ * More SI prefixes also available as literals, just type the string
513
+ * @example 'cm', 'km'
514
+ */
515
+ export declare enum UnitOfLength {
444
516
  Feet = "ft",
445
- Hertz = "Hz",
446
- Hours = "hr",
517
+ /**
518
+ * More SI prefixes also available as literals, just type the string
519
+ * @example 'cm', 'km'
520
+ */
521
+ Meter = "m",
522
+ Inches = "in",
523
+ Yards = "yd",
524
+ Miles = "mi"
525
+ }
526
+ export declare type LengthUnit = MeterUnit<HKMetricPrefix> | UnitOfLength;
527
+ /**
528
+ * More SI prefixes also available as literals, just type the string
529
+ * @example 'ml', 'cl'
530
+ */
531
+ export declare enum UnitOfVolume {
447
532
  ImperialCup = "cup_imp",
448
533
  ImperialFluidOunces = "fl_oz_imp",
449
534
  ImperialPint = "pt_imp",
450
- Inches = "in",
451
- InternationalUnit = "IU",
452
- Kilocalories = "kcal",
453
- LargeCalories = "Cal",
454
- Miles = "mi",
455
- MillimetersOfMercury = "mmHg",
456
- Minutes = "min",
457
- Ounces = "oz",
458
- Percent = "%",
459
- Pounds = "lb",
460
- SmallCalories = "cal",
461
- Stones = "st",
462
535
  USCup = "cup_us",
463
536
  USFluidOunces = "fl_oz_us",
464
537
  USPint = "pt_us",
465
- Yard = "yd",
538
+ /**
539
+ * More SI prefixes also available as literals, just type the string
540
+ * @example 'ml', 'cl'
541
+ */
542
+ Liter = "l"
543
+ }
544
+ export declare type VolumeUnit = LiterUnit<HKMetricPrefix> | UnitOfVolume;
545
+ /**
546
+ * More SI prefixes also available as literals, just type the string
547
+ * @example 'mg', 'kg'
548
+ */
549
+ export declare enum UnitOfMass {
550
+ Ounces = "oz",
551
+ Stones = "st",
552
+ Pounds = "lb",
553
+ /**
554
+ * More SI prefixes also available as literals, just type the string
555
+ * @example 'mg', 'kg'
556
+ */
557
+ Gram = "g"
558
+ }
559
+ /**
560
+ * More SI prefixes also available as literals, just type the string
561
+ * @example 'mg', 'kg'
562
+ */
563
+ export declare type MassUnit = GramUnit<HKMetricPrefix> | UnitOfMass;
564
+ /**
565
+ * More SI prefixes also available as literals, just type the string
566
+ * @example 'kPa', 'hPa'
567
+ */
568
+ export declare enum UnitOfPressure {
569
+ Atmospheres = "atm",
570
+ CentimetersOfWater = "cmAq",
571
+ MillimetersOfMercury = "mmHg",
572
+ InchesOfMercury = "inHg",
573
+ DecibelAWeightedSoundPressureLevel = "dBASPL",
574
+ /**
575
+ * More SI prefixes also available as literals, just type the string
576
+ * @example 'kPa', 'hPa'
577
+ */
578
+ Pascals = "Pa"
579
+ }
580
+ /**
581
+ * More SI prefixes also available as literals, just type the string
582
+ * @example 'kPa', 'hPa'
583
+ */
584
+ export declare type PressureUnit = PascalUnit<HKMetricPrefix> | UnitOfPressure;
585
+ /**
586
+ * More SI prefixes also available as literals, just type the string
587
+ * @example 'ms'
588
+ */
589
+ export declare enum UnitOfTime {
590
+ Days = "d",
591
+ Minutes = "min",
592
+ Hours = "hr",
593
+ /**
594
+ * More SI prefixes also available as literals, just type the string
595
+ * @example 'ms'
596
+ */
597
+ Seconds = "s"
598
+ }
599
+ /**
600
+ * More SI prefixes also available as literals, just type the string
601
+ * @example 'ms'
602
+ */
603
+ export declare type TimeUnit = SecondUnit<HKMetricPrefix> | UnitOfTime;
604
+ export declare enum TemperatureUnit {
605
+ DegreesCelsius = "degC",
606
+ DegreesFahrenheit = "degF",
607
+ Kelvin = "K"
608
+ }
609
+ /**
610
+ * More SI prefixes also available as literals, just type the string
611
+ * @example 'kJ'
612
+ */
613
+ export declare enum UnitOfEnergy {
614
+ Kilocalories = "kcal",
615
+ LargeCalories = "Cal",
616
+ SmallCalories = "cal",
617
+ /**
618
+ * More SI prefixes also available as literals, just type the string
619
+ * @example 'kJ'
620
+ */
621
+ Joules = "J"
622
+ }
623
+ export declare type EnergyUnit = JouleUnit<HKMetricPrefix> | UnitOfEnergy;
624
+ export declare enum BloodGlucoseUnit {
466
625
  GlucoseMmolPerL = "mmol<180.15588000005408>/l",
467
626
  GlucoseMgPerDl = "mg/dL"
468
627
  }
628
+ export declare type SpeedUnit<TLength extends LengthUnit, TTime extends TimeUnit> = `${TLength}/${TTime}`;
629
+ export declare type CountPerTime<TTime extends TimeUnit> = `count/${TTime}`;
630
+ export declare type HKUnit = BloodGlucoseUnit | CountPerTime<TimeUnit> | EnergyUnit | FrequencyUnit | HKUnits | LengthUnit | MassUnit | PressureUnit | SpeedUnit<LengthUnit, TimeUnit> | TemperatureUnit | TimeUnit | VolumeUnit | `${BloodGlucoseUnit}` | `${EnergyUnit}` | `${FrequencyUnit}` | `${HKUnits}` | `${LengthUnit}` | `${MassUnit}` | `${PressureUnit}` | `${TemperatureUnit}` | `${TimeUnit}` | `${VolumeUnit}`;
469
631
  export declare type HKDevice = {
470
632
  readonly name: string;
471
633
  readonly firmwareVersion: string | null;
@@ -485,7 +647,7 @@ export declare type HKSourceRevision = {
485
647
  readonly operatingSystemVersion?: string;
486
648
  readonly productType?: string;
487
649
  };
488
- export declare type HKQuantitySampleRaw<TQuantityIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier, TUnit extends HKUnit = HKUnit> = {
650
+ export declare type HKQuantitySampleRaw<TQuantityIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TQuantityIdentifier> = UnitForIdentifier<TQuantityIdentifier>> = {
489
651
  readonly uuid: string;
490
652
  readonly device?: HKDevice;
491
653
  readonly quantityType: TQuantityIdentifier;
@@ -496,15 +658,17 @@ export declare type HKQuantitySampleRaw<TQuantityIdentifier extends HKQuantityTy
496
658
  readonly metadata: MetadataMapperForQuantityIdentifier<TQuantityIdentifier>;
497
659
  readonly sourceRevision?: HKSourceRevision;
498
660
  };
499
- export declare type HKWorkoutRaw<TEnergy extends HKUnit, TDistance extends HKUnit> = {
661
+ export declare type HKQuantitySampleRawForSaving<TQuantityIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TQuantityIdentifier> = UnitForIdentifier<TQuantityIdentifier>> = Omit<HKQuantitySampleRaw<TQuantityIdentifier, TUnit>, 'device' | 'endDate' | 'startDate' | 'uuid'>;
662
+ export declare type HKCategorySampleRawForSaving<TCategory extends HKCategoryTypeIdentifier = HKCategoryTypeIdentifier> = Omit<HKCategorySampleRaw<TCategory>, 'device' | 'endDate' | 'startDate' | 'uuid'>;
663
+ export declare type HKWorkoutRaw<TEnergy extends EnergyUnit, TDistance extends LengthUnit> = {
500
664
  readonly uuid: string;
501
665
  readonly device?: HKDevice;
502
666
  readonly workoutActivityType: HKWorkoutActivityType;
503
667
  readonly duration: number;
504
- readonly totalDistance?: HKQuantity<TDistance>;
505
- readonly totalEnergyBurned?: HKQuantity<TEnergy>;
506
- readonly totalSwimmingStrokeCount?: HKQuantity<HKUnit.Count>;
507
- readonly totalFlightsClimbed?: HKQuantity<HKUnit.Count>;
668
+ readonly totalDistance?: HKQuantity<HKQuantityTypeIdentifier, TDistance>;
669
+ readonly totalEnergyBurned?: HKQuantity<HKQuantityTypeIdentifier, TEnergy>;
670
+ readonly totalSwimmingStrokeCount?: HKQuantity<HKQuantityTypeIdentifier, HKUnits.Count>;
671
+ readonly totalFlightsClimbed?: HKQuantity<HKQuantityTypeIdentifier, HKUnits.Count>;
508
672
  readonly startDate: string;
509
673
  readonly endDate: string;
510
674
  readonly metadata?: HKWorkoutMetadata;
@@ -515,7 +679,8 @@ export declare enum HKCharacteristicTypeIdentifier {
515
679
  biologicalSex = "HKCharacteristicTypeIdentifierBiologicalSex",
516
680
  bloodType = "HKCharacteristicTypeIdentifierBloodType",
517
681
  dateOfBirth = "HKCharacteristicTypeIdentifierDateOfBirth",
518
- wheelchairUse = "HKCharacteristicTypeIdentifierWheelchairUse"
682
+ wheelchairUse = "HKCharacteristicTypeIdentifierWheelchairUse",
683
+ activityMoveMode = "HKCharacteristicTypeIdentifierActivityMoveMode"
519
684
  }
520
685
  export declare type WritePermissions = {
521
686
  readonly [key in HKCategoryTypeIdentifier | HKCharacteristicTypeIdentifier | HKQuantityTypeIdentifier]: boolean;
@@ -572,20 +737,20 @@ declare type ReactNativeHealthkitTypeNative = {
572
737
  readonly enableBackgroundDelivery: (typeIdentifier: HKSampleTypeIdentifier, updateFrequency: HKUpdateFrequency) => Promise<boolean>;
573
738
  readonly disableBackgroundDelivery: (typeIdentifier: HKSampleTypeIdentifier) => Promise<boolean>;
574
739
  readonly disableAllBackgroundDelivery: () => Promise<boolean>;
575
- readonly saveCorrelationSample: <TIdentifier extends HKCorrelationTypeIdentifier>(typeIdentifier: TIdentifier, samples: readonly Omit<HKCategorySampleRaw | HKQuantitySampleRaw, 'device' | 'endDate' | 'startDate' | 'uuid'>[], start: string, end: string, metadata: MetadataMapperForCorrelationIdentifier<TIdentifier>) => Promise<boolean>;
576
- readonly saveWorkoutSample: (typeIdentifier: HKWorkoutActivityType, quantities: readonly Omit<HKQuantitySampleRaw, 'device' | 'endDate' | 'startDate' | 'uuid'>[], start: string, end: string, metadata: HKWorkoutMetadata) => Promise<boolean>;
740
+ readonly saveCorrelationSample: <TIdentifier extends HKCorrelationTypeIdentifier, TSamples extends readonly (HKCategorySampleRawForSaving | HKQuantitySampleRawForSaving)[]>(typeIdentifier: TIdentifier, samples: TSamples, start: string, end: string, metadata: MetadataMapperForCorrelationIdentifier<TIdentifier>) => Promise<boolean>;
741
+ readonly saveWorkoutSample: (typeIdentifier: HKWorkoutActivityType, quantities: readonly HKQuantitySampleRawForSaving[], start: string, end: string, metadata: HKWorkoutMetadata) => Promise<boolean>;
577
742
  readonly queryCorrelationSamples: <TIdentifier extends HKCorrelationTypeIdentifier>(typeIdentifier: TIdentifier, from: string, to: string) => Promise<readonly HKCorrelationRaw<TIdentifier>[]>;
578
743
  subscribeToObserverQuery(identifier: HKSampleTypeIdentifier): Promise<QueryId>;
579
744
  unsubscribeQuery(queryId: QueryId): Promise<boolean>;
580
745
  authorizationStatusFor(type: HealthkitReadAuthorization): Promise<boolean>;
581
746
  getRequestStatusForAuthorization(write: WritePermissions, read: ReadPermissions): Promise<HKAuthorizationRequestStatus>;
582
747
  requestAuthorization(write: WritePermissions, read: ReadPermissions): Promise<boolean>;
583
- readonly saveQuantitySample: (identifier: HKQuantityTypeIdentifier, unit: HKUnit, value: number, start: string, end: string, metadata: unknown) => Promise<boolean>;
584
- readonly queryWorkoutSamples: <TEnergy extends HKUnit, TDistance extends HKUnit>(energyUnit: TEnergy, distanceUnit: TDistance, from: string, to: string, limit: number, ascending: boolean) => Promise<readonly HKWorkoutRaw<TEnergy, TDistance>[]>;
748
+ readonly saveQuantitySample: <TType extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TType> = UnitForIdentifier<TType>>(identifier: TType, unit: TUnit, value: number, start: string, end: string, metadata: unknown) => Promise<boolean>;
749
+ readonly queryWorkoutSamples: <TEnergy extends EnergyUnit, TDistance extends LengthUnit>(energyUnit: TEnergy, distanceUnit: TDistance, from: string, to: string, limit: number, ascending: boolean) => Promise<readonly HKWorkoutRaw<TEnergy, TDistance>[]>;
585
750
  readonly queryCategorySamples: <T extends HKCategoryTypeIdentifier>(identifier: T, from: string, to: string, limit: number, ascending: boolean) => Promise<readonly HKCategorySampleRaw<T>[]>;
586
- readonly queryQuantitySamples: <TUnit extends HKUnit, TIdentifier extends HKQuantityTypeIdentifier>(identifier: TIdentifier, unit: TUnit, from: string, to: string, limit: number, ascending: boolean) => Promise<readonly HKQuantitySampleRaw<TIdentifier, TUnit>[]>;
751
+ readonly queryQuantitySamples: <TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier>>(identifier: TIdentifier, unit: TUnit, from: string, to: string, limit: number, ascending: boolean) => Promise<readonly HKQuantitySampleRaw<TIdentifier, TUnit>[]>;
587
752
  readonly saveCategorySample: <T extends HKCategoryTypeIdentifier>(identifier: T, value: HKCategoryValueForIdentifier<T>, start: string, end: string, metadata: unknown) => Promise<boolean>;
588
- readonly queryStatisticsForQuantity: <TUnit extends HKUnit>(identifier: HKQuantityTypeIdentifier, unit: TUnit, from: string, to: string, options: readonly HKStatisticsOptions[]) => Promise<QueryStatisticsResponseRaw<TUnit>>;
753
+ readonly queryStatisticsForQuantity: <TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier>>(identifier: HKQuantityTypeIdentifier, unit: TUnit, from: string, to: string, options: readonly HKStatisticsOptions[]) => Promise<QueryStatisticsResponseRaw<TIdentifier, TUnit>>;
589
754
  readonly getPreferredUnits: (identifiers: readonly HKQuantityTypeIdentifier[]) => Promise<TypeToUnitMapping>;
590
755
  readonly getWorkoutRoutes: (workoutUUID: string) => Promise<readonly WorkoutRoute[]>;
591
756
  };
@@ -1,4 +1,5 @@
1
- import type { HealthkitReadAuthorization, HealthkitWriteAuthorization, HKAuthorizationRequestStatus, HKBiologicalSex, HKBloodType, HKCategorySampleRaw, HKCategoryTypeIdentifier, HKCategoryValueForIdentifier, HKCorrelationRaw, HKCorrelationTypeIdentifier, HKFitzpatrickSkinType, HKQuantitySampleRaw, HKQuantityTypeIdentifier, HKSampleTypeIdentifier, HKStatisticsOptions, HKUnit, HKUnitSI, HKUnitSIPrefix, HKUpdateFrequency, HKWheelchairUse, HKWorkoutActivityType, HKWorkoutMetadata, HKWorkoutRaw, MetadataMapperForCategoryIdentifier, MetadataMapperForCorrelationIdentifier, MetadataMapperForQuantityIdentifier, QueryStatisticsResponseRaw, WorkoutRoute } from './native-types';
1
+ import type { EnergyUnit, HKCategorySampleRaw, HKCategoryTypeIdentifier, HKCorrelationRaw, HKCorrelationTypeIdentifier, HKDevice, HKQuantityTypeIdentifier, HKSourceRevision, HKUnit, HKWorkoutRaw, LengthUnit, MetadataMapperForQuantityIdentifier, QueryStatisticsResponseRaw, UnitForIdentifier } from './native-types';
2
+ export * from './native-types';
2
3
  export interface QueryWorkoutsOptions<TEnergy extends HKUnit, TDistance extends HKUnit> extends GenericQueryOptions {
3
4
  readonly energyUnit?: TEnergy;
4
5
  readonly distanceUnit?: TDistance;
@@ -13,108 +14,31 @@ export declare type GenericQueryOptions = {
13
14
  readonly limit?: number;
14
15
  readonly ascending?: boolean;
15
16
  };
16
- export interface HKWorkout<TEnergy extends HKUnit = HKUnit, TDistance extends HKUnit = HKUnit> extends Omit<HKWorkoutRaw<TEnergy, TDistance>, 'endDate' | 'startDate'> {
17
+ export interface HKWorkout<TEnergy extends EnergyUnit = EnergyUnit, TDistance extends LengthUnit = LengthUnit> extends Omit<HKWorkoutRaw<TEnergy, TDistance>, 'endDate' | 'startDate'> {
17
18
  readonly startDate: Date;
18
19
  readonly endDate: Date;
19
20
  }
20
- export interface HKQuantitySample<TIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier, TUnit extends HKUnit = HKUnit> extends Omit<HKQuantitySampleRaw<TIdentifier, TUnit>, 'endDate' | 'startDate'> {
21
+ export interface HKQuantitySample<TIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier> = UnitForIdentifier<TIdentifier>> {
22
+ readonly uuid: string;
23
+ readonly device?: HKDevice;
24
+ readonly quantityType: TIdentifier;
25
+ readonly quantity: number;
26
+ readonly unit: TUnit;
27
+ readonly metadata?: MetadataMapperForQuantityIdentifier<TIdentifier>;
28
+ readonly sourceRevision?: HKSourceRevision;
21
29
  readonly startDate: Date;
22
30
  readonly endDate: Date;
23
31
  }
24
- export interface QueryStatisticsResponse<T extends HKUnit = HKUnit> extends Omit<QueryStatisticsResponseRaw<T>, 'mostRecentQuantityDateInterval'> {
32
+ export interface QueryStatisticsResponse<TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier> = UnitForIdentifier<TIdentifier>> extends Omit<QueryStatisticsResponseRaw<TIdentifier, TUnit>, 'mostRecentQuantityDateInterval'> {
25
33
  readonly mostRecentQuantityDateInterval?: {
26
34
  readonly from: Date;
27
35
  readonly to: Date;
28
36
  };
29
37
  }
30
- declare type UnsubscribeFunction = () => Promise<boolean>;
31
- export declare type IsHealthDataAvailableFn = () => Promise<boolean>;
32
- export declare type GetBloodTypeFn = () => Promise<HKBloodType>;
33
- export declare type GetDateOfBirthFn = () => Promise<Date>;
34
- export declare type GetBiologicalSexFn = () => Promise<HKBiologicalSex>;
35
- export declare type GetWheelchairUseFn = () => Promise<HKWheelchairUse>;
36
- export declare type GetFitzpatrickSkinTypeFn = () => Promise<HKFitzpatrickSkinType>;
37
- export declare type QueryStatisticsForQuantityFn = <TUnit extends HKUnit>(identifier: HKQuantityTypeIdentifier, options: readonly HKStatisticsOptions[], from: Date, to?: Date, unit?: TUnit) => Promise<QueryStatisticsResponse<TUnit>>;
38
- export declare type QueryWorkoutsFn = <TEnergy extends HKUnit, TDistance extends HKUnit>(options: QueryWorkoutsOptions<TEnergy, TDistance>) => Promise<readonly HKWorkout<TEnergy, TDistance>[]>;
39
- export declare type AuthorizationStatusForFn = (type: HealthkitReadAuthorization) => Promise<boolean>;
40
- export declare type QueryCategorySamplesFn = <T extends HKCategoryTypeIdentifier>(identifier: T, options: GenericQueryOptions) => Promise<readonly HKCategorySample<T>[]>;
41
- export declare type GetRequestStatusForAuthorizationFn = (read: readonly HealthkitReadAuthorization[], write?: readonly HealthkitWriteAuthorization[]) => Promise<HKAuthorizationRequestStatus>;
42
- export declare type RequestAuthorizationFn = (read: readonly HealthkitReadAuthorization[], write?: readonly HealthkitWriteAuthorization[]) => Promise<boolean>;
43
- export declare type SaveQuantitySampleFn = <TUnit extends HKQuantityTypeIdentifier>(identifier: TUnit, unit: HKUnit, value: number, options?: {
44
- readonly start?: Date;
45
- readonly end?: Date;
46
- readonly metadata?: MetadataMapperForQuantityIdentifier<TUnit>;
47
- }) => Promise<boolean>;
48
- export declare type QueryQuantitySamplesFn = <TIdentifier extends HKQuantityTypeIdentifier, TUnit extends HKUnit = HKUnit>(identifier: TIdentifier, options: GenericQueryOptions & {
49
- readonly unit?: TUnit;
50
- }) => Promise<readonly HKQuantitySample<TIdentifier, TUnit>[]>;
51
- export declare type SubscribeToChangesFn = (identifier: HKSampleTypeIdentifier, callback: () => void) => Promise<UnsubscribeFunction>;
52
- export declare type SaveCategorySampleFn = <T extends HKCategoryTypeIdentifier>(identifier: T, value: HKCategoryValueForIdentifier<T>, options?: {
53
- readonly start?: Date;
54
- readonly end?: Date;
55
- readonly metadata?: MetadataMapperForCategoryIdentifier<T>;
56
- }) => Promise<boolean>;
57
- export declare type GetMostRecentCategorySampleFn = <T extends HKCategoryTypeIdentifier>(identifier: T) => Promise<HKCategorySample<T> | null>;
58
- export declare type MostRecentCategorySampleHook = <T extends HKCategoryTypeIdentifier>(identifier: T) => HKCategorySample<T> | null;
59
- export declare type MostRecentCorrelationSampleHook = <T extends HKCorrelationTypeIdentifier>(identifer: T) => HKCorrelation<T> | null;
60
- export declare type GetMostRecentQuantitySampleFn = <TIdentifier extends HKQuantityTypeIdentifier, TUnit extends HKUnit>(identifier: TIdentifier, unit?: TUnit) => Promise<HKQuantitySample<TIdentifier, TUnit> | null>;
61
- export declare type MostRecentQuantitySampleHook = <TIdentifier extends HKQuantityTypeIdentifier, TUnit extends HKUnit>(identifier: TIdentifier, unit?: TUnit) => HKQuantitySample<TIdentifier, TUnit> | null;
62
- export declare type GetMostRecentWorkoutFn = <TEnergy extends HKUnit, TDistance extends HKUnit>(options?: Pick<QueryWorkoutsOptions<TEnergy, TDistance>, 'distanceUnit' | 'energyUnit'>) => Promise<HKWorkout<TEnergy, TDistance> | null>;
63
- export declare type MostRecentWorkoutHook = <TEnergy extends HKUnit, TDistance extends HKUnit>(options?: Pick<QueryWorkoutsOptions<TEnergy, TDistance>, 'distanceUnit' | 'energyUnit'>) => HKWorkout<TEnergy, TDistance> | null;
64
- export declare type GetPreferredUnitsFn = (identifiers: readonly HKQuantityTypeIdentifier[]) => Promise<readonly HKUnit[]>;
65
- export declare type GetPreferredUnitFn = (identifier: HKQuantityTypeIdentifier) => Promise<HKUnit>;
66
- export declare type SaveCorrelationSampleFn = <TIdentifier extends HKCorrelationTypeIdentifier>(typeIdentifier: TIdentifier, samples: readonly (Omit<HKCategorySample, 'device' | 'endDate' | 'startDate' | 'uuid'> | Omit<HKQuantitySample, 'device' | 'endDate' | 'startDate' | 'uuid'>)[], options?: {
67
- readonly start?: Date;
68
- readonly end?: Date;
69
- readonly metadata?: MetadataMapperForCorrelationIdentifier<TIdentifier>;
70
- }) => Promise<boolean>;
71
- export declare type SaveWorkoutSampleFn = (typeIdentifier: HKWorkoutActivityType, quantities: readonly Omit<HKQuantitySample, 'device' | 'endDate' | 'startDate' | 'uuid'>[], start: Date, options?: {
72
- readonly end?: Date;
73
- readonly metadata?: HKWorkoutMetadata;
74
- }) => Promise<boolean>;
38
+ export declare type HKCategorySampleForSaving = Omit<HKCategorySample, 'device' | 'endDate' | 'startDate' | 'uuid'>;
39
+ export declare type HKQuantitySampleForSaving = Omit<HKQuantitySample, 'device' | 'endDate' | 'startDate' | 'uuid'>;
75
40
  export interface HKCorrelation<TIdentifier extends HKCorrelationTypeIdentifier> extends Omit<HKCorrelationRaw<TIdentifier>, 'endDate' | 'objects' | 'startDate'> {
76
41
  readonly objects: readonly (HKCategorySample | HKQuantitySample)[];
77
42
  readonly startDate: Date;
78
43
  readonly endDate: Date;
79
44
  }
80
- export declare type QueryCorrelationSamplesFn = <TIdentifier extends HKCorrelationTypeIdentifier>(typeIdentifier: TIdentifier, options: Omit<GenericQueryOptions, 'ascending' | 'limit'>) => Promise<readonly HKCorrelation<TIdentifier>[]>;
81
- export declare type SubscribeToChangesHook = <TIdentifier extends HKSampleTypeIdentifier>(identifier: TIdentifier, onChange: () => void, runInitialUpdate?: boolean) => void;
82
- export declare type GetWorkoutRoutesFn = (workoutUUID: string) => Promise<readonly WorkoutRoute[]>;
83
- export declare type ReactNativeHealthkit = {
84
- readonly authorizationStatusFor: AuthorizationStatusForFn;
85
- readonly getBiologicalSex: GetBiologicalSexFn;
86
- readonly getBloodType: GetBloodTypeFn;
87
- readonly getDateOfBirth: GetDateOfBirthFn;
88
- readonly getFitzpatrickSkinType: GetFitzpatrickSkinTypeFn;
89
- readonly getMostRecentQuantitySample: GetMostRecentQuantitySampleFn;
90
- readonly getMostRecentCategorySample: GetMostRecentCategorySampleFn;
91
- readonly getMostRecentWorkout: GetMostRecentWorkoutFn;
92
- readonly getPreferredUnit: GetPreferredUnitFn;
93
- readonly getPreferredUnits: GetPreferredUnitsFn;
94
- readonly getRequestStatusForAuthorization: GetRequestStatusForAuthorizationFn;
95
- readonly getWheelchairUse: GetWheelchairUseFn;
96
- readonly getWorkoutRoutes: GetWorkoutRoutesFn;
97
- readonly buildUnitWithPrefix: (prefix: HKUnitSIPrefix, unit: HKUnitSI) => HKUnit;
98
- readonly isHealthDataAvailable: IsHealthDataAvailableFn;
99
- readonly queryCategorySamples: QueryCategorySamplesFn;
100
- readonly queryQuantitySamples: QueryQuantitySamplesFn;
101
- readonly queryStatisticsForQuantity: QueryStatisticsForQuantityFn;
102
- readonly queryWorkouts: QueryWorkoutsFn;
103
- readonly queryCorrelationSamples: QueryCorrelationSamplesFn;
104
- readonly requestAuthorization: RequestAuthorizationFn;
105
- readonly saveCategorySample: SaveCategorySampleFn;
106
- readonly saveQuantitySample: SaveQuantitySampleFn;
107
- readonly saveCorrelationSample: SaveCorrelationSampleFn;
108
- readonly saveWorkoutSample: SaveWorkoutSampleFn;
109
- readonly enableBackgroundDelivery: (typeIdentifier: HKSampleTypeIdentifier, updateFrequency: HKUpdateFrequency) => Promise<boolean>;
110
- readonly disableBackgroundDelivery: (typeIdentifier: HKSampleTypeIdentifier) => Promise<boolean>;
111
- readonly disableAllBackgroundDelivery: () => Promise<boolean>;
112
- readonly subscribeToChanges: SubscribeToChangesFn;
113
- readonly useMostRecentWorkout: MostRecentWorkoutHook;
114
- readonly useMostRecentCategorySample: MostRecentCategorySampleHook;
115
- readonly useMostRecentQuantitySample: MostRecentQuantitySampleHook;
116
- readonly useSubscribeToChanges: SubscribeToChangesHook;
117
- readonly useIsHealthDataAvailable: () => boolean | null;
118
- readonly useHealthkitAuthorization: (read: readonly HealthkitReadAuthorization[], write?: readonly HealthkitWriteAuthorization[]) => readonly [authorizationStatus: HKAuthorizationRequestStatus | null, request: () => Promise<HKAuthorizationRequestStatus | null>];
119
- };
120
- export {};
@@ -0,0 +1,4 @@
1
+ import type { HKCategorySampleRaw, HKCategoryTypeIdentifier } from '../native-types';
2
+ import type { HKCategorySample } from '../types';
3
+ declare const deserializCategorySample: <T extends HKCategoryTypeIdentifier>(sample: HKCategorySampleRaw<T>) => HKCategorySample<T>;
4
+ export default deserializCategorySample;
@@ -0,0 +1,4 @@
1
+ import type { HKCorrelationRaw, HKCorrelationTypeIdentifier } from '../native-types';
2
+ import type { HKCorrelation } from '../types';
3
+ declare function deserializeCorrelation<TIdentifier extends HKCorrelationTypeIdentifier>(s: HKCorrelationRaw<TIdentifier>): HKCorrelation<TIdentifier>;
4
+ export default deserializeCorrelation;
@@ -0,0 +1,4 @@
1
+ import type { HKQuantitySampleRaw, HKQuantityTypeIdentifier, UnitForIdentifier } from '../native-types';
2
+ import type { HKQuantitySample } from '../types';
3
+ declare function deserializeSample<TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier>>(sample: HKQuantitySampleRaw<TIdentifier, TUnit>): HKQuantitySample<TIdentifier, TUnit>;
4
+ export default deserializeSample;
@@ -0,0 +1,4 @@
1
+ import type { EnergyUnit, HKWorkoutRaw, LengthUnit } from '../native-types';
2
+ import type { HKWorkout } from '../types';
3
+ declare function deserializeWorkout<TEnergy extends EnergyUnit, TDistance extends LengthUnit>(sample: HKWorkoutRaw<TEnergy, TDistance>): HKWorkout<TEnergy, TDistance>;
4
+ export default deserializeWorkout;
@@ -0,0 +1,2 @@
1
+ declare function ensureMetadata<TMetadata>(metadata?: TMetadata): TMetadata;
2
+ export default ensureMetadata;
@@ -0,0 +1,3 @@
1
+ import type { HKQuantityTypeIdentifier, UnitForIdentifier } from '../native-types';
2
+ declare const ensureUnit: <TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier>>(type: TIdentifier, providedUnit?: TUnit | undefined) => Promise<TUnit>;
3
+ export default ensureUnit;
@@ -0,0 +1,2 @@
1
+ declare const getDateOfBirth: () => Promise<Date>;
2
+ export default getDateOfBirth;
@@ -0,0 +1,3 @@
1
+ import type { HKCategoryTypeIdentifier } from '../native-types';
2
+ declare function getMostRecentCategorySample<T extends HKCategoryTypeIdentifier>(identifier: T): Promise<import("..").HKCategorySample<T> | null>;
3
+ export default getMostRecentCategorySample;
@@ -0,0 +1,3 @@
1
+ import type { HKQuantityTypeIdentifier, UnitForIdentifier } from '../native-types';
2
+ declare function getMostRecentQuantitySample<TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier>>(identifier: TIdentifier, unit: TUnit): Promise<import("..").HKQuantitySample<TIdentifier, UnitForIdentifier<TIdentifier>> | null>;
3
+ export default getMostRecentQuantitySample;
@@ -0,0 +1,5 @@
1
+ import type { EnergyUnit, LengthUnit } from '../native-types';
2
+ import type { HKWorkout, QueryWorkoutsOptions } from '../types';
3
+ export declare type GetMostRecentWorkoutFn = <TEnergy extends EnergyUnit, TDistance extends LengthUnit>(options?: Pick<QueryWorkoutsOptions<TEnergy, TDistance>, 'distanceUnit' | 'energyUnit'>) => Promise<HKWorkout<TEnergy, TDistance> | null>;
4
+ declare const getMostRecentWorkout: GetMostRecentWorkoutFn;
5
+ export default getMostRecentWorkout;