@kingstinct/react-native-healthkit 7.3.2 → 8.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 (210) hide show
  1. package/README.md +1 -1
  2. package/ios/Constants.swift +1 -1
  3. package/ios/ReactNativeHealthkit.m +1 -1
  4. package/ios/ReactNativeHealthkit.swift +2 -2
  5. package/ios/Serializers.swift +12 -0
  6. package/lib/commonjs/hooks/useHealthkitAuthorization.js +2 -3
  7. package/lib/commonjs/hooks/useHealthkitAuthorization.js.map +1 -1
  8. package/lib/commonjs/hooks/useHealthkitAuthorization.test.js +42 -19
  9. package/lib/commonjs/hooks/useHealthkitAuthorization.test.js.map +1 -1
  10. package/lib/commonjs/hooks/useIsHealthDataAvailable.js +2 -3
  11. package/lib/commonjs/hooks/useIsHealthDataAvailable.js.map +1 -1
  12. package/lib/commonjs/hooks/useIsHealthDataAvailable.test.js +17 -8
  13. package/lib/commonjs/hooks/useIsHealthDataAvailable.test.js.map +1 -1
  14. package/lib/commonjs/hooks/useMostRecentCategorySample.js +2 -3
  15. package/lib/commonjs/hooks/useMostRecentCategorySample.js.map +1 -1
  16. package/lib/commonjs/hooks/useMostRecentQuantitySample.js +4 -3
  17. package/lib/commonjs/hooks/useMostRecentQuantitySample.js.map +1 -1
  18. package/lib/commonjs/hooks/useMostRecentWorkout.js +2 -3
  19. package/lib/commonjs/hooks/useMostRecentWorkout.js.map +1 -1
  20. package/lib/commonjs/hooks/useSources.js +2 -3
  21. package/lib/commonjs/hooks/useSources.js.map +1 -1
  22. package/lib/commonjs/hooks/useStatisticsForQuantity.js +2 -3
  23. package/lib/commonjs/hooks/useStatisticsForQuantity.js.map +1 -1
  24. package/lib/commonjs/hooks/useSubscribeToChanges.js +2 -3
  25. package/lib/commonjs/hooks/useSubscribeToChanges.js.map +1 -1
  26. package/lib/commonjs/index.ios.js +18 -43
  27. package/lib/commonjs/index.ios.js.map +1 -1
  28. package/lib/commonjs/index.js +3 -4
  29. package/lib/commonjs/index.js.map +1 -1
  30. package/lib/commonjs/index.native.js +46 -95
  31. package/lib/commonjs/index.native.js.map +1 -1
  32. package/lib/commonjs/index.web.js +3 -4
  33. package/lib/commonjs/index.web.js.map +1 -1
  34. package/lib/commonjs/native-types.js +65 -90
  35. package/lib/commonjs/native-types.js.map +1 -1
  36. package/lib/commonjs/test-setup.js +51 -0
  37. package/lib/commonjs/test-setup.js.map +1 -0
  38. package/lib/commonjs/test-utils.js +1 -2
  39. package/lib/commonjs/test-utils.js.map +1 -1
  40. package/lib/commonjs/types.js.map +1 -1
  41. package/lib/commonjs/utils/deleteQuantitySample.js +2 -3
  42. package/lib/commonjs/utils/deleteQuantitySample.js.map +1 -1
  43. package/lib/commonjs/utils/deleteSamples.js +2 -3
  44. package/lib/commonjs/utils/deleteSamples.js.map +1 -1
  45. package/lib/commonjs/utils/deserializeCategorySample.js +1 -2
  46. package/lib/commonjs/utils/deserializeCategorySample.js.map +1 -1
  47. package/lib/commonjs/utils/deserializeCategorySample.test.js +8 -4
  48. package/lib/commonjs/utils/deserializeCategorySample.test.js.map +1 -1
  49. package/lib/commonjs/utils/deserializeCorrelation.js +2 -3
  50. package/lib/commonjs/utils/deserializeCorrelation.js.map +1 -1
  51. package/lib/commonjs/utils/deserializeHeartbeatSeriesSample.js +1 -2
  52. package/lib/commonjs/utils/deserializeHeartbeatSeriesSample.js.map +1 -1
  53. package/lib/commonjs/utils/deserializeSample.js +1 -2
  54. package/lib/commonjs/utils/deserializeSample.js.map +1 -1
  55. package/lib/commonjs/utils/deserializeWorkout.js +1 -2
  56. package/lib/commonjs/utils/deserializeWorkout.js.map +1 -1
  57. package/lib/commonjs/utils/ensureMetadata.js +1 -2
  58. package/lib/commonjs/utils/ensureMetadata.js.map +1 -1
  59. package/lib/commonjs/utils/ensureTotals.js +1 -2
  60. package/lib/commonjs/utils/ensureTotals.js.map +1 -1
  61. package/lib/commonjs/utils/ensureUnit.js +2 -3
  62. package/lib/commonjs/utils/ensureUnit.js.map +1 -1
  63. package/lib/commonjs/utils/getDateOfBirth.js +2 -3
  64. package/lib/commonjs/utils/getDateOfBirth.js.map +1 -1
  65. package/lib/commonjs/utils/getMostRecentCategorySample.js +2 -3
  66. package/lib/commonjs/utils/getMostRecentCategorySample.js.map +1 -1
  67. package/lib/commonjs/utils/getMostRecentQuantitySample.js +2 -3
  68. package/lib/commonjs/utils/getMostRecentQuantitySample.js.map +1 -1
  69. package/lib/commonjs/utils/getMostRecentWorkout.js +2 -3
  70. package/lib/commonjs/utils/getMostRecentWorkout.js.map +1 -1
  71. package/lib/commonjs/utils/getPreferredUnit.js +2 -3
  72. package/lib/commonjs/utils/getPreferredUnit.js.map +1 -1
  73. package/lib/commonjs/utils/getPreferredUnits.js +2 -3
  74. package/lib/commonjs/utils/getPreferredUnits.js.map +1 -1
  75. package/lib/commonjs/utils/getPreferredUnitsTyped.js +3 -4
  76. package/lib/commonjs/utils/getPreferredUnitsTyped.js.map +1 -1
  77. package/lib/commonjs/utils/getRequestStatusForAuthorization.js +3 -5
  78. package/lib/commonjs/utils/getRequestStatusForAuthorization.js.map +1 -1
  79. package/lib/commonjs/utils/getWorkoutPlanById.js +2 -3
  80. package/lib/commonjs/utils/getWorkoutPlanById.js.map +1 -1
  81. package/lib/commonjs/utils/prepareOptions.js +3 -3
  82. package/lib/commonjs/utils/prepareOptions.js.map +1 -1
  83. package/lib/commonjs/utils/queryCategorySamples.js +2 -3
  84. package/lib/commonjs/utils/queryCategorySamples.js.map +1 -1
  85. package/lib/commonjs/utils/queryCategorySamplesWithAnchor.js +2 -3
  86. package/lib/commonjs/utils/queryCategorySamplesWithAnchor.js.map +1 -1
  87. package/lib/commonjs/utils/queryCorrelationSamples.js +2 -3
  88. package/lib/commonjs/utils/queryCorrelationSamples.js.map +1 -1
  89. package/lib/commonjs/utils/queryHeartbeatSeriesSamples.js +2 -3
  90. package/lib/commonjs/utils/queryHeartbeatSeriesSamples.js.map +1 -1
  91. package/lib/commonjs/utils/queryHeartbeatSeriesSamplesWithAnchor.js +2 -3
  92. package/lib/commonjs/utils/queryHeartbeatSeriesSamplesWithAnchor.js.map +1 -1
  93. package/lib/commonjs/utils/queryQuantitySamples.js +2 -3
  94. package/lib/commonjs/utils/queryQuantitySamples.js.map +1 -1
  95. package/lib/commonjs/utils/queryQuantitySamplesWithAnchor.js +2 -3
  96. package/lib/commonjs/utils/queryQuantitySamplesWithAnchor.js.map +1 -1
  97. package/lib/commonjs/utils/querySources.js +2 -3
  98. package/lib/commonjs/utils/querySources.js.map +1 -1
  99. package/lib/commonjs/utils/queryStatisticsForQuantity.js +2 -3
  100. package/lib/commonjs/utils/queryStatisticsForQuantity.js.map +1 -1
  101. package/lib/commonjs/utils/queryWorkouts.js +2 -3
  102. package/lib/commonjs/utils/queryWorkouts.js.map +1 -1
  103. package/lib/commonjs/utils/requestAuthorization.js +3 -5
  104. package/lib/commonjs/utils/requestAuthorization.js.map +1 -1
  105. package/lib/commonjs/utils/saveCategorySample.js +2 -3
  106. package/lib/commonjs/utils/saveCategorySample.js.map +1 -1
  107. package/lib/commonjs/utils/saveCorrelationSample.js +2 -3
  108. package/lib/commonjs/utils/saveCorrelationSample.js.map +1 -1
  109. package/lib/commonjs/utils/saveQuantitySample.js +2 -3
  110. package/lib/commonjs/utils/saveQuantitySample.js.map +1 -1
  111. package/lib/commonjs/utils/saveWorkoutRoute.js +2 -3
  112. package/lib/commonjs/utils/saveWorkoutRoute.js.map +1 -1
  113. package/lib/commonjs/utils/saveWorkoutSample.js +2 -3
  114. package/lib/commonjs/utils/saveWorkoutSample.js.map +1 -1
  115. package/lib/commonjs/utils/serializeDate.js +1 -2
  116. package/lib/commonjs/utils/serializeDate.js.map +1 -1
  117. package/lib/commonjs/utils/serializeDate.test.js +1 -1
  118. package/lib/commonjs/utils/serializeDate.test.js.map +1 -1
  119. package/lib/commonjs/utils/subscribeToChanges.js +6 -8
  120. package/lib/commonjs/utils/subscribeToChanges.js.map +1 -1
  121. package/lib/module/hooks/useHealthkitAuthorization.js.map +1 -1
  122. package/lib/module/hooks/useHealthkitAuthorization.test.js +26 -3
  123. package/lib/module/hooks/useHealthkitAuthorization.test.js.map +1 -1
  124. package/lib/module/hooks/useIsHealthDataAvailable.js.map +1 -1
  125. package/lib/module/hooks/useIsHealthDataAvailable.test.js +9 -2
  126. package/lib/module/hooks/useIsHealthDataAvailable.test.js.map +1 -1
  127. package/lib/module/hooks/useMostRecentCategorySample.js.map +1 -1
  128. package/lib/module/hooks/useMostRecentQuantitySample.js +2 -0
  129. package/lib/module/hooks/useMostRecentQuantitySample.js.map +1 -1
  130. package/lib/module/hooks/useMostRecentWorkout.js.map +1 -1
  131. package/lib/module/hooks/useSources.js.map +1 -1
  132. package/lib/module/hooks/useStatisticsForQuantity.js.map +1 -1
  133. package/lib/module/hooks/useSubscribeToChanges.js.map +1 -1
  134. package/lib/module/index.ios.js +4 -15
  135. package/lib/module/index.ios.js.map +1 -1
  136. package/lib/module/index.js.map +1 -1
  137. package/lib/module/index.native.js +1 -3
  138. package/lib/module/index.native.js.map +1 -1
  139. package/lib/module/index.web.js.map +1 -1
  140. package/lib/module/native-types.js +21 -2
  141. package/lib/module/native-types.js.map +1 -1
  142. package/lib/module/test-setup.js +48 -0
  143. package/lib/module/test-setup.js.map +1 -0
  144. package/lib/module/test-utils.js.map +1 -1
  145. package/lib/module/types.js.map +1 -1
  146. package/lib/module/utils/deleteQuantitySample.js.map +1 -1
  147. package/lib/module/utils/deleteSamples.js.map +1 -1
  148. package/lib/module/utils/deserializeCategorySample.js.map +1 -1
  149. package/lib/module/utils/deserializeCategorySample.test.js +4 -2
  150. package/lib/module/utils/deserializeCategorySample.test.js.map +1 -1
  151. package/lib/module/utils/deserializeCorrelation.js.map +1 -1
  152. package/lib/module/utils/deserializeHeartbeatSeriesSample.js.map +1 -1
  153. package/lib/module/utils/deserializeSample.js.map +1 -1
  154. package/lib/module/utils/deserializeWorkout.js.map +1 -1
  155. package/lib/module/utils/ensureMetadata.js.map +1 -1
  156. package/lib/module/utils/ensureTotals.js.map +1 -1
  157. package/lib/module/utils/ensureUnit.js.map +1 -1
  158. package/lib/module/utils/getDateOfBirth.js.map +1 -1
  159. package/lib/module/utils/getMostRecentCategorySample.js.map +1 -1
  160. package/lib/module/utils/getMostRecentQuantitySample.js.map +1 -1
  161. package/lib/module/utils/getMostRecentWorkout.js.map +1 -1
  162. package/lib/module/utils/getPreferredUnit.js.map +1 -1
  163. package/lib/module/utils/getPreferredUnits.js.map +1 -1
  164. package/lib/module/utils/getPreferredUnitsTyped.js.map +1 -1
  165. package/lib/module/utils/getRequestStatusForAuthorization.js +1 -2
  166. package/lib/module/utils/getRequestStatusForAuthorization.js.map +1 -1
  167. package/lib/module/utils/getWorkoutPlanById.js.map +1 -1
  168. package/lib/module/utils/prepareOptions.js +1 -0
  169. package/lib/module/utils/prepareOptions.js.map +1 -1
  170. package/lib/module/utils/queryCategorySamples.js.map +1 -1
  171. package/lib/module/utils/queryCategorySamplesWithAnchor.js.map +1 -1
  172. package/lib/module/utils/queryCorrelationSamples.js.map +1 -1
  173. package/lib/module/utils/queryHeartbeatSeriesSamples.js.map +1 -1
  174. package/lib/module/utils/queryHeartbeatSeriesSamplesWithAnchor.js.map +1 -1
  175. package/lib/module/utils/queryQuantitySamples.js.map +1 -1
  176. package/lib/module/utils/queryQuantitySamplesWithAnchor.js.map +1 -1
  177. package/lib/module/utils/querySources.js.map +1 -1
  178. package/lib/module/utils/queryStatisticsForQuantity.js.map +1 -1
  179. package/lib/module/utils/queryWorkouts.js.map +1 -1
  180. package/lib/module/utils/requestAuthorization.js +1 -2
  181. package/lib/module/utils/requestAuthorization.js.map +1 -1
  182. package/lib/module/utils/saveCategorySample.js.map +1 -1
  183. package/lib/module/utils/saveCorrelationSample.js.map +1 -1
  184. package/lib/module/utils/saveQuantitySample.js.map +1 -1
  185. package/lib/module/utils/saveWorkoutRoute.js.map +1 -1
  186. package/lib/module/utils/saveWorkoutSample.js.map +1 -1
  187. package/lib/module/utils/serializeDate.js.map +1 -1
  188. package/lib/module/utils/serializeDate.test.js.map +1 -1
  189. package/lib/module/utils/subscribeToChanges.js +3 -4
  190. package/lib/module/utils/subscribeToChanges.js.map +1 -1
  191. package/lib/typescript/src/index.ios.d.ts +2 -10
  192. package/lib/typescript/src/index.native.d.ts +2 -2
  193. package/lib/typescript/src/native-types.d.ts +86 -8
  194. package/package.json +16 -11
  195. package/src/hooks/useHealthkitAuthorization.test.ts +18 -4
  196. package/src/hooks/useIsHealthDataAvailable.test.ts +5 -2
  197. package/src/hooks/useIsHealthDataAvailable.ts +1 -1
  198. package/src/hooks/useMostRecentQuantitySample.ts +3 -0
  199. package/src/index.ios.tsx +2 -15
  200. package/src/index.native.tsx +0 -3
  201. package/src/native-types.ts +97 -9
  202. package/src/test-setup.ts +51 -0
  203. package/src/utils/deserializeCategorySample.test.ts +5 -2
  204. package/src/utils/prepareOptions.ts +1 -0
  205. package/lib/commonjs/jest.setup.js +0 -45
  206. package/lib/commonjs/jest.setup.js.map +0 -1
  207. package/lib/module/jest.setup.js +0 -43
  208. package/lib/module/jest.setup.js.map +0 -1
  209. package/src/jest.setup.ts +0 -46
  210. /package/lib/typescript/src/{jest.setup.d.ts → test-setup.d.ts} +0 -0
@@ -717,6 +717,69 @@ export enum HKQuantityTypeIdentifier {
717
717
  * @since iOS 16
718
718
  */
719
719
  runningSpeed = 'HKQuantityTypeIdentifierRunningSpeed',
720
+
721
+ /**
722
+ * Cross Country Skiing Speed
723
+ * @see {@link https://developer.apple.com/documentation/healthkit/HKQuantityTypeIdentifierCrossCountrySkiingSpeed Apple Docs HKQuantityTypeIdentifierCrossCountrySkiingSpeed}
724
+ * @since iOS 18
725
+ */
726
+ crossCountrySkiingSpeed = 'HKQuantityTypeIdentifierCrossCountrySkiingSpeed',
727
+
728
+ /**
729
+ * Cross Country Skiing Distance
730
+ * @see {@link https://developer.apple.com/documentation/healthkit/HKQuantityTypeIdentifierDistanceCrossCountrySkiing Apple Docs HKQuantityTypeIdentifierCrossCountrySkiingDistance}
731
+ * @since iOS 18
732
+ */
733
+ distanceCrossCountrySkiing = 'HKQuantityTypeIdentifierDistanceCrossCountrySkiing',
734
+
735
+ /**
736
+ * Paddle Sports Distance
737
+ * @see {@link https://developer.apple.com/documentation/healthkit/HKQuantityTypeIdentifierDistancePaddleSports Apple Docs HKQuantityTypeIdentifierDistancePaddleSports}
738
+ * @since iOS 18
739
+ */
740
+ distancePaddleSports = 'HKQuantityTypeIdentifierDistancePaddleSports',
741
+
742
+ /**
743
+ * Rowing Distance
744
+ * @see {@link https://developer.apple.com/documentation/healthkit/HKQuantityTypeIdentifierDistanceRowing Apple Docs HKQuantityTypeIdentifierDistanceRowing}
745
+ * @since iOS 18
746
+ */
747
+ distanceRowing = 'HKQuantityTypeIdentifierDistanceRowing',
748
+
749
+ /**
750
+ * Skating Sports Distance
751
+ * @see {@link https://developer.apple.com/documentation/healthkit/HKQuantityTypeIdentifierDistanceSkatingSports Apple Docs HKQuantityTypeIdentifierDistanceSkatingSports}
752
+ * @since iOS 18
753
+ */
754
+ distanceSkatingSports = 'HKQuantityTypeIdentifierDistanceSkatingSports',
755
+
756
+ /**
757
+ * Estimated Workout Effort Score
758
+ * @see {@link https://developer.apple.com/documentation/healthkit/HKQuantityTypeIdentifierEstimatedWorkoutEffortScore Apple Docs HKQuantityTypeIdentifierEstimatedWorkoutEffortScore}
759
+ * @since iOS 18
760
+ */
761
+ estimatedWorkoutEffortScore = 'HKQuantityTypeIdentifierEstimatedWorkoutEffortScore',
762
+
763
+ /**
764
+ * Paddle Sports Speed
765
+ * @see {@link https://developer.apple.com/documentation/healthkit/HKQuantityTypeIdentifierPaddleSportsSpeed Apple Docs HKQuantityTypeIdentifierPaddleSportsSpeed}
766
+ * @since iOS 18
767
+ */
768
+ paddleSportsSpeed = 'HKQuantityTypeIdentifierPaddleSportsSpeed',
769
+
770
+ /**
771
+ * Rowing Speed
772
+ * @see {@link https://developer.apple.com/documentation/healthkit/HKQuantityTypeIdentifierRowingSpeed Apple Docs HKQuantityTypeIdentifierRowingSpeed}
773
+ * @since iOS 18
774
+ */
775
+ rowingSpeed = 'HKQuantityTypeIdentifierRowingSpeed',
776
+
777
+ /**
778
+ * Workout Effort Score
779
+ * @see {@link https://developer.apple.com/documentation/healthkit/HKQuantityTypeIdentifierWorkoutEffortScore Apple Docs HKQuantityTypeIdentifierWorkoutEffortScore}
780
+ * @since iOS 18
781
+ */
782
+ workoutEffortScore = 'HKQuantityTypeIdentifierWorkoutEffortScore',
720
783
  }
721
784
 
722
785
  export type TypeToUnitMapping = {
@@ -749,6 +812,10 @@ export enum HKCategoryTypeIdentifier {
749
812
  appleStandHour = 'HKCategoryTypeIdentifierAppleStandHour',
750
813
  cervicalMucusQuality = 'HKCategoryTypeIdentifierCervicalMucusQuality',
751
814
  ovulationTestResult = 'HKCategoryTypeIdentifierOvulationTestResult',
815
+ /**
816
+ * @deprecated In iOS 18 beta
817
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkcategorytypeidentifiermenstrualflow Apple Docs }
818
+ */
752
819
  menstrualFlow = 'HKCategoryTypeIdentifierMenstrualFlow',
753
820
  intermenstrualBleeding = 'HKCategoryTypeIdentifierIntermenstrualBleeding',
754
821
  sexualActivity = 'HKCategoryTypeIdentifierSexualActivity',
@@ -812,6 +879,20 @@ export enum HKCategoryTypeIdentifier {
812
879
  vaginalDryness = 'HKCategoryTypeIdentifierVaginalDryness', // HKCategoryValueSeverity
813
880
  vomiting = 'HKCategoryTypeIdentifierVomiting', // HKCategoryValueSeverity
814
881
  wheezing = 'HKCategoryTypeIdentifierWheezing', // HKCategoryValueSeverity
882
+
883
+ /**
884
+ * Bleeding After Pregnancy
885
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkcategorytypeidentifierbleedingafterpregnancy Apple Docs }
886
+ * @since iOS 18
887
+ */
888
+ bleedingAfterPregnancy = 'HKCategoryTypeIdentifierBleedingAfterPregnancy', // HKCategoryValueSeverity
889
+
890
+ /**
891
+ * Bleeding During Pregnancy
892
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkcategorytypeidentifierbleedingduringpregnancy Apple Docs }
893
+ * @since iOS 18
894
+ */
895
+ bleedingDuringPregnancy = 'HKCategoryTypeIdentifierBleedingDuringPregnancy', // HKCategoryValueSeverity
815
896
  }
816
897
 
817
898
  export type HKSampleTypeIdentifier =
@@ -916,6 +997,13 @@ export enum HKWorkoutActivityType {
916
997
  handCycling = 74,
917
998
  discSports = 75,
918
999
  fitnessGaming = 76,
1000
+ cardioDance = 77,
1001
+ socialDance = 78,
1002
+ pickleball = 79,
1003
+ cooldown = 80,
1004
+ swimBikeRun = 82,
1005
+ transition = 83,
1006
+ underwaterDiving = 84,
919
1007
  other = 3000,
920
1008
  }
921
1009
 
@@ -1097,6 +1185,7 @@ export enum HKCategoryValueCervicalMucusQuality {
1097
1185
 
1098
1186
  /**
1099
1187
  * @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvaluemenstrualflow Apple Docs }
1188
+ * @deprecated In iOS 18 beta
1100
1189
  */
1101
1190
  export enum HKCategoryValueMenstrualFlow {
1102
1191
  unspecified = 1,
@@ -1129,7 +1218,7 @@ export enum HKCategoryValueSleepAnalysis {
1129
1218
  }
1130
1219
 
1131
1220
  /**
1132
- * @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvalueappetitechanges
1221
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvalueappetitechanges Apple Docs}
1133
1222
  */
1134
1223
  export enum HKCategoryValueAppetiteChanges {
1135
1224
  decreased = 2,
@@ -1139,7 +1228,7 @@ export enum HKCategoryValueAppetiteChanges {
1139
1228
  }
1140
1229
 
1141
1230
  /**
1142
- * @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvaluepresence
1231
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvaluepresence Apple Docs}
1143
1232
  */
1144
1233
  export enum HKCategoryValuePresence {
1145
1234
  notPresent = 1,
@@ -1240,14 +1329,14 @@ export type UnitForIdentifier<T extends HKQuantityTypeIdentifier> =
1240
1329
  ? HKUnits.Percent
1241
1330
  : T extends
1242
1331
  | HKQuantityTypeIdentifier.basalBodyTemperature
1243
- | HKQuantityTypeIdentifier.basalBodyTemperature
1332
+
1244
1333
  ? TemperatureUnit
1245
1334
  : T extends
1246
1335
  | HKQuantityTypeIdentifier.runningSpeed
1247
1336
  | HKQuantityTypeIdentifier.stairAscentSpeed
1248
1337
  | HKQuantityTypeIdentifier.stairDescentSpeed
1249
1338
  | HKQuantityTypeIdentifier.walkingSpeed
1250
- | HKQuantityTypeIdentifier.walkingSpeed
1339
+
1251
1340
  ? SpeedUnit<LengthUnit, TimeUnit>
1252
1341
  : T extends
1253
1342
  | HKQuantityTypeIdentifier.flightsClimbed
@@ -1273,7 +1362,7 @@ export type UnitForIdentifier<T extends HKQuantityTypeIdentifier> =
1273
1362
  | HKQuantityTypeIdentifier.dietaryFiber
1274
1363
  | HKQuantityTypeIdentifier.dietaryFolate
1275
1364
  | HKQuantityTypeIdentifier.dietaryIodine
1276
- | HKQuantityTypeIdentifier.dietaryIodine
1365
+
1277
1366
  | HKQuantityTypeIdentifier.dietaryIron
1278
1367
  | HKQuantityTypeIdentifier.dietaryMagnesium
1279
1368
  | HKQuantityTypeIdentifier.dietaryManganese
@@ -1325,7 +1414,7 @@ export type HKCategoryValueForIdentifier<T extends HKCategoryTypeIdentifier> =
1325
1414
  ? HKCategoryValueNotApplicable
1326
1415
  : T extends
1327
1416
  | HKCategoryTypeIdentifier.abdominalCramps
1328
- | HKCategoryTypeIdentifier.abdominalCramps
1417
+
1329
1418
  | HKCategoryTypeIdentifier.acne
1330
1419
  | HKCategoryTypeIdentifier.bladderIncontinence
1331
1420
  | HKCategoryTypeIdentifier.bloating
@@ -1633,7 +1722,7 @@ export type HKUnit =
1633
1722
  | VolumeUnit
1634
1723
  | `${BloodGlucoseUnit}`
1635
1724
  | `${EnergyUnit}`
1636
- | `${FrequencyUnit}`
1725
+
1637
1726
  | `${HKUnits}`
1638
1727
  | `${LengthUnit}`
1639
1728
  | `${MassUnit}`
@@ -1908,8 +1997,7 @@ type ReactNativeHealthkitTypeNative = {
1908
1997
  * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable Apple Docs }
1909
1998
  */
1910
1999
  isHealthDataAvailable(): Promise<boolean>;
1911
- // Todo [>8]: Rename to align with Apple function name (isProtectedDataAvailable) - remember to rename native code :)
1912
- canAccessProtectedData(): Promise<boolean>;
2000
+ isProtectedDataAvailable(): Promise<boolean>;
1913
2001
  getBloodType(): Promise<HKBloodType>;
1914
2002
  getDateOfBirth(): Promise<string>;
1915
2003
  getBiologicalSex(): Promise<HKBiologicalSex>;
@@ -0,0 +1,51 @@
1
+ // eslint-disable-next-line import/no-unresolved
2
+ import { mock, jest, beforeAll } from 'bun:test'
3
+
4
+ import type Native from './native-types'
5
+
6
+ beforeAll(async () => {
7
+ const mockModule: typeof Native = {
8
+ isHealthDataAvailable: jest.fn(),
9
+ isProtectedDataAvailable: jest.fn(),
10
+ authorizationStatusFor: jest.fn(),
11
+ requestAuthorization: jest.fn(),
12
+ saveQuantitySample: jest.fn(),
13
+ deleteQuantitySample: jest.fn(),
14
+ deleteSamples: jest.fn(),
15
+ disableAllBackgroundDelivery: jest.fn(),
16
+ disableBackgroundDelivery: jest.fn(),
17
+ enableBackgroundDelivery: jest.fn(),
18
+ queryCategorySamplesWithAnchor: jest.fn(),
19
+ queryQuantitySamplesWithAnchor: jest.fn(),
20
+ getBiologicalSex: jest.fn(),
21
+ getBloodType: jest.fn(),
22
+ getDateOfBirth: jest.fn(),
23
+ getFitzpatrickSkinType: jest.fn(),
24
+ getPreferredUnits: jest.fn(),
25
+ getRequestStatusForAuthorization: jest.fn(),
26
+ getWheelchairUse: jest.fn(),
27
+ getWorkoutRoutes: jest.fn(),
28
+ queryCategorySamples: jest.fn(),
29
+ queryCorrelationSamples: jest.fn(),
30
+ queryHeartbeatSeriesSamples: jest.fn(),
31
+ queryHeartbeatSeriesSamplesWithAnchor: jest.fn(),
32
+ queryQuantitySamples: jest.fn(),
33
+ querySources: jest.fn(),
34
+ queryStatisticsForQuantity: jest.fn(),
35
+ queryWorkoutSamples: jest.fn(),
36
+ saveCategorySample: jest.fn(),
37
+ saveCorrelationSample: jest.fn(),
38
+ saveWorkoutSample: jest.fn(),
39
+ subscribeToObserverQuery: jest.fn(),
40
+ unsubscribeQuery: jest.fn(),
41
+ saveWorkoutRoute: jest.fn(),
42
+ getWorkoutPlanById: jest.fn(),
43
+ }
44
+
45
+ await mock.module('react-native', () => ({
46
+ NativeModules: {
47
+ ReactNativeHealthkit: mockModule,
48
+ },
49
+ NativeEventEmitter: jest.fn(),
50
+ }))
51
+ })
@@ -1,8 +1,11 @@
1
1
  import deserializeCategorySample from './deserializeCategorySample'
2
- import { HKCategorySampleRaw, HKCategoryTypeIdentifier } from '../types'
2
+
3
+ import type { HKCategorySampleRaw } from '../types'
3
4
 
4
5
  describe('deserializeCategorySample', () => {
5
- it('should deserialize category sample', () => {
6
+ it('should deserialize category sample', async () => {
7
+ const { HKCategoryTypeIdentifier } = await import('../native-types')
8
+
6
9
  const sample: HKCategorySampleRaw = {
7
10
  startDate: '2020-01-01T00:00:00.000Z',
8
11
  endDate: '2020-01-01T00:00:00.000Z',
@@ -7,6 +7,7 @@ const prepareOptions = (options: GenericQueryOptions) => {
7
7
  ? 0
8
8
  : options.limit
9
9
  const ascending = options.ascending ?? limit === 0
10
+ // eslint-disable-next-line no-nested-ternary
10
11
  const from = serializeDate(options.from ? options.from : (limit > 0 ? new Date(0) : undefined))
11
12
  const to = serializeDate(options.to)
12
13
  const anchor = options.anchor ?? ''
@@ -1,45 +0,0 @@
1
- "use strict";
2
-
3
- var _reactNative = require("react-native");
4
- const mockModule = {
5
- isHealthDataAvailable: jest.fn(),
6
- addListener: jest.fn(),
7
- removeListeners: jest.fn(),
8
- authorizationStatusFor: jest.fn(),
9
- requestAuthorization: jest.fn(),
10
- saveQuantitySample: jest.fn(),
11
- deleteQuantitySample: jest.fn(),
12
- deleteSamples: jest.fn(),
13
- disableAllBackgroundDelivery: jest.fn(),
14
- disableBackgroundDelivery: jest.fn(),
15
- enableBackgroundDelivery: jest.fn(),
16
- queryCategorySamplesWithAnchor: jest.fn(),
17
- queryQuantitySamplesWithAnchor: jest.fn(),
18
- getBiologicalSex: jest.fn(),
19
- getBloodType: jest.fn(),
20
- getDateOfBirth: jest.fn(),
21
- getFitzpatrickSkinType: jest.fn(),
22
- getPreferredUnits: jest.fn(),
23
- getRequestStatusForAuthorization: jest.fn(),
24
- getWheelchairUse: jest.fn(),
25
- getWorkoutRoutes: jest.fn(),
26
- queryCategorySamples: jest.fn(),
27
- queryCorrelationSamples: jest.fn(),
28
- queryHeartbeatSeriesSamples: jest.fn(),
29
- queryHeartbeatSeriesSamplesWithAnchor: jest.fn(),
30
- queryQuantitySamples: jest.fn(),
31
- querySources: jest.fn(),
32
- queryStatisticsForQuantity: jest.fn(),
33
- queryWorkoutSamples: jest.fn(),
34
- saveCategorySample: jest.fn(),
35
- saveCorrelationSample: jest.fn(),
36
- saveWorkoutSample: jest.fn(),
37
- subscribeToObserverQuery: jest.fn(),
38
- unsubscribeQuery: jest.fn(),
39
- // Todo [>8]: Remove to align with Apple function name (isProtectedDataAvailable)
40
- canAccessProtectedData: jest.fn(),
41
- saveWorkoutRoute: jest.fn(),
42
- getWorkoutPlanById: jest.fn()
43
- };
44
- _reactNative.NativeModules.ReactNativeHealthkit = mockModule;
45
- //# sourceMappingURL=jest.setup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_reactNative","require","mockModule","isHealthDataAvailable","jest","fn","addListener","removeListeners","authorizationStatusFor","requestAuthorization","saveQuantitySample","deleteQuantitySample","deleteSamples","disableAllBackgroundDelivery","disableBackgroundDelivery","enableBackgroundDelivery","queryCategorySamplesWithAnchor","queryQuantitySamplesWithAnchor","getBiologicalSex","getBloodType","getDateOfBirth","getFitzpatrickSkinType","getPreferredUnits","getRequestStatusForAuthorization","getWheelchairUse","getWorkoutRoutes","queryCategorySamples","queryCorrelationSamples","queryHeartbeatSeriesSamples","queryHeartbeatSeriesSamplesWithAnchor","queryQuantitySamples","querySources","queryStatisticsForQuantity","queryWorkoutSamples","saveCategorySample","saveCorrelationSample","saveWorkoutSample","subscribeToObserverQuery","unsubscribeQuery","canAccessProtectedData","saveWorkoutRoute","getWorkoutPlanById","NativeModules","ReactNativeHealthkit"],"sources":["jest.setup.ts"],"sourcesContent":["import { NativeModule, NativeModules } from 'react-native'\n\nimport type Native from './native-types'\n\nconst mockModule: NativeModule & typeof Native = {\n isHealthDataAvailable: jest.fn(),\n addListener: jest.fn(),\n removeListeners: jest.fn(),\n authorizationStatusFor: jest.fn(),\n requestAuthorization: jest.fn(),\n saveQuantitySample: jest.fn(),\n deleteQuantitySample: jest.fn(),\n deleteSamples: jest.fn(),\n disableAllBackgroundDelivery: jest.fn(),\n disableBackgroundDelivery: jest.fn(),\n enableBackgroundDelivery: jest.fn(),\n queryCategorySamplesWithAnchor: jest.fn(),\n queryQuantitySamplesWithAnchor: jest.fn(),\n getBiologicalSex: jest.fn(),\n getBloodType: jest.fn(),\n getDateOfBirth: jest.fn(),\n getFitzpatrickSkinType: jest.fn(),\n getPreferredUnits: jest.fn(),\n getRequestStatusForAuthorization: jest.fn(),\n getWheelchairUse: jest.fn(),\n getWorkoutRoutes: jest.fn(),\n queryCategorySamples: jest.fn(),\n queryCorrelationSamples: jest.fn(),\n queryHeartbeatSeriesSamples: jest.fn(),\n queryHeartbeatSeriesSamplesWithAnchor: jest.fn(),\n queryQuantitySamples: jest.fn(),\n querySources: jest.fn(),\n queryStatisticsForQuantity: jest.fn(),\n queryWorkoutSamples: jest.fn(),\n saveCategorySample: jest.fn(),\n saveCorrelationSample: jest.fn(),\n saveWorkoutSample: jest.fn(),\n subscribeToObserverQuery: jest.fn(),\n unsubscribeQuery: jest.fn(),\n // Todo [>8]: Remove to align with Apple function name (isProtectedDataAvailable)\n canAccessProtectedData: jest.fn(),\n saveWorkoutRoute: jest.fn(),\n getWorkoutPlanById: jest.fn(),\n}\n\nNativeModules.ReactNativeHealthkit = mockModule\n"],"mappings":";;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAIA,MAAMC,UAAwC,GAAG;EAC/CC,qBAAqB,EAAEC,IAAI,CAACC,EAAE,CAAC,CAAC;EAChCC,WAAW,EAAEF,IAAI,CAACC,EAAE,CAAC,CAAC;EACtBE,eAAe,EAAEH,IAAI,CAACC,EAAE,CAAC,CAAC;EAC1BG,sBAAsB,EAAEJ,IAAI,CAACC,EAAE,CAAC,CAAC;EACjCI,oBAAoB,EAAEL,IAAI,CAACC,EAAE,CAAC,CAAC;EAC/BK,kBAAkB,EAAEN,IAAI,CAACC,EAAE,CAAC,CAAC;EAC7BM,oBAAoB,EAAEP,IAAI,CAACC,EAAE,CAAC,CAAC;EAC/BO,aAAa,EAAER,IAAI,CAACC,EAAE,CAAC,CAAC;EACxBQ,4BAA4B,EAAET,IAAI,CAACC,EAAE,CAAC,CAAC;EACvCS,yBAAyB,EAAEV,IAAI,CAACC,EAAE,CAAC,CAAC;EACpCU,wBAAwB,EAAEX,IAAI,CAACC,EAAE,CAAC,CAAC;EACnCW,8BAA8B,EAAEZ,IAAI,CAACC,EAAE,CAAC,CAAC;EACzCY,8BAA8B,EAAEb,IAAI,CAACC,EAAE,CAAC,CAAC;EACzCa,gBAAgB,EAAEd,IAAI,CAACC,EAAE,CAAC,CAAC;EAC3Bc,YAAY,EAAEf,IAAI,CAACC,EAAE,CAAC,CAAC;EACvBe,cAAc,EAAEhB,IAAI,CAACC,EAAE,CAAC,CAAC;EACzBgB,sBAAsB,EAAEjB,IAAI,CAACC,EAAE,CAAC,CAAC;EACjCiB,iBAAiB,EAAElB,IAAI,CAACC,EAAE,CAAC,CAAC;EAC5BkB,gCAAgC,EAAEnB,IAAI,CAACC,EAAE,CAAC,CAAC;EAC3CmB,gBAAgB,EAAEpB,IAAI,CAACC,EAAE,CAAC,CAAC;EAC3BoB,gBAAgB,EAAErB,IAAI,CAACC,EAAE,CAAC,CAAC;EAC3BqB,oBAAoB,EAAEtB,IAAI,CAACC,EAAE,CAAC,CAAC;EAC/BsB,uBAAuB,EAAEvB,IAAI,CAACC,EAAE,CAAC,CAAC;EAClCuB,2BAA2B,EAAExB,IAAI,CAACC,EAAE,CAAC,CAAC;EACtCwB,qCAAqC,EAAEzB,IAAI,CAACC,EAAE,CAAC,CAAC;EAChDyB,oBAAoB,EAAE1B,IAAI,CAACC,EAAE,CAAC,CAAC;EAC/B0B,YAAY,EAAE3B,IAAI,CAACC,EAAE,CAAC,CAAC;EACvB2B,0BAA0B,EAAE5B,IAAI,CAACC,EAAE,CAAC,CAAC;EACrC4B,mBAAmB,EAAE7B,IAAI,CAACC,EAAE,CAAC,CAAC;EAC9B6B,kBAAkB,EAAE9B,IAAI,CAACC,EAAE,CAAC,CAAC;EAC7B8B,qBAAqB,EAAE/B,IAAI,CAACC,EAAE,CAAC,CAAC;EAChC+B,iBAAiB,EAAEhC,IAAI,CAACC,EAAE,CAAC,CAAC;EAC5BgC,wBAAwB,EAAEjC,IAAI,CAACC,EAAE,CAAC,CAAC;EACnCiC,gBAAgB,EAAElC,IAAI,CAACC,EAAE,CAAC,CAAC;EAC3B;EACAkC,sBAAsB,EAAEnC,IAAI,CAACC,EAAE,CAAC,CAAC;EACjCmC,gBAAgB,EAAEpC,IAAI,CAACC,EAAE,CAAC,CAAC;EAC3BoC,kBAAkB,EAAErC,IAAI,CAACC,EAAE,CAAC;AAC9B,CAAC;AAEDqC,0BAAa,CAACC,oBAAoB,GAAGzC,UAAU"}
@@ -1,43 +0,0 @@
1
- import { NativeModules } from 'react-native';
2
- const mockModule = {
3
- isHealthDataAvailable: jest.fn(),
4
- addListener: jest.fn(),
5
- removeListeners: jest.fn(),
6
- authorizationStatusFor: jest.fn(),
7
- requestAuthorization: jest.fn(),
8
- saveQuantitySample: jest.fn(),
9
- deleteQuantitySample: jest.fn(),
10
- deleteSamples: jest.fn(),
11
- disableAllBackgroundDelivery: jest.fn(),
12
- disableBackgroundDelivery: jest.fn(),
13
- enableBackgroundDelivery: jest.fn(),
14
- queryCategorySamplesWithAnchor: jest.fn(),
15
- queryQuantitySamplesWithAnchor: jest.fn(),
16
- getBiologicalSex: jest.fn(),
17
- getBloodType: jest.fn(),
18
- getDateOfBirth: jest.fn(),
19
- getFitzpatrickSkinType: jest.fn(),
20
- getPreferredUnits: jest.fn(),
21
- getRequestStatusForAuthorization: jest.fn(),
22
- getWheelchairUse: jest.fn(),
23
- getWorkoutRoutes: jest.fn(),
24
- queryCategorySamples: jest.fn(),
25
- queryCorrelationSamples: jest.fn(),
26
- queryHeartbeatSeriesSamples: jest.fn(),
27
- queryHeartbeatSeriesSamplesWithAnchor: jest.fn(),
28
- queryQuantitySamples: jest.fn(),
29
- querySources: jest.fn(),
30
- queryStatisticsForQuantity: jest.fn(),
31
- queryWorkoutSamples: jest.fn(),
32
- saveCategorySample: jest.fn(),
33
- saveCorrelationSample: jest.fn(),
34
- saveWorkoutSample: jest.fn(),
35
- subscribeToObserverQuery: jest.fn(),
36
- unsubscribeQuery: jest.fn(),
37
- // Todo [>8]: Remove to align with Apple function name (isProtectedDataAvailable)
38
- canAccessProtectedData: jest.fn(),
39
- saveWorkoutRoute: jest.fn(),
40
- getWorkoutPlanById: jest.fn()
41
- };
42
- NativeModules.ReactNativeHealthkit = mockModule;
43
- //# sourceMappingURL=jest.setup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["NativeModules","mockModule","isHealthDataAvailable","jest","fn","addListener","removeListeners","authorizationStatusFor","requestAuthorization","saveQuantitySample","deleteQuantitySample","deleteSamples","disableAllBackgroundDelivery","disableBackgroundDelivery","enableBackgroundDelivery","queryCategorySamplesWithAnchor","queryQuantitySamplesWithAnchor","getBiologicalSex","getBloodType","getDateOfBirth","getFitzpatrickSkinType","getPreferredUnits","getRequestStatusForAuthorization","getWheelchairUse","getWorkoutRoutes","queryCategorySamples","queryCorrelationSamples","queryHeartbeatSeriesSamples","queryHeartbeatSeriesSamplesWithAnchor","queryQuantitySamples","querySources","queryStatisticsForQuantity","queryWorkoutSamples","saveCategorySample","saveCorrelationSample","saveWorkoutSample","subscribeToObserverQuery","unsubscribeQuery","canAccessProtectedData","saveWorkoutRoute","getWorkoutPlanById","ReactNativeHealthkit"],"sources":["jest.setup.ts"],"sourcesContent":["import { NativeModule, NativeModules } from 'react-native'\n\nimport type Native from './native-types'\n\nconst mockModule: NativeModule & typeof Native = {\n isHealthDataAvailable: jest.fn(),\n addListener: jest.fn(),\n removeListeners: jest.fn(),\n authorizationStatusFor: jest.fn(),\n requestAuthorization: jest.fn(),\n saveQuantitySample: jest.fn(),\n deleteQuantitySample: jest.fn(),\n deleteSamples: jest.fn(),\n disableAllBackgroundDelivery: jest.fn(),\n disableBackgroundDelivery: jest.fn(),\n enableBackgroundDelivery: jest.fn(),\n queryCategorySamplesWithAnchor: jest.fn(),\n queryQuantitySamplesWithAnchor: jest.fn(),\n getBiologicalSex: jest.fn(),\n getBloodType: jest.fn(),\n getDateOfBirth: jest.fn(),\n getFitzpatrickSkinType: jest.fn(),\n getPreferredUnits: jest.fn(),\n getRequestStatusForAuthorization: jest.fn(),\n getWheelchairUse: jest.fn(),\n getWorkoutRoutes: jest.fn(),\n queryCategorySamples: jest.fn(),\n queryCorrelationSamples: jest.fn(),\n queryHeartbeatSeriesSamples: jest.fn(),\n queryHeartbeatSeriesSamplesWithAnchor: jest.fn(),\n queryQuantitySamples: jest.fn(),\n querySources: jest.fn(),\n queryStatisticsForQuantity: jest.fn(),\n queryWorkoutSamples: jest.fn(),\n saveCategorySample: jest.fn(),\n saveCorrelationSample: jest.fn(),\n saveWorkoutSample: jest.fn(),\n subscribeToObserverQuery: jest.fn(),\n unsubscribeQuery: jest.fn(),\n // Todo [>8]: Remove to align with Apple function name (isProtectedDataAvailable)\n canAccessProtectedData: jest.fn(),\n saveWorkoutRoute: jest.fn(),\n getWorkoutPlanById: jest.fn(),\n}\n\nNativeModules.ReactNativeHealthkit = mockModule\n"],"mappings":"AAAA,SAAuBA,aAAa,QAAQ,cAAc;AAI1D,MAAMC,UAAwC,GAAG;EAC/CC,qBAAqB,EAAEC,IAAI,CAACC,EAAE,CAAC,CAAC;EAChCC,WAAW,EAAEF,IAAI,CAACC,EAAE,CAAC,CAAC;EACtBE,eAAe,EAAEH,IAAI,CAACC,EAAE,CAAC,CAAC;EAC1BG,sBAAsB,EAAEJ,IAAI,CAACC,EAAE,CAAC,CAAC;EACjCI,oBAAoB,EAAEL,IAAI,CAACC,EAAE,CAAC,CAAC;EAC/BK,kBAAkB,EAAEN,IAAI,CAACC,EAAE,CAAC,CAAC;EAC7BM,oBAAoB,EAAEP,IAAI,CAACC,EAAE,CAAC,CAAC;EAC/BO,aAAa,EAAER,IAAI,CAACC,EAAE,CAAC,CAAC;EACxBQ,4BAA4B,EAAET,IAAI,CAACC,EAAE,CAAC,CAAC;EACvCS,yBAAyB,EAAEV,IAAI,CAACC,EAAE,CAAC,CAAC;EACpCU,wBAAwB,EAAEX,IAAI,CAACC,EAAE,CAAC,CAAC;EACnCW,8BAA8B,EAAEZ,IAAI,CAACC,EAAE,CAAC,CAAC;EACzCY,8BAA8B,EAAEb,IAAI,CAACC,EAAE,CAAC,CAAC;EACzCa,gBAAgB,EAAEd,IAAI,CAACC,EAAE,CAAC,CAAC;EAC3Bc,YAAY,EAAEf,IAAI,CAACC,EAAE,CAAC,CAAC;EACvBe,cAAc,EAAEhB,IAAI,CAACC,EAAE,CAAC,CAAC;EACzBgB,sBAAsB,EAAEjB,IAAI,CAACC,EAAE,CAAC,CAAC;EACjCiB,iBAAiB,EAAElB,IAAI,CAACC,EAAE,CAAC,CAAC;EAC5BkB,gCAAgC,EAAEnB,IAAI,CAACC,EAAE,CAAC,CAAC;EAC3CmB,gBAAgB,EAAEpB,IAAI,CAACC,EAAE,CAAC,CAAC;EAC3BoB,gBAAgB,EAAErB,IAAI,CAACC,EAAE,CAAC,CAAC;EAC3BqB,oBAAoB,EAAEtB,IAAI,CAACC,EAAE,CAAC,CAAC;EAC/BsB,uBAAuB,EAAEvB,IAAI,CAACC,EAAE,CAAC,CAAC;EAClCuB,2BAA2B,EAAExB,IAAI,CAACC,EAAE,CAAC,CAAC;EACtCwB,qCAAqC,EAAEzB,IAAI,CAACC,EAAE,CAAC,CAAC;EAChDyB,oBAAoB,EAAE1B,IAAI,CAACC,EAAE,CAAC,CAAC;EAC/B0B,YAAY,EAAE3B,IAAI,CAACC,EAAE,CAAC,CAAC;EACvB2B,0BAA0B,EAAE5B,IAAI,CAACC,EAAE,CAAC,CAAC;EACrC4B,mBAAmB,EAAE7B,IAAI,CAACC,EAAE,CAAC,CAAC;EAC9B6B,kBAAkB,EAAE9B,IAAI,CAACC,EAAE,CAAC,CAAC;EAC7B8B,qBAAqB,EAAE/B,IAAI,CAACC,EAAE,CAAC,CAAC;EAChC+B,iBAAiB,EAAEhC,IAAI,CAACC,EAAE,CAAC,CAAC;EAC5BgC,wBAAwB,EAAEjC,IAAI,CAACC,EAAE,CAAC,CAAC;EACnCiC,gBAAgB,EAAElC,IAAI,CAACC,EAAE,CAAC,CAAC;EAC3B;EACAkC,sBAAsB,EAAEnC,IAAI,CAACC,EAAE,CAAC,CAAC;EACjCmC,gBAAgB,EAAEpC,IAAI,CAACC,EAAE,CAAC,CAAC;EAC3BoC,kBAAkB,EAAErC,IAAI,CAACC,EAAE,CAAC;AAC9B,CAAC;AAEDJ,aAAa,CAACyC,oBAAoB,GAAGxC,UAAU"}
package/src/jest.setup.ts DELETED
@@ -1,46 +0,0 @@
1
- import { NativeModule, NativeModules } from 'react-native'
2
-
3
- import type Native from './native-types'
4
-
5
- const mockModule: NativeModule & typeof Native = {
6
- isHealthDataAvailable: jest.fn(),
7
- addListener: jest.fn(),
8
- removeListeners: jest.fn(),
9
- authorizationStatusFor: jest.fn(),
10
- requestAuthorization: jest.fn(),
11
- saveQuantitySample: jest.fn(),
12
- deleteQuantitySample: jest.fn(),
13
- deleteSamples: jest.fn(),
14
- disableAllBackgroundDelivery: jest.fn(),
15
- disableBackgroundDelivery: jest.fn(),
16
- enableBackgroundDelivery: jest.fn(),
17
- queryCategorySamplesWithAnchor: jest.fn(),
18
- queryQuantitySamplesWithAnchor: jest.fn(),
19
- getBiologicalSex: jest.fn(),
20
- getBloodType: jest.fn(),
21
- getDateOfBirth: jest.fn(),
22
- getFitzpatrickSkinType: jest.fn(),
23
- getPreferredUnits: jest.fn(),
24
- getRequestStatusForAuthorization: jest.fn(),
25
- getWheelchairUse: jest.fn(),
26
- getWorkoutRoutes: jest.fn(),
27
- queryCategorySamples: jest.fn(),
28
- queryCorrelationSamples: jest.fn(),
29
- queryHeartbeatSeriesSamples: jest.fn(),
30
- queryHeartbeatSeriesSamplesWithAnchor: jest.fn(),
31
- queryQuantitySamples: jest.fn(),
32
- querySources: jest.fn(),
33
- queryStatisticsForQuantity: jest.fn(),
34
- queryWorkoutSamples: jest.fn(),
35
- saveCategorySample: jest.fn(),
36
- saveCorrelationSample: jest.fn(),
37
- saveWorkoutSample: jest.fn(),
38
- subscribeToObserverQuery: jest.fn(),
39
- unsubscribeQuery: jest.fn(),
40
- // Todo [>8]: Remove to align with Apple function name (isProtectedDataAvailable)
41
- canAccessProtectedData: jest.fn(),
42
- saveWorkoutRoute: jest.fn(),
43
- getWorkoutPlanById: jest.fn(),
44
- }
45
-
46
- NativeModules.ReactNativeHealthkit = mockModule