@kingstinct/react-native-healthkit 4.4.4 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/README.md +1 -1
  2. package/ios/ReactNativeHealthkit.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  3. package/ios/ReactNativeHealthkit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  4. package/ios/ReactNativeHealthkit.xcodeproj/project.xcworkspace/xcuserdata/robertherber.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  5. package/ios/ReactNativeHealthkit.xcodeproj/xcuserdata/robertherber.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
  6. package/lib/commonjs/hooks/useHealthkitAuthorization.js +41 -0
  7. package/lib/commonjs/hooks/useHealthkitAuthorization.js.map +1 -0
  8. package/lib/commonjs/hooks/useIsHealthDataAvailable.js +29 -0
  9. package/lib/commonjs/hooks/useIsHealthDataAvailable.js.map +1 -0
  10. package/lib/commonjs/hooks/useMostRecentCategorySample.js +27 -0
  11. package/lib/commonjs/hooks/useMostRecentCategorySample.js.map +1 -0
  12. package/lib/commonjs/hooks/useMostRecentQuantitySample.js +43 -0
  13. package/lib/commonjs/hooks/useMostRecentQuantitySample.js.map +1 -0
  14. package/lib/commonjs/hooks/useMostRecentWorkout.js +60 -0
  15. package/lib/commonjs/hooks/useMostRecentWorkout.js.map +1 -0
  16. package/lib/commonjs/hooks/useStatisticsForQuantity.js +35 -0
  17. package/lib/commonjs/hooks/useStatisticsForQuantity.js.map +1 -0
  18. package/lib/commonjs/hooks/useSubscribeToChanges.js +37 -0
  19. package/lib/commonjs/hooks/useSubscribeToChanges.js.map +1 -0
  20. package/lib/commonjs/index.ios.js +66 -394
  21. package/lib/commonjs/index.ios.js.map +1 -1
  22. package/lib/commonjs/index.js +9 -17
  23. package/lib/commonjs/index.js.map +1 -1
  24. package/lib/commonjs/native-types.js +249 -78
  25. package/lib/commonjs/native-types.js.map +1 -1
  26. package/lib/commonjs/types.js +13 -0
  27. package/lib/commonjs/types.js.map +1 -1
  28. package/lib/commonjs/utils/deserializeCategorySample.js +15 -0
  29. package/lib/commonjs/utils/deserializeCategorySample.js.map +1 -0
  30. package/lib/commonjs/utils/deserializeCorrelation.js +32 -0
  31. package/lib/commonjs/utils/deserializeCorrelation.js.map +1 -0
  32. package/lib/commonjs/utils/deserializeSample.js +17 -0
  33. package/lib/commonjs/utils/deserializeSample.js.map +1 -0
  34. package/lib/commonjs/utils/deserializeWorkout.js +17 -0
  35. package/lib/commonjs/utils/deserializeWorkout.js.map +1 -0
  36. package/lib/commonjs/utils/ensureMetadata.js +14 -0
  37. package/lib/commonjs/utils/ensureMetadata.js.map +1 -0
  38. package/lib/commonjs/utils/ensureUnit.js +23 -0
  39. package/lib/commonjs/utils/ensureUnit.js.map +1 -0
  40. package/lib/commonjs/utils/getDateOfBirth.js +19 -0
  41. package/lib/commonjs/utils/getDateOfBirth.js.map +1 -0
  42. package/lib/commonjs/utils/getMostRecentCategorySample.js +22 -0
  43. package/lib/commonjs/utils/getMostRecentCategorySample.js.map +1 -0
  44. package/lib/commonjs/utils/getMostRecentQuantitySample.js +22 -0
  45. package/lib/commonjs/utils/getMostRecentQuantitySample.js.map +1 -0
  46. package/lib/commonjs/utils/getMostRecentWorkout.js +24 -0
  47. package/lib/commonjs/utils/getMostRecentWorkout.js.map +1 -0
  48. package/lib/commonjs/utils/getPreferredUnit.js +19 -0
  49. package/lib/commonjs/utils/getPreferredUnit.js.map +1 -0
  50. package/lib/commonjs/utils/getPreferredUnits.js +19 -0
  51. package/lib/commonjs/utils/getPreferredUnits.js.map +1 -0
  52. package/lib/commonjs/utils/getPreferredUnitsTyped.js +46 -0
  53. package/lib/commonjs/utils/getPreferredUnitsTyped.js.map +1 -0
  54. package/lib/commonjs/utils/getRequestStatusForAuthorization.js +25 -0
  55. package/lib/commonjs/utils/getRequestStatusForAuthorization.js.map +1 -0
  56. package/lib/commonjs/utils/prepareOptions.js +27 -0
  57. package/lib/commonjs/utils/prepareOptions.js.map +1 -0
  58. package/lib/commonjs/utils/queryCategorySamples.js +24 -0
  59. package/lib/commonjs/utils/queryCategorySamples.js.map +1 -0
  60. package/lib/commonjs/utils/queryCorrelationSamples.js +24 -0
  61. package/lib/commonjs/utils/queryCorrelationSamples.js.map +1 -0
  62. package/lib/commonjs/utils/queryQuantitySamples.js +27 -0
  63. package/lib/commonjs/utils/queryQuantitySamples.js.map +1 -0
  64. package/lib/commonjs/utils/queryStatisticsForQuantity.js +34 -0
  65. package/lib/commonjs/utils/queryStatisticsForQuantity.js.map +1 -0
  66. package/lib/commonjs/utils/queryWorkouts.js +30 -0
  67. package/lib/commonjs/utils/queryWorkouts.js.map +1 -0
  68. package/lib/commonjs/utils/requestAuthorization.js +25 -0
  69. package/lib/commonjs/utils/requestAuthorization.js.map +1 -0
  70. package/lib/commonjs/utils/saveCategorySample.js +21 -0
  71. package/lib/commonjs/utils/saveCategorySample.js.map +1 -0
  72. package/lib/commonjs/utils/saveCorrelationSample.js +24 -0
  73. package/lib/commonjs/utils/saveCorrelationSample.js.map +1 -0
  74. package/lib/commonjs/utils/saveQuantitySample.js +21 -0
  75. package/lib/commonjs/utils/saveQuantitySample.js.map +1 -0
  76. package/lib/commonjs/utils/saveWorkoutSample.js +25 -0
  77. package/lib/commonjs/utils/saveWorkoutSample.js.map +1 -0
  78. package/lib/commonjs/utils/serializeDate.js +12 -0
  79. package/lib/commonjs/utils/serializeDate.js.map +1 -0
  80. package/lib/commonjs/utils/subscribeToChanges.js +37 -0
  81. package/lib/commonjs/utils/subscribeToChanges.js.map +1 -0
  82. package/lib/module/hooks/useHealthkitAuthorization.js +29 -0
  83. package/lib/module/hooks/useHealthkitAuthorization.js.map +1 -0
  84. package/lib/module/hooks/useIsHealthDataAvailable.js +18 -0
  85. package/lib/module/hooks/useIsHealthDataAvailable.js.map +1 -0
  86. package/lib/module/hooks/useMostRecentCategorySample.js +15 -0
  87. package/lib/module/hooks/useMostRecentCategorySample.js.map +1 -0
  88. package/lib/module/hooks/useMostRecentQuantitySample.js +30 -0
  89. package/lib/module/hooks/useMostRecentQuantitySample.js.map +1 -0
  90. package/lib/module/hooks/useMostRecentWorkout.js +47 -0
  91. package/lib/module/hooks/useMostRecentWorkout.js.map +1 -0
  92. package/lib/module/hooks/useStatisticsForQuantity.js +23 -0
  93. package/lib/module/hooks/useStatisticsForQuantity.js.map +1 -0
  94. package/lib/module/hooks/useSubscribeToChanges.js +26 -0
  95. package/lib/module/hooks/useSubscribeToChanges.js.map +1 -0
  96. package/lib/module/index.ios.js +32 -370
  97. package/lib/module/index.ios.js.map +1 -1
  98. package/lib/module/index.js +10 -7
  99. package/lib/module/index.js.map +1 -1
  100. package/lib/module/native-types.js +232 -74
  101. package/lib/module/native-types.js.map +1 -1
  102. package/lib/module/types.js +15 -0
  103. package/lib/module/types.js.map +1 -1
  104. package/lib/module/utils/deserializeCategorySample.js +7 -0
  105. package/lib/module/utils/deserializeCategorySample.js.map +1 -0
  106. package/lib/module/utils/deserializeCorrelation.js +21 -0
  107. package/lib/module/utils/deserializeCorrelation.js.map +1 -0
  108. package/lib/module/utils/deserializeSample.js +9 -0
  109. package/lib/module/utils/deserializeSample.js.map +1 -0
  110. package/lib/module/utils/deserializeWorkout.js +9 -0
  111. package/lib/module/utils/deserializeWorkout.js.map +1 -0
  112. package/lib/module/utils/ensureMetadata.js +6 -0
  113. package/lib/module/utils/ensureMetadata.js.map +1 -0
  114. package/lib/module/utils/ensureUnit.js +13 -0
  115. package/lib/module/utils/ensureUnit.js.map +1 -0
  116. package/lib/module/utils/getDateOfBirth.js +9 -0
  117. package/lib/module/utils/getDateOfBirth.js.map +1 -0
  118. package/lib/module/utils/getMostRecentCategorySample.js +12 -0
  119. package/lib/module/utils/getMostRecentCategorySample.js.map +1 -0
  120. package/lib/module/utils/getMostRecentQuantitySample.js +12 -0
  121. package/lib/module/utils/getMostRecentQuantitySample.js.map +1 -0
  122. package/lib/module/utils/getMostRecentWorkout.js +14 -0
  123. package/lib/module/utils/getMostRecentWorkout.js.map +1 -0
  124. package/lib/module/utils/getPreferredUnit.js +9 -0
  125. package/lib/module/utils/getPreferredUnit.js.map +1 -0
  126. package/lib/module/utils/getPreferredUnits.js +9 -0
  127. package/lib/module/utils/getPreferredUnits.js.map +1 -0
  128. package/lib/module/utils/getPreferredUnitsTyped.js +34 -0
  129. package/lib/module/utils/getPreferredUnitsTyped.js.map +1 -0
  130. package/lib/module/utils/getRequestStatusForAuthorization.js +15 -0
  131. package/lib/module/utils/getRequestStatusForAuthorization.js.map +1 -0
  132. package/lib/module/utils/prepareOptions.js +17 -0
  133. package/lib/module/utils/prepareOptions.js.map +1 -0
  134. package/lib/module/utils/queryCategorySamples.js +12 -0
  135. package/lib/module/utils/queryCategorySamples.js.map +1 -0
  136. package/lib/module/utils/queryCorrelationSamples.js +12 -0
  137. package/lib/module/utils/queryCorrelationSamples.js.map +1 -0
  138. package/lib/module/utils/queryQuantitySamples.js +14 -0
  139. package/lib/module/utils/queryQuantitySamples.js.map +1 -0
  140. package/lib/module/utils/queryStatisticsForQuantity.js +23 -0
  141. package/lib/module/utils/queryStatisticsForQuantity.js.map +1 -0
  142. package/lib/module/utils/queryWorkouts.js +17 -0
  143. package/lib/module/utils/queryWorkouts.js.map +1 -0
  144. package/lib/module/utils/requestAuthorization.js +15 -0
  145. package/lib/module/utils/requestAuthorization.js.map +1 -0
  146. package/lib/module/utils/saveCategorySample.js +11 -0
  147. package/lib/module/utils/saveCategorySample.js.map +1 -0
  148. package/lib/module/utils/saveCorrelationSample.js +13 -0
  149. package/lib/module/utils/saveCorrelationSample.js.map +1 -0
  150. package/lib/module/utils/saveQuantitySample.js +11 -0
  151. package/lib/module/utils/saveQuantitySample.js.map +1 -0
  152. package/lib/module/utils/saveWorkoutSample.js +14 -0
  153. package/lib/module/utils/saveWorkoutSample.js.map +1 -0
  154. package/lib/module/utils/serializeDate.js +4 -0
  155. package/lib/module/utils/serializeDate.js.map +1 -0
  156. package/lib/module/utils/subscribeToChanges.js +25 -0
  157. package/lib/module/utils/subscribeToChanges.js.map +1 -0
  158. package/lib/typescript/example-expo/App.d.ts +2 -0
  159. package/lib/typescript/src/hooks/useHealthkitAuthorization.d.ts +3 -0
  160. package/lib/typescript/src/hooks/useIsHealthDataAvailable.d.ts +2 -0
  161. package/lib/typescript/src/hooks/useMostRecentCategorySample.d.ts +4 -0
  162. package/lib/typescript/src/hooks/useMostRecentQuantitySample.d.ts +4 -0
  163. package/lib/typescript/src/hooks/useMostRecentWorkout.d.ts +7 -0
  164. package/lib/typescript/src/hooks/useStatisticsForQuantity.d.ts +4 -0
  165. package/lib/typescript/src/hooks/useSubscribeToChanges.d.ts +3 -0
  166. package/lib/typescript/src/index.d.ts +2 -3
  167. package/lib/typescript/src/index.ios.d.ts +48 -3
  168. package/lib/typescript/src/native-types.d.ts +235 -70
  169. package/lib/typescript/src/types.d.ts +14 -90
  170. package/lib/typescript/src/utils/deserializeCategorySample.d.ts +4 -0
  171. package/lib/typescript/src/utils/deserializeCorrelation.d.ts +4 -0
  172. package/lib/typescript/src/utils/deserializeSample.d.ts +4 -0
  173. package/lib/typescript/src/utils/deserializeWorkout.d.ts +4 -0
  174. package/lib/typescript/src/utils/ensureMetadata.d.ts +2 -0
  175. package/lib/typescript/src/utils/ensureUnit.d.ts +3 -0
  176. package/lib/typescript/src/utils/getDateOfBirth.d.ts +2 -0
  177. package/lib/typescript/src/utils/getMostRecentCategorySample.d.ts +3 -0
  178. package/lib/typescript/src/utils/getMostRecentQuantitySample.d.ts +3 -0
  179. package/lib/typescript/src/utils/getMostRecentWorkout.d.ts +5 -0
  180. package/lib/typescript/src/utils/getPreferredUnit.d.ts +4 -0
  181. package/lib/typescript/src/utils/getPreferredUnits.d.ts +4 -0
  182. package/lib/typescript/src/utils/getPreferredUnitsTyped.d.ts +9 -0
  183. package/lib/typescript/src/utils/getRequestStatusForAuthorization.d.ts +3 -0
  184. package/lib/typescript/src/utils/prepareOptions.d.ts +8 -0
  185. package/lib/typescript/src/utils/queryCategorySamples.d.ts +5 -0
  186. package/lib/typescript/src/utils/queryCorrelationSamples.d.ts +5 -0
  187. package/lib/typescript/src/utils/queryQuantitySamples.d.ts +7 -0
  188. package/lib/typescript/src/utils/queryStatisticsForQuantity.d.ts +14 -0
  189. package/lib/typescript/src/utils/queryWorkouts.d.ts +4 -0
  190. package/lib/typescript/src/utils/requestAuthorization.d.ts +3 -0
  191. package/lib/typescript/src/utils/saveCategorySample.d.ts +7 -0
  192. package/lib/typescript/src/utils/saveCorrelationSample.d.ts +8 -0
  193. package/lib/typescript/src/utils/saveQuantitySample.d.ts +7 -0
  194. package/lib/typescript/src/utils/saveWorkoutSample.d.ts +7 -0
  195. package/lib/typescript/src/utils/serializeDate.d.ts +2 -0
  196. package/lib/typescript/src/utils/subscribeToChanges.d.ts +3 -0
  197. package/package.json +17 -6
  198. package/src/hooks/useHealthkitAuthorization.ts +39 -0
  199. package/src/hooks/useIsHealthDataAvailable.ts +17 -0
  200. package/src/hooks/useMostRecentCategorySample.ts +24 -0
  201. package/src/hooks/useMostRecentQuantitySample.ts +39 -0
  202. package/src/hooks/useMostRecentWorkout.ts +60 -0
  203. package/src/hooks/useStatisticsForQuantity.ts +42 -0
  204. package/src/hooks/useSubscribeToChanges.ts +31 -0
  205. package/src/index.ios.tsx +36 -569
  206. package/src/index.tsx +12 -9
  207. package/src/native-types.ts +323 -93
  208. package/src/types.ts +41 -152
  209. package/src/utils/deserializeCategorySample.ts +12 -0
  210. package/src/utils/deserializeCorrelation.ts +28 -0
  211. package/src/utils/deserializeSample.ts +17 -0
  212. package/src/utils/deserializeWorkout.ts +14 -0
  213. package/src/utils/ensureMetadata.ts +5 -0
  214. package/src/utils/ensureUnit.ts +19 -0
  215. package/src/utils/getDateOfBirth.ts +8 -0
  216. package/src/utils/getMostRecentCategorySample.ts +18 -0
  217. package/src/utils/getMostRecentQuantitySample.ts +19 -0
  218. package/src/utils/getMostRecentWorkout.ts +27 -0
  219. package/src/utils/getPreferredUnit.ts +14 -0
  220. package/src/utils/getPreferredUnits.ts +14 -0
  221. package/src/utils/getPreferredUnitsTyped.ts +38 -0
  222. package/src/utils/getRequestStatusForAuthorization.ts +21 -0
  223. package/src/utils/prepareOptions.ts +15 -0
  224. package/src/utils/queryCategorySamples.ts +29 -0
  225. package/src/utils/queryCorrelationSamples.ts +29 -0
  226. package/src/utils/queryQuantitySamples.ts +36 -0
  227. package/src/utils/queryStatisticsForQuantity.ts +38 -0
  228. package/src/utils/queryWorkouts.ts +28 -0
  229. package/src/utils/requestAuthorization.ts +18 -0
  230. package/src/utils/saveCategorySample.ts +27 -0
  231. package/src/utils/saveCorrelationSample.ts +34 -0
  232. package/src/utils/saveQuantitySample.ts +29 -0
  233. package/src/utils/saveWorkoutSample.ts +28 -0
  234. package/src/utils/serializeDate.ts +3 -0
  235. package/src/utils/subscribeToChanges.ts +32 -0
@@ -1 +1 @@
1
- {"version":3,"names":["notAvailableError","Platform","OS","UnavailableFn","retVal","console","warn","Healthkit","authorizationStatusFor","Promise","resolve","buildUnitWithPrefix","HKUnit","Atmospheres","disableAllBackgroundDelivery","disableBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","HKBiologicalSex","notSet","getBloodType","HKBloodType","getDateOfBirth","Date","getFitzpatrickSkinType","HKFitzpatrickSkinType","getMostRecentCategorySample","getMostRecentQuantitySample","getMostRecentWorkout","getPreferredUnit","getPreferredUnits","getRequestStatusForAuthorization","HKAuthorizationRequestStatus","unknown","getWheelchairUse","HKWheelchairUse","getWorkoutRoutes","isHealthDataAvailable","queryCategorySamples","queryCorrelationSamples","queryQuantitySamples","queryStatisticsForQuantity","averageQuantity","undefined","maximumQuantity","minimumQuantity","sumQuantity","mostRecentQuantity","mostRecentQuantityDateInterval","duration","queryWorkouts","requestAuthorization","saveCategorySample","saveCorrelationSample","saveQuantitySample","saveWorkoutSample","subscribeToChanges","useMostRecentCategorySample","useMostRecentQuantitySample","useMostRecentWorkout","useSubscribeToChanges","useHealthkitAuthorization","useIsHealthDataAvailable"],"sources":["index.tsx"],"sourcesContent":["import { Platform } from 'react-native'\n\nimport {\n HKAuthorizationRequestStatus, HKBiologicalSex, HKBloodType, HKFitzpatrickSkinType, HKUnit, HKWheelchairUse,\n} from './native-types'\n\nimport type { ReactNativeHealthkit } from './types'\n\nconst notAvailableError = `[@kingstinct/react-native-healthkit] Platform \"${\n Platform.OS\n}\" not supported`\n\nfunction UnavailableFn<T = unknown>(retVal: T) {\n return () => {\n console.warn(notAvailableError)\n return retVal\n }\n}\n\nconst Healthkit: ReactNativeHealthkit = {\n authorizationStatusFor: UnavailableFn(Promise.resolve(false)),\n buildUnitWithPrefix: UnavailableFn(HKUnit.Atmospheres),\n disableAllBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n disableBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n enableBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n getBiologicalSex: UnavailableFn(Promise.resolve(HKBiologicalSex.notSet)),\n getBloodType: UnavailableFn(Promise.resolve(HKBloodType.notSet)),\n getDateOfBirth: UnavailableFn(Promise.resolve(new Date(0))),\n getFitzpatrickSkinType: UnavailableFn(Promise.resolve(HKFitzpatrickSkinType.notSet)),\n getMostRecentCategorySample: UnavailableFn(Promise.resolve(null)),\n getMostRecentQuantitySample: UnavailableFn(Promise.resolve(null)),\n getMostRecentWorkout: UnavailableFn(Promise.resolve(null)),\n getPreferredUnit: UnavailableFn(Promise.resolve(HKUnit.Atmospheres)),\n getPreferredUnits: UnavailableFn(Promise.resolve([])),\n getRequestStatusForAuthorization: UnavailableFn(Promise.resolve(HKAuthorizationRequestStatus.unknown)),\n getWheelchairUse: UnavailableFn(Promise.resolve(HKWheelchairUse.notSet)),\n getWorkoutRoutes: UnavailableFn(Promise.resolve([])),\n isHealthDataAvailable: async () => Promise.resolve(false),\n queryCategorySamples: UnavailableFn(Promise.resolve([])),\n queryCorrelationSamples: UnavailableFn(Promise.resolve([])),\n queryQuantitySamples: UnavailableFn(Promise.resolve([])),\n queryStatisticsForQuantity: UnavailableFn(Promise.resolve({\n averageQuantity: undefined,\n maximumQuantity: undefined,\n minimumQuantity: undefined,\n sumQuantity: undefined,\n mostRecentQuantity: undefined,\n mostRecentQuantityDateInterval: undefined,\n duration: undefined,\n })),\n queryWorkouts: UnavailableFn(Promise.resolve([])),\n requestAuthorization: UnavailableFn(Promise.resolve(false)),\n saveCategorySample: UnavailableFn(Promise.resolve(false)),\n saveCorrelationSample: UnavailableFn(Promise.resolve(false)),\n saveQuantitySample: UnavailableFn(Promise.resolve(false)),\n saveWorkoutSample: UnavailableFn(Promise.resolve(false)),\n subscribeToChanges: UnavailableFn(Promise.resolve(async () => Promise.resolve(false))),\n useMostRecentCategorySample: UnavailableFn(null),\n useMostRecentQuantitySample: UnavailableFn(null),\n useMostRecentWorkout: UnavailableFn(null),\n useSubscribeToChanges: UnavailableFn([null, () => null]),\n useHealthkitAuthorization: UnavailableFn([null, async () => Promise.resolve(null)] as const),\n useIsHealthDataAvailable: UnavailableFn(false),\n}\n\nexport * from './native-types'\nexport * from './types'\n\nexport default Healthkit\n"],"mappings":";;;;;;;;AAAA;;AAEA;;AA+DA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AA1DA,MAAMA,iBAAiB,GAAI,kDACzBC,qBAAA,CAASC,EACV,iBAFD;;AAIA,SAASC,aAAT,CAAoCC,MAApC,EAA+C;EAC7C,OAAO,MAAM;IACXC,OAAO,CAACC,IAAR,CAAaN,iBAAb;IACA,OAAOI,MAAP;EACD,CAHD;AAID;;AAED,MAAMG,SAA+B,GAAG;EACtCC,sBAAsB,EAAEL,aAAa,CAACM,OAAO,CAACC,OAAR,CAAgB,KAAhB,CAAD,CADC;EAEtCC,mBAAmB,EAA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M,OAAO,CAACC,OAAR,CAAgB,KAAhB,CAAD,CApCM;EAqCtC8C,kBAAkB,EAAErD,aAAa,CAACM,OAAO,CAACC,OAAR,CAAgB,YAAYD,OAAO,CAACC,OAAR,CAAgB,KAAhB,CAA5B,CAAD,CArCK;EAsCtC+C,2BAA2B,EAAEtD,aAAa,CAAC,IAAD,CAtCJ;EAuCtCuD,2BAA2B,EAAEvD,aAAa,CAAC,IAAD,CAvCJ;EAwCtCwD,oBAAoB,EAAExD,aAAa,CAAC,IAAD,CAxCG;EAyCtCyD,qBAAqB,EAAEzD,aAAa,CAAC,CAAC,IAAD,EAAO,MAAM,IAAb,CAAD,CAzCE;EA0CtC0D,yBAAyB,EAAE1D,aAAa,CAAC,CAAC,IAAD,EAAO,YAAYM,OAAO,CAACC,OAAR,CAAgB,IAAhB,CAAnB,CAAD,CA1CF;EA2CtCoD,wBAAwB,EAAE3D,aAAa,CAAC,KAAD;AA3CD,CAAxC;eAiDeI,S"}
1
+ {"version":3,"names":["notAvailableError","Platform","OS","hasWarned","UnavailableFn","retVal","console","warn","Healthkit","authorizationStatusFor","Promise","resolve","disableAllBackgroundDelivery","disableBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","HKBiologicalSex","notSet","getBloodType","HKBloodType","getDateOfBirth","Date","getFitzpatrickSkinType","HKFitzpatrickSkinType","getMostRecentCategorySample","getMostRecentQuantitySample","getMostRecentWorkout","getPreferredUnit","HKUnits","Count","getPreferredUnits","getRequestStatusForAuthorization","HKAuthorizationRequestStatus","unknown","getWheelchairUse","HKWheelchairUse","getWorkoutRoutes","isHealthDataAvailable","queryCategorySamples","queryCorrelationSamples","queryQuantitySamples","queryStatisticsForQuantity","averageQuantity","undefined","maximumQuantity","minimumQuantity","sumQuantity","mostRecentQuantity","mostRecentQuantityDateInterval","duration","queryWorkouts","requestAuthorization","saveCategorySample","saveCorrelationSample","saveQuantitySample","saveWorkoutSample","subscribeToChanges","useMostRecentCategorySample","useMostRecentQuantitySample","useMostRecentWorkout","useSubscribeToChanges","useHealthkitAuthorization","useIsHealthDataAvailable"],"sources":["index.tsx"],"sourcesContent":["import { Platform } from 'react-native'\n\nimport {\n HKAuthorizationRequestStatus, HKBiologicalSex, HKBloodType, HKFitzpatrickSkinType, HKUnits, HKWheelchairUse,\n} from './native-types'\n\nimport type ReactNativeHealthkit from './index.ios'\n\nconst notAvailableError = `[@kingstinct/react-native-healthkit] Platform \"${\n Platform.OS\n}\" not supported`\n\nlet hasWarned = false\n\nfunction UnavailableFn<T = unknown>(retVal: T) {\n return () => {\n if (!hasWarned) {\n console.warn(notAvailableError)\n hasWarned = true\n }\n return retVal\n }\n}\n\nconst Healthkit: typeof ReactNativeHealthkit = {\n authorizationStatusFor: UnavailableFn(Promise.resolve(false)),\n disableAllBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n disableBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n enableBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n getBiologicalSex: UnavailableFn(Promise.resolve(HKBiologicalSex.notSet)),\n getBloodType: UnavailableFn(Promise.resolve(HKBloodType.notSet)),\n getDateOfBirth: UnavailableFn(Promise.resolve(new Date(0))),\n getFitzpatrickSkinType: UnavailableFn(Promise.resolve(HKFitzpatrickSkinType.notSet)),\n getMostRecentCategorySample: UnavailableFn(Promise.resolve(null)),\n getMostRecentQuantitySample: UnavailableFn(Promise.resolve(null)),\n getMostRecentWorkout: UnavailableFn(Promise.resolve(null)),\n getPreferredUnit: UnavailableFn(Promise.resolve(HKUnits.Count)),\n getPreferredUnits: UnavailableFn(Promise.resolve([])),\n getRequestStatusForAuthorization: UnavailableFn(Promise.resolve(HKAuthorizationRequestStatus.unknown)),\n getWheelchairUse: UnavailableFn(Promise.resolve(HKWheelchairUse.notSet)),\n getWorkoutRoutes: UnavailableFn(Promise.resolve([])),\n isHealthDataAvailable: async () => Promise.resolve(false),\n queryCategorySamples: UnavailableFn(Promise.resolve([])),\n queryCorrelationSamples: UnavailableFn(Promise.resolve([])),\n queryQuantitySamples: UnavailableFn(Promise.resolve([])),\n queryStatisticsForQuantity: UnavailableFn(Promise.resolve({\n averageQuantity: undefined,\n maximumQuantity: undefined,\n minimumQuantity: undefined,\n sumQuantity: undefined,\n mostRecentQuantity: undefined,\n mostRecentQuantityDateInterval: undefined,\n duration: undefined,\n })),\n queryWorkouts: UnavailableFn(Promise.resolve([])),\n requestAuthorization: UnavailableFn(Promise.resolve(false)),\n saveCategorySample: UnavailableFn(Promise.resolve(false)),\n saveCorrelationSample: UnavailableFn(Promise.resolve(false)),\n saveQuantitySample: UnavailableFn(Promise.resolve(false)),\n saveWorkoutSample: UnavailableFn(Promise.resolve(false)),\n subscribeToChanges: UnavailableFn(Promise.resolve(async () => Promise.resolve(false))),\n useMostRecentCategorySample: UnavailableFn(null),\n useMostRecentQuantitySample: UnavailableFn(null),\n useMostRecentWorkout: UnavailableFn(null),\n useSubscribeToChanges: UnavailableFn([null, () => null]),\n useHealthkitAuthorization: UnavailableFn([null, async () => Promise.resolve(HKAuthorizationRequestStatus.unknown)] as const),\n useIsHealthDataAvailable: () => false,\n}\n\nexport * from './types'\n\nexport default Healthkit\n"],"mappings":";;;;;;;;AAAA;;AAEA;;AAmEA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AA7DA,MAAMA,iBAAiB,GAAI,kDACzBC,qBAAA,CAASC,EACV,iBAFD;AAIA,IAAIC,SAAS,GAAG,KAAhB;;AAEA,SAASC,aAAT,CAAoCC,MAApC,EAA+C;EAC7C,OAAO,MAAM;IACX,IAAI,CAACF,SAAL,EAAgB;MACdG,OAAO,CAACC,IAAR,CAAaP,iBAAb;MACAG,SAAS,GAAG,IAAZ;IACD;;IACD,OAAOE,MAAP;EACD,CAND;AAOD;;AAED,MAAMG,SAAsC,GAAG;EAC7CC,sBAAsB,EAAEL,aAAa,CAACM,OAAO,CAACC,OAAR,CAAgB,KAAhB,CAAD,CADQ;EAE7CC,4B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AoC7C6C,kBAAkB,EAAEpD,aAAa,CAACM,OAAO,CAACC,OAAR,CAAgB,YAAYD,OAAO,CAACC,OAAR,CAAgB,KAAhB,CAA5B,CAAD,CApCY;EAqC7C8C,2BAA2B,EAAErD,aAAa,CAAC,IAAD,CArCG;EAsC7CsD,2BAA2B,EAAEtD,aAAa,CAAC,IAAD,CAtCG;EAuC7CuD,oBAAoB,EAAEvD,aAAa,CAAC,IAAD,CAvCU;EAwC7CwD,qBAAqB,EAAExD,aAAa,CAAC,CAAC,IAAD,EAAO,MAAM,IAAb,CAAD,CAxCS;EAyC7CyD,yBAAyB,EAAEzD,aAAa,CAAC,CAAC,IAAD,EAAO,YAAYM,OAAO,CAACC,OAAR,CAAgBqB,yCAAA,CAA6BC,OAA7C,CAAnB,CAAD,CAzCK;EA0C7C6B,wBAAwB,EAAE,MAAM;AA1Ca,CAA/C;eA+CetD,S"}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = exports.HKWorkoutTypeIdentifier = exports.HKWorkoutRouteTypeIdentifier = exports.HKWorkoutActivityType = exports.HKWheelchairUse = exports.HKWeatherCondition = exports.HKUpdateFrequency = exports.HKUnitSIPrefix = exports.HKUnitSI = exports.HKUnit = exports.HKStatisticsOptions = exports.HKQuantityTypeIdentifier = exports.HKInsulinDeliveryReason = exports.HKHeartRateMotionContext = exports.HKFitzpatrickSkinType = exports.HKDataTypeIdentifierHeartbeatSeries = exports.HKCorrelationTypeIdentifier = exports.HKCharacteristicTypeIdentifier = exports.HKCategoryValueSleepAnalysis = exports.HKCategoryValueSeverity = exports.HKCategoryValuePresence = exports.HKCategoryValueOvulationTestResult = exports.HKCategoryValueNotApplicable = exports.HKCategoryValueMenstrualFlow = exports.HKCategoryValueCervicalMucusQuality = exports.HKCategoryValueAppleStandHour = exports.HKCategoryValueAppetiteChanges = exports.HKCategoryTypeIdentifier = exports.HKBloodType = exports.HKBiologicalSex = exports.HKAuthorizationStatus = exports.HKAuthorizationRequestStatus = exports.HKAudiogramTypeIdentifier = exports.EventEmitter = void 0;
6
+ exports.default = exports.UnitOfVolume = exports.UnitOfTime = exports.UnitOfPressure = exports.UnitOfMass = exports.UnitOfLength = exports.UnitOfEnergy = exports.TemperatureUnit = exports.HKWorkoutTypeIdentifier = exports.HKWorkoutRouteTypeIdentifier = exports.HKWorkoutActivityType = exports.HKWheelchairUse = exports.HKWeatherCondition = exports.HKUpdateFrequency = exports.HKUnits = exports.HKUnitMetric = exports.HKStatisticsOptions = exports.HKQuantityTypeIdentifier = exports.HKMetricPrefix = exports.HKInsulinDeliveryReason = exports.HKHeartRateMotionContext = exports.HKFitzpatrickSkinType = exports.HKDataTypeIdentifierHeartbeatSeries = exports.HKCorrelationTypeIdentifier = exports.HKCharacteristicTypeIdentifier = exports.HKCategoryValueSleepAnalysis = exports.HKCategoryValueSeverity = exports.HKCategoryValuePresence = exports.HKCategoryValueOvulationTestResult = exports.HKCategoryValueNotApplicable = exports.HKCategoryValueMenstrualFlow = exports.HKCategoryValueLowCardioFitnessEvent = exports.HKCategoryValueCervicalMucusQuality = exports.HKCategoryValueAppleStandHour = exports.HKCategoryValueAppetiteChanges = exports.HKCategoryTypeIdentifier = exports.HKBloodType = exports.HKBiologicalSex = exports.HKAuthorizationStatus = exports.HKAuthorizationRequestStatus = exports.HKAudiogramTypeIdentifier = exports.EventEmitter = exports.BloodGlucoseUnit = void 0;
7
7
 
8
8
  var _reactNative = require("react-native");
9
9
 
@@ -110,8 +110,18 @@ exports.HKQuantityTypeIdentifier = HKQuantityTypeIdentifier;
110
110
  HKQuantityTypeIdentifier["stairAscentSpeed"] = "HKQuantityTypeIdentifierStairAscentSpeed";
111
111
  HKQuantityTypeIdentifier["stairDescentSpeed"] = "HKQuantityTypeIdentifierStairDescentSpeed";
112
112
  HKQuantityTypeIdentifier["uvExposure"] = "HKQuantityTypeIdentifierUvExposure";
113
+ HKQuantityTypeIdentifier["appleMoveTime"] = "HKQuantityTypeIdentifierAppleMoveTime";
114
+ HKQuantityTypeIdentifier["appleWalkingSteadiness"] = "HKQuantityTypeIdentifierAppleWalkingSteadiness";
115
+ HKQuantityTypeIdentifier["numberOfAlcoholicBeverages"] = "HKQuantityTypeIdentifierNumberOfAlcoholicBeverages";
113
116
  })(HKQuantityTypeIdentifier || (exports.HKQuantityTypeIdentifier = HKQuantityTypeIdentifier = {}));
114
117
 
118
+ let HKCategoryValueLowCardioFitnessEvent;
119
+ exports.HKCategoryValueLowCardioFitnessEvent = HKCategoryValueLowCardioFitnessEvent;
120
+
121
+ (function (HKCategoryValueLowCardioFitnessEvent) {
122
+ HKCategoryValueLowCardioFitnessEvent[HKCategoryValueLowCardioFitnessEvent["lowFitness"] = 1] = "lowFitness";
123
+ })(HKCategoryValueLowCardioFitnessEvent || (exports.HKCategoryValueLowCardioFitnessEvent = HKCategoryValueLowCardioFitnessEvent = {}));
124
+
115
125
  let HKHeartRateMotionContext;
116
126
  exports.HKHeartRateMotionContext = HKHeartRateMotionContext;
117
127
 
@@ -146,6 +156,55 @@ exports.HKCategoryTypeIdentifier = HKCategoryTypeIdentifier;
146
156
  HKCategoryTypeIdentifier["irregularHeartRhythmEvent"] = "HKCategoryTypeIdentifierIrregularHeartRhythmEvent";
147
157
  HKCategoryTypeIdentifier["audioExposureEvent"] = "HKCategoryTypeIdentifierAudioExposureEvent";
148
158
  HKCategoryTypeIdentifier["toothbrushingEvent"] = "HKCategoryTypeIdentifierToothbrushingEvent";
159
+ HKCategoryTypeIdentifier["lowCardioFitnessEvent"] = "HKCategoryTypeIdentifierLowCardioFitnessEvent";
160
+ HKCategoryTypeIdentifier["contraceptive"] = "HKCategoryTypeIdentifierContraceptive";
161
+ HKCategoryTypeIdentifier["lactation"] = "HKCategoryTypeIdentifierLactation";
162
+ HKCategoryTypeIdentifier["pregnancy"] = "HKCategoryTypeIdentifierPregnancy";
163
+ HKCategoryTypeIdentifier["pregnancyTestResult"] = "HKCategoryTypeIdentifierPregnancyTestResult";
164
+ HKCategoryTypeIdentifier["progesteroneTestResult"] = "HKCategoryTypeIdentifierProgesteroneTestResult";
165
+ HKCategoryTypeIdentifier["environmentalAudioExposureEvent"] = "HKCategoryTypeIdentifierEnvironmentalAudioExposureEvent";
166
+ HKCategoryTypeIdentifier["headphoneAudioExposureEvent"] = "HKCategoryTypeIdentifierHeadphoneAudioExposureEvent";
167
+ HKCategoryTypeIdentifier["appleWalkingSteadinessEvent"] = "HKCategoryTypeIdentifierAppleWalkingSteadinessEvent";
168
+ HKCategoryTypeIdentifier["handwashingEvent"] = "HKCategoryTypeIdentifierHandwashingEvent";
169
+ HKCategoryTypeIdentifier["abdominalCramps"] = "HKCategoryTypeIdentifierAbdominalCramps";
170
+ HKCategoryTypeIdentifier["acne"] = "HKCategoryTypeIdentifierAcne";
171
+ HKCategoryTypeIdentifier["appetiteChanges"] = "HKCategoryTypeIdentifierAppetiteChanges";
172
+ HKCategoryTypeIdentifier["bladderIncontinence"] = "HKCategoryTypeIdentifierBladderIncontinence";
173
+ HKCategoryTypeIdentifier["bloating"] = "HKCategoryTypeIdentifierBloating";
174
+ HKCategoryTypeIdentifier["breastPain"] = "HKCategoryTypeIdentifierBreastPain";
175
+ HKCategoryTypeIdentifier["chestTightnessOrPain"] = "HKCategoryTypeIdentifierChestTightnessOrPain";
176
+ HKCategoryTypeIdentifier["chills"] = "HKCategoryTypeIdentifierChills";
177
+ HKCategoryTypeIdentifier["constipation"] = "HKCategoryTypeIdentifierConstipation";
178
+ HKCategoryTypeIdentifier["coughing"] = "HKCategoryTypeIdentifierCoughing";
179
+ HKCategoryTypeIdentifier["diarrhea"] = "HKCategoryTypeIdentifierDiarrhea";
180
+ HKCategoryTypeIdentifier["dizziness"] = "HKCategoryTypeIdentifierDizziness";
181
+ HKCategoryTypeIdentifier["drySkin"] = "HKCategoryTypeIdentifierDrySkin";
182
+ HKCategoryTypeIdentifier["fainting"] = "HKCategoryTypeIdentifierFainting";
183
+ HKCategoryTypeIdentifier["fatigue"] = "HKCategoryTypeIdentifierFatigue";
184
+ HKCategoryTypeIdentifier["fever"] = "HKCategoryTypeIdentifierFever";
185
+ HKCategoryTypeIdentifier["generalizedBodyAche"] = "HKCategoryTypeIdentifierGeneralizedBodyAche";
186
+ HKCategoryTypeIdentifier["hairLoss"] = "HKCategoryTypeIdentifierHairLoss";
187
+ HKCategoryTypeIdentifier["headache"] = "HKCategoryTypeIdentifierHeadache";
188
+ HKCategoryTypeIdentifier["heartburn"] = "HKCategoryTypeIdentifierHeartburn";
189
+ HKCategoryTypeIdentifier["hotFlashes"] = "HKCategoryTypeIdentifierHotFlashes";
190
+ HKCategoryTypeIdentifier["lossOfSmell"] = "HKCategoryTypeIdentifierLossOfSmell";
191
+ HKCategoryTypeIdentifier["lossOfTaste"] = "HKCategoryTypeIdentifierLossOfTaste";
192
+ HKCategoryTypeIdentifier["lowerBackPain"] = "HKCategoryTypeIdentifierLowerBackPain";
193
+ HKCategoryTypeIdentifier["memoryLapse"] = "HKCategoryTypeIdentifierMemoryLapse";
194
+ HKCategoryTypeIdentifier["moodChanges"] = "HKCategoryTypeIdentifierMoodChanges";
195
+ HKCategoryTypeIdentifier["nausea"] = "HKCategoryTypeIdentifierNausea";
196
+ HKCategoryTypeIdentifier["nightSweats"] = "HKCategoryTypeIdentifierNightSweats";
197
+ HKCategoryTypeIdentifier["pelvicPain"] = "HKCategoryTypeIdentifierPelvicPain";
198
+ HKCategoryTypeIdentifier["rapidPoundingOrFlutteringHeartbeat"] = "HKCategoryTypeIdentifierRapidPoundingOrFlutteringHeartbeat";
199
+ HKCategoryTypeIdentifier["runnyNose"] = "HKCategoryTypeIdentifierRunnyNose";
200
+ HKCategoryTypeIdentifier["shortnessOfBreath"] = "HKCategoryTypeIdentifierShortnessOfBreath";
201
+ HKCategoryTypeIdentifier["sinusCongestion"] = "HKCategoryTypeIdentifierSinusCongestion";
202
+ HKCategoryTypeIdentifier["skippedHeartbeat"] = "HKCategoryTypeIdentifierSkippedHeartbeat";
203
+ HKCategoryTypeIdentifier["sleepChanges"] = "HKCategoryTypeIdentifierSleepChanges";
204
+ HKCategoryTypeIdentifier["soreThroat"] = "HKCategoryTypeIdentifierSoreThroat";
205
+ HKCategoryTypeIdentifier["vaginalDryness"] = "HKCategoryTypeIdentifierVaginalDryness";
206
+ HKCategoryTypeIdentifier["vomiting"] = "HKCategoryTypeIdentifierVomiting";
207
+ HKCategoryTypeIdentifier["wheezing"] = "HKCategoryTypeIdentifierWheezing";
149
208
  })(HKCategoryTypeIdentifier || (exports.HKCategoryTypeIdentifier = HKCategoryTypeIdentifier = {}));
150
209
 
151
210
  let HKCategoryValueAppleStandHour;
@@ -436,6 +495,25 @@ exports.HKInsulinDeliveryReason = HKInsulinDeliveryReason;
436
495
  HKInsulinDeliveryReason[HKInsulinDeliveryReason["bolus"] = 2] = "bolus";
437
496
  })(HKInsulinDeliveryReason || (exports.HKInsulinDeliveryReason = HKInsulinDeliveryReason = {}));
438
497
 
498
+ var HKCategoryValuePregnancyTestResult;
499
+ /* needs further mapping
500
+
501
+ contraceptive = 'HKCategoryTypeIdentifierContraceptive',
502
+ lactation = 'HKCategoryTypeIdentifierLactation',
503
+ pregnancy = 'HKCategoryTypeIdentifierPregnancy',
504
+
505
+ progesteroneTestResult = 'HKCategoryTypeIdentifierProgesteroneTestResult',
506
+ environmentalAudioExposureEvent = 'HKCategoryTypeIdentifierEnvironmentalAudioExposureEvent',
507
+ headphoneAudioExposureEvent = 'HKCategoryTypeIdentifierHeadphoneAudioExposureEvent',
508
+ appleWalkingSteadinessEvent = 'HKCategoryTypeIdentifierAppleWalkingSteadinessEvent',
509
+ handwashingEvent = 'HKCategoryTypeIdentifierHandwashingEvent', // HKCategoryValue */
510
+
511
+ (function (HKCategoryValuePregnancyTestResult) {
512
+ HKCategoryValuePregnancyTestResult[HKCategoryValuePregnancyTestResult["positive"] = 2] = "positive";
513
+ HKCategoryValuePregnancyTestResult[HKCategoryValuePregnancyTestResult["negative"] = 1] = "negative";
514
+ HKCategoryValuePregnancyTestResult[HKCategoryValuePregnancyTestResult["indeterminate"] = 3] = "indeterminate";
515
+ })(HKCategoryValuePregnancyTestResult || (HKCategoryValuePregnancyTestResult = {}));
516
+
439
517
  // Maps directly to https://developer.apple.com/documentation/healthkit/hkwheelchairuse
440
518
  let HKWheelchairUse; // Unit types are a straight mapping from here https://developer.apple.com/documentation/healthkit/hkunit/1615733-init
441
519
 
@@ -447,83 +525,175 @@ exports.HKWheelchairUse = HKWheelchairUse;
447
525
  HKWheelchairUse[HKWheelchairUse["yes"] = 2] = "yes";
448
526
  })(HKWheelchairUse || (exports.HKWheelchairUse = HKWheelchairUse = {}));
449
527
 
450
- let HKUnitSIPrefix;
451
- exports.HKUnitSIPrefix = HKUnitSIPrefix;
452
-
453
- (function (HKUnitSIPrefix) {
454
- HKUnitSIPrefix["Pico"] = "p";
455
- HKUnitSIPrefix["Nano"] = "n";
456
- HKUnitSIPrefix["Micro"] = "mc";
457
- HKUnitSIPrefix["Milli"] = "m";
458
- HKUnitSIPrefix["Centi"] = "c";
459
- HKUnitSIPrefix["Deci"] = "d";
460
- HKUnitSIPrefix["Deca"] = "da";
461
- HKUnitSIPrefix["Hecto"] = "h";
462
- HKUnitSIPrefix["Kilo"] = "k";
463
- HKUnitSIPrefix["Mega"] = "M";
464
- HKUnitSIPrefix["Giga"] = "G";
465
- HKUnitSIPrefix["Tera"] = "T";
466
- })(HKUnitSIPrefix || (exports.HKUnitSIPrefix = HKUnitSIPrefix = {}));
467
-
468
- let HKUnitSI;
469
- exports.HKUnitSI = HKUnitSI;
470
-
471
- (function (HKUnitSI) {
472
- HKUnitSI["Grams"] = "g";
473
- HKUnitSI["Joules"] = "J";
474
- HKUnitSI["Kelvin"] = "K";
475
- HKUnitSI["Liters"] = "l";
476
- HKUnitSI["Meters"] = "m";
477
- HKUnitSI["Pascals"] = "Pa";
478
- HKUnitSI["Seconds"] = "s";
479
- HKUnitSI["Siemens"] = "S";
480
- })(HKUnitSI || (exports.HKUnitSI = HKUnitSI = {}));
481
-
482
- let HKUnit;
483
- exports.HKUnit = HKUnit;
484
-
485
- (function (HKUnit) {
486
- HKUnit["Grams"] = "g";
487
- HKUnit["Joules"] = "J";
488
- HKUnit["Kelvin"] = "K";
489
- HKUnit["Liters"] = "l";
490
- HKUnit["Meters"] = "m";
491
- HKUnit["Pascals"] = "Pa";
492
- HKUnit["Seconds"] = "s";
493
- HKUnit["Siemens"] = "S";
494
- HKUnit["Atmospheres"] = "atm";
495
- HKUnit["CentimetersOfWater"] = "cmAq";
496
- HKUnit["Count"] = "count";
497
- HKUnit["Days"] = "d";
498
- HKUnit["DecibelHearingLevel"] = "dBHL";
499
- HKUnit["DecibelSoundPressureLevel"] = "dBASPL";
500
- HKUnit["DegreesCelsius"] = "degC";
501
- HKUnit["DegreesFahrenheit"] = "degF";
502
- HKUnit["Feet"] = "ft";
503
- HKUnit["Hertz"] = "Hz";
504
- HKUnit["Hours"] = "hr";
505
- HKUnit["ImperialCup"] = "cup_imp";
506
- HKUnit["ImperialFluidOunces"] = "fl_oz_imp";
507
- HKUnit["ImperialPint"] = "pt_imp";
508
- HKUnit["Inches"] = "in";
509
- HKUnit["InternationalUnit"] = "IU";
510
- HKUnit["Kilocalories"] = "kcal";
511
- HKUnit["LargeCalories"] = "Cal";
512
- HKUnit["Miles"] = "mi";
513
- HKUnit["MillimetersOfMercury"] = "mmHg";
514
- HKUnit["Minutes"] = "min";
515
- HKUnit["Ounces"] = "oz";
516
- HKUnit["Percent"] = "%";
517
- HKUnit["Pounds"] = "lb";
518
- HKUnit["SmallCalories"] = "cal";
519
- HKUnit["Stones"] = "st";
520
- HKUnit["USCup"] = "cup_us";
521
- HKUnit["USFluidOunces"] = "fl_oz_us";
522
- HKUnit["USPint"] = "pt_us";
523
- HKUnit["Yard"] = "yd";
524
- HKUnit["GlucoseMmolPerL"] = "mmol<180.15588000005408>/l";
525
- HKUnit["GlucoseMgPerDl"] = "mg/dL";
526
- })(HKUnit || (exports.HKUnit = HKUnit = {}));
528
+ let HKMetricPrefix;
529
+ exports.HKMetricPrefix = HKMetricPrefix;
530
+
531
+ (function (HKMetricPrefix) {
532
+ HKMetricPrefix["None"] = "";
533
+ HKMetricPrefix["Pico"] = "p";
534
+ HKMetricPrefix["Nano"] = "n";
535
+ HKMetricPrefix["Micro"] = "mc";
536
+ HKMetricPrefix["Milli"] = "m";
537
+ HKMetricPrefix["Centi"] = "c";
538
+ HKMetricPrefix["Deci"] = "d";
539
+ HKMetricPrefix["Deca"] = "da";
540
+ HKMetricPrefix["Hecto"] = "h";
541
+ HKMetricPrefix["Kilo"] = "k";
542
+ HKMetricPrefix["Mega"] = "M";
543
+ HKMetricPrefix["Giga"] = "G";
544
+ HKMetricPrefix["Tera"] = "T";
545
+ HKMetricPrefix["Femto"] = "f";
546
+ })(HKMetricPrefix || (exports.HKMetricPrefix = HKMetricPrefix = {}));
547
+
548
+ let HKUnitMetric;
549
+ exports.HKUnitMetric = HKUnitMetric;
550
+
551
+ (function (HKUnitMetric) {
552
+ HKUnitMetric["Gram"] = "g";
553
+ HKUnitMetric["Joule"] = "J";
554
+ HKUnitMetric["Kelvin"] = "K";
555
+ HKUnitMetric["Liter"] = "l";
556
+ HKUnitMetric["Meter"] = "m";
557
+ HKUnitMetric["Pascal"] = "Pa";
558
+ HKUnitMetric["Second"] = "s";
559
+ HKUnitMetric["Siemen"] = "S";
560
+ HKUnitMetric["Hertz"] = "Hz";
561
+ HKUnitMetric["Volt"] = "V";
562
+ })(HKUnitMetric || (exports.HKUnitMetric = HKUnitMetric = {}));
563
+
564
+ let HKUnits;
565
+ exports.HKUnits = HKUnits;
566
+
567
+ (function (HKUnits) {
568
+ HKUnits["DecibelHearingLevel"] = "dBHL";
569
+ HKUnits["DecibelSoundPressureLevel"] = "dBASPL";
570
+ HKUnits["Percent"] = "%";
571
+ HKUnits["Count"] = "count";
572
+ HKUnits["InternationalUnit"] = "IU";
573
+ })(HKUnits || (exports.HKUnits = HKUnits = {}));
574
+
575
+ /**
576
+ * More SI prefixes also available as literals, just type the string
577
+ * @example 'cm', 'km'
578
+ */
579
+ let UnitOfLength;
580
+ exports.UnitOfLength = UnitOfLength;
581
+
582
+ (function (UnitOfLength) {
583
+ UnitOfLength["Feet"] = "ft";
584
+ UnitOfLength["Meter"] = "m";
585
+ UnitOfLength["Inches"] = "in";
586
+ UnitOfLength["Yards"] = "yd";
587
+ UnitOfLength["Miles"] = "mi";
588
+ })(UnitOfLength || (exports.UnitOfLength = UnitOfLength = {}));
589
+
590
+ /**
591
+ * More SI prefixes also available as literals, just type the string
592
+ * @example 'ml', 'cl'
593
+ */
594
+ let UnitOfVolume;
595
+ exports.UnitOfVolume = UnitOfVolume;
596
+
597
+ (function (UnitOfVolume) {
598
+ UnitOfVolume["ImperialCup"] = "cup_imp";
599
+ UnitOfVolume["ImperialFluidOunces"] = "fl_oz_imp";
600
+ UnitOfVolume["ImperialPint"] = "pt_imp";
601
+ UnitOfVolume["USCup"] = "cup_us";
602
+ UnitOfVolume["USFluidOunces"] = "fl_oz_us";
603
+ UnitOfVolume["USPint"] = "pt_us";
604
+ UnitOfVolume["Liter"] = "l";
605
+ })(UnitOfVolume || (exports.UnitOfVolume = UnitOfVolume = {}));
606
+
607
+ /**
608
+ * More SI prefixes also available as literals, just type the string
609
+ * @example 'mg', 'kg'
610
+ */
611
+ let UnitOfMass;
612
+ /**
613
+ * More SI prefixes also available as literals, just type the string
614
+ * @example 'mg', 'kg'
615
+ */
616
+
617
+ exports.UnitOfMass = UnitOfMass;
618
+
619
+ (function (UnitOfMass) {
620
+ UnitOfMass["Ounces"] = "oz";
621
+ UnitOfMass["Stones"] = "st";
622
+ UnitOfMass["Pounds"] = "lb";
623
+ UnitOfMass["Gram"] = "g";
624
+ })(UnitOfMass || (exports.UnitOfMass = UnitOfMass = {}));
625
+
626
+ /**
627
+ * More SI prefixes also available as literals, just type the string
628
+ * @example 'kPa', 'hPa'
629
+ */
630
+ let UnitOfPressure;
631
+ /**
632
+ * More SI prefixes also available as literals, just type the string
633
+ * @example 'kPa', 'hPa'
634
+ */
635
+
636
+ exports.UnitOfPressure = UnitOfPressure;
637
+
638
+ (function (UnitOfPressure) {
639
+ UnitOfPressure["Atmospheres"] = "atm";
640
+ UnitOfPressure["CentimetersOfWater"] = "cmAq";
641
+ UnitOfPressure["MillimetersOfMercury"] = "mmHg";
642
+ UnitOfPressure["InchesOfMercury"] = "inHg";
643
+ UnitOfPressure["DecibelAWeightedSoundPressureLevel"] = "dBASPL";
644
+ UnitOfPressure["Pascals"] = "Pa";
645
+ })(UnitOfPressure || (exports.UnitOfPressure = UnitOfPressure = {}));
646
+
647
+ /**
648
+ * More SI prefixes also available as literals, just type the string
649
+ * @example 'ms'
650
+ */
651
+ let UnitOfTime;
652
+ /**
653
+ * More SI prefixes also available as literals, just type the string
654
+ * @example 'ms'
655
+ */
656
+
657
+ exports.UnitOfTime = UnitOfTime;
658
+
659
+ (function (UnitOfTime) {
660
+ UnitOfTime["Days"] = "d";
661
+ UnitOfTime["Minutes"] = "min";
662
+ UnitOfTime["Hours"] = "hr";
663
+ UnitOfTime["Seconds"] = "s";
664
+ })(UnitOfTime || (exports.UnitOfTime = UnitOfTime = {}));
665
+
666
+ let TemperatureUnit;
667
+ /**
668
+ * More SI prefixes also available as literals, just type the string
669
+ * @example 'kJ'
670
+ */
671
+
672
+ exports.TemperatureUnit = TemperatureUnit;
673
+
674
+ (function (TemperatureUnit) {
675
+ TemperatureUnit["DegreesCelsius"] = "degC";
676
+ TemperatureUnit["DegreesFahrenheit"] = "degF";
677
+ TemperatureUnit["Kelvin"] = "K";
678
+ })(TemperatureUnit || (exports.TemperatureUnit = TemperatureUnit = {}));
679
+
680
+ let UnitOfEnergy;
681
+ exports.UnitOfEnergy = UnitOfEnergy;
682
+
683
+ (function (UnitOfEnergy) {
684
+ UnitOfEnergy["Kilocalories"] = "kcal";
685
+ UnitOfEnergy["LargeCalories"] = "Cal";
686
+ UnitOfEnergy["SmallCalories"] = "cal";
687
+ UnitOfEnergy["Joules"] = "J";
688
+ })(UnitOfEnergy || (exports.UnitOfEnergy = UnitOfEnergy = {}));
689
+
690
+ let BloodGlucoseUnit;
691
+ exports.BloodGlucoseUnit = BloodGlucoseUnit;
692
+
693
+ (function (BloodGlucoseUnit) {
694
+ BloodGlucoseUnit["GlucoseMmolPerL"] = "mmol<180.15588000005408>/l";
695
+ BloodGlucoseUnit["GlucoseMgPerDl"] = "mg/dL";
696
+ })(BloodGlucoseUnit || (exports.BloodGlucoseUnit = BloodGlucoseUnit = {}));
527
697
 
528
698
  // Straight mapping to https://developer.apple.com/documentation/healthkit/hkcharacteristictypeidentifier
529
699
  let HKCharacteristicTypeIdentifier;
@@ -535,6 +705,7 @@ exports.HKCharacteristicTypeIdentifier = HKCharacteristicTypeIdentifier;
535
705
  HKCharacteristicTypeIdentifier["bloodType"] = "HKCharacteristicTypeIdentifierBloodType";
536
706
  HKCharacteristicTypeIdentifier["dateOfBirth"] = "HKCharacteristicTypeIdentifierDateOfBirth";
537
707
  HKCharacteristicTypeIdentifier["wheelchairUse"] = "HKCharacteristicTypeIdentifierWheelchairUse";
708
+ HKCharacteristicTypeIdentifier["activityMoveMode"] = "HKCharacteristicTypeIdentifierActivityMoveMode";
538
709
  })(HKCharacteristicTypeIdentifier || (exports.HKCharacteristicTypeIdentifier = HKCharacteristicTypeIdentifier = {}));
539
710
 
540
711
  let HKUpdateFrequency;