@kingstinct/react-native-healthkit 4.4.6 → 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 (231) hide show
  1. package/ios/ReactNativeHealthkit.xcodeproj/project.xcworkspace/xcuserdata/robertherber.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  2. package/lib/commonjs/hooks/useHealthkitAuthorization.js +41 -0
  3. package/lib/commonjs/hooks/useHealthkitAuthorization.js.map +1 -0
  4. package/lib/commonjs/hooks/useIsHealthDataAvailable.js +29 -0
  5. package/lib/commonjs/hooks/useIsHealthDataAvailable.js.map +1 -0
  6. package/lib/commonjs/hooks/useMostRecentCategorySample.js +27 -0
  7. package/lib/commonjs/hooks/useMostRecentCategorySample.js.map +1 -0
  8. package/lib/commonjs/hooks/useMostRecentQuantitySample.js +43 -0
  9. package/lib/commonjs/hooks/useMostRecentQuantitySample.js.map +1 -0
  10. package/lib/commonjs/hooks/useMostRecentWorkout.js +60 -0
  11. package/lib/commonjs/hooks/useMostRecentWorkout.js.map +1 -0
  12. package/lib/commonjs/hooks/useStatisticsForQuantity.js +35 -0
  13. package/lib/commonjs/hooks/useStatisticsForQuantity.js.map +1 -0
  14. package/lib/commonjs/hooks/useSubscribeToChanges.js +37 -0
  15. package/lib/commonjs/hooks/useSubscribeToChanges.js.map +1 -0
  16. package/lib/commonjs/index.ios.js +66 -394
  17. package/lib/commonjs/index.ios.js.map +1 -1
  18. package/lib/commonjs/index.js +2 -15
  19. package/lib/commonjs/index.js.map +1 -1
  20. package/lib/commonjs/native-types.js +170 -78
  21. package/lib/commonjs/native-types.js.map +1 -1
  22. package/lib/commonjs/types.js +13 -0
  23. package/lib/commonjs/types.js.map +1 -1
  24. package/lib/commonjs/utils/deserializeCategorySample.js +15 -0
  25. package/lib/commonjs/utils/deserializeCategorySample.js.map +1 -0
  26. package/lib/commonjs/utils/deserializeCorrelation.js +32 -0
  27. package/lib/commonjs/utils/deserializeCorrelation.js.map +1 -0
  28. package/lib/commonjs/utils/deserializeSample.js +17 -0
  29. package/lib/commonjs/utils/deserializeSample.js.map +1 -0
  30. package/lib/commonjs/utils/deserializeWorkout.js +17 -0
  31. package/lib/commonjs/utils/deserializeWorkout.js.map +1 -0
  32. package/lib/commonjs/utils/ensureMetadata.js +14 -0
  33. package/lib/commonjs/utils/ensureMetadata.js.map +1 -0
  34. package/lib/commonjs/utils/ensureUnit.js +23 -0
  35. package/lib/commonjs/utils/ensureUnit.js.map +1 -0
  36. package/lib/commonjs/utils/getDateOfBirth.js +19 -0
  37. package/lib/commonjs/utils/getDateOfBirth.js.map +1 -0
  38. package/lib/commonjs/utils/getMostRecentCategorySample.js +22 -0
  39. package/lib/commonjs/utils/getMostRecentCategorySample.js.map +1 -0
  40. package/lib/commonjs/utils/getMostRecentQuantitySample.js +22 -0
  41. package/lib/commonjs/utils/getMostRecentQuantitySample.js.map +1 -0
  42. package/lib/commonjs/utils/getMostRecentWorkout.js +24 -0
  43. package/lib/commonjs/utils/getMostRecentWorkout.js.map +1 -0
  44. package/lib/commonjs/utils/getPreferredUnit.js +19 -0
  45. package/lib/commonjs/utils/getPreferredUnit.js.map +1 -0
  46. package/lib/commonjs/utils/getPreferredUnits.js +19 -0
  47. package/lib/commonjs/utils/getPreferredUnits.js.map +1 -0
  48. package/lib/commonjs/utils/getPreferredUnitsTyped.js +46 -0
  49. package/lib/commonjs/utils/getPreferredUnitsTyped.js.map +1 -0
  50. package/lib/commonjs/utils/getRequestStatusForAuthorization.js +25 -0
  51. package/lib/commonjs/utils/getRequestStatusForAuthorization.js.map +1 -0
  52. package/lib/commonjs/utils/prepareOptions.js +27 -0
  53. package/lib/commonjs/utils/prepareOptions.js.map +1 -0
  54. package/lib/commonjs/utils/queryCategorySamples.js +24 -0
  55. package/lib/commonjs/utils/queryCategorySamples.js.map +1 -0
  56. package/lib/commonjs/utils/queryCorrelationSamples.js +24 -0
  57. package/lib/commonjs/utils/queryCorrelationSamples.js.map +1 -0
  58. package/lib/commonjs/utils/queryQuantitySamples.js +27 -0
  59. package/lib/commonjs/utils/queryQuantitySamples.js.map +1 -0
  60. package/lib/commonjs/utils/queryStatisticsForQuantity.js +34 -0
  61. package/lib/commonjs/utils/queryStatisticsForQuantity.js.map +1 -0
  62. package/lib/commonjs/utils/queryWorkouts.js +30 -0
  63. package/lib/commonjs/utils/queryWorkouts.js.map +1 -0
  64. package/lib/commonjs/utils/requestAuthorization.js +25 -0
  65. package/lib/commonjs/utils/requestAuthorization.js.map +1 -0
  66. package/lib/commonjs/utils/saveCategorySample.js +21 -0
  67. package/lib/commonjs/utils/saveCategorySample.js.map +1 -0
  68. package/lib/commonjs/utils/saveCorrelationSample.js +24 -0
  69. package/lib/commonjs/utils/saveCorrelationSample.js.map +1 -0
  70. package/lib/commonjs/utils/saveQuantitySample.js +21 -0
  71. package/lib/commonjs/utils/saveQuantitySample.js.map +1 -0
  72. package/lib/commonjs/utils/saveWorkoutSample.js +25 -0
  73. package/lib/commonjs/utils/saveWorkoutSample.js.map +1 -0
  74. package/lib/commonjs/utils/serializeDate.js +12 -0
  75. package/lib/commonjs/utils/serializeDate.js.map +1 -0
  76. package/lib/commonjs/utils/subscribeToChanges.js +37 -0
  77. package/lib/commonjs/utils/subscribeToChanges.js.map +1 -0
  78. package/lib/module/hooks/useHealthkitAuthorization.js +29 -0
  79. package/lib/module/hooks/useHealthkitAuthorization.js.map +1 -0
  80. package/lib/module/hooks/useIsHealthDataAvailable.js +18 -0
  81. package/lib/module/hooks/useIsHealthDataAvailable.js.map +1 -0
  82. package/lib/module/hooks/useMostRecentCategorySample.js +15 -0
  83. package/lib/module/hooks/useMostRecentCategorySample.js.map +1 -0
  84. package/lib/module/hooks/useMostRecentQuantitySample.js +30 -0
  85. package/lib/module/hooks/useMostRecentQuantitySample.js.map +1 -0
  86. package/lib/module/hooks/useMostRecentWorkout.js +47 -0
  87. package/lib/module/hooks/useMostRecentWorkout.js.map +1 -0
  88. package/lib/module/hooks/useStatisticsForQuantity.js +23 -0
  89. package/lib/module/hooks/useStatisticsForQuantity.js.map +1 -0
  90. package/lib/module/hooks/useSubscribeToChanges.js +26 -0
  91. package/lib/module/hooks/useSubscribeToChanges.js.map +1 -0
  92. package/lib/module/index.ios.js +32 -370
  93. package/lib/module/index.ios.js.map +1 -1
  94. package/lib/module/index.js +3 -5
  95. package/lib/module/index.js.map +1 -1
  96. package/lib/module/native-types.js +154 -74
  97. package/lib/module/native-types.js.map +1 -1
  98. package/lib/module/types.js +15 -0
  99. package/lib/module/types.js.map +1 -1
  100. package/lib/module/utils/deserializeCategorySample.js +7 -0
  101. package/lib/module/utils/deserializeCategorySample.js.map +1 -0
  102. package/lib/module/utils/deserializeCorrelation.js +21 -0
  103. package/lib/module/utils/deserializeCorrelation.js.map +1 -0
  104. package/lib/module/utils/deserializeSample.js +9 -0
  105. package/lib/module/utils/deserializeSample.js.map +1 -0
  106. package/lib/module/utils/deserializeWorkout.js +9 -0
  107. package/lib/module/utils/deserializeWorkout.js.map +1 -0
  108. package/lib/module/utils/ensureMetadata.js +6 -0
  109. package/lib/module/utils/ensureMetadata.js.map +1 -0
  110. package/lib/module/utils/ensureUnit.js +13 -0
  111. package/lib/module/utils/ensureUnit.js.map +1 -0
  112. package/lib/module/utils/getDateOfBirth.js +9 -0
  113. package/lib/module/utils/getDateOfBirth.js.map +1 -0
  114. package/lib/module/utils/getMostRecentCategorySample.js +12 -0
  115. package/lib/module/utils/getMostRecentCategorySample.js.map +1 -0
  116. package/lib/module/utils/getMostRecentQuantitySample.js +12 -0
  117. package/lib/module/utils/getMostRecentQuantitySample.js.map +1 -0
  118. package/lib/module/utils/getMostRecentWorkout.js +14 -0
  119. package/lib/module/utils/getMostRecentWorkout.js.map +1 -0
  120. package/lib/module/utils/getPreferredUnit.js +9 -0
  121. package/lib/module/utils/getPreferredUnit.js.map +1 -0
  122. package/lib/module/utils/getPreferredUnits.js +9 -0
  123. package/lib/module/utils/getPreferredUnits.js.map +1 -0
  124. package/lib/module/utils/getPreferredUnitsTyped.js +34 -0
  125. package/lib/module/utils/getPreferredUnitsTyped.js.map +1 -0
  126. package/lib/module/utils/getRequestStatusForAuthorization.js +15 -0
  127. package/lib/module/utils/getRequestStatusForAuthorization.js.map +1 -0
  128. package/lib/module/utils/prepareOptions.js +17 -0
  129. package/lib/module/utils/prepareOptions.js.map +1 -0
  130. package/lib/module/utils/queryCategorySamples.js +12 -0
  131. package/lib/module/utils/queryCategorySamples.js.map +1 -0
  132. package/lib/module/utils/queryCorrelationSamples.js +12 -0
  133. package/lib/module/utils/queryCorrelationSamples.js.map +1 -0
  134. package/lib/module/utils/queryQuantitySamples.js +14 -0
  135. package/lib/module/utils/queryQuantitySamples.js.map +1 -0
  136. package/lib/module/utils/queryStatisticsForQuantity.js +23 -0
  137. package/lib/module/utils/queryStatisticsForQuantity.js.map +1 -0
  138. package/lib/module/utils/queryWorkouts.js +17 -0
  139. package/lib/module/utils/queryWorkouts.js.map +1 -0
  140. package/lib/module/utils/requestAuthorization.js +15 -0
  141. package/lib/module/utils/requestAuthorization.js.map +1 -0
  142. package/lib/module/utils/saveCategorySample.js +11 -0
  143. package/lib/module/utils/saveCategorySample.js.map +1 -0
  144. package/lib/module/utils/saveCorrelationSample.js +13 -0
  145. package/lib/module/utils/saveCorrelationSample.js.map +1 -0
  146. package/lib/module/utils/saveQuantitySample.js +11 -0
  147. package/lib/module/utils/saveQuantitySample.js.map +1 -0
  148. package/lib/module/utils/saveWorkoutSample.js +14 -0
  149. package/lib/module/utils/saveWorkoutSample.js.map +1 -0
  150. package/lib/module/utils/serializeDate.js +4 -0
  151. package/lib/module/utils/serializeDate.js.map +1 -0
  152. package/lib/module/utils/subscribeToChanges.js +25 -0
  153. package/lib/module/utils/subscribeToChanges.js.map +1 -0
  154. package/lib/typescript/example-expo/App.d.ts +2 -0
  155. package/lib/typescript/src/hooks/useHealthkitAuthorization.d.ts +3 -0
  156. package/lib/typescript/src/hooks/useIsHealthDataAvailable.d.ts +2 -0
  157. package/lib/typescript/src/hooks/useMostRecentCategorySample.d.ts +4 -0
  158. package/lib/typescript/src/hooks/useMostRecentQuantitySample.d.ts +4 -0
  159. package/lib/typescript/src/hooks/useMostRecentWorkout.d.ts +7 -0
  160. package/lib/typescript/src/hooks/useStatisticsForQuantity.d.ts +4 -0
  161. package/lib/typescript/src/hooks/useSubscribeToChanges.d.ts +3 -0
  162. package/lib/typescript/src/index.d.ts +2 -3
  163. package/lib/typescript/src/index.ios.d.ts +48 -3
  164. package/lib/typescript/src/native-types.d.ts +169 -65
  165. package/lib/typescript/src/types.d.ts +14 -90
  166. package/lib/typescript/src/utils/deserializeCategorySample.d.ts +4 -0
  167. package/lib/typescript/src/utils/deserializeCorrelation.d.ts +4 -0
  168. package/lib/typescript/src/utils/deserializeSample.d.ts +4 -0
  169. package/lib/typescript/src/utils/deserializeWorkout.d.ts +4 -0
  170. package/lib/typescript/src/utils/ensureMetadata.d.ts +2 -0
  171. package/lib/typescript/src/utils/ensureUnit.d.ts +3 -0
  172. package/lib/typescript/src/utils/getDateOfBirth.d.ts +2 -0
  173. package/lib/typescript/src/utils/getMostRecentCategorySample.d.ts +3 -0
  174. package/lib/typescript/src/utils/getMostRecentQuantitySample.d.ts +3 -0
  175. package/lib/typescript/src/utils/getMostRecentWorkout.d.ts +5 -0
  176. package/lib/typescript/src/utils/getPreferredUnit.d.ts +4 -0
  177. package/lib/typescript/src/utils/getPreferredUnits.d.ts +4 -0
  178. package/lib/typescript/src/utils/getPreferredUnitsTyped.d.ts +9 -0
  179. package/lib/typescript/src/utils/getRequestStatusForAuthorization.d.ts +3 -0
  180. package/lib/typescript/src/utils/prepareOptions.d.ts +8 -0
  181. package/lib/typescript/src/utils/queryCategorySamples.d.ts +5 -0
  182. package/lib/typescript/src/utils/queryCorrelationSamples.d.ts +5 -0
  183. package/lib/typescript/src/utils/queryQuantitySamples.d.ts +7 -0
  184. package/lib/typescript/src/utils/queryStatisticsForQuantity.d.ts +14 -0
  185. package/lib/typescript/src/utils/queryWorkouts.d.ts +4 -0
  186. package/lib/typescript/src/utils/requestAuthorization.d.ts +3 -0
  187. package/lib/typescript/src/utils/saveCategorySample.d.ts +7 -0
  188. package/lib/typescript/src/utils/saveCorrelationSample.d.ts +8 -0
  189. package/lib/typescript/src/utils/saveQuantitySample.d.ts +7 -0
  190. package/lib/typescript/src/utils/saveWorkoutSample.d.ts +7 -0
  191. package/lib/typescript/src/utils/serializeDate.d.ts +2 -0
  192. package/lib/typescript/src/utils/subscribeToChanges.d.ts +3 -0
  193. package/package.json +17 -6
  194. package/src/hooks/useHealthkitAuthorization.ts +39 -0
  195. package/src/hooks/useIsHealthDataAvailable.ts +17 -0
  196. package/src/hooks/useMostRecentCategorySample.ts +24 -0
  197. package/src/hooks/useMostRecentQuantitySample.ts +39 -0
  198. package/src/hooks/useMostRecentWorkout.ts +60 -0
  199. package/src/hooks/useStatisticsForQuantity.ts +42 -0
  200. package/src/hooks/useSubscribeToChanges.ts +31 -0
  201. package/src/index.ios.tsx +36 -569
  202. package/src/index.tsx +5 -7
  203. package/src/native-types.ts +213 -74
  204. package/src/types.ts +41 -152
  205. package/src/utils/deserializeCategorySample.ts +12 -0
  206. package/src/utils/deserializeCorrelation.ts +28 -0
  207. package/src/utils/deserializeSample.ts +17 -0
  208. package/src/utils/deserializeWorkout.ts +14 -0
  209. package/src/utils/ensureMetadata.ts +5 -0
  210. package/src/utils/ensureUnit.ts +19 -0
  211. package/src/utils/getDateOfBirth.ts +8 -0
  212. package/src/utils/getMostRecentCategorySample.ts +18 -0
  213. package/src/utils/getMostRecentQuantitySample.ts +19 -0
  214. package/src/utils/getMostRecentWorkout.ts +27 -0
  215. package/src/utils/getPreferredUnit.ts +14 -0
  216. package/src/utils/getPreferredUnits.ts +14 -0
  217. package/src/utils/getPreferredUnitsTyped.ts +38 -0
  218. package/src/utils/getRequestStatusForAuthorization.ts +21 -0
  219. package/src/utils/prepareOptions.ts +15 -0
  220. package/src/utils/queryCategorySamples.ts +29 -0
  221. package/src/utils/queryCorrelationSamples.ts +29 -0
  222. package/src/utils/queryQuantitySamples.ts +36 -0
  223. package/src/utils/queryStatisticsForQuantity.ts +38 -0
  224. package/src/utils/queryWorkouts.ts +28 -0
  225. package/src/utils/requestAuthorization.ts +18 -0
  226. package/src/utils/saveCategorySample.ts +27 -0
  227. package/src/utils/saveCorrelationSample.ts +34 -0
  228. package/src/utils/saveQuantitySample.ts +29 -0
  229. package/src/utils/saveWorkoutSample.ts +28 -0
  230. package/src/utils/serializeDate.ts +3 -0
  231. package/src/utils/subscribeToChanges.ts +32 -0
@@ -488,80 +488,160 @@ export let HKWheelchairUse; // Unit types are a straight mapping from here https
488
488
  HKWheelchairUse[HKWheelchairUse["yes"] = 2] = "yes";
489
489
  })(HKWheelchairUse || (HKWheelchairUse = {}));
490
490
 
491
- export let HKUnitSIPrefix;
492
-
493
- (function (HKUnitSIPrefix) {
494
- HKUnitSIPrefix["Pico"] = "p";
495
- HKUnitSIPrefix["Nano"] = "n";
496
- HKUnitSIPrefix["Micro"] = "mc";
497
- HKUnitSIPrefix["Milli"] = "m";
498
- HKUnitSIPrefix["Centi"] = "c";
499
- HKUnitSIPrefix["Deci"] = "d";
500
- HKUnitSIPrefix["Deca"] = "da";
501
- HKUnitSIPrefix["Hecto"] = "h";
502
- HKUnitSIPrefix["Kilo"] = "k";
503
- HKUnitSIPrefix["Mega"] = "M";
504
- HKUnitSIPrefix["Giga"] = "G";
505
- HKUnitSIPrefix["Tera"] = "T";
506
- })(HKUnitSIPrefix || (HKUnitSIPrefix = {}));
507
-
508
- export let HKUnitSI;
509
-
510
- (function (HKUnitSI) {
511
- HKUnitSI["Grams"] = "g";
512
- HKUnitSI["Joules"] = "J";
513
- HKUnitSI["Kelvin"] = "K";
514
- HKUnitSI["Liters"] = "l";
515
- HKUnitSI["Meters"] = "m";
516
- HKUnitSI["Pascals"] = "Pa";
517
- HKUnitSI["Seconds"] = "s";
518
- HKUnitSI["Siemens"] = "S";
519
- })(HKUnitSI || (HKUnitSI = {}));
520
-
521
- export let HKUnit;
522
-
523
- (function (HKUnit) {
524
- HKUnit["Grams"] = "g";
525
- HKUnit["Joules"] = "J";
526
- HKUnit["Kelvin"] = "K";
527
- HKUnit["Liters"] = "l";
528
- HKUnit["Meters"] = "m";
529
- HKUnit["Pascals"] = "Pa";
530
- HKUnit["Seconds"] = "s";
531
- HKUnit["Siemens"] = "S";
532
- HKUnit["Atmospheres"] = "atm";
533
- HKUnit["CentimetersOfWater"] = "cmAq";
534
- HKUnit["Count"] = "count";
535
- HKUnit["Days"] = "d";
536
- HKUnit["DecibelHearingLevel"] = "dBHL";
537
- HKUnit["DecibelSoundPressureLevel"] = "dBASPL";
538
- HKUnit["DegreesCelsius"] = "degC";
539
- HKUnit["DegreesFahrenheit"] = "degF";
540
- HKUnit["Feet"] = "ft";
541
- HKUnit["Hertz"] = "Hz";
542
- HKUnit["Hours"] = "hr";
543
- HKUnit["ImperialCup"] = "cup_imp";
544
- HKUnit["ImperialFluidOunces"] = "fl_oz_imp";
545
- HKUnit["ImperialPint"] = "pt_imp";
546
- HKUnit["Inches"] = "in";
547
- HKUnit["InternationalUnit"] = "IU";
548
- HKUnit["Kilocalories"] = "kcal";
549
- HKUnit["LargeCalories"] = "Cal";
550
- HKUnit["Miles"] = "mi";
551
- HKUnit["MillimetersOfMercury"] = "mmHg";
552
- HKUnit["Minutes"] = "min";
553
- HKUnit["Ounces"] = "oz";
554
- HKUnit["Percent"] = "%";
555
- HKUnit["Pounds"] = "lb";
556
- HKUnit["SmallCalories"] = "cal";
557
- HKUnit["Stones"] = "st";
558
- HKUnit["USCup"] = "cup_us";
559
- HKUnit["USFluidOunces"] = "fl_oz_us";
560
- HKUnit["USPint"] = "pt_us";
561
- HKUnit["Yard"] = "yd";
562
- HKUnit["GlucoseMmolPerL"] = "mmol<180.15588000005408>/l";
563
- HKUnit["GlucoseMgPerDl"] = "mg/dL";
564
- })(HKUnit || (HKUnit = {}));
491
+ export let HKMetricPrefix;
492
+
493
+ (function (HKMetricPrefix) {
494
+ HKMetricPrefix["None"] = "";
495
+ HKMetricPrefix["Pico"] = "p";
496
+ HKMetricPrefix["Nano"] = "n";
497
+ HKMetricPrefix["Micro"] = "mc";
498
+ HKMetricPrefix["Milli"] = "m";
499
+ HKMetricPrefix["Centi"] = "c";
500
+ HKMetricPrefix["Deci"] = "d";
501
+ HKMetricPrefix["Deca"] = "da";
502
+ HKMetricPrefix["Hecto"] = "h";
503
+ HKMetricPrefix["Kilo"] = "k";
504
+ HKMetricPrefix["Mega"] = "M";
505
+ HKMetricPrefix["Giga"] = "G";
506
+ HKMetricPrefix["Tera"] = "T";
507
+ HKMetricPrefix["Femto"] = "f";
508
+ })(HKMetricPrefix || (HKMetricPrefix = {}));
509
+
510
+ export let HKUnitMetric;
511
+
512
+ (function (HKUnitMetric) {
513
+ HKUnitMetric["Gram"] = "g";
514
+ HKUnitMetric["Joule"] = "J";
515
+ HKUnitMetric["Kelvin"] = "K";
516
+ HKUnitMetric["Liter"] = "l";
517
+ HKUnitMetric["Meter"] = "m";
518
+ HKUnitMetric["Pascal"] = "Pa";
519
+ HKUnitMetric["Second"] = "s";
520
+ HKUnitMetric["Siemen"] = "S";
521
+ HKUnitMetric["Hertz"] = "Hz";
522
+ HKUnitMetric["Volt"] = "V";
523
+ })(HKUnitMetric || (HKUnitMetric = {}));
524
+
525
+ export let HKUnits;
526
+
527
+ (function (HKUnits) {
528
+ HKUnits["DecibelHearingLevel"] = "dBHL";
529
+ HKUnits["DecibelSoundPressureLevel"] = "dBASPL";
530
+ HKUnits["Percent"] = "%";
531
+ HKUnits["Count"] = "count";
532
+ HKUnits["InternationalUnit"] = "IU";
533
+ })(HKUnits || (HKUnits = {}));
534
+
535
+ /**
536
+ * More SI prefixes also available as literals, just type the string
537
+ * @example 'cm', 'km'
538
+ */
539
+ export let UnitOfLength;
540
+
541
+ (function (UnitOfLength) {
542
+ UnitOfLength["Feet"] = "ft";
543
+ UnitOfLength["Meter"] = "m";
544
+ UnitOfLength["Inches"] = "in";
545
+ UnitOfLength["Yards"] = "yd";
546
+ UnitOfLength["Miles"] = "mi";
547
+ })(UnitOfLength || (UnitOfLength = {}));
548
+
549
+ /**
550
+ * More SI prefixes also available as literals, just type the string
551
+ * @example 'ml', 'cl'
552
+ */
553
+ export let UnitOfVolume;
554
+
555
+ (function (UnitOfVolume) {
556
+ UnitOfVolume["ImperialCup"] = "cup_imp";
557
+ UnitOfVolume["ImperialFluidOunces"] = "fl_oz_imp";
558
+ UnitOfVolume["ImperialPint"] = "pt_imp";
559
+ UnitOfVolume["USCup"] = "cup_us";
560
+ UnitOfVolume["USFluidOunces"] = "fl_oz_us";
561
+ UnitOfVolume["USPint"] = "pt_us";
562
+ UnitOfVolume["Liter"] = "l";
563
+ })(UnitOfVolume || (UnitOfVolume = {}));
564
+
565
+ /**
566
+ * More SI prefixes also available as literals, just type the string
567
+ * @example 'mg', 'kg'
568
+ */
569
+ export let UnitOfMass;
570
+ /**
571
+ * More SI prefixes also available as literals, just type the string
572
+ * @example 'mg', 'kg'
573
+ */
574
+
575
+ (function (UnitOfMass) {
576
+ UnitOfMass["Ounces"] = "oz";
577
+ UnitOfMass["Stones"] = "st";
578
+ UnitOfMass["Pounds"] = "lb";
579
+ UnitOfMass["Gram"] = "g";
580
+ })(UnitOfMass || (UnitOfMass = {}));
581
+
582
+ /**
583
+ * More SI prefixes also available as literals, just type the string
584
+ * @example 'kPa', 'hPa'
585
+ */
586
+ export let UnitOfPressure;
587
+ /**
588
+ * More SI prefixes also available as literals, just type the string
589
+ * @example 'kPa', 'hPa'
590
+ */
591
+
592
+ (function (UnitOfPressure) {
593
+ UnitOfPressure["Atmospheres"] = "atm";
594
+ UnitOfPressure["CentimetersOfWater"] = "cmAq";
595
+ UnitOfPressure["MillimetersOfMercury"] = "mmHg";
596
+ UnitOfPressure["InchesOfMercury"] = "inHg";
597
+ UnitOfPressure["DecibelAWeightedSoundPressureLevel"] = "dBASPL";
598
+ UnitOfPressure["Pascals"] = "Pa";
599
+ })(UnitOfPressure || (UnitOfPressure = {}));
600
+
601
+ /**
602
+ * More SI prefixes also available as literals, just type the string
603
+ * @example 'ms'
604
+ */
605
+ export let UnitOfTime;
606
+ /**
607
+ * More SI prefixes also available as literals, just type the string
608
+ * @example 'ms'
609
+ */
610
+
611
+ (function (UnitOfTime) {
612
+ UnitOfTime["Days"] = "d";
613
+ UnitOfTime["Minutes"] = "min";
614
+ UnitOfTime["Hours"] = "hr";
615
+ UnitOfTime["Seconds"] = "s";
616
+ })(UnitOfTime || (UnitOfTime = {}));
617
+
618
+ export let TemperatureUnit;
619
+ /**
620
+ * More SI prefixes also available as literals, just type the string
621
+ * @example 'kJ'
622
+ */
623
+
624
+ (function (TemperatureUnit) {
625
+ TemperatureUnit["DegreesCelsius"] = "degC";
626
+ TemperatureUnit["DegreesFahrenheit"] = "degF";
627
+ TemperatureUnit["Kelvin"] = "K";
628
+ })(TemperatureUnit || (TemperatureUnit = {}));
629
+
630
+ export let UnitOfEnergy;
631
+
632
+ (function (UnitOfEnergy) {
633
+ UnitOfEnergy["Kilocalories"] = "kcal";
634
+ UnitOfEnergy["LargeCalories"] = "Cal";
635
+ UnitOfEnergy["SmallCalories"] = "cal";
636
+ UnitOfEnergy["Joules"] = "J";
637
+ })(UnitOfEnergy || (UnitOfEnergy = {}));
638
+
639
+ export let BloodGlucoseUnit;
640
+
641
+ (function (BloodGlucoseUnit) {
642
+ BloodGlucoseUnit["GlucoseMmolPerL"] = "mmol<180.15588000005408>/l";
643
+ BloodGlucoseUnit["GlucoseMgPerDl"] = "mg/dL";
644
+ })(BloodGlucoseUnit || (BloodGlucoseUnit = {}));
565
645
 
566
646
  // Straight mapping to https://developer.apple.com/documentation/healthkit/hkcharacteristictypeidentifier
567
647
  export let HKCharacteristicTypeIdentifier;
@@ -1 +1 @@
1
- {"version":3,"names":["NativeEventEmitter","NativeModules","HKWorkoutTypeIdentifier","HKAudiogramTypeIdentifier","HKWorkoutRouteTypeIdentifier","HKDataTypeIdentifierHeartbeatSeries","HKQuantityTypeIdentifier","HKCategoryValueLowCardioFitnessEvent","HKHeartRateMotionContext","HKCorrelationTypeIdentifier","HKCategoryTypeIdentifier","HKCategoryValueAppleStandHour","HKWorkoutActivityType","HKWeatherCondition","HKIndoorWorkout","HKAuthorizationRequestStatus","HKAuthorizationStatus","HKBloodType","HKBiologicalSex","HKFitzpatrickSkinType","HKStatisticsOptions","HKCategoryValueCervicalMucusQuality","HKCategoryValueMenstrualFlow","HKCategoryValueOvulationTestResult","HKCategoryValueSleepAnalysis","HKCategoryValueAppetiteChanges","HKCategoryValuePresence","HKCategoryValueSeverity","HKCategoryValueNotApplicable","HKInsulinDeliveryReason","HKCategoryValuePregnancyTestResult","HKWheelchairUse","HKUnitSIPrefix","HKUnitSI","HKUnit","HKCharacteristicTypeIdentifier","HKUpdateFrequency","Native","ReactNativeHealthkit","EventEmitter"],"sources":["native-types.ts"],"sourcesContent":["import {\n NativeEventEmitter,\n NativeModules,\n} from 'react-native'\n\nimport type { EmitterSubscription } from 'react-native'\n\nexport const HKWorkoutTypeIdentifier = 'HKWorkoutTypeIdentifier' as const\nexport const HKAudiogramTypeIdentifier = 'HKAudiogramTypeIdentifier' as const\nexport const HKWorkoutRouteTypeIdentifier = 'HKWorkoutRouteTypeIdentifier' as const\nexport const HKDataTypeIdentifierHeartbeatSeries = 'HKDataTypeIdentifierHeartbeatSeries' as const\n\n// Straight mapping to https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifier\nexport enum HKQuantityTypeIdentifier {\n bodyMassIndex = 'HKQuantityTypeIdentifierBodyMassIndex',\n bodyFatPercentage = 'HKQuantityTypeIdentifierBodyFatPercentage', // Scalar(Percent, 0.0 - 1.0), Discrete\n height = 'HKQuantityTypeIdentifierHeight', // Length, Discrete\n bodyMass = 'HKQuantityTypeIdentifierBodyMass', // Mass, Discrete\n leanBodyMass = 'HKQuantityTypeIdentifierLeanBodyMass', // Mass, Discrete\n\n waistCircumference = 'HKQuantityTypeIdentifierWaistCircumference', // Length, Discrete\n // Fitness\n stepCount = 'HKQuantityTypeIdentifierStepCount', // Scalar(Count), Cumulative\n distanceWalkingRunning = 'HKQuantityTypeIdentifierDistanceWalkingRunning', // Length, Cumulative\n distanceCycling = 'HKQuantityTypeIdentifierDistanceCycling', // Length, Cumulative\n distanceWheelchair = 'HKQuantityTypeIdentifierDistanceWheelchair', // Length, Cumulative\n basalEnergyBurned = 'HKQuantityTypeIdentifierBasalEnergyBurned', // Energy, Cumulative\n activeEnergyBurned = 'HKQuantityTypeIdentifierActiveEnergyBurned', // Energy, Cumulative\n flightsClimbed = 'HKQuantityTypeIdentifierFlightsClimbed', // Scalar(Count), Cumulative\n nikeFuel = 'HKQuantityTypeIdentifierNikeFuel', // Scalar(Count), Cumulative\n appleExerciseTime = 'HKQuantityTypeIdentifierAppleExerciseTime', // Time Cumulative\n pushCount = 'HKQuantityTypeIdentifierPushCount', // Scalar(Count), Cumulative\n distanceSwimming = 'HKQuantityTypeIdentifierDistanceSwimming', // Length, Cumulative\n swimmingStrokeCount = 'HKQuantityTypeIdentifierSwimmingStrokeCount', // Scalar(Count), Cumulative\n vo2Max = 'HKQuantityTypeIdentifierVo2Max', // ml/(kg*min) Discrete\n distanceDownhillSnowSports = 'HKQuantityTypeIdentifierDistanceDownhillSnowSports', // Length, Cumulative\n\n appleStandTime = 'HKQuantityTypeIdentifierAppleStandTime', // Time, Cumulative\n // Vitals\n heartRate = 'HKQuantityTypeIdentifierHeartRate', // Scalar(Count)/Time, Discrete\n bodyTemperature = 'HKQuantityTypeIdentifierBodyTemperature', // Temperature, Discrete\n basalBodyTemperature = 'HKQuantityTypeIdentifierBasalBodyTemperature', // Basal Body Temperature, Discrete\n bloodPressureSystolic = 'HKQuantityTypeIdentifierBloodPressureSystolic', // Pressure, Discrete\n bloodPressureDiastolic = 'HKQuantityTypeIdentifierBloodPressureDiastolic', // Pressure, Discrete\n respiratoryRate = 'HKQuantityTypeIdentifierRespiratoryRate', // Scalar(Count)/Time, Discrete\n // Beats per minute estimate of a user's lowest heart rate while at rest\n restingHeartRate = 'HKQuantityTypeIdentifierRestingHeartRate', // Scalar(Count)/Time, Discrete\n // Average heartbeats per minute captured by an Apple Watch while a user is walking\n walkingHeartRateAverage = 'HKQuantityTypeIdentifierWalkingHeartRateAverage', // Scalar(Count)/Time, Discrete\n // The standard deviation of heart beat-to-beat intevals (Standard Deviation of Normal to Normal)\n\n heartRateVariabilitySDNN = 'HKQuantityTypeIdentifierHeartRateVariabilitySDNN', // Time (ms), Discrete\n // Results\n oxygenSaturation = 'HKQuantityTypeIdentifierOxygenSaturation', // Scalar (Percent, 0.0 - 1.0, Discrete\n peripheralPerfusionIndex = 'HKQuantityTypeIdentifierPeripheralPerfusionIndex', // Scalar(Percent, 0.0 - 1.0), Discrete\n bloodGlucose = 'HKQuantityTypeIdentifierBloodGlucose', // Mass/Volume, Discrete\n numberOfTimesFallen = 'HKQuantityTypeIdentifierNumberOfTimesFallen', // Scalar(Count), Cumulative\n electrodermalActivity = 'HKQuantityTypeIdentifierElectrodermalActivity', // Conductance, Discrete\n inhalerUsage = 'HKQuantityTypeIdentifierInhalerUsage', // Scalar(Count), Cumulative\n insulinDelivery = 'HKQuantityTypeIdentifierInsulinDelivery', // Pharmacology (IU) Cumulative\n bloodAlcoholContent = 'HKQuantityTypeIdentifierBloodAlcoholContent', // Scalar(Percent, 0.0 - 1.0), Discrete\n forcedVitalCapacity = 'HKQuantityTypeIdentifierForcedVitalCapacity', // Volume, Discrete\n forcedExpiratoryVolume1 = 'HKQuantityTypeIdentifierForcedExpiratoryVolume1', // Volume, Discrete\n peakExpiratoryFlowRate = 'HKQuantityTypeIdentifierPeakExpiratoryFlowRate', // Volume/Time, Discrete\n environmentalAudioExposure = 'HKQuantityTypeIdentifierEnvironmentalAudioExposure', // Pressure, Cumulative\n\n headphoneAudioExposure = 'HKQuantityTypeIdentifierHeadphoneAudioExposure', // Pressure, Cumulative\n // Nutrition\n dietaryFatTotal = 'HKQuantityTypeIdentifierDietaryFatTotal', // Mass, Cumulative\n dietaryFatPolyunsaturated = 'HKQuantityTypeIdentifierDietaryFatPolyunsaturated', // Mass, Cumulative\n dietaryFatMonounsaturated = 'HKQuantityTypeIdentifierDietaryFatMonounsaturated', // Mass, Cumulative\n dietaryFatSaturated = 'HKQuantityTypeIdentifierDietaryFatSaturated', // Mass, Cumulative\n dietaryCholesterol = 'HKQuantityTypeIdentifierDietaryCholesterol', // Mass, Cumulative\n dietarySodium = 'HKQuantityTypeIdentifierDietarySodium', // Mass, Cumulative\n dietaryCarbohydrates = 'HKQuantityTypeIdentifierDietaryCarbohydrates', // Mass, Cumulative\n dietaryFiber = 'HKQuantityTypeIdentifierDietaryFiber', // Mass, Cumulative\n dietarySugar = 'HKQuantityTypeIdentifierDietarySugar', // Mass, Cumulative\n dietaryEnergyConsumed = 'HKQuantityTypeIdentifierDietaryEnergyConsumed', // Energy, Cumulative\n dietaryProtein = 'HKQuantityTypeIdentifierDietaryProtein', // Mass, Cumulative\n\n dietaryVitaminA = 'HKQuantityTypeIdentifierDietaryVitaminA', // Mass, Cumulative\n dietaryVitaminB6 = 'HKQuantityTypeIdentifierDietaryVitaminB6', // Mass, Cumulative\n dietaryVitaminB12 = 'HKQuantityTypeIdentifierDietaryVitaminB12', // Mass, Cumulative\n dietaryVitaminC = 'HKQuantityTypeIdentifierDietaryVitaminC', // Mass, Cumulative\n dietaryVitaminD = 'HKQuantityTypeIdentifierDietaryVitaminD', // Mass, Cumulative\n dietaryVitaminE = 'HKQuantityTypeIdentifierDietaryVitaminE', // Mass, Cumulative\n dietaryVitaminK = 'HKQuantityTypeIdentifierDietaryVitaminK', // Mass, Cumulative\n dietaryCalcium = 'HKQuantityTypeIdentifierDietaryCalcium', // Mass, Cumulative\n dietaryIron = 'HKQuantityTypeIdentifierDietaryIron', // Mass, Cumulative\n dietaryThiamin = 'HKQuantityTypeIdentifierDietaryThiamin', // Mass, Cumulative\n dietaryRiboflavin = 'HKQuantityTypeIdentifierDietaryRiboflavin', // Mass, Cumulative\n dietaryNiacin = 'HKQuantityTypeIdentifierDietaryNiacin', // Mass, Cumulative\n dietaryFolate = 'HKQuantityTypeIdentifierDietaryFolate', // Mass, Cumulative\n dietaryBiotin = 'HKQuantityTypeIdentifierDietaryBiotin', // Mass, Cumulative\n dietaryPantothenicAcid = 'HKQuantityTypeIdentifierDietaryPantothenicAcid', // Mass, Cumulative\n dietaryPhosphorus = 'HKQuantityTypeIdentifierDietaryPhosphorus', // Mass, Cumulative\n dietaryIodine = 'HKQuantityTypeIdentifierDietaryIodine', // Mass, Cumulative\n dietaryMagnesium = 'HKQuantityTypeIdentifierDietaryMagnesium', // Mass, Cumulative\n dietaryZinc = 'HKQuantityTypeIdentifierDietaryZinc', // Mass, Cumulative\n dietarySelenium = 'HKQuantityTypeIdentifierDietarySelenium', // Mass, Cumulative\n dietaryCopper = 'HKQuantityTypeIdentifierDietaryCopper', // Mass, Cumulative\n dietaryManganese = 'HKQuantityTypeIdentifierDietaryManganese', // Mass, Cumulative\n dietaryChromium = 'HKQuantityTypeIdentifierDietaryChromium', // Mass, Cumulative\n dietaryMolybdenum = 'HKQuantityTypeIdentifierDietaryMolybdenum', // Mass, Cumulative\n dietaryChloride = 'HKQuantityTypeIdentifierDietaryChloride', // Mass, Cumulative\n dietaryPotassium = 'HKQuantityTypeIdentifierDietaryPotassium', // Mass, Cumulative\n dietaryCaffeine = 'HKQuantityTypeIdentifierDietaryCaffeine', // Mass, Cumulative\n dietaryWater = 'HKQuantityTypeIdentifierDietaryWater', // Volume, Cumulative\n\n // Mobility\n sixMinuteWalkTestDistance = 'HKQuantityTypeIdentifierSixMinuteWalkTestDistance',\n walkingSpeed = 'HKQuantityTypeIdentifierWalkingSpeed',\n walkingStepLength = 'HKQuantityTypeIdentifierWalkingStepLength',\n walkingAsymmetryPercentage = 'HKQuantityTypeIdentifierWalkingAsymmetryPercentage',\n walkingDoubleSupportPercentage = 'HKQuantityTypeIdentifierWalkingDoubleSupportPercentage',\n stairAscentSpeed = 'HKQuantityTypeIdentifierStairAscentSpeed',\n stairDescentSpeed = 'HKQuantityTypeIdentifierStairDescentSpeed',\n\n uvExposure = 'HKQuantityTypeIdentifierUvExposure', // Scalar (Count), Discrete\n\n appleMoveTime = 'HKQuantityTypeIdentifierAppleMoveTime', // Time, Cumulative\n appleWalkingSteadiness = 'HKQuantityTypeIdentifierAppleWalkingSteadiness', // Scalar(Percent, 0.0 - 1.0), Discrete\n\n numberOfAlcoholicBeverages = 'HKQuantityTypeIdentifierNumberOfAlcoholicBeverages', // Scalar(Count), Cumulative\n}\n\nexport type TypeToUnitMapping = { readonly\n [key in HKQuantityTypeIdentifier]: HKUnit;\n};\n\nexport enum HKCategoryValueLowCardioFitnessEvent {\n lowFitness = 1,\n}\n\nexport enum HKHeartRateMotionContext {\n active = 2,\n notSet = 0,\n sedentary = 1,\n}\n\nexport enum HKCorrelationTypeIdentifier {\n bloodPressure = 'HKCorrelationTypeIdentifierBloodPressure',\n food = 'HKCorrelationTypeIdentifierFood',\n}\n\nexport enum HKCategoryTypeIdentifier {\n sleepAnalysis = 'HKCategoryTypeIdentifierSleepAnalysis',\n appleStandHour = 'HKCategoryTypeIdentifierAppleStandHour',\n cervicalMucusQuality = 'HKCategoryTypeIdentifierCervicalMucusQuality',\n ovulationTestResult = 'HKCategoryTypeIdentifierOvulationTestResult',\n menstrualFlow = 'HKCategoryTypeIdentifierMenstrualFlow',\n intermenstrualBleeding = 'HKCategoryTypeIdentifierIntermenstrualBleeding',\n sexualActivity = 'HKCategoryTypeIdentifierSexualActivity',\n mindfulSession = 'HKCategoryTypeIdentifierMindfulSession',\n highHeartRateEvent = 'HKCategoryTypeIdentifierHighHeartRateEvent',\n lowHeartRateEvent = 'HKCategoryTypeIdentifierLowHeartRateEvent',\n irregularHeartRhythmEvent = 'HKCategoryTypeIdentifierIrregularHeartRhythmEvent',\n audioExposureEvent = 'HKCategoryTypeIdentifierAudioExposureEvent',\n toothbrushingEvent = 'HKCategoryTypeIdentifierToothbrushingEvent',\n lowCardioFitnessEvent = 'HKCategoryTypeIdentifierLowCardioFitnessEvent',\n contraceptive = 'HKCategoryTypeIdentifierContraceptive',\n lactation = 'HKCategoryTypeIdentifierLactation',\n pregnancy = 'HKCategoryTypeIdentifierPregnancy',\n pregnancyTestResult = 'HKCategoryTypeIdentifierPregnancyTestResult',\n progesteroneTestResult = 'HKCategoryTypeIdentifierProgesteroneTestResult',\n environmentalAudioExposureEvent = 'HKCategoryTypeIdentifierEnvironmentalAudioExposureEvent',\n headphoneAudioExposureEvent = 'HKCategoryTypeIdentifierHeadphoneAudioExposureEvent',\n appleWalkingSteadinessEvent = 'HKCategoryTypeIdentifierAppleWalkingSteadinessEvent',\n handwashingEvent = 'HKCategoryTypeIdentifierHandwashingEvent', // HKCategoryValue\n\n // Symptoms\n abdominalCramps = 'HKCategoryTypeIdentifierAbdominalCramps', // HKCategoryValueSeverity\n acne = 'HKCategoryTypeIdentifierAcne', // HKCategoryValueSeverity\n appetiteChanges = 'HKCategoryTypeIdentifierAppetiteChanges', // HKCategoryValueAppetiteChanges\n bladderIncontinence = 'HKCategoryTypeIdentifierBladderIncontinence', // HKCategoryValueSeverity\n bloating = 'HKCategoryTypeIdentifierBloating', // HKCategoryValueSeverity\n breastPain = 'HKCategoryTypeIdentifierBreastPain', // HKCategoryValueSeverity\n chestTightnessOrPain = 'HKCategoryTypeIdentifierChestTightnessOrPain', // HKCategoryValueSeverity\n chills = 'HKCategoryTypeIdentifierChills', // HKCategoryValueSeverity\n constipation = 'HKCategoryTypeIdentifierConstipation', // HKCategoryValueSeverity\n coughing = 'HKCategoryTypeIdentifierCoughing', // HKCategoryValueSeverity\n diarrhea = 'HKCategoryTypeIdentifierDiarrhea', // HKCategoryValueSeverity\n dizziness = 'HKCategoryTypeIdentifierDizziness', // HKCategoryValueSeverity\n drySkin = 'HKCategoryTypeIdentifierDrySkin', // HKCategoryValueSeverity\n fainting = 'HKCategoryTypeIdentifierFainting', // HKCategoryValueSeverity\n fatigue = 'HKCategoryTypeIdentifierFatigue', // HKCategoryValueSeverity\n fever = 'HKCategoryTypeIdentifierFever', // HKCategoryValueSeverity\n generalizedBodyAche = 'HKCategoryTypeIdentifierGeneralizedBodyAche', // HKCategoryValueSeverity\n hairLoss = 'HKCategoryTypeIdentifierHairLoss', // HKCategoryValueSeverity\n headache = 'HKCategoryTypeIdentifierHeadache', // HKCategoryValueSeverity\n heartburn = 'HKCategoryTypeIdentifierHeartburn', // HKCategoryValueSeverity\n hotFlashes = 'HKCategoryTypeIdentifierHotFlashes', // HKCategoryValueSeverity\n lossOfSmell = 'HKCategoryTypeIdentifierLossOfSmell', // HKCategoryValueSeverity\n lossOfTaste = 'HKCategoryTypeIdentifierLossOfTaste', // HKCategoryValueSeverity\n lowerBackPain = 'HKCategoryTypeIdentifierLowerBackPain', // HKCategoryValueSeverity\n memoryLapse = 'HKCategoryTypeIdentifierMemoryLapse', // HKCategoryValueSeverity\n moodChanges = 'HKCategoryTypeIdentifierMoodChanges', // HKCategoryValuePresence\n nausea = 'HKCategoryTypeIdentifierNausea', // HKCategoryValueSeverity\n nightSweats = 'HKCategoryTypeIdentifierNightSweats', // HKCategoryValueSeverity\n pelvicPain = 'HKCategoryTypeIdentifierPelvicPain', // HKCategoryValueSeverity\n rapidPoundingOrFlutteringHeartbeat = 'HKCategoryTypeIdentifierRapidPoundingOrFlutteringHeartbeat', // HKCategoryValueSeverity\n runnyNose = 'HKCategoryTypeIdentifierRunnyNose', // HKCategoryValueSeverity\n shortnessOfBreath = 'HKCategoryTypeIdentifierShortnessOfBreath', // HKCategoryValueSeverity\n sinusCongestion = 'HKCategoryTypeIdentifierSinusCongestion', // HKCategoryValueSeverity\n skippedHeartbeat = 'HKCategoryTypeIdentifierSkippedHeartbeat', // HKCategoryValueSeverity\n sleepChanges = 'HKCategoryTypeIdentifierSleepChanges', // HKCategoryValuePresence\n soreThroat = 'HKCategoryTypeIdentifierSoreThroat', // HKCategoryValueSeverity\n vaginalDryness = 'HKCategoryTypeIdentifierVaginalDryness', // HKCategoryValueSeverity\n vomiting = 'HKCategoryTypeIdentifierVomiting', // HKCategoryValueSeverity\n wheezing = 'HKCategoryTypeIdentifierWheezing', // HKCategoryValueSeverity\n\n}\n\nexport type HKSampleTypeIdentifier =\nHKCategoryTypeIdentifier\n| HKCorrelationTypeIdentifier\n| HKQuantityTypeIdentifier\n| typeof HKAudiogramTypeIdentifier\n| typeof HKDataTypeIdentifierHeartbeatSeries\n| typeof HKWorkoutRouteTypeIdentifier\n| typeof HKWorkoutTypeIdentifier\n| `${HKCategoryTypeIdentifier}`\n| `${HKCorrelationTypeIdentifier}`\n| `${HKQuantityTypeIdentifier}`\n\nexport type HealthkitReadAuthorization = HKCharacteristicTypeIdentifier | HKSampleTypeIdentifier | `${HKCharacteristicTypeIdentifier}` | `${HKSampleTypeIdentifier}`\nexport type HealthkitWriteAuthorization = HKSampleTypeIdentifier\n\nexport enum HKCategoryValueAppleStandHour {\n stood = 0,\n idle = 1,\n}\n\nexport enum HKWorkoutActivityType {\n americanFootball = 1,\n archery = 2,\n australianFootball = 3,\n badminton = 4,\n baseball = 5,\n basketball = 6,\n bowling = 7,\n boxing = 8, // See also HKWorkoutActivityTypeKickboxing.,\n climbing = 9,\n cricket = 10,\n crossTraining = 11, // Any mix of cardio and/or strength training. See also HKWorkoutActivityTypeCoreTraining and HKWorkoutActivityTypeFlexibility.,\n curling = 12,\n cycling = 13,\n dance = 14,\n danceInspiredTraining = 15, // This enum remains available to access older data.,\n elliptical = 16,\n equestrianSports = 17, // Polo, Horse Racing, Horse Riding, etc.,\n fencing = 18,\n fishing = 19,\n functionalStrengthTraining = 20, // Primarily free weights and/or body weight and/or accessories,\n golf = 21,\n gymnastics = 22,\n handball = 23,\n hiking = 24,\n hockey = 25, // Ice Hockey, Field Hockey, etc.,\n hunting = 26,\n lacrosse = 27,\n martialArts = 28,\n mindAndBody = 29, // Qigong, meditation, etc.,\n mixedMetabolicCardioTraining = 30, // This enum remains available to access older data.,\n paddleSports = 31, // Canoeing, Kayaking, Outrigger, Stand Up Paddle Board, etc.,\n play = 32, // Dodge Ball, Hopscotch, Tetherball, Jungle Gym, etc.,\n preparationAndRecovery = 33, // Foam rolling, stretching, etc.,\n racquetball = 34,\n rowing = 35,\n rugby = 36,\n running = 37,\n sailing = 38,\n skatingSports = 39, // Ice Skating, Speed Skating, Inline Skating, Skateboarding, etc.,\n snowSports = 40, // Sledding, Snowmobiling, Building a Snowman, etc. See also HKWorkoutActivityTypeCrossCountrySkiing, HKWorkoutActivityTypeSnowboarding, and HKWorkoutActivityTypeDownhillSkiing.,\n soccer = 41,\n softball = 42,\n squash = 43,\n stairClimbing = 44, // See also HKWorkoutActivityTypeStairs and HKWorkoutActivityTypeStepTraining.,\n surfingSports = 45, // Traditional Surfing, Kite Surfing, Wind Surfing, etc.,\n swimming = 46,\n tableTennis = 47,\n tennis = 48,\n trackAndField = 49, // Shot Put, Javelin, Pole Vaulting, etc.,\n traditionalStrengthTraining = 50, // Primarily machines and/or free weights,\n volleyball = 51,\n walking = 52,\n waterFitness = 53,\n waterPolo = 54,\n waterSports = 55, // Water Skiing, Wake Boarding, etc.,\n wrestling = 56,\n yoga = 57,\n barre = 58, // HKWorkoutActivityTypeDanceInspiredTraining,\n coreTraining = 59,\n crossCountrySkiing = 60,\n downhillSkiing = 61,\n flexibility = 62,\n highIntensityIntervalTraining = 63,\n jumpRope = 64,\n kickboxing = 65,\n pilates = 66, // HKWorkoutActivityTypeDanceInspiredTraining,\n snowboarding = 67,\n stairs = 68,\n stepTraining = 69,\n wheelchairWalkPace = 70,\n wheelchairRunPace = 71,\n taiChi = 72,\n mixedCardio = 73, // HKWorkoutActivityTypeMixedMetabolicCardioTraining,\n handCycling = 74,\n discSports = 75,\n fitnessGaming = 76,\n other = 3000,\n}\n\nexport type HKGenericMetadata = {\n readonly [key: string]: HKQuantity | boolean | number | string | undefined;\n readonly HKExternalUUID?: string;\n readonly HKTimeZone?: string;\n readonly HKWasUserEntered?: boolean;\n readonly HKDeviceSerialNumber?: string;\n readonly HKUDIDeviceIdentifier?: string;\n readonly HKUDIProductionIdentifier?: string;\n readonly HKDigitalSignature?: string;\n readonly HKDeviceName?: string;\n readonly HKDeviceManufacturerName?: string;\n readonly HKSyncIdentifier?: string;\n readonly HKSyncVersion?: number;\n readonly HKWasTakenInLab?: boolean;\n readonly HKReferenceRangeLowerLimit?: number;\n readonly HKReferenceRangeUpperLimit?: number;\n};\n\n// documented at https://developer.apple.com/documentation/healthkit/hkweathercondition\nexport enum HKWeatherCondition {\n none = 0,\n clear = 1,\n fair = 2,\n partlyCloudy = 3,\n mostlyCloudy = 4,\n cloudy = 5,\n foggy = 6,\n haze = 7,\n windy = 8,\n blustery = 9,\n smoky = 10,\n dust = 11,\n snow = 12,\n hail = 13,\n sleet = 14,\n freezingDrizzle = 15,\n freezingRain = 16,\n mixedRainAndHail = 17,\n mixedRainAndSnow = 18,\n mixedRainAndSleet = 19,\n mixedSnowAndSleet = 20,\n drizzle = 21,\n scatteredShowers = 22,\n showers = 23,\n thunderstorms = 24,\n tropicalStorm = 25,\n hurricane = 26,\n tornado = 27,\n}\n\nenum HKIndoorWorkout {\n false = 0,\n true = 1,\n}\n\nexport interface HKWorkoutMetadata\n extends HKGenericMetadata /* <TTemperatureUnit extends HKUnit> */ {\n readonly HKWeatherCondition?: HKWeatherCondition;\n readonly HKWeatherHumidity?: HKQuantity<HKUnit.Percent>;\n // HKWeatherTemperature: HKQuantity<TTemperatureUnit>\n readonly HKAverageMETs?: HKQuantity<HKUnit>,\n readonly HKElevationAscended?: HKQuantity<HKUnit.Meters>,\n readonly HKIndoorWorkout?: HKIndoorWorkout,\n}\n\nexport enum HKAuthorizationRequestStatus {\n unknown = 0,\n shouldRequest = 1,\n unnecessary = 2,\n}\n\nexport enum HKAuthorizationStatus {\n notDetermined = 0,\n sharingDenied = 1,\n sharingAuthorized = 2,\n}\n\nexport type HKQuantity<T extends HKUnit = HKUnit> = {\n readonly unit: T;\n readonly quantity: number;\n};\n\nexport enum HKBloodType {\n notSet = 0,\n aPositive = 1,\n aNegative = 2,\n bPositive = 3,\n bNegative = 4,\n abPositive = 5,\n abNegative = 6,\n oPositive = 7,\n oNegative = 8,\n}\n\nexport enum HKBiologicalSex {\n notSet = 0,\n female = 1,\n male = 2,\n other = 3,\n}\n\nexport enum HKFitzpatrickSkinType {\n notSet = 0,\n I = 1,\n II = 2,\n III = 3,\n IV = 4,\n V = 5,\n VI = 6,\n}\n\nexport enum HKStatisticsOptions {\n cumulativeSum = 'cumulativeSum',\n discreteAverage = 'discreteAverage',\n discreteMax = 'discreteMax',\n discreteMin = 'discreteMin',\n discreteMostRecent = 'discreteMostRecent',\n duration = 'duration',\n mostRecent = 'mostRecent',\n separateBySource = 'separateBySource',\n}\n\nexport type QueryStatisticsResponseRaw<TUnit extends HKUnit = HKUnit> = {\n readonly averageQuantity?: HKQuantity<TUnit>;\n readonly maximumQuantity?: HKQuantity<TUnit>;\n readonly minimumQuantity?: HKQuantity<TUnit>;\n readonly sumQuantity?: HKQuantity<TUnit>;\n readonly mostRecentQuantity?: HKQuantity<TUnit>;\n readonly mostRecentQuantityDateInterval?: { readonly from: string; readonly to: string };\n readonly duration?: HKQuantity<HKUnit.Seconds>;\n};\n\nexport enum HKCategoryValueCervicalMucusQuality {\n dry = 1,\n sticky = 2,\n creamy = 3,\n watery = 4,\n eggWhite = 5,\n}\n\nexport enum HKCategoryValueMenstrualFlow {\n unspecified = 1,\n none = 5,\n light = 2,\n medium = 3,\n heavy = 4,\n}\n\nexport enum HKCategoryValueOvulationTestResult {\n negative = 1,\n luteinizingHormoneSurge = 2,\n indeterminate = 3,\n estrogenSurge = 4,\n}\n\nexport enum HKCategoryValueSleepAnalysis {\n inBed = 0,\n asleep = 1,\n awake = 2,\n}\n\nexport enum HKCategoryValueAppetiteChanges {\n decreased = 2,\n increased = 3,\n noChange = 1,\n unspecified = 0,\n}\n\nexport enum HKCategoryValuePresence {\n notPresent = 1,\n present = 0,\n}\n\nexport enum HKCategoryValueSeverity {\n notPresent = 1,\n mild = 2,\n moderate = 3,\n severe = 4,\n unspecified = 0,\n}\n\nexport enum HKCategoryValueNotApplicable {\n notApplicable = 0,\n}\n\nexport type HKCategoryValue =\n HKCategoryValueAppetiteChanges | HKCategoryValueCervicalMucusQuality |\n HKCategoryValueLowCardioFitnessEvent | HKCategoryValueMenstrualFlow |\n HKCategoryValueOvulationTestResult | HKCategoryValuePresence |\n HKCategoryValueSeverity | HKCategoryValueSleepAnalysis | number;\n\nexport enum HKInsulinDeliveryReason {\n basal = 1,\n bolus = 2,\n}\n\nexport type MetadataMapperForQuantityIdentifier<\n TQuantityTypeIdentifier = HKQuantityTypeIdentifier\n> = TQuantityTypeIdentifier extends HKQuantityTypeIdentifier.insulinDelivery\n ? HKGenericMetadata & {\n readonly HKInsulinDeliveryReason: HKInsulinDeliveryReason;\n }\n : TQuantityTypeIdentifier extends HKQuantityTypeIdentifier.bloodGlucose\n ? HKGenericMetadata & {\n readonly HKBloodGlucoseMealTime?: number;\n }\n : TQuantityTypeIdentifier extends HKQuantityTypeIdentifier.heartRate\n ? HKGenericMetadata & {\n readonly HKHeartRateMotionContext?: HKHeartRateMotionContext;\n }\n : HKGenericMetadata;\n\nexport type MetadataMapperForCorrelationIdentifier<\n TCorrelationTypeIdentifier = HKCorrelationTypeIdentifier\n> = TCorrelationTypeIdentifier extends HKCorrelationTypeIdentifier.food\n ? HKGenericMetadata & {\n readonly HKFoodType?: string;\n }\n : HKGenericMetadata;\n\nexport type HKCategoryValueForIdentifier<T extends HKCategoryTypeIdentifier> =\n T extends HKCategoryTypeIdentifier.cervicalMucusQuality\n ? HKCategoryValueCervicalMucusQuality\n : T extends HKCategoryTypeIdentifier.menstrualFlow\n ? HKCategoryValueMenstrualFlow\n : T extends HKCategoryTypeIdentifier.ovulationTestResult\n ? HKCategoryValueOvulationTestResult\n : T extends HKCategoryTypeIdentifier.sleepAnalysis\n ? HKCategoryValueSleepAnalysis\n : T extends (HKCategoryTypeIdentifier.highHeartRateEvent | HKCategoryTypeIdentifier.intermenstrualBleeding\n | HKCategoryTypeIdentifier.mindfulSession | HKCategoryTypeIdentifier.sexualActivity)\n ? HKCategoryValueNotApplicable\n : T extends (HKCategoryTypeIdentifier.abdominalCramps\n | HKCategoryTypeIdentifier.abdominalCramps\n | HKCategoryTypeIdentifier.acne\n | HKCategoryTypeIdentifier.bladderIncontinence\n | HKCategoryTypeIdentifier.bloating| HKCategoryTypeIdentifier.breastPain\n | HKCategoryTypeIdentifier.chestTightnessOrPain| HKCategoryTypeIdentifier.chills| HKCategoryTypeIdentifier.constipation\n | HKCategoryTypeIdentifier.coughing| HKCategoryTypeIdentifier.diarrhea| HKCategoryTypeIdentifier.dizziness| HKCategoryTypeIdentifier.drySkin| HKCategoryTypeIdentifier.fainting\n | HKCategoryTypeIdentifier.fatigue| HKCategoryTypeIdentifier.fever| HKCategoryTypeIdentifier.generalizedBodyAche| HKCategoryTypeIdentifier.hairLoss\n | HKCategoryTypeIdentifier.headache| HKCategoryTypeIdentifier.heartburn\n | HKCategoryTypeIdentifier.hotFlashes| HKCategoryTypeIdentifier.lossOfSmell| HKCategoryTypeIdentifier.lossOfTaste\n | HKCategoryTypeIdentifier.lowerBackPain| HKCategoryTypeIdentifier.memoryLapse| HKCategoryTypeIdentifier.moodChanges\n | HKCategoryTypeIdentifier.nausea| HKCategoryTypeIdentifier.nightSweats| HKCategoryTypeIdentifier.pelvicPain\n | HKCategoryTypeIdentifier.rapidPoundingOrFlutteringHeartbeat| HKCategoryTypeIdentifier.runnyNose\n | HKCategoryTypeIdentifier.shortnessOfBreath| HKCategoryTypeIdentifier.sinusCongestion| HKCategoryTypeIdentifier.skippedHeartbeat\n | HKCategoryTypeIdentifier.soreThroat| HKCategoryTypeIdentifier.vaginalDryness\n | HKCategoryTypeIdentifier.vomiting| HKCategoryTypeIdentifier.wheezing)\n ? HKCategoryValueSeverity\n : T extends (HKCategoryTypeIdentifier.appetiteChanges | HKCategoryTypeIdentifier.sleepChanges)\n ? HKCategoryValuePresence\n : T extends HKCategoryTypeIdentifier.lowCardioFitnessEvent ? HKCategoryValueLowCardioFitnessEvent :\n T extends HKCategoryTypeIdentifier.pregnancyTestResult ? HKCategoryValuePregnancyTestResult :\n T extends HKCategoryTypeIdentifier.pregnancyTestResult ? HKCategoryValuePregnancyTestResult :\n T extends HKCategoryTypeIdentifier.appleStandHour\n ? HKCategoryValueAppleStandHour\n : number;\n\nenum HKCategoryValuePregnancyTestResult {\n positive = 2,\n negative = 1,\n indeterminate = 3\n}\n/* needs further mapping\n\ncontraceptive = 'HKCategoryTypeIdentifierContraceptive',\n lactation = 'HKCategoryTypeIdentifierLactation',\n pregnancy = 'HKCategoryTypeIdentifierPregnancy',\n\n progesteroneTestResult = 'HKCategoryTypeIdentifierProgesteroneTestResult',\n environmentalAudioExposureEvent = 'HKCategoryTypeIdentifierEnvironmentalAudioExposureEvent',\n headphoneAudioExposureEvent = 'HKCategoryTypeIdentifierHeadphoneAudioExposureEvent',\n appleWalkingSteadinessEvent = 'HKCategoryTypeIdentifierAppleWalkingSteadinessEvent',\n handwashingEvent = 'HKCategoryTypeIdentifierHandwashingEvent', // HKCategoryValue */\n\nexport type MetadataMapperForCategoryIdentifier<\n T extends HKCategoryTypeIdentifier\n> = T extends HKCategoryTypeIdentifier.sexualActivity\n ? HKGenericMetadata & {\n readonly HKSexualActivityProtectionUsed: boolean;\n }\n : T extends HKCategoryTypeIdentifier.menstrualFlow\n ? HKGenericMetadata & {\n readonly HKMenstrualCycleStart: boolean;\n }\n : HKGenericMetadata;\n\n// Maps directly to https://developer.apple.com/documentation/healthkit/hkwheelchairuse\nexport enum HKWheelchairUse {\n notSet = 0,\n no = 1,\n yes = 2,\n}\n\n// Unit types are a straight mapping from here https://developer.apple.com/documentation/healthkit/hkunit/1615733-init\nexport enum HKUnitSIPrefix {\n Pico = 'p',\n Nano = 'n',\n Micro = 'mc',\n Milli = 'm',\n Centi = 'c',\n Deci = 'd',\n Deca = 'da',\n Hecto = 'h',\n Kilo = 'k',\n Mega = 'M',\n Giga = 'G',\n Tera = 'T',\n}\n\nexport enum HKUnitSI {\n Grams = 'g',\n Joules = 'J',\n Kelvin = 'K',\n Liters = 'l',\n Meters = 'm',\n Pascals = 'Pa',\n Seconds = 's',\n Siemens = 'S',\n}\n\nexport enum HKUnit {\n Grams = 'g',\n Joules = 'J',\n Kelvin = 'K',\n Liters = 'l',\n Meters = 'm',\n Pascals = 'Pa',\n Seconds = 's',\n Siemens = 'S',\n\n Atmospheres = 'atm',\n CentimetersOfWater = 'cmAq',\n Count = 'count',\n Days = 'd',\n DecibelHearingLevel = 'dBHL',\n DecibelSoundPressureLevel = 'dBASPL',\n DegreesCelsius = 'degC',\n DegreesFahrenheit = 'degF',\n Feet = 'ft',\n Hertz = 'Hz',\n Hours = 'hr',\n ImperialCup = 'cup_imp',\n ImperialFluidOunces = 'fl_oz_imp',\n ImperialPint = 'pt_imp',\n Inches = 'in',\n InternationalUnit = 'IU',\n Kilocalories = 'kcal',\n LargeCalories = 'Cal',\n Miles = 'mi',\n MillimetersOfMercury = 'mmHg',\n Minutes = 'min',\n Ounces = 'oz',\n Percent = '%',\n Pounds = 'lb',\n SmallCalories = 'cal',\n Stones = 'st',\n USCup = 'cup_us',\n USFluidOunces = 'fl_oz_us',\n USPint = 'pt_us',\n Yard = 'yd',\n\n GlucoseMmolPerL = 'mmol<180.15588000005408>/l',\n GlucoseMgPerDl = 'mg/dL',\n}\n\nexport type HKDevice = {\n readonly name: string; // ex: \"Apple Watch\"\n readonly firmwareVersion: string | null;\n readonly hardwareVersion: string; // ex: \"Watch6,2\",\n readonly localIdentifier: string | null;\n readonly manufacturer: string; // ex: \"Apple Inc.\"\n readonly model: string; // ex: \"Watch\"\n readonly softwareVersion: string; // ex: \"9.0\"\n};\n\nexport type HKSource = {\n readonly name: string;\n readonly bundleIdentifier: string;\n};\n\nexport type HKSourceRevision = {\n readonly source: HKSource;\n readonly version: string;\n readonly operatingSystemVersion?: string;\n readonly productType?: string;\n};\n\nexport type HKQuantitySampleRaw<\n TQuantityIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier,\n TUnit extends HKUnit = HKUnit\n> = {\n readonly uuid: string;\n readonly device?: HKDevice;\n readonly quantityType: TQuantityIdentifier;\n readonly startDate: string;\n readonly endDate: string;\n readonly quantity: number;\n readonly unit: TUnit;\n readonly metadata: MetadataMapperForQuantityIdentifier<TQuantityIdentifier>;\n readonly sourceRevision?: HKSourceRevision;\n};\n\nexport type HKWorkoutRaw<TEnergy extends HKUnit, TDistance extends HKUnit> = {\n readonly uuid: string;\n readonly device?: HKDevice;\n readonly workoutActivityType: HKWorkoutActivityType;\n readonly duration: number;\n readonly totalDistance?: HKQuantity<TDistance>;\n readonly totalEnergyBurned?: HKQuantity<TEnergy>;\n readonly totalSwimmingStrokeCount?: HKQuantity<HKUnit.Count>;\n readonly totalFlightsClimbed?: HKQuantity<HKUnit.Count>;\n readonly startDate: string;\n readonly endDate: string;\n readonly metadata?: HKWorkoutMetadata;\n readonly sourceRevision?: HKSourceRevision;\n};\n\n// Straight mapping to https://developer.apple.com/documentation/healthkit/hkcharacteristictypeidentifier\nexport enum HKCharacteristicTypeIdentifier {\n fitzpatrickSkinType = 'HKCharacteristicTypeIdentifierFitzpatrickSkinType',\n biologicalSex = 'HKCharacteristicTypeIdentifierBiologicalSex',\n bloodType = 'HKCharacteristicTypeIdentifierBloodType',\n dateOfBirth = 'HKCharacteristicTypeIdentifierDateOfBirth',\n wheelchairUse = 'HKCharacteristicTypeIdentifierWheelchairUse',\n activityMoveMode = 'HKCharacteristicTypeIdentifierActivityMoveMode', // HKActivityMoveModeObject\n}\n\nexport type WritePermissions = {\n readonly [key in HKCategoryTypeIdentifier | HKCharacteristicTypeIdentifier | HKQuantityTypeIdentifier]: boolean;\n};\n\nexport type ReadPermissions = {\n readonly [key in HKCategoryTypeIdentifier | HKCharacteristicTypeIdentifier | HKQuantityTypeIdentifier]: boolean;\n};\n\nexport type HKCategorySampleRaw<\n T extends HKCategoryTypeIdentifier = HKCategoryTypeIdentifier\n> = {\n readonly uuid: string;\n readonly device?: HKDevice;\n readonly categoryType: T;\n readonly startDate: string;\n readonly endDate: string;\n readonly value: HKCategoryValueForIdentifier<T>;\n readonly metadata: MetadataMapperForCategoryIdentifier<T>;\n readonly sourceRevision?: HKSourceRevision;\n};\n\nexport type HKCorrelationRaw<TIdentifier extends HKCorrelationTypeIdentifier> =\n {\n readonly correlationType: HKCorrelationTypeIdentifier;\n readonly objects: readonly (HKCategorySampleRaw | HKQuantitySampleRaw)[];\n readonly metadata: MetadataMapperForCorrelationIdentifier<TIdentifier>;\n readonly startDate: string;\n readonly endDate: string;\n };\n\ntype QueryId = string;\n\nexport enum HKUpdateFrequency {\n immediate = 1,\n hourly = 2,\n daily = 3,\n weekly = 4,\n}\n\nexport type WorkoutLocation = {\n readonly longitude: number;\n readonly latitude: number;\n readonly altitude: number;\n readonly speed: number;\n readonly timestamp: number;\n readonly horizontalAccuracy: number;\n readonly speedAccuracy: number;\n readonly verticalAccuracy: number;\n};\n\nexport type WorkoutRoute = {\n readonly locations: readonly WorkoutLocation[];\n readonly HKMetadataKeySyncIdentifier?: string;\n readonly HKMetadataKeySyncVersion?: number;\n};\n\ntype ReactNativeHealthkitTypeNative = {\n isHealthDataAvailable(): Promise<boolean>;\n getBloodType(): Promise<HKBloodType>;\n getDateOfBirth(): Promise<string>;\n getBiologicalSex(): Promise<HKBiologicalSex>;\n getFitzpatrickSkinType(): Promise<HKFitzpatrickSkinType>;\n readonly getWheelchairUse: () => Promise<HKWheelchairUse>;\n\n readonly enableBackgroundDelivery: (\n typeIdentifier: HKSampleTypeIdentifier,\n updateFrequency: HKUpdateFrequency\n ) => Promise<boolean>;\n readonly disableBackgroundDelivery: (\n typeIdentifier: HKSampleTypeIdentifier,\n ) => Promise<boolean>;\n readonly disableAllBackgroundDelivery: () => Promise<boolean>;\n\n readonly saveCorrelationSample: <TIdentifier extends HKCorrelationTypeIdentifier>(\n typeIdentifier: TIdentifier,\n samples: readonly Omit<\n HKCategorySampleRaw | HKQuantitySampleRaw,\n 'device' | 'endDate' | 'startDate' | 'uuid'\n >[],\n start: string,\n end: string,\n metadata: MetadataMapperForCorrelationIdentifier<TIdentifier>\n ) => Promise<boolean>;\n\n readonly saveWorkoutSample: (\n typeIdentifier: HKWorkoutActivityType,\n quantities: readonly Omit<\n HKQuantitySampleRaw,\n 'device' | 'endDate' | 'startDate' | 'uuid'\n >[],\n start: string,\n end: string,\n metadata: HKWorkoutMetadata\n ) => Promise<boolean>;\n\n readonly queryCorrelationSamples: <TIdentifier extends HKCorrelationTypeIdentifier>(\n typeIdentifier: TIdentifier,\n from: string,\n to: string\n ) => Promise<readonly HKCorrelationRaw<TIdentifier>[]>;\n\n subscribeToObserverQuery(\n identifier: HKSampleTypeIdentifier\n ): Promise<QueryId>;\n unsubscribeQuery(queryId: QueryId): Promise<boolean>;\n authorizationStatusFor(\n type: HealthkitReadAuthorization\n ): Promise<boolean>;\n getRequestStatusForAuthorization(\n write: WritePermissions,\n read: ReadPermissions\n ): Promise<HKAuthorizationRequestStatus>;\n requestAuthorization(\n write: WritePermissions,\n read: ReadPermissions\n ): Promise<boolean>;\n readonly saveQuantitySample: (\n identifier: HKQuantityTypeIdentifier,\n unit: HKUnit,\n value: number,\n start: string,\n end: string,\n metadata: unknown\n ) => Promise<boolean>;\n readonly queryWorkoutSamples: <TEnergy extends HKUnit, TDistance extends HKUnit>(\n energyUnit: TEnergy,\n distanceUnit: TDistance,\n from: string,\n to: string,\n limit: number,\n ascending: boolean\n ) => Promise<readonly HKWorkoutRaw<TEnergy, TDistance>[]>;\n readonly queryCategorySamples: <T extends HKCategoryTypeIdentifier>(\n identifier: T,\n from: string,\n to: string,\n limit: number,\n ascending: boolean\n ) => Promise<readonly HKCategorySampleRaw<T>[]>;\n readonly queryQuantitySamples: <\n TUnit extends HKUnit,\n TIdentifier extends HKQuantityTypeIdentifier\n >(\n identifier: TIdentifier,\n unit: TUnit,\n from: string,\n to: string,\n limit: number,\n ascending: boolean\n ) => Promise<readonly HKQuantitySampleRaw<TIdentifier, TUnit>[]>;\n readonly saveCategorySample: <T extends HKCategoryTypeIdentifier>(\n identifier: T,\n value: HKCategoryValueForIdentifier<T>,\n start: string,\n end: string,\n metadata: unknown\n ) => Promise<boolean>;\n readonly queryStatisticsForQuantity: <TUnit extends HKUnit>(\n identifier: HKQuantityTypeIdentifier,\n unit: TUnit,\n from: string,\n to: string,\n options: readonly HKStatisticsOptions[]\n ) => Promise<QueryStatisticsResponseRaw<TUnit>>;\n readonly getPreferredUnits: (\n identifiers: readonly HKQuantityTypeIdentifier[]\n ) => Promise<TypeToUnitMapping>;\n readonly getWorkoutRoutes: (workoutUUID: string) => Promise<readonly WorkoutRoute[]>;\n};\n\nconst Native = NativeModules.ReactNativeHealthkit as ReactNativeHealthkitTypeNative\n\ntype OnChangeCallback = ({\n typeIdentifier,\n}: {\n readonly typeIdentifier: HKSampleTypeIdentifier;\n}) => void;\n\ninterface HealthkitEventEmitter extends NativeEventEmitter {\n readonly addListener: (\n eventType: 'onChange',\n callback: OnChangeCallback\n ) => EmitterSubscription;\n}\n\nexport const EventEmitter = new NativeEventEmitter(\n NativeModules.ReactNativeHealthkit,\n) as HealthkitEventEmitter\n\nexport default Native\n"],"mappings":"AAAA,SACEA,kBADF,EAEEC,aAFF,QAGO,cAHP;AAOA,OAAO,MAAMC,uBAAuB,GAAG,yBAAhC;AACP,OAAO,MAAMC,yBAAyB,GAAG,2BAAlC;AACP,OAAO,MAAMC,4BAA4B,GAAG,8BAArC;AACP,OAAO,MAAMC,mCAAmC,GAAG,qCAA5C,C,CAEP;;AACA,WAAYC,wBAAZ;;WAAYA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;E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;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;GAAAA,M,KAAAA,M;;AAiGZ;AACA,WAAYC,8BAAZ;;WAAYA,8B;EAAAA,8B;EAAAA,8B;EAAAA,8B;EAAAA,8B;EAAAA,8B;EAAAA,8B;GAAAA,8B,KAAAA,8B;;AAyCZ,WAAYC,iBAAZ;;WAAYA,iB;EAAAA,iB,CAAAA,iB;EAAAA,iB,CAAAA,iB;EAAAA,iB,CAAAA,iB;EAAAA,iB,CAAAA,iB;GAAAA,iB,KAAAA,iB;;AA0IZ,MAAMC,MAAM,GAAGpC,aAAa,CAACqC,oBAA7B;AAeA,OAAO,MAAMC,YAAY,GAAG,IAAIvC,kBAAJ,CAC1BC,aAAa,CAACqC,oBADY,CAArB;AAIP,eAAeD,MAAf"}
1
+ {"version":3,"names":["NativeEventEmitter","NativeModules","HKWorkoutTypeIdentifier","HKAudiogramTypeIdentifier","HKWorkoutRouteTypeIdentifier","HKDataTypeIdentifierHeartbeatSeries","HKQuantityTypeIdentifier","HKCategoryValueLowCardioFitnessEvent","HKHeartRateMotionContext","HKCorrelationTypeIdentifier","HKCategoryTypeIdentifier","HKCategoryValueAppleStandHour","HKWorkoutActivityType","HKWeatherCondition","HKIndoorWorkout","HKAuthorizationRequestStatus","HKAuthorizationStatus","HKBloodType","HKBiologicalSex","HKFitzpatrickSkinType","HKStatisticsOptions","HKCategoryValueCervicalMucusQuality","HKCategoryValueMenstrualFlow","HKCategoryValueOvulationTestResult","HKCategoryValueSleepAnalysis","HKCategoryValueAppetiteChanges","HKCategoryValuePresence","HKCategoryValueSeverity","HKCategoryValueNotApplicable","HKInsulinDeliveryReason","HKCategoryValuePregnancyTestResult","HKWheelchairUse","HKMetricPrefix","HKUnitMetric","HKUnits","UnitOfLength","UnitOfVolume","UnitOfMass","UnitOfPressure","UnitOfTime","TemperatureUnit","UnitOfEnergy","BloodGlucoseUnit","HKCharacteristicTypeIdentifier","HKUpdateFrequency","Native","ReactNativeHealthkit","EventEmitter"],"sources":["native-types.ts"],"sourcesContent":["import {\n NativeEventEmitter,\n NativeModules,\n} from 'react-native'\n\nimport type { EmitterSubscription } from 'react-native'\n\nexport const HKWorkoutTypeIdentifier = 'HKWorkoutTypeIdentifier' as const\nexport const HKAudiogramTypeIdentifier = 'HKAudiogramTypeIdentifier' as const\nexport const HKWorkoutRouteTypeIdentifier = 'HKWorkoutRouteTypeIdentifier' as const\nexport const HKDataTypeIdentifierHeartbeatSeries = 'HKDataTypeIdentifierHeartbeatSeries' as const\n\n// Straight mapping to https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifier\nexport enum HKQuantityTypeIdentifier {\n bodyMassIndex = 'HKQuantityTypeIdentifierBodyMassIndex',\n bodyFatPercentage = 'HKQuantityTypeIdentifierBodyFatPercentage', // Scalar(Percent, 0.0 - 1.0), Discrete\n height = 'HKQuantityTypeIdentifierHeight', // Length, Discrete\n bodyMass = 'HKQuantityTypeIdentifierBodyMass', // Mass, Discrete\n leanBodyMass = 'HKQuantityTypeIdentifierLeanBodyMass', // Mass, Discrete\n\n waistCircumference = 'HKQuantityTypeIdentifierWaistCircumference', // Length, Discrete\n // Fitness\n stepCount = 'HKQuantityTypeIdentifierStepCount', // Scalar(Count), Cumulative\n distanceWalkingRunning = 'HKQuantityTypeIdentifierDistanceWalkingRunning', // Length, Cumulative\n distanceCycling = 'HKQuantityTypeIdentifierDistanceCycling', // Length, Cumulative\n distanceWheelchair = 'HKQuantityTypeIdentifierDistanceWheelchair', // Length, Cumulative\n basalEnergyBurned = 'HKQuantityTypeIdentifierBasalEnergyBurned', // Energy, Cumulative\n activeEnergyBurned = 'HKQuantityTypeIdentifierActiveEnergyBurned', // Energy, Cumulative\n flightsClimbed = 'HKQuantityTypeIdentifierFlightsClimbed', // Scalar(Count), Cumulative\n nikeFuel = 'HKQuantityTypeIdentifierNikeFuel', // Scalar(Count), Cumulative\n appleExerciseTime = 'HKQuantityTypeIdentifierAppleExerciseTime', // Time Cumulative\n pushCount = 'HKQuantityTypeIdentifierPushCount', // Scalar(Count), Cumulative\n distanceSwimming = 'HKQuantityTypeIdentifierDistanceSwimming', // Length, Cumulative\n swimmingStrokeCount = 'HKQuantityTypeIdentifierSwimmingStrokeCount', // Scalar(Count), Cumulative\n vo2Max = 'HKQuantityTypeIdentifierVo2Max', // ml/(kg*min) Discrete\n distanceDownhillSnowSports = 'HKQuantityTypeIdentifierDistanceDownhillSnowSports', // Length, Cumulative\n\n appleStandTime = 'HKQuantityTypeIdentifierAppleStandTime', // Time, Cumulative\n // Vitals\n heartRate = 'HKQuantityTypeIdentifierHeartRate', // Scalar(Count)/Time, Discrete\n bodyTemperature = 'HKQuantityTypeIdentifierBodyTemperature', // Temperature, Discrete\n basalBodyTemperature = 'HKQuantityTypeIdentifierBasalBodyTemperature', // Basal Body Temperature, Discrete\n bloodPressureSystolic = 'HKQuantityTypeIdentifierBloodPressureSystolic', // Pressure, Discrete\n bloodPressureDiastolic = 'HKQuantityTypeIdentifierBloodPressureDiastolic', // Pressure, Discrete\n respiratoryRate = 'HKQuantityTypeIdentifierRespiratoryRate', // Scalar(Count)/Time, Discrete\n // Beats per minute estimate of a user's lowest heart rate while at rest\n restingHeartRate = 'HKQuantityTypeIdentifierRestingHeartRate', // Scalar(Count)/Time, Discrete\n // Average heartbeats per minute captured by an Apple Watch while a user is walking\n walkingHeartRateAverage = 'HKQuantityTypeIdentifierWalkingHeartRateAverage', // Scalar(Count)/Time, Discrete\n // The standard deviation of heart beat-to-beat intevals (Standard Deviation of Normal to Normal)\n\n heartRateVariabilitySDNN = 'HKQuantityTypeIdentifierHeartRateVariabilitySDNN', // Time (ms), Discrete\n // Results\n oxygenSaturation = 'HKQuantityTypeIdentifierOxygenSaturation', // Scalar (Percent, 0.0 - 1.0, Discrete\n peripheralPerfusionIndex = 'HKQuantityTypeIdentifierPeripheralPerfusionIndex', // Scalar(Percent, 0.0 - 1.0), Discrete\n bloodGlucose = 'HKQuantityTypeIdentifierBloodGlucose', // Mass/Volume, Discrete\n numberOfTimesFallen = 'HKQuantityTypeIdentifierNumberOfTimesFallen', // Scalar(Count), Cumulative\n electrodermalActivity = 'HKQuantityTypeIdentifierElectrodermalActivity', // Conductance, Discrete\n inhalerUsage = 'HKQuantityTypeIdentifierInhalerUsage', // Scalar(Count), Cumulative\n insulinDelivery = 'HKQuantityTypeIdentifierInsulinDelivery', // Pharmacology (IU) Cumulative\n bloodAlcoholContent = 'HKQuantityTypeIdentifierBloodAlcoholContent', // Scalar(Percent, 0.0 - 1.0), Discrete\n forcedVitalCapacity = 'HKQuantityTypeIdentifierForcedVitalCapacity', // Volume, Discrete\n forcedExpiratoryVolume1 = 'HKQuantityTypeIdentifierForcedExpiratoryVolume1', // Volume, Discrete\n peakExpiratoryFlowRate = 'HKQuantityTypeIdentifierPeakExpiratoryFlowRate', // Volume/Time, Discrete\n environmentalAudioExposure = 'HKQuantityTypeIdentifierEnvironmentalAudioExposure', // Pressure, Cumulative\n\n headphoneAudioExposure = 'HKQuantityTypeIdentifierHeadphoneAudioExposure', // Pressure, Cumulative\n // Nutrition\n dietaryFatTotal = 'HKQuantityTypeIdentifierDietaryFatTotal', // Mass, Cumulative\n dietaryFatPolyunsaturated = 'HKQuantityTypeIdentifierDietaryFatPolyunsaturated', // Mass, Cumulative\n dietaryFatMonounsaturated = 'HKQuantityTypeIdentifierDietaryFatMonounsaturated', // Mass, Cumulative\n dietaryFatSaturated = 'HKQuantityTypeIdentifierDietaryFatSaturated', // Mass, Cumulative\n dietaryCholesterol = 'HKQuantityTypeIdentifierDietaryCholesterol', // Mass, Cumulative\n dietarySodium = 'HKQuantityTypeIdentifierDietarySodium', // Mass, Cumulative\n dietaryCarbohydrates = 'HKQuantityTypeIdentifierDietaryCarbohydrates', // Mass, Cumulative\n dietaryFiber = 'HKQuantityTypeIdentifierDietaryFiber', // Mass, Cumulative\n dietarySugar = 'HKQuantityTypeIdentifierDietarySugar', // Mass, Cumulative\n dietaryEnergyConsumed = 'HKQuantityTypeIdentifierDietaryEnergyConsumed', // Energy, Cumulative\n dietaryProtein = 'HKQuantityTypeIdentifierDietaryProtein', // Mass, Cumulative\n\n dietaryVitaminA = 'HKQuantityTypeIdentifierDietaryVitaminA', // Mass, Cumulative\n dietaryVitaminB6 = 'HKQuantityTypeIdentifierDietaryVitaminB6', // Mass, Cumulative\n dietaryVitaminB12 = 'HKQuantityTypeIdentifierDietaryVitaminB12', // Mass, Cumulative\n dietaryVitaminC = 'HKQuantityTypeIdentifierDietaryVitaminC', // Mass, Cumulative\n dietaryVitaminD = 'HKQuantityTypeIdentifierDietaryVitaminD', // Mass, Cumulative\n dietaryVitaminE = 'HKQuantityTypeIdentifierDietaryVitaminE', // Mass, Cumulative\n dietaryVitaminK = 'HKQuantityTypeIdentifierDietaryVitaminK', // Mass, Cumulative\n dietaryCalcium = 'HKQuantityTypeIdentifierDietaryCalcium', // Mass, Cumulative\n dietaryIron = 'HKQuantityTypeIdentifierDietaryIron', // Mass, Cumulative\n dietaryThiamin = 'HKQuantityTypeIdentifierDietaryThiamin', // Mass, Cumulative\n dietaryRiboflavin = 'HKQuantityTypeIdentifierDietaryRiboflavin', // Mass, Cumulative\n dietaryNiacin = 'HKQuantityTypeIdentifierDietaryNiacin', // Mass, Cumulative\n dietaryFolate = 'HKQuantityTypeIdentifierDietaryFolate', // Mass, Cumulative\n dietaryBiotin = 'HKQuantityTypeIdentifierDietaryBiotin', // Mass, Cumulative\n dietaryPantothenicAcid = 'HKQuantityTypeIdentifierDietaryPantothenicAcid', // Mass, Cumulative\n dietaryPhosphorus = 'HKQuantityTypeIdentifierDietaryPhosphorus', // Mass, Cumulative\n dietaryIodine = 'HKQuantityTypeIdentifierDietaryIodine', // Mass, Cumulative\n dietaryMagnesium = 'HKQuantityTypeIdentifierDietaryMagnesium', // Mass, Cumulative\n dietaryZinc = 'HKQuantityTypeIdentifierDietaryZinc', // Mass, Cumulative\n dietarySelenium = 'HKQuantityTypeIdentifierDietarySelenium', // Mass, Cumulative\n dietaryCopper = 'HKQuantityTypeIdentifierDietaryCopper', // Mass, Cumulative\n dietaryManganese = 'HKQuantityTypeIdentifierDietaryManganese', // Mass, Cumulative\n dietaryChromium = 'HKQuantityTypeIdentifierDietaryChromium', // Mass, Cumulative\n dietaryMolybdenum = 'HKQuantityTypeIdentifierDietaryMolybdenum', // Mass, Cumulative\n dietaryChloride = 'HKQuantityTypeIdentifierDietaryChloride', // Mass, Cumulative\n dietaryPotassium = 'HKQuantityTypeIdentifierDietaryPotassium', // Mass, Cumulative\n dietaryCaffeine = 'HKQuantityTypeIdentifierDietaryCaffeine', // Mass, Cumulative\n dietaryWater = 'HKQuantityTypeIdentifierDietaryWater', // Volume, Cumulative\n\n // Mobility\n sixMinuteWalkTestDistance = 'HKQuantityTypeIdentifierSixMinuteWalkTestDistance',\n walkingSpeed = 'HKQuantityTypeIdentifierWalkingSpeed',\n walkingStepLength = 'HKQuantityTypeIdentifierWalkingStepLength',\n walkingAsymmetryPercentage = 'HKQuantityTypeIdentifierWalkingAsymmetryPercentage',\n walkingDoubleSupportPercentage = 'HKQuantityTypeIdentifierWalkingDoubleSupportPercentage',\n stairAscentSpeed = 'HKQuantityTypeIdentifierStairAscentSpeed',\n stairDescentSpeed = 'HKQuantityTypeIdentifierStairDescentSpeed',\n\n uvExposure = 'HKQuantityTypeIdentifierUvExposure', // Scalar (Count), Discrete\n\n appleMoveTime = 'HKQuantityTypeIdentifierAppleMoveTime', // Time, Cumulative\n appleWalkingSteadiness = 'HKQuantityTypeIdentifierAppleWalkingSteadiness', // Scalar(Percent, 0.0 - 1.0), Discrete\n\n numberOfAlcoholicBeverages = 'HKQuantityTypeIdentifierNumberOfAlcoholicBeverages', // Scalar(Count), Cumulative\n}\n\nexport type TypeToUnitMapping = { readonly\n [key in HKQuantityTypeIdentifier]: HKUnit;\n};\n\nexport enum HKCategoryValueLowCardioFitnessEvent {\n lowFitness = 1,\n}\n\nexport enum HKHeartRateMotionContext {\n active = 2,\n notSet = 0,\n sedentary = 1,\n}\n\nexport enum HKCorrelationTypeIdentifier {\n bloodPressure = 'HKCorrelationTypeIdentifierBloodPressure',\n food = 'HKCorrelationTypeIdentifierFood',\n}\n\nexport enum HKCategoryTypeIdentifier {\n sleepAnalysis = 'HKCategoryTypeIdentifierSleepAnalysis',\n appleStandHour = 'HKCategoryTypeIdentifierAppleStandHour',\n cervicalMucusQuality = 'HKCategoryTypeIdentifierCervicalMucusQuality',\n ovulationTestResult = 'HKCategoryTypeIdentifierOvulationTestResult',\n menstrualFlow = 'HKCategoryTypeIdentifierMenstrualFlow',\n intermenstrualBleeding = 'HKCategoryTypeIdentifierIntermenstrualBleeding',\n sexualActivity = 'HKCategoryTypeIdentifierSexualActivity',\n mindfulSession = 'HKCategoryTypeIdentifierMindfulSession',\n highHeartRateEvent = 'HKCategoryTypeIdentifierHighHeartRateEvent',\n lowHeartRateEvent = 'HKCategoryTypeIdentifierLowHeartRateEvent',\n irregularHeartRhythmEvent = 'HKCategoryTypeIdentifierIrregularHeartRhythmEvent',\n audioExposureEvent = 'HKCategoryTypeIdentifierAudioExposureEvent',\n toothbrushingEvent = 'HKCategoryTypeIdentifierToothbrushingEvent',\n lowCardioFitnessEvent = 'HKCategoryTypeIdentifierLowCardioFitnessEvent',\n contraceptive = 'HKCategoryTypeIdentifierContraceptive',\n lactation = 'HKCategoryTypeIdentifierLactation',\n pregnancy = 'HKCategoryTypeIdentifierPregnancy',\n pregnancyTestResult = 'HKCategoryTypeIdentifierPregnancyTestResult',\n progesteroneTestResult = 'HKCategoryTypeIdentifierProgesteroneTestResult',\n environmentalAudioExposureEvent = 'HKCategoryTypeIdentifierEnvironmentalAudioExposureEvent',\n headphoneAudioExposureEvent = 'HKCategoryTypeIdentifierHeadphoneAudioExposureEvent',\n appleWalkingSteadinessEvent = 'HKCategoryTypeIdentifierAppleWalkingSteadinessEvent',\n handwashingEvent = 'HKCategoryTypeIdentifierHandwashingEvent', // HKCategoryValue\n\n // Symptoms\n abdominalCramps = 'HKCategoryTypeIdentifierAbdominalCramps', // HKCategoryValueSeverity\n acne = 'HKCategoryTypeIdentifierAcne', // HKCategoryValueSeverity\n appetiteChanges = 'HKCategoryTypeIdentifierAppetiteChanges', // HKCategoryValueAppetiteChanges\n bladderIncontinence = 'HKCategoryTypeIdentifierBladderIncontinence', // HKCategoryValueSeverity\n bloating = 'HKCategoryTypeIdentifierBloating', // HKCategoryValueSeverity\n breastPain = 'HKCategoryTypeIdentifierBreastPain', // HKCategoryValueSeverity\n chestTightnessOrPain = 'HKCategoryTypeIdentifierChestTightnessOrPain', // HKCategoryValueSeverity\n chills = 'HKCategoryTypeIdentifierChills', // HKCategoryValueSeverity\n constipation = 'HKCategoryTypeIdentifierConstipation', // HKCategoryValueSeverity\n coughing = 'HKCategoryTypeIdentifierCoughing', // HKCategoryValueSeverity\n diarrhea = 'HKCategoryTypeIdentifierDiarrhea', // HKCategoryValueSeverity\n dizziness = 'HKCategoryTypeIdentifierDizziness', // HKCategoryValueSeverity\n drySkin = 'HKCategoryTypeIdentifierDrySkin', // HKCategoryValueSeverity\n fainting = 'HKCategoryTypeIdentifierFainting', // HKCategoryValueSeverity\n fatigue = 'HKCategoryTypeIdentifierFatigue', // HKCategoryValueSeverity\n fever = 'HKCategoryTypeIdentifierFever', // HKCategoryValueSeverity\n generalizedBodyAche = 'HKCategoryTypeIdentifierGeneralizedBodyAche', // HKCategoryValueSeverity\n hairLoss = 'HKCategoryTypeIdentifierHairLoss', // HKCategoryValueSeverity\n headache = 'HKCategoryTypeIdentifierHeadache', // HKCategoryValueSeverity\n heartburn = 'HKCategoryTypeIdentifierHeartburn', // HKCategoryValueSeverity\n hotFlashes = 'HKCategoryTypeIdentifierHotFlashes', // HKCategoryValueSeverity\n lossOfSmell = 'HKCategoryTypeIdentifierLossOfSmell', // HKCategoryValueSeverity\n lossOfTaste = 'HKCategoryTypeIdentifierLossOfTaste', // HKCategoryValueSeverity\n lowerBackPain = 'HKCategoryTypeIdentifierLowerBackPain', // HKCategoryValueSeverity\n memoryLapse = 'HKCategoryTypeIdentifierMemoryLapse', // HKCategoryValueSeverity\n moodChanges = 'HKCategoryTypeIdentifierMoodChanges', // HKCategoryValuePresence\n nausea = 'HKCategoryTypeIdentifierNausea', // HKCategoryValueSeverity\n nightSweats = 'HKCategoryTypeIdentifierNightSweats', // HKCategoryValueSeverity\n pelvicPain = 'HKCategoryTypeIdentifierPelvicPain', // HKCategoryValueSeverity\n rapidPoundingOrFlutteringHeartbeat = 'HKCategoryTypeIdentifierRapidPoundingOrFlutteringHeartbeat', // HKCategoryValueSeverity\n runnyNose = 'HKCategoryTypeIdentifierRunnyNose', // HKCategoryValueSeverity\n shortnessOfBreath = 'HKCategoryTypeIdentifierShortnessOfBreath', // HKCategoryValueSeverity\n sinusCongestion = 'HKCategoryTypeIdentifierSinusCongestion', // HKCategoryValueSeverity\n skippedHeartbeat = 'HKCategoryTypeIdentifierSkippedHeartbeat', // HKCategoryValueSeverity\n sleepChanges = 'HKCategoryTypeIdentifierSleepChanges', // HKCategoryValuePresence\n soreThroat = 'HKCategoryTypeIdentifierSoreThroat', // HKCategoryValueSeverity\n vaginalDryness = 'HKCategoryTypeIdentifierVaginalDryness', // HKCategoryValueSeverity\n vomiting = 'HKCategoryTypeIdentifierVomiting', // HKCategoryValueSeverity\n wheezing = 'HKCategoryTypeIdentifierWheezing', // HKCategoryValueSeverity\n\n}\n\nexport type HKSampleTypeIdentifier =\nHKCategoryTypeIdentifier\n| HKCorrelationTypeIdentifier\n| HKQuantityTypeIdentifier\n| typeof HKAudiogramTypeIdentifier\n| typeof HKDataTypeIdentifierHeartbeatSeries\n| typeof HKWorkoutRouteTypeIdentifier\n| typeof HKWorkoutTypeIdentifier\n| `${HKCategoryTypeIdentifier}`\n| `${HKCorrelationTypeIdentifier}`\n| `${HKQuantityTypeIdentifier}`\n\nexport type HealthkitReadAuthorization = HKCharacteristicTypeIdentifier | HKSampleTypeIdentifier | `${HKCharacteristicTypeIdentifier}` | `${HKSampleTypeIdentifier}`\nexport type HealthkitWriteAuthorization = HKSampleTypeIdentifier\n\nexport enum HKCategoryValueAppleStandHour {\n stood = 0,\n idle = 1,\n}\n\nexport enum HKWorkoutActivityType {\n americanFootball = 1,\n archery = 2,\n australianFootball = 3,\n badminton = 4,\n baseball = 5,\n basketball = 6,\n bowling = 7,\n boxing = 8, // See also HKWorkoutActivityTypeKickboxing.,\n climbing = 9,\n cricket = 10,\n crossTraining = 11, // Any mix of cardio and/or strength training. See also HKWorkoutActivityTypeCoreTraining and HKWorkoutActivityTypeFlexibility.,\n curling = 12,\n cycling = 13,\n dance = 14,\n danceInspiredTraining = 15, // This enum remains available to access older data.,\n elliptical = 16,\n equestrianSports = 17, // Polo, Horse Racing, Horse Riding, etc.,\n fencing = 18,\n fishing = 19,\n functionalStrengthTraining = 20, // Primarily free weights and/or body weight and/or accessories,\n golf = 21,\n gymnastics = 22,\n handball = 23,\n hiking = 24,\n hockey = 25, // Ice Hockey, Field Hockey, etc.,\n hunting = 26,\n lacrosse = 27,\n martialArts = 28,\n mindAndBody = 29, // Qigong, meditation, etc.,\n mixedMetabolicCardioTraining = 30, // This enum remains available to access older data.,\n paddleSports = 31, // Canoeing, Kayaking, Outrigger, Stand Up Paddle Board, etc.,\n play = 32, // Dodge Ball, Hopscotch, Tetherball, Jungle Gym, etc.,\n preparationAndRecovery = 33, // Foam rolling, stretching, etc.,\n racquetball = 34,\n rowing = 35,\n rugby = 36,\n running = 37,\n sailing = 38,\n skatingSports = 39, // Ice Skating, Speed Skating, Inline Skating, Skateboarding, etc.,\n snowSports = 40, // Sledding, Snowmobiling, Building a Snowman, etc. See also HKWorkoutActivityTypeCrossCountrySkiing, HKWorkoutActivityTypeSnowboarding, and HKWorkoutActivityTypeDownhillSkiing.,\n soccer = 41,\n softball = 42,\n squash = 43,\n stairClimbing = 44, // See also HKWorkoutActivityTypeStairs and HKWorkoutActivityTypeStepTraining.,\n surfingSports = 45, // Traditional Surfing, Kite Surfing, Wind Surfing, etc.,\n swimming = 46,\n tableTennis = 47,\n tennis = 48,\n trackAndField = 49, // Shot Put, Javelin, Pole Vaulting, etc.,\n traditionalStrengthTraining = 50, // Primarily machines and/or free weights,\n volleyball = 51,\n walking = 52,\n waterFitness = 53,\n waterPolo = 54,\n waterSports = 55, // Water Skiing, Wake Boarding, etc.,\n wrestling = 56,\n yoga = 57,\n barre = 58, // HKWorkoutActivityTypeDanceInspiredTraining,\n coreTraining = 59,\n crossCountrySkiing = 60,\n downhillSkiing = 61,\n flexibility = 62,\n highIntensityIntervalTraining = 63,\n jumpRope = 64,\n kickboxing = 65,\n pilates = 66, // HKWorkoutActivityTypeDanceInspiredTraining,\n snowboarding = 67,\n stairs = 68,\n stepTraining = 69,\n wheelchairWalkPace = 70,\n wheelchairRunPace = 71,\n taiChi = 72,\n mixedCardio = 73, // HKWorkoutActivityTypeMixedMetabolicCardioTraining,\n handCycling = 74,\n discSports = 75,\n fitnessGaming = 76,\n other = 3000,\n}\n\nexport type HKGenericMetadata = {\n readonly [key: string]: HKQuantity | boolean | number | string | undefined;\n readonly HKExternalUUID?: string;\n readonly HKTimeZone?: string;\n readonly HKWasUserEntered?: boolean;\n readonly HKDeviceSerialNumber?: string;\n readonly HKUDIDeviceIdentifier?: string;\n readonly HKUDIProductionIdentifier?: string;\n readonly HKDigitalSignature?: string;\n readonly HKDeviceName?: string;\n readonly HKDeviceManufacturerName?: string;\n readonly HKSyncIdentifier?: string;\n readonly HKSyncVersion?: number;\n readonly HKWasTakenInLab?: boolean;\n readonly HKReferenceRangeLowerLimit?: number;\n readonly HKReferenceRangeUpperLimit?: number;\n};\n\n// documented at https://developer.apple.com/documentation/healthkit/hkweathercondition\nexport enum HKWeatherCondition {\n none = 0,\n clear = 1,\n fair = 2,\n partlyCloudy = 3,\n mostlyCloudy = 4,\n cloudy = 5,\n foggy = 6,\n haze = 7,\n windy = 8,\n blustery = 9,\n smoky = 10,\n dust = 11,\n snow = 12,\n hail = 13,\n sleet = 14,\n freezingDrizzle = 15,\n freezingRain = 16,\n mixedRainAndHail = 17,\n mixedRainAndSnow = 18,\n mixedRainAndSleet = 19,\n mixedSnowAndSleet = 20,\n drizzle = 21,\n scatteredShowers = 22,\n showers = 23,\n thunderstorms = 24,\n tropicalStorm = 25,\n hurricane = 26,\n tornado = 27,\n}\n\nenum HKIndoorWorkout {\n false = 0,\n true = 1,\n}\n\nexport interface HKWorkoutMetadata\n extends HKGenericMetadata /* <TTemperatureUnit extends HKUnit> */ {\n readonly HKWeatherCondition?: HKWeatherCondition;\n readonly HKWeatherHumidity?: HKQuantity<HKQuantityTypeIdentifier, HKUnits.Percent>;\n // HKWeatherTemperature: HKQuantity<TTemperatureUnit>\n readonly HKAverageMETs?: HKQuantity<HKQuantityTypeIdentifier, HKUnit>,\n readonly HKElevationAscended?: HKQuantity<HKQuantityTypeIdentifier, LengthUnit>,\n readonly HKIndoorWorkout?: HKIndoorWorkout,\n}\n\nexport enum HKAuthorizationRequestStatus {\n unknown = 0,\n shouldRequest = 1,\n unnecessary = 2,\n}\n\nexport enum HKAuthorizationStatus {\n notDetermined = 0,\n sharingDenied = 1,\n sharingAuthorized = 2,\n}\n\nexport type HKQuantity<TIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier> = UnitForIdentifier<TIdentifier>> = {\n readonly unit: TUnit;\n readonly quantity: number;\n};\n\nexport enum HKBloodType {\n notSet = 0,\n aPositive = 1,\n aNegative = 2,\n bPositive = 3,\n bNegative = 4,\n abPositive = 5,\n abNegative = 6,\n oPositive = 7,\n oNegative = 8,\n}\n\nexport enum HKBiologicalSex {\n notSet = 0,\n female = 1,\n male = 2,\n other = 3,\n}\n\nexport enum HKFitzpatrickSkinType {\n notSet = 0,\n I = 1,\n II = 2,\n III = 3,\n IV = 4,\n V = 5,\n VI = 6,\n}\n\nexport enum HKStatisticsOptions {\n cumulativeSum = 'cumulativeSum',\n discreteAverage = 'discreteAverage',\n discreteMax = 'discreteMax',\n discreteMin = 'discreteMin',\n discreteMostRecent = 'discreteMostRecent',\n duration = 'duration',\n mostRecent = 'mostRecent',\n separateBySource = 'separateBySource',\n}\n\nexport type QueryStatisticsResponseRaw<TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier>> = {\n readonly averageQuantity?: HKQuantity<TIdentifier, TUnit>;\n readonly maximumQuantity?: HKQuantity<TIdentifier, TUnit>;\n readonly minimumQuantity?: HKQuantity<TIdentifier, TUnit>;\n readonly sumQuantity?: HKQuantity<TIdentifier, TUnit>;\n readonly mostRecentQuantity?: HKQuantity<TIdentifier, TUnit>;\n readonly mostRecentQuantityDateInterval?: { readonly from: string; readonly to: string };\n readonly duration?: HKQuantity<HKQuantityTypeIdentifier, TimeUnit>;\n};\n\nexport enum HKCategoryValueCervicalMucusQuality {\n dry = 1,\n sticky = 2,\n creamy = 3,\n watery = 4,\n eggWhite = 5,\n}\n\nexport enum HKCategoryValueMenstrualFlow {\n unspecified = 1,\n none = 5,\n light = 2,\n medium = 3,\n heavy = 4,\n}\n\nexport enum HKCategoryValueOvulationTestResult {\n negative = 1,\n luteinizingHormoneSurge = 2,\n indeterminate = 3,\n estrogenSurge = 4,\n}\n\nexport enum HKCategoryValueSleepAnalysis {\n inBed = 0,\n asleep = 1,\n awake = 2,\n}\n\nexport enum HKCategoryValueAppetiteChanges {\n decreased = 2,\n increased = 3,\n noChange = 1,\n unspecified = 0,\n}\n\nexport enum HKCategoryValuePresence {\n notPresent = 1,\n present = 0,\n}\n\nexport enum HKCategoryValueSeverity {\n notPresent = 1,\n mild = 2,\n moderate = 3,\n severe = 4,\n unspecified = 0,\n}\n\nexport enum HKCategoryValueNotApplicable {\n notApplicable = 0,\n}\n\nexport type HKCategoryValue =\n HKCategoryValueAppetiteChanges | HKCategoryValueCervicalMucusQuality |\n HKCategoryValueLowCardioFitnessEvent | HKCategoryValueMenstrualFlow |\n HKCategoryValueOvulationTestResult | HKCategoryValuePresence |\n HKCategoryValueSeverity | HKCategoryValueSleepAnalysis | number;\n\nexport enum HKInsulinDeliveryReason {\n basal = 1,\n bolus = 2,\n}\n\nexport type MetadataMapperForQuantityIdentifier<\n TQuantityTypeIdentifier = HKQuantityTypeIdentifier\n> = TQuantityTypeIdentifier extends HKQuantityTypeIdentifier.insulinDelivery\n ? HKGenericMetadata & {\n readonly HKInsulinDeliveryReason: HKInsulinDeliveryReason;\n }\n : TQuantityTypeIdentifier extends HKQuantityTypeIdentifier.bloodGlucose\n ? HKGenericMetadata & {\n readonly HKBloodGlucoseMealTime?: number;\n }\n : TQuantityTypeIdentifier extends HKQuantityTypeIdentifier.heartRate\n ? HKGenericMetadata & {\n readonly HKHeartRateMotionContext?: HKHeartRateMotionContext;\n }\n : HKGenericMetadata;\n\nexport type MetadataMapperForCorrelationIdentifier<\n TCorrelationTypeIdentifier = HKCorrelationTypeIdentifier\n> = TCorrelationTypeIdentifier extends HKCorrelationTypeIdentifier.food\n ? HKGenericMetadata & {\n readonly HKFoodType?: string;\n }\n : HKGenericMetadata;\n\nexport type UnitForIdentifier<T extends HKQuantityTypeIdentifier> = T extends HKQuantityTypeIdentifier.bloodGlucose ? BloodGlucoseUnit\n : T extends HKQuantityTypeIdentifier.appleExerciseTime | HKQuantityTypeIdentifier.appleMoveTime | HKQuantityTypeIdentifier.appleStandTime ? TimeUnit\n : T extends HKQuantityTypeIdentifier.activeEnergyBurned | HKQuantityTypeIdentifier.basalEnergyBurned | HKQuantityTypeIdentifier.dietaryEnergyConsumed ? EnergyUnit\n : T extends HKQuantityTypeIdentifier.distanceCycling | HKQuantityTypeIdentifier.distanceDownhillSnowSports | HKQuantityTypeIdentifier.distanceSwimming | HKQuantityTypeIdentifier.distanceWalkingRunning | HKQuantityTypeIdentifier.distanceWheelchair | HKQuantityTypeIdentifier.sixMinuteWalkTestDistance | HKQuantityTypeIdentifier.waistCircumference ? LengthUnit\n : T extends HKQuantityTypeIdentifier.bodyFatPercentage | HKQuantityTypeIdentifier.oxygenSaturation | HKQuantityTypeIdentifier.walkingAsymmetryPercentage | HKQuantityTypeIdentifier.walkingDoubleSupportPercentage ? HKUnits.Percent\n : T extends HKQuantityTypeIdentifier.basalBodyTemperature | HKQuantityTypeIdentifier.basalBodyTemperature ? TemperatureUnit\n : T extends HKQuantityTypeIdentifier.stairAscentSpeed | HKQuantityTypeIdentifier.stairDescentSpeed | HKQuantityTypeIdentifier.walkingSpeed | HKQuantityTypeIdentifier.walkingSpeed ? SpeedUnit<LengthUnit, TimeUnit>\n : T extends HKQuantityTypeIdentifier.flightsClimbed | HKQuantityTypeIdentifier.numberOfAlcoholicBeverages | HKQuantityTypeIdentifier.numberOfTimesFallen | HKQuantityTypeIdentifier.pushCount | HKQuantityTypeIdentifier.stepCount | HKQuantityTypeIdentifier.swimmingStrokeCount ? HKUnits.Count\n : 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\n : T extends HKQuantityTypeIdentifier.dietaryWater ? VolumeUnit\n : T extends HKQuantityTypeIdentifier.insulinDelivery ? HKUnits.InternationalUnit | `${HKUnits.InternationalUnit}`\n : T extends HKQuantityTypeIdentifier.heartRate | HKQuantityTypeIdentifier.restingHeartRate | HKQuantityTypeIdentifier.walkingHeartRateAverage ? CountPerTime<TimeUnit>\n : HKUnit\n\nexport type HKCategoryValueForIdentifier<T extends HKCategoryTypeIdentifier> =\n T extends HKCategoryTypeIdentifier.cervicalMucusQuality\n ? HKCategoryValueCervicalMucusQuality\n : T extends HKCategoryTypeIdentifier.menstrualFlow\n ? HKCategoryValueMenstrualFlow\n : T extends HKCategoryTypeIdentifier.ovulationTestResult\n ? HKCategoryValueOvulationTestResult\n : T extends HKCategoryTypeIdentifier.sleepAnalysis\n ? HKCategoryValueSleepAnalysis\n : T extends (HKCategoryTypeIdentifier.highHeartRateEvent | HKCategoryTypeIdentifier.intermenstrualBleeding\n | HKCategoryTypeIdentifier.mindfulSession | HKCategoryTypeIdentifier.sexualActivity)\n ? HKCategoryValueNotApplicable\n : T extends (HKCategoryTypeIdentifier.abdominalCramps\n | HKCategoryTypeIdentifier.abdominalCramps\n | HKCategoryTypeIdentifier.acne\n | HKCategoryTypeIdentifier.bladderIncontinence\n | HKCategoryTypeIdentifier.bloating| HKCategoryTypeIdentifier.breastPain\n | HKCategoryTypeIdentifier.chestTightnessOrPain| HKCategoryTypeIdentifier.chills| HKCategoryTypeIdentifier.constipation\n | HKCategoryTypeIdentifier.coughing| HKCategoryTypeIdentifier.diarrhea| HKCategoryTypeIdentifier.dizziness| HKCategoryTypeIdentifier.drySkin| HKCategoryTypeIdentifier.fainting\n | HKCategoryTypeIdentifier.fatigue| HKCategoryTypeIdentifier.fever| HKCategoryTypeIdentifier.generalizedBodyAche| HKCategoryTypeIdentifier.hairLoss\n | HKCategoryTypeIdentifier.headache| HKCategoryTypeIdentifier.heartburn\n | HKCategoryTypeIdentifier.hotFlashes| HKCategoryTypeIdentifier.lossOfSmell| HKCategoryTypeIdentifier.lossOfTaste\n | HKCategoryTypeIdentifier.lowerBackPain| HKCategoryTypeIdentifier.memoryLapse| HKCategoryTypeIdentifier.moodChanges\n | HKCategoryTypeIdentifier.nausea| HKCategoryTypeIdentifier.nightSweats| HKCategoryTypeIdentifier.pelvicPain\n | HKCategoryTypeIdentifier.rapidPoundingOrFlutteringHeartbeat| HKCategoryTypeIdentifier.runnyNose\n | HKCategoryTypeIdentifier.shortnessOfBreath| HKCategoryTypeIdentifier.sinusCongestion| HKCategoryTypeIdentifier.skippedHeartbeat\n | HKCategoryTypeIdentifier.soreThroat| HKCategoryTypeIdentifier.vaginalDryness\n | HKCategoryTypeIdentifier.vomiting| HKCategoryTypeIdentifier.wheezing)\n ? HKCategoryValueSeverity\n : T extends (HKCategoryTypeIdentifier.appetiteChanges | HKCategoryTypeIdentifier.sleepChanges)\n ? HKCategoryValuePresence\n : T extends HKCategoryTypeIdentifier.lowCardioFitnessEvent ? HKCategoryValueLowCardioFitnessEvent :\n T extends HKCategoryTypeIdentifier.pregnancyTestResult ? HKCategoryValuePregnancyTestResult :\n T extends HKCategoryTypeIdentifier.pregnancyTestResult ? HKCategoryValuePregnancyTestResult :\n T extends HKCategoryTypeIdentifier.appleStandHour\n ? HKCategoryValueAppleStandHour\n : number;\n\nenum HKCategoryValuePregnancyTestResult {\n positive = 2,\n negative = 1,\n indeterminate = 3\n}\n/* needs further mapping\n\ncontraceptive = 'HKCategoryTypeIdentifierContraceptive',\n lactation = 'HKCategoryTypeIdentifierLactation',\n pregnancy = 'HKCategoryTypeIdentifierPregnancy',\n\n progesteroneTestResult = 'HKCategoryTypeIdentifierProgesteroneTestResult',\n environmentalAudioExposureEvent = 'HKCategoryTypeIdentifierEnvironmentalAudioExposureEvent',\n headphoneAudioExposureEvent = 'HKCategoryTypeIdentifierHeadphoneAudioExposureEvent',\n appleWalkingSteadinessEvent = 'HKCategoryTypeIdentifierAppleWalkingSteadinessEvent',\n handwashingEvent = 'HKCategoryTypeIdentifierHandwashingEvent', // HKCategoryValue */\n\nexport type MetadataMapperForCategoryIdentifier<\n T extends HKCategoryTypeIdentifier\n> = T extends HKCategoryTypeIdentifier.sexualActivity\n ? HKGenericMetadata & {\n readonly HKSexualActivityProtectionUsed: boolean;\n }\n : T extends HKCategoryTypeIdentifier.menstrualFlow\n ? HKGenericMetadata & {\n readonly HKMenstrualCycleStart: boolean;\n }\n : HKGenericMetadata;\n\n// Maps directly to https://developer.apple.com/documentation/healthkit/hkwheelchairuse\nexport enum HKWheelchairUse {\n notSet = 0,\n no = 1,\n yes = 2,\n}\n\n// Unit types are a straight mapping from here https://developer.apple.com/documentation/healthkit/hkunit/1615733-init\nexport enum HKMetricPrefix {\n None = '',\n Pico = 'p',\n Nano = 'n',\n Micro = 'mc',\n Milli = 'm',\n Centi = 'c',\n Deci = 'd',\n Deca = 'da',\n Hecto = 'h',\n Kilo = 'k',\n Mega = 'M',\n Giga = 'G',\n Tera = 'T',\n Femto = 'f',\n}\n\nexport enum HKUnitMetric {\n Gram = 'g',\n Joule = 'J',\n Kelvin = 'K',\n Liter = 'l',\n Meter = 'm',\n Pascal = 'Pa',\n Second = 's',\n Siemen = 'S',\n Hertz = 'Hz',\n Volt = 'V',\n}\n\nexport enum HKUnits {\n\n DecibelHearingLevel = 'dBHL',\n DecibelSoundPressureLevel = 'dBASPL',\n\n Percent = '%',\n Count = 'count',\n InternationalUnit = 'IU',\n\n}\n\nexport type MeterUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Meter}`;\nexport type LiterUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Liter}`;\nexport type GramUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Gram}`;\nexport type PascalUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Pascal}`;\nexport type SecondUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Second}`;\nexport type JouleUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Joule}`;\nexport type HertzUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Hertz}`;\nexport type VoltUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Volt}`;\nexport type SiemenUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Siemen}`;\n\n// not 100% sure about these\nexport type MoleUnit<MolarMass extends number> =`mol<${MolarMass}>`;\nexport type MoleUnitWith<MolarMass extends number, Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}mol<${MolarMass}>`;\n\nexport type FrequencyUnit = HertzUnit<HKMetricPrefix>\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'cm', 'km'\n */\nexport enum UnitOfLength {\n Feet = 'ft',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'cm', 'km'\n */\n Meter = 'm',\n Inches = 'in',\n Yards = 'yd',\n Miles = 'mi',\n}\nexport type LengthUnit = MeterUnit<HKMetricPrefix> | UnitOfLength\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'ml', 'cl'\n */\nexport enum UnitOfVolume {\n ImperialCup = 'cup_imp',\n ImperialFluidOunces = 'fl_oz_imp',\n ImperialPint = 'pt_imp',\n USCup = 'cup_us',\n USFluidOunces = 'fl_oz_us',\n USPint = 'pt_us',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'ml', 'cl'\n */\n Liter = 'l',\n}\nexport type VolumeUnit = LiterUnit<HKMetricPrefix> | UnitOfVolume;\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'mg', 'kg'\n */\nexport enum UnitOfMass {\n Ounces = 'oz',\n Stones = 'st',\n Pounds = 'lb',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'mg', 'kg'\n */\n Gram = 'g'\n}\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'mg', 'kg'\n */\nexport type MassUnit = GramUnit<HKMetricPrefix> | UnitOfMass\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'kPa', 'hPa'\n */\nexport enum UnitOfPressure {\n Atmospheres = 'atm',\n CentimetersOfWater = 'cmAq',\n MillimetersOfMercury = 'mmHg',\n InchesOfMercury = 'inHg',\n DecibelAWeightedSoundPressureLevel = 'dBASPL',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'kPa', 'hPa'\n */\n Pascals = 'Pa',\n}\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'kPa', 'hPa'\n */\nexport type PressureUnit = PascalUnit<HKMetricPrefix> | UnitOfPressure;\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'ms'\n */\nexport enum UnitOfTime {\n Days = 'd',\n Minutes = 'min',\n Hours = 'hr',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'ms'\n */\n Seconds = 's',\n}\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'ms'\n */\nexport type TimeUnit = SecondUnit<HKMetricPrefix> | UnitOfTime\nexport enum TemperatureUnit {\n DegreesCelsius = 'degC',\n DegreesFahrenheit = 'degF',\n Kelvin = 'K',\n}\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'kJ'\n */\nexport enum UnitOfEnergy {\n Kilocalories = 'kcal',\n LargeCalories = 'Cal',\n SmallCalories = 'cal',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'kJ'\n */\n Joules = 'J',\n}\nexport type EnergyUnit = JouleUnit<HKMetricPrefix> | UnitOfEnergy\nexport enum BloodGlucoseUnit {\n GlucoseMmolPerL = 'mmol<180.15588000005408>/l',\n GlucoseMgPerDl = 'mg/dL',\n}\n\nexport type SpeedUnit<TLength extends LengthUnit, TTime extends TimeUnit> =`${TLength}/${TTime}`;\nexport type CountPerTime<TTime extends TimeUnit> =`count/${TTime}`;\n\nexport type HKUnit = BloodGlucoseUnit | CountPerTime<TimeUnit> | EnergyUnit | FrequencyUnit | HKUnits | LengthUnit | MassUnit | PressureUnit | SpeedUnit<LengthUnit, TimeUnit> | TemperatureUnit | TimeUnit | VolumeUnit\n| `${BloodGlucoseUnit}` | `${EnergyUnit}` | `${FrequencyUnit}` | `${HKUnits}` | `${LengthUnit}` | `${MassUnit}` | `${PressureUnit}` | `${TemperatureUnit}` | `${TimeUnit}` | `${VolumeUnit}`;\n\nexport type HKDevice = {\n readonly name: string; // ex: \"Apple Watch\"\n readonly firmwareVersion: string | null;\n readonly hardwareVersion: string; // ex: \"Watch6,2\",\n readonly localIdentifier: string | null;\n readonly manufacturer: string; // ex: \"Apple Inc.\"\n readonly model: string; // ex: \"Watch\"\n readonly softwareVersion: string; // ex: \"9.0\"\n};\n\nexport type HKSource = {\n readonly name: string;\n readonly bundleIdentifier: string;\n};\n\nexport type HKSourceRevision = {\n readonly source: HKSource;\n readonly version: string;\n readonly operatingSystemVersion?: string;\n readonly productType?: string;\n};\n\nexport type HKQuantitySampleRaw<\n TQuantityIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier,\n TUnit extends UnitForIdentifier<TQuantityIdentifier> = UnitForIdentifier<TQuantityIdentifier>,\n> = {\n readonly uuid: string;\n readonly device?: HKDevice;\n readonly quantityType: TQuantityIdentifier;\n readonly startDate: string;\n readonly endDate: string;\n readonly quantity: number;\n readonly unit: TUnit;\n readonly metadata: MetadataMapperForQuantityIdentifier<TQuantityIdentifier>;\n readonly sourceRevision?: HKSourceRevision;\n};\n\nexport type HKQuantitySampleRawForSaving<\n TQuantityIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier,\n TUnit extends UnitForIdentifier<TQuantityIdentifier> = UnitForIdentifier<TQuantityIdentifier>,\n> = Omit<\nHKQuantitySampleRaw<TQuantityIdentifier, TUnit>,\n'device' | 'endDate' | 'startDate' | 'uuid'\n>\n\nexport type HKCategorySampleRawForSaving<\n TCategory extends HKCategoryTypeIdentifier = HKCategoryTypeIdentifier,\n> = Omit<\nHKCategorySampleRaw<TCategory>,\n'device' | 'endDate' | 'startDate' | 'uuid'\n>\n\nexport type HKWorkoutRaw<TEnergy extends EnergyUnit, TDistance extends LengthUnit> = {\n readonly uuid: string;\n readonly device?: HKDevice;\n readonly workoutActivityType: HKWorkoutActivityType;\n readonly duration: number;\n readonly totalDistance?: HKQuantity<HKQuantityTypeIdentifier, TDistance>;\n readonly totalEnergyBurned?: HKQuantity<HKQuantityTypeIdentifier, TEnergy>;\n readonly totalSwimmingStrokeCount?: HKQuantity<HKQuantityTypeIdentifier, HKUnits.Count>;\n readonly totalFlightsClimbed?: HKQuantity<HKQuantityTypeIdentifier, HKUnits.Count>;\n readonly startDate: string;\n readonly endDate: string;\n readonly metadata?: HKWorkoutMetadata;\n readonly sourceRevision?: HKSourceRevision;\n};\n\n// Straight mapping to https://developer.apple.com/documentation/healthkit/hkcharacteristictypeidentifier\nexport enum HKCharacteristicTypeIdentifier {\n fitzpatrickSkinType = 'HKCharacteristicTypeIdentifierFitzpatrickSkinType',\n biologicalSex = 'HKCharacteristicTypeIdentifierBiologicalSex',\n bloodType = 'HKCharacteristicTypeIdentifierBloodType',\n dateOfBirth = 'HKCharacteristicTypeIdentifierDateOfBirth',\n wheelchairUse = 'HKCharacteristicTypeIdentifierWheelchairUse',\n activityMoveMode = 'HKCharacteristicTypeIdentifierActivityMoveMode', // HKActivityMoveModeObject\n}\n\nexport type WritePermissions = {\n readonly [key in HKCategoryTypeIdentifier | HKCharacteristicTypeIdentifier | HKQuantityTypeIdentifier]: boolean;\n};\n\nexport type ReadPermissions = {\n readonly [key in HKCategoryTypeIdentifier | HKCharacteristicTypeIdentifier | HKQuantityTypeIdentifier]: boolean;\n};\n\nexport type HKCategorySampleRaw<\n T extends HKCategoryTypeIdentifier = HKCategoryTypeIdentifier\n> = {\n readonly uuid: string;\n readonly device?: HKDevice;\n readonly categoryType: T;\n readonly startDate: string;\n readonly endDate: string;\n readonly value: HKCategoryValueForIdentifier<T>;\n readonly metadata: MetadataMapperForCategoryIdentifier<T>;\n readonly sourceRevision?: HKSourceRevision;\n};\n\nexport type HKCorrelationRaw<TIdentifier extends HKCorrelationTypeIdentifier> =\n {\n readonly correlationType: HKCorrelationTypeIdentifier;\n readonly objects: readonly (HKCategorySampleRaw | HKQuantitySampleRaw)[];\n readonly metadata: MetadataMapperForCorrelationIdentifier<TIdentifier>;\n readonly startDate: string;\n readonly endDate: string;\n };\n\ntype QueryId = string;\n\nexport enum HKUpdateFrequency {\n immediate = 1,\n hourly = 2,\n daily = 3,\n weekly = 4,\n}\n\nexport type WorkoutLocation = {\n readonly longitude: number;\n readonly latitude: number;\n readonly altitude: number;\n readonly speed: number;\n readonly timestamp: number;\n readonly horizontalAccuracy: number;\n readonly speedAccuracy: number;\n readonly verticalAccuracy: number;\n};\n\nexport type WorkoutRoute = {\n readonly locations: readonly WorkoutLocation[];\n readonly HKMetadataKeySyncIdentifier?: string;\n readonly HKMetadataKeySyncVersion?: number;\n};\n\ntype ReactNativeHealthkitTypeNative = {\n isHealthDataAvailable(): Promise<boolean>;\n getBloodType(): Promise<HKBloodType>;\n getDateOfBirth(): Promise<string>;\n getBiologicalSex(): Promise<HKBiologicalSex>;\n getFitzpatrickSkinType(): Promise<HKFitzpatrickSkinType>;\n readonly getWheelchairUse: () => Promise<HKWheelchairUse>;\n\n readonly enableBackgroundDelivery: (\n typeIdentifier: HKSampleTypeIdentifier,\n updateFrequency: HKUpdateFrequency\n ) => Promise<boolean>;\n readonly disableBackgroundDelivery: (\n typeIdentifier: HKSampleTypeIdentifier,\n ) => Promise<boolean>;\n readonly disableAllBackgroundDelivery: () => Promise<boolean>;\n\n readonly saveCorrelationSample: <TIdentifier extends HKCorrelationTypeIdentifier, TSamples extends readonly (HKCategorySampleRawForSaving | HKQuantitySampleRawForSaving)[]>(\n typeIdentifier: TIdentifier,\n samples: TSamples,\n start: string,\n end: string,\n metadata: MetadataMapperForCorrelationIdentifier<TIdentifier>\n ) => Promise<boolean>;\n\n readonly saveWorkoutSample: (\n typeIdentifier: HKWorkoutActivityType,\n quantities: readonly HKQuantitySampleRawForSaving[],\n start: string,\n end: string,\n metadata: HKWorkoutMetadata\n ) => Promise<boolean>;\n\n readonly queryCorrelationSamples: <TIdentifier extends HKCorrelationTypeIdentifier>(\n typeIdentifier: TIdentifier,\n from: string,\n to: string\n ) => Promise<readonly HKCorrelationRaw<TIdentifier>[]>;\n\n subscribeToObserverQuery(\n identifier: HKSampleTypeIdentifier\n ): Promise<QueryId>;\n unsubscribeQuery(queryId: QueryId): Promise<boolean>;\n authorizationStatusFor(\n type: HealthkitReadAuthorization\n ): Promise<boolean>;\n getRequestStatusForAuthorization(\n write: WritePermissions,\n read: ReadPermissions\n ): Promise<HKAuthorizationRequestStatus>;\n requestAuthorization(\n write: WritePermissions,\n read: ReadPermissions\n ): Promise<boolean>;\n readonly saveQuantitySample: <TType extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TType> = UnitForIdentifier<TType>> (\n identifier: TType,\n unit: TUnit,\n value: number,\n start: string,\n end: string,\n metadata: unknown\n ) => Promise<boolean>;\n readonly queryWorkoutSamples: <TEnergy extends EnergyUnit, TDistance extends LengthUnit>(\n energyUnit: TEnergy,\n distanceUnit: TDistance,\n from: string,\n to: string,\n limit: number,\n ascending: boolean\n ) => Promise<readonly HKWorkoutRaw<TEnergy, TDistance>[]>;\n readonly queryCategorySamples: <T extends HKCategoryTypeIdentifier>(\n identifier: T,\n from: string,\n to: string,\n limit: number,\n ascending: boolean\n ) => Promise<readonly HKCategorySampleRaw<T>[]>;\n readonly queryQuantitySamples: <\n TIdentifier extends HKQuantityTypeIdentifier,\n TUnit extends UnitForIdentifier<TIdentifier>,\n >(\n identifier: TIdentifier,\n unit: TUnit,\n from: string,\n to: string,\n limit: number,\n ascending: boolean\n ) => Promise<readonly HKQuantitySampleRaw<TIdentifier, TUnit>[]>;\n readonly saveCategorySample: <T extends HKCategoryTypeIdentifier>(\n identifier: T,\n value: HKCategoryValueForIdentifier<T>,\n start: string,\n end: string,\n metadata: unknown\n ) => Promise<boolean>;\n readonly queryStatisticsForQuantity: <TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier>>(\n identifier: HKQuantityTypeIdentifier,\n unit: TUnit,\n from: string,\n to: string,\n options: readonly HKStatisticsOptions[]\n ) => Promise<QueryStatisticsResponseRaw<TIdentifier, TUnit>>;\n readonly getPreferredUnits: (\n identifiers: readonly HKQuantityTypeIdentifier[]\n ) => Promise<TypeToUnitMapping>;\n readonly getWorkoutRoutes: (workoutUUID: string) => Promise<readonly WorkoutRoute[]>;\n};\n\nconst Native = NativeModules.ReactNativeHealthkit as ReactNativeHealthkitTypeNative\n\ntype OnChangeCallback = ({\n typeIdentifier,\n}: {\n readonly typeIdentifier: HKSampleTypeIdentifier;\n}) => void;\n\ninterface HealthkitEventEmitter extends NativeEventEmitter {\n readonly addListener: (\n eventType: 'onChange',\n callback: OnChangeCallback\n ) => EmitterSubscription;\n}\n\nexport const EventEmitter = new NativeEventEmitter(\n NativeModules.ReactNativeHealthkit,\n) as HealthkitEventEmitter\n\nexport default Native\n"],"mappings":"AAAA,SACEA,kBADF,EAEEC,aAFF,QAGO,cAHP;AAOA,OAAO,MAAMC,uBAAuB,GAAG,yBAAhC;AACP,OAAO,MAAMC,yBAAyB,GAAG,2BAAlC;AACP,OAAO,MAAMC,4BAA4B,GAAG,8BAArC;AACP,OAAO,MAAMC,mCAAmC,GAAG,qCAA5C,C,CAEP;;AACA,WAAYC,wBAAZ;;WAAYA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAA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YC,eAAZ;AAMA;AACA;AACA;AACA;;WATYA,e;EAAAA,e;EAAAA,e;EAAAA,e;GAAAA,e,KAAAA,e;;AAUZ,WAAYC,YAAZ;;WAAYA,Y;EAAAA,Y;EAAAA,Y;EAAAA,Y;EAAAA,Y;GAAAA,Y,KAAAA,Y;;AAWZ,WAAYC,gBAAZ;;WAAYA,gB;EAAAA,gB;EAAAA,gB;GAAAA,gB,KAAAA,gB;;AA8EZ;AACA,WAAYC,8BAAZ;;WAAYA,8B;EAAAA,8B;EAAAA,8B;EAAAA,8B;EAAAA,8B;EAAAA,8B;EAAAA,8B;GAAAA,8B,KAAAA,8B;;AAyCZ,WAAYC,iBAAZ;;WAAYA,iB;EAAAA,iB,CAAAA,iB;EAAAA,iB,CAAAA,iB;EAAAA,iB,CAAAA,iB;EAAAA,iB,CAAAA,iB;GAAAA,iB,KAAAA,iB;;AAoIZ,MAAMC,MAAM,GAAG5C,aAAa,CAAC6C,oBAA7B;AAeA,OAAO,MAAMC,YAAY,GAAG,IAAI/C,kBAAJ,CAC1BC,aAAa,CAAC6C,oBADY,CAArB;AAIP,eAAeD,MAAf"}
@@ -1,2 +1,17 @@
1
+ export * from './native-types';
2
+ /*
3
+ export type SubscribeToChangesHook = <
4
+ TIdentifier extends HKSampleTypeIdentifier
5
+ >(
6
+ identifier: TIdentifier,
7
+ onChange: () => void,
8
+ runInitialUpdate?: boolean
9
+ ) => void;
10
+
11
+ export type GetWorkoutRoutesFn = (
12
+ workoutUUID: string
13
+ ) => Promise<readonly WorkoutRoute[]>;
14
+ */
15
+
1
16
  export {};
2
17
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {\n HealthkitReadAuthorization,\n HealthkitWriteAuthorization,\n HKAuthorizationRequestStatus,\n HKBiologicalSex,\n HKBloodType,\n HKCategorySampleRaw,\n HKCategoryTypeIdentifier,\n HKCategoryValueForIdentifier,\n HKCorrelationRaw,\n HKCorrelationTypeIdentifier,\n HKFitzpatrickSkinType,\n HKQuantitySampleRaw,\n HKQuantityTypeIdentifier,\n HKSampleTypeIdentifier,\n HKStatisticsOptions,\n HKUnit,\n HKUnitSI,\n HKUnitSIPrefix,\n HKUpdateFrequency,\n HKWheelchairUse,\n HKWorkoutActivityType,\n HKWorkoutMetadata,\n HKWorkoutRaw,\n MetadataMapperForCategoryIdentifier,\n MetadataMapperForCorrelationIdentifier,\n MetadataMapperForQuantityIdentifier,\n QueryStatisticsResponseRaw,\n WorkoutRoute,\n} from './native-types'\n\nexport interface QueryWorkoutsOptions<\n TEnergy extends HKUnit,\n TDistance extends HKUnit\n> extends GenericQueryOptions {\n readonly energyUnit?: TEnergy;\n readonly distanceUnit?: TDistance;\n}\n\nexport interface HKCategorySample<\n T extends HKCategoryTypeIdentifier = HKCategoryTypeIdentifier\n> extends Omit<HKCategorySampleRaw<T>, 'endDate' | 'startDate'> {\n readonly startDate: Date;\n readonly endDate: Date;\n}\n\nexport type GenericQueryOptions = {\n readonly from?: Date;\n readonly to?: Date;\n readonly limit?: number;\n readonly ascending?: boolean;\n};\n\nexport interface HKWorkout<\n TEnergy extends HKUnit = HKUnit,\n TDistance extends HKUnit = HKUnit\n> extends Omit<HKWorkoutRaw<TEnergy, TDistance>, 'endDate' | 'startDate'> {\n readonly startDate: Date;\n readonly endDate: Date;\n}\n\nexport interface HKQuantitySample<\n TIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier,\n TUnit extends HKUnit = HKUnit\n> extends Omit<\n HKQuantitySampleRaw<TIdentifier, TUnit>,\n 'endDate' | 'startDate'\n > {\n readonly startDate: Date;\n readonly endDate: Date;\n}\n\nexport interface QueryStatisticsResponse<T extends HKUnit = HKUnit>\n extends Omit<\n QueryStatisticsResponseRaw<T>,\n 'mostRecentQuantityDateInterval'\n > {\n readonly mostRecentQuantityDateInterval?: { readonly from: Date; readonly to: Date };\n}\n\ntype UnsubscribeFunction = () => Promise<boolean>;\n\nexport type IsHealthDataAvailableFn = () => Promise<boolean>;\n\nexport type GetBloodTypeFn = () => Promise<HKBloodType>;\n\nexport type GetDateOfBirthFn = () => Promise<Date>;\nexport type GetBiologicalSexFn = () => Promise<HKBiologicalSex>;\nexport type GetWheelchairUseFn = () => Promise<HKWheelchairUse>;\nexport type GetFitzpatrickSkinTypeFn = () => Promise<HKFitzpatrickSkinType>;\n\nexport type QueryStatisticsForQuantityFn = <TUnit extends HKUnit>(\n identifier: HKQuantityTypeIdentifier,\n options: readonly HKStatisticsOptions[],\n from: Date,\n to?: Date,\n unit?: TUnit\n) => Promise<QueryStatisticsResponse<TUnit>>;\n\nexport type QueryWorkoutsFn = <\n TEnergy extends HKUnit,\n TDistance extends HKUnit\n>(\n options: QueryWorkoutsOptions<TEnergy, TDistance>\n) => Promise<readonly HKWorkout<TEnergy, TDistance>[]>;\n\nexport type AuthorizationStatusForFn = (\n type: HealthkitReadAuthorization\n) => Promise<boolean>;\n\nexport type QueryCategorySamplesFn = <T extends HKCategoryTypeIdentifier>(\n identifier: T,\n options: GenericQueryOptions\n) => Promise<readonly HKCategorySample<T>[]>;\n\nexport type GetRequestStatusForAuthorizationFn = (\n read: readonly HealthkitReadAuthorization[],\n write?: readonly HealthkitWriteAuthorization[]\n) => Promise<HKAuthorizationRequestStatus>;\n\nexport type RequestAuthorizationFn = (\n read: readonly HealthkitReadAuthorization[],\n write?: readonly HealthkitWriteAuthorization[]\n) => Promise<boolean>;\n\nexport type SaveQuantitySampleFn = <TUnit extends HKQuantityTypeIdentifier>(\n identifier: TUnit,\n unit: HKUnit,\n value: number,\n options?: {\n readonly start?: Date;\n readonly end?: Date;\n readonly metadata?: MetadataMapperForQuantityIdentifier<TUnit>;\n }\n) => Promise<boolean>;\n\nexport type QueryQuantitySamplesFn = <\n TIdentifier extends HKQuantityTypeIdentifier,\n TUnit extends HKUnit = HKUnit\n>(\n identifier: TIdentifier,\n options: GenericQueryOptions & { readonly unit?: TUnit }\n) => Promise<readonly HKQuantitySample<TIdentifier, TUnit>[]>;\n\nexport type SubscribeToChangesFn = (\n identifier: HKSampleTypeIdentifier,\n callback: () => void\n) => Promise<UnsubscribeFunction>;\n\nexport type SaveCategorySampleFn = <T extends HKCategoryTypeIdentifier>(\n identifier: T,\n value: HKCategoryValueForIdentifier<T>,\n options?: {\n readonly start?: Date;\n readonly end?: Date;\n readonly metadata?: MetadataMapperForCategoryIdentifier<T>;\n }\n) => Promise<boolean>;\n\nexport type GetMostRecentCategorySampleFn = <\n T extends HKCategoryTypeIdentifier\n>(\n identifier: T\n) => Promise<HKCategorySample<T> | null>;\n\nexport type MostRecentCategorySampleHook = <T extends HKCategoryTypeIdentifier>(\n identifier: T\n) => HKCategorySample<T> | null;\n\nexport type MostRecentCorrelationSampleHook = <\n T extends HKCorrelationTypeIdentifier\n>(\n identifer: T\n) => HKCorrelation<T> | null;\n\nexport type GetMostRecentQuantitySampleFn = <\n TIdentifier extends HKQuantityTypeIdentifier,\n TUnit extends HKUnit\n>(\n identifier: TIdentifier,\n unit?: TUnit\n) => Promise<HKQuantitySample<TIdentifier, TUnit> | null>;\n\nexport type MostRecentQuantitySampleHook = <\n TIdentifier extends HKQuantityTypeIdentifier,\n TUnit extends HKUnit\n>(\n identifier: TIdentifier,\n unit?: TUnit\n) => HKQuantitySample<TIdentifier, TUnit> | null;\n\nexport type GetMostRecentWorkoutFn = <\n TEnergy extends HKUnit,\n TDistance extends HKUnit\n>(\n options?: Pick<\n QueryWorkoutsOptions<TEnergy, TDistance>,\n 'distanceUnit' | 'energyUnit'\n >\n) => Promise<HKWorkout<TEnergy, TDistance> | null>;\n\nexport type MostRecentWorkoutHook = <\n TEnergy extends HKUnit,\n TDistance extends HKUnit\n>(\n options?: Pick<\n QueryWorkoutsOptions<TEnergy, TDistance>,\n 'distanceUnit' | 'energyUnit'\n >\n) => HKWorkout<TEnergy, TDistance> | null;\n\nexport type GetPreferredUnitsFn = (\n identifiers: readonly HKQuantityTypeIdentifier[]\n) => Promise<readonly HKUnit[]>;\n\nexport type GetPreferredUnitFn = (\n identifier: HKQuantityTypeIdentifier\n) => Promise<HKUnit>;\n\nexport type SaveCorrelationSampleFn = <\n TIdentifier extends HKCorrelationTypeIdentifier\n>(\n typeIdentifier: TIdentifier,\n samples: readonly (\n | Omit<HKCategorySample, 'device' | 'endDate' | 'startDate' | 'uuid'>\n | Omit<HKQuantitySample, 'device' | 'endDate' | 'startDate' | 'uuid'>\n )[],\n options?: {\n readonly start?: Date;\n readonly end?: Date;\n readonly metadata?: MetadataMapperForCorrelationIdentifier<TIdentifier>;\n }\n) => Promise<boolean>;\n\nexport type SaveWorkoutSampleFn = (\n typeIdentifier: HKWorkoutActivityType,\n quantities: readonly Omit<\n HKQuantitySample,\n 'device' | 'endDate' | 'startDate' | 'uuid'\n >[],\n start: Date,\n options?: {\n readonly end?: Date;\n readonly metadata?: HKWorkoutMetadata;\n }\n) => Promise<boolean>;\n\nexport interface HKCorrelation<TIdentifier extends HKCorrelationTypeIdentifier>\n extends Omit<\n HKCorrelationRaw<TIdentifier>,\n 'endDate' | 'objects' | 'startDate'\n > {\n readonly objects: readonly (HKCategorySample | HKQuantitySample)[];\n readonly startDate: Date;\n readonly endDate: Date;\n}\n\nexport type QueryCorrelationSamplesFn = <\n TIdentifier extends HKCorrelationTypeIdentifier\n>(\n typeIdentifier: TIdentifier,\n options: Omit<GenericQueryOptions, 'ascending' | 'limit'>\n) => Promise<readonly HKCorrelation<TIdentifier>[]>;\n\nexport type SubscribeToChangesHook = <\n TIdentifier extends HKSampleTypeIdentifier\n>(\n identifier: TIdentifier,\n onChange: () => void,\n runInitialUpdate?: boolean\n) => void;\n\nexport type GetWorkoutRoutesFn = (\n workoutUUID: string\n) => Promise<readonly WorkoutRoute[]>;\n\nexport type ReactNativeHealthkit = {\n readonly authorizationStatusFor: AuthorizationStatusForFn;\n\n readonly getBiologicalSex: GetBiologicalSexFn;\n readonly getBloodType: GetBloodTypeFn;\n readonly getDateOfBirth: GetDateOfBirthFn;\n readonly getFitzpatrickSkinType: GetFitzpatrickSkinTypeFn;\n readonly getMostRecentQuantitySample: GetMostRecentQuantitySampleFn;\n readonly getMostRecentCategorySample: GetMostRecentCategorySampleFn;\n readonly getMostRecentWorkout: GetMostRecentWorkoutFn;\n readonly getPreferredUnit: GetPreferredUnitFn;\n readonly getPreferredUnits: GetPreferredUnitsFn;\n readonly getRequestStatusForAuthorization: GetRequestStatusForAuthorizationFn;\n readonly getWheelchairUse: GetWheelchairUseFn;\n readonly getWorkoutRoutes: GetWorkoutRoutesFn;\n\n readonly buildUnitWithPrefix: (prefix: HKUnitSIPrefix, unit: HKUnitSI) => HKUnit;\n\n readonly isHealthDataAvailable: IsHealthDataAvailableFn;\n\n readonly queryCategorySamples: QueryCategorySamplesFn;\n readonly queryQuantitySamples: QueryQuantitySamplesFn;\n readonly queryStatisticsForQuantity: QueryStatisticsForQuantityFn;\n readonly queryWorkouts: QueryWorkoutsFn;\n readonly queryCorrelationSamples: QueryCorrelationSamplesFn;\n\n readonly requestAuthorization: RequestAuthorizationFn;\n\n readonly saveCategorySample: SaveCategorySampleFn;\n readonly saveQuantitySample: SaveQuantitySampleFn;\n readonly saveCorrelationSample: SaveCorrelationSampleFn;\n readonly saveWorkoutSample: SaveWorkoutSampleFn;\n readonly enableBackgroundDelivery: (\n typeIdentifier: HKSampleTypeIdentifier,\n updateFrequency: HKUpdateFrequency\n ) => Promise<boolean>;\n readonly disableBackgroundDelivery: (\n typeIdentifier: HKSampleTypeIdentifier\n ) => Promise<boolean>;\n readonly disableAllBackgroundDelivery: () => Promise<boolean>;\n\n readonly subscribeToChanges: SubscribeToChangesFn;\n\n readonly useMostRecentWorkout: MostRecentWorkoutHook;\n readonly useMostRecentCategorySample: MostRecentCategorySampleHook;\n readonly useMostRecentQuantitySample: MostRecentQuantitySampleHook;\n\n readonly useSubscribeToChanges: SubscribeToChangesHook;\n readonly useIsHealthDataAvailable: () => boolean | null;\n readonly useHealthkitAuthorization: (\n read: readonly HealthkitReadAuthorization[],\n write?: readonly HealthkitWriteAuthorization[],\n ) => readonly [authorizationStatus: HKAuthorizationRequestStatus | null, request: () => Promise<HKAuthorizationRequestStatus | null>];\n};\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {\n EnergyUnit,\n HKCategorySampleRaw,\n HKCategoryTypeIdentifier,\n HKCorrelationRaw,\n HKCorrelationTypeIdentifier,\n HKDevice,\n HKQuantityTypeIdentifier,\n HKSourceRevision,\n HKUnit,\n HKWorkoutRaw,\n LengthUnit,\n MetadataMapperForQuantityIdentifier,\n QueryStatisticsResponseRaw,\n UnitForIdentifier,\n} from './native-types'\n\nexport * from './native-types'\n\nexport interface QueryWorkoutsOptions<\n TEnergy extends HKUnit,\n TDistance extends HKUnit\n> extends GenericQueryOptions {\n readonly energyUnit?: TEnergy;\n readonly distanceUnit?: TDistance;\n}\n\nexport interface HKCategorySample<\n T extends HKCategoryTypeIdentifier = HKCategoryTypeIdentifier\n> extends Omit<HKCategorySampleRaw<T>, 'endDate' | 'startDate'> {\n readonly startDate: Date;\n readonly endDate: Date;\n}\n\nexport type GenericQueryOptions = {\n readonly from?: Date;\n readonly to?: Date;\n readonly limit?: number;\n readonly ascending?: boolean;\n};\n\nexport interface HKWorkout<\n TEnergy extends EnergyUnit = EnergyUnit,\n TDistance extends LengthUnit = LengthUnit\n> extends Omit<HKWorkoutRaw<TEnergy, TDistance>, 'endDate' | 'startDate'> {\n readonly startDate: Date;\n readonly endDate: Date;\n}\n\nexport interface HKQuantitySample<\n TIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier,\n TUnit extends UnitForIdentifier<TIdentifier> = UnitForIdentifier<TIdentifier>\n> {\n readonly uuid: string;\n readonly device?: HKDevice;\n readonly quantityType: TIdentifier;\n readonly quantity: number;\n readonly unit: TUnit;\n readonly metadata?: MetadataMapperForQuantityIdentifier<TIdentifier>;\n readonly sourceRevision?: HKSourceRevision;\n readonly startDate: Date;\n readonly endDate: Date;\n}\n\nexport interface QueryStatisticsResponse<TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier> = UnitForIdentifier<TIdentifier>>\n extends Omit<\n QueryStatisticsResponseRaw<TIdentifier, TUnit>,\n 'mostRecentQuantityDateInterval'\n > {\n readonly mostRecentQuantityDateInterval?: { readonly from: Date; readonly to: Date };\n}\n/*\nexport type IsHealthDataAvailableFn = () => Promise<boolean>;\n\nexport type GetBloodTypeFn = () => Promise<HKBloodType>;\n\nexport type GetDateOfBirthFn = () => Promise<Date>;\nexport type GetBiologicalSexFn = () => Promise<HKBiologicalSex>;\nexport type GetWheelchairUseFn = () => Promise<HKWheelchairUse>;\nexport type GetFitzpatrickSkinTypeFn = () => Promise<HKFitzpatrickSkinType>;\n\nexport type AuthorizationStatusForFn = (\n type: HealthkitReadAuthorization\n) => Promise<boolean>;\n\nexport type QueryCategorySamplesFn = <T extends HKCategoryTypeIdentifier>(\n identifier: T,\n options: GenericQueryOptions\n) => Promise<readonly HKCategorySample<T>[]>;\n\nexport type GetRequestStatusForAuthorizationFn = (\n read: readonly HealthkitReadAuthorization[],\n write?: readonly HealthkitWriteAuthorization[]\n) => Promise<HKAuthorizationRequestStatus>;\n\nexport type RequestAuthorizationFn = (\n read: readonly HealthkitReadAuthorization[],\n write?: readonly HealthkitWriteAuthorization[]\n) => Promise<boolean>;\n\nexport type SaveQuantitySampleFn = <TType extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TType>>(\n identifier: TType,\n unit: TUnit,\n value: number,\n options?: {\n readonly start?: Date;\n readonly end?: Date;\n readonly metadata?: MetadataMapperForQuantityIdentifier<TType>;\n }\n) => Promise<boolean>;\n\nexport type QueryQuantitySamplesFn = <\n TIdentifier extends HKQuantityTypeIdentifier,\n TUnit extends UnitForIdentifier<TIdentifier>\n>(\n identifier: TIdentifier,\n options: GenericQueryOptions & { readonly unit?: TUnit }\n) => Promise<readonly HKQuantitySample<TIdentifier>[]>; */\n\nexport type HKCategorySampleForSaving =Omit<HKCategorySample, 'device' | 'endDate' | 'startDate' | 'uuid'>\n\nexport type HKQuantitySampleForSaving =Omit<HKQuantitySample, 'device' | 'endDate' | 'startDate' | 'uuid'>\n/*\nexport type SaveCategorySampleFn = <T extends HKCategoryTypeIdentifier>(\n identifier: T,\n value: HKCategoryValueForIdentifier<T>,\n options?: {\n readonly start?: Date;\n readonly end?: Date;\n readonly metadata?: MetadataMapperForCategoryIdentifier<T>;\n }\n) => Promise<boolean>;\n\nexport type MostRecentCategorySampleHook = <T extends HKCategoryTypeIdentifier>(\n identifier: T\n) => HKCategorySample<T> | null;\n\nexport type MostRecentCorrelationSampleHook = <\n T extends HKCorrelationTypeIdentifier\n>(\n identifer: T\n) => HKCorrelation<T> | null;\n\nexport type MostRecentQuantitySampleHook = <\n TIdentifier extends HKQuantityTypeIdentifier,\n TUnit extends UnitForIdentifier<TIdentifier>\n>(\n identifier: TIdentifier,\n unit?: TUnit\n) => HKQuantitySample<TIdentifier> | null;\n\nexport type MostRecentWorkoutHook = <\n TEnergy extends EnergyUnit,\n TDistance extends LengthUnit\n>(\n options?: Pick<\n QueryWorkoutsOptions<TEnergy, TDistance>,\n 'distanceUnit' | 'energyUnit'\n >\n) => HKWorkout<TEnergy, TDistance> | null;\n\nexport type GetPreferredUnitsFn = (\n identifiers: readonly HKQuantityTypeIdentifier[]\n) => Promise<readonly HKUnit[]>;\n\nexport type GetPreferredUnitFn = (\n identifier: HKQuantityTypeIdentifier\n) => Promise<HKUnit>;\n\nexport type SaveCorrelationSampleFn = <\n TIdentifier extends HKCorrelationTypeIdentifier\n>(\n typeIdentifier: TIdentifier,\n samples: readonly (\n | Omit<HKCategorySample, 'device' | 'endDate' | 'startDate' | 'uuid'>\n | Omit<HKQuantitySample<HKQuantityTypeIdentifier>, 'device' | 'endDate' | 'startDate' | 'uuid'>\n )[],\n options?: {\n readonly start?: Date;\n readonly end?: Date;\n readonly metadata?: MetadataMapperForCorrelationIdentifier<TIdentifier>;\n }\n) => Promise<boolean>;\n\nexport type SaveWorkoutSampleFn<TIdentifier extends HKWorkoutActivityType, TQIdentifier extends HKQuantityTypeIdentifier> = (\n typeIdentifier: TIdentifier,\n quantities: readonly Omit<\n HKQuantitySample<TQIdentifier>,\n 'device' | 'endDate' | 'startDate' | 'uuid'\n >[],\n start: Date,\n options?: {\n readonly end?: Date;\n readonly metadata?: HKWorkoutMetadata;\n }\n) => Promise<boolean>;\n*/\nexport interface HKCorrelation<TIdentifier extends HKCorrelationTypeIdentifier>\n extends Omit<\n HKCorrelationRaw<TIdentifier>,\n 'endDate' | 'objects' | 'startDate'\n > {\n readonly objects: readonly (HKCategorySample | HKQuantitySample)[];\n readonly startDate: Date;\n readonly endDate: Date;\n}\n/*\nexport type SubscribeToChangesHook = <\n TIdentifier extends HKSampleTypeIdentifier\n>(\n identifier: TIdentifier,\n onChange: () => void,\n runInitialUpdate?: boolean\n) => void;\n\nexport type GetWorkoutRoutesFn = (\n workoutUUID: string\n) => Promise<readonly WorkoutRoute[]>;\n*/\n"],"mappings":"AAiBA,cAAc,gBAAd;AA6LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
@@ -0,0 +1,7 @@
1
+ const deserializCategorySample = sample => ({ ...sample,
2
+ startDate: new Date(sample.startDate),
3
+ endDate: new Date(sample.endDate)
4
+ });
5
+
6
+ export default deserializCategorySample;
7
+ //# sourceMappingURL=deserializeCategorySample.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["deserializCategorySample","sample","startDate","Date","endDate"],"sources":["deserializeCategorySample.ts"],"sourcesContent":["import type { HKCategorySampleRaw, HKCategoryTypeIdentifier } from '../native-types'\nimport type { HKCategorySample } from '../types'\n\nconst deserializCategorySample = <T extends HKCategoryTypeIdentifier>(\n sample: HKCategorySampleRaw<T>,\n): HKCategorySample<T> => ({\n ...sample,\n startDate: new Date(sample.startDate),\n endDate: new Date(sample.endDate),\n})\n\nexport default deserializCategorySample\n"],"mappings":"AAGA,MAAMA,wBAAwB,GAC5BC,MAD+B,KAEN,EACzB,GAAGA,MADsB;EAEzBC,SAAS,EAAE,IAAIC,IAAJ,CAASF,MAAM,CAACC,SAAhB,CAFc;EAGzBE,OAAO,EAAE,IAAID,IAAJ,CAASF,MAAM,CAACG,OAAhB;AAHgB,CAFM,CAAjC;;AAQA,eAAeJ,wBAAf"}
@@ -0,0 +1,21 @@
1
+ import deserializCategorySample from './deserializeCategorySample';
2
+ import deserializeSample from './deserializeSample';
3
+
4
+ function deserializeCorrelation(s) {
5
+ return { ...s,
6
+ objects: s.objects.map(o => {
7
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
8
+ // @ts-ignore
9
+ if (o.quantity !== undefined) {
10
+ return deserializeSample(o);
11
+ }
12
+
13
+ return deserializCategorySample(o);
14
+ }),
15
+ endDate: new Date(s.endDate),
16
+ startDate: new Date(s.startDate)
17
+ };
18
+ }
19
+
20
+ export default deserializeCorrelation;
21
+ //# sourceMappingURL=deserializeCorrelation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["deserializCategorySample","deserializeSample","deserializeCorrelation","s","objects","map","o","quantity","undefined","endDate","Date","startDate"],"sources":["deserializeCorrelation.ts"],"sourcesContent":["import deserializCategorySample from './deserializeCategorySample'\nimport deserializeSample from './deserializeSample'\n\nimport type {\n HKCategorySampleRaw, HKCorrelationRaw, HKCorrelationTypeIdentifier, HKQuantitySampleRaw, HKQuantityTypeIdentifier,\n} from '../native-types'\nimport type { HKCorrelation } from '../types'\n\nfunction deserializeCorrelation<\n TIdentifier extends HKCorrelationTypeIdentifier\n>(s: HKCorrelationRaw<TIdentifier>): HKCorrelation<TIdentifier> {\n return {\n ...s,\n objects: s.objects.map((o) => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n if (o.quantity !== undefined) {\n return deserializeSample(o as HKQuantitySampleRaw<HKQuantityTypeIdentifier>)\n }\n\n return deserializCategorySample(o as HKCategorySampleRaw)\n }),\n endDate: new Date(s.endDate),\n startDate: new Date(s.startDate),\n }\n}\n\nexport default deserializeCorrelation\n"],"mappings":"AAAA,OAAOA,wBAAP,MAAqC,6BAArC;AACA,OAAOC,iBAAP,MAA8B,qBAA9B;;AAOA,SAASC,sBAAT,CAEEC,CAFF,EAEgE;EAC9D,OAAO,EACL,GAAGA,CADE;IAELC,OAAO,EAAED,CAAC,CAACC,OAAF,CAAUC,GAAV,CAAeC,CAAD,IAAO;MAC9B;MACA;MACE,IAAIA,CAAC,CAACC,QAAF,KAAeC,SAAnB,EAA8B;QAC5B,OAAOP,iBAAiB,CAACK,CAAD,CAAxB;MACD;;MAED,OAAON,wBAAwB,CAACM,CAAD,CAA/B;IACD,CARQ,CAFJ;IAWLG,OAAO,EAAE,IAAIC,IAAJ,CAASP,CAAC,CAACM,OAAX,CAXJ;IAYLE,SAAS,EAAE,IAAID,IAAJ,CAASP,CAAC,CAACQ,SAAX;EAZN,CAAP;AAcD;;AAED,eAAeT,sBAAf"}