@kingstinct/react-native-healthkit 4.3.0 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ios/ReactNativeHealthkit.swift +2 -2
- package/lib/commonjs/index.ios.js +92 -103
- package/lib/commonjs/index.ios.js.map +1 -1
- package/lib/commonjs/index.js +2 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/native-types.js +9 -1
- package/lib/commonjs/native-types.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/module/index.ios.js +92 -103
- package/lib/module/index.ios.js.map +1 -1
- package/lib/module/index.js +2 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/native-types.js +4 -0
- package/lib/module/native-types.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/src/native-types.d.ts +126 -120
- package/lib/typescript/src/types.d.ts +79 -79
- package/package.json +20 -35
- package/src/index.ios.tsx +260 -269
- package/src/index.tsx +13 -13
- package/src/native-types.ts +184 -182
- package/src/types.ts +100 -100
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HKHeartRateMotionContext","HKCategoryTypeIdentifier","HKCategoryValueAppleStandHour","HKWorkoutActivityType","HKWeatherCondition","HKQuantityTypeIdentifier","HKAuthorizationRequestStatus","HKAuthorizationStatus","HKBloodType","HKBiologicalSex","HKFitzpatrickSkinType","HKStatisticsOptions","HKCategoryValueCervicalMucusQuality","HKCategoryValueMenstrualFlow","HKCategoryValueOvulationTestResult","HKCategoryValueSleepAnalysis","HKCategoryValueAppetiteChanges","HKCategoryValuePresence","HKCategoryValueSeverity","HKCategoryValueNotApplicable","HKInsulinDeliveryReason","HKWheelchairUse","HKUnitSIPrefix","HKUnitSI","HKUnit","HKCharacteristicTypeIdentifier","HKCorrelationTypeIdentifier","HKUpdateFrequency","Native","NativeModules","ReactNativeHealthkit","EventEmitter","NativeEventEmitter"],"sources":["native-types.ts"],"sourcesContent":["import {\n EmitterSubscription,\n NativeEventEmitter,\n NativeModules,\n} from 'react-native';\n\nexport type HKWorkoutTypeIdentifier = 'HKWorkoutTypeIdentifier';\nexport type HKAudiogramTypeIdentifier = 'HKAudiogramTypeIdentifier';\n\nexport type HKSampleTypeIdentifier =\n | HKWorkoutTypeIdentifier\n | HKQuantityTypeIdentifier\n | HKCategoryTypeIdentifier\n | HKAudiogramTypeIdentifier\n | HKCorrelationTypeIdentifier;\n\nexport type TypeToUnitMapping = {\n [key in HKQuantityTypeIdentifier]: HKUnit;\n};\n\nexport enum HKHeartRateMotionContext {\n active = 2,\n notSet = 0,\n sedentary = 1,\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}\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 [key: string]: string | number | boolean | HKQuantity | undefined;\n HKExternalUUID?: string;\n HKTimeZone?: string;\n HKWasUserEntered?: boolean;\n HKDeviceSerialNumber?: string;\n HKUDIDeviceIdentifier?: string;\n HKUDIProductionIdentifier?: string;\n HKDigitalSignature?: string;\n HKDeviceName?: string;\n HKDeviceManufacturerName?: string;\n HKSyncIdentifier?: string;\n HKSyncVersion?: number;\n HKWasTakenInLab?: boolean;\n HKReferenceRangeLowerLimit?: number;\n 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\nexport interface HKWorkoutMetadata\n extends HKGenericMetadata /*<TTemperatureUnit extends HKUnit>*/ {\n HKWeatherCondition?: HKWeatherCondition;\n HKWeatherHumidity?: HKQuantity<HKUnit.Percent>;\n // HKWeatherTemperature: HKQuantity<TTemperatureUnit>\n}\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\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 unit: T;\n 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 averageQuantity?: HKQuantity<TUnit>;\n maximumQuantity?: HKQuantity<TUnit>;\n minimumQuantity?: HKQuantity<TUnit>;\n sumQuantity?: HKQuantity<TUnit>;\n mostRecentQuantity?: HKQuantity<TUnit>;\n mostRecentQuantityDateInterval?: { from: string; to: string };\n 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\n | HKCategoryValuePresence\n | HKCategoryValueSeverity\n | HKCategoryValuePresence\n | HKCategoryValueMenstrualFlow\n | HKCategoryValueSleepAnalysis\n | HKCategoryValueCervicalMucusQuality\n | HKCategoryValueOvulationTestResult\n | 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 HKInsulinDeliveryReason: HKInsulinDeliveryReason;\n }\n : TQuantityTypeIdentifier extends HKQuantityTypeIdentifier.bloodGlucose\n ? HKGenericMetadata & {\n HKBloodGlucoseMealTime?: number;\n }\n : TQuantityTypeIdentifier extends HKQuantityTypeIdentifier.heartRate\n ? HKGenericMetadata & {\n HKHeartRateMotionContext?: HKHeartRateMotionContext;\n }\n : HKGenericMetadata;\n\nexport type MetadataMapperForCorrelationIdentifier<\n TCorrelationTypeIdentifier = HKCorrelationTypeIdentifier\n> = TCorrelationTypeIdentifier extends HKCorrelationTypeIdentifier.food\n ? HKGenericMetadata & {\n 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.mindfulSession\n ? HKCategoryValueNotApplicable\n : T extends HKCategoryTypeIdentifier.intermenstrualBleeding\n ? HKCategoryValueNotApplicable\n : T extends HKCategoryTypeIdentifier.highHeartRateEvent\n ? HKCategoryValueNotApplicable\n : T extends HKCategoryTypeIdentifier.sexualActivity\n ? HKCategoryValueNotApplicable\n : T extends HKCategoryTypeIdentifier.appleStandHour\n ? HKCategoryValueAppleStandHour\n : number;\n\nexport type MetadataMapperForCategoryIdentifier<\n T extends HKCategoryTypeIdentifier\n> = T extends HKCategoryTypeIdentifier.sexualActivity\n ? HKGenericMetadata & {\n HKSexualActivityProtectionUsed: boolean;\n }\n : T extends HKCategoryTypeIdentifier.menstrualFlow\n ? HKGenericMetadata & {\n 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 name: string;\n firmwareVersion: string;\n hardwareVersion: string;\n localIdentifier: string;\n manufacturer: string;\n model: string;\n softwareVersion: string;\n};\n\nexport type HKSource = {\n name: string;\n bundleIdentifier: string;\n};\n\nexport type HKSourceRevision = {\n source: HKSource;\n version: string;\n operatingSystemVersion?: string;\n productType?: string;\n};\n\nexport type HKQuantitySampleRaw<\n TQuantityIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier,\n TUnit extends HKUnit = HKUnit\n> = {\n uuid: string;\n device?: HKDevice;\n quantityType: TQuantityIdentifier;\n startDate: string;\n endDate: string;\n quantity: number;\n unit: TUnit;\n metadata: MetadataMapperForQuantityIdentifier<TQuantityIdentifier>;\n sourceRevision?: HKSourceRevision;\n};\n\nexport type HKWorkoutRaw<TEnergy extends HKUnit, TDistance extends HKUnit> = {\n workoutActivityType: HKWorkoutActivityType;\n duration: number;\n totalDistance?: HKQuantity<TDistance>;\n totalEnergyBurned?: HKQuantity<TEnergy>;\n totalSwimmingStrokeCount?: HKQuantity<HKUnit.Count>;\n totalFlightsClimbed?: HKQuantity<HKUnit.Count>;\n startDate: string;\n endDate: string;\n metadata?: HKWorkoutMetadata;\n 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}\n\nexport type WritePermssions = {\n [key in\n | HKCharacteristicTypeIdentifier\n | HKQuantityTypeIdentifier\n | HKCategoryTypeIdentifier]: boolean;\n};\n\nexport type ReadPermssions = {\n [key in\n | HKQuantityTypeIdentifier\n | HKCharacteristicTypeIdentifier\n | HKCategoryTypeIdentifier]: boolean;\n};\n\nexport type HKCategorySampleRaw<\n T extends HKCategoryTypeIdentifier = HKCategoryTypeIdentifier\n> = {\n uuid: string;\n device?: HKDevice;\n categoryType: T;\n startDate: string;\n endDate: string;\n value: HKCategoryValueForIdentifier<T>;\n metadata: MetadataMapperForCategoryIdentifier<T>;\n sourceRevision?: HKSourceRevision;\n};\n\nexport type HKCorrelationRaw<TIdentifier extends HKCorrelationTypeIdentifier> =\n {\n correlationType: HKCorrelationTypeIdentifier;\n objects: (HKQuantitySampleRaw | HKCategorySampleRaw)[];\n metadata: MetadataMapperForCorrelationIdentifier<TIdentifier>;\n startDate: string;\n endDate: string;\n };\n\ntype QueryId = string;\n\nexport enum HKCorrelationTypeIdentifier {\n bloodPressure = 'HKCorrelationTypeIdentifierBloodPressure',\n food = 'HKCorrelationTypeIdentifierFood',\n}\n\nexport enum HKUpdateFrequency {\n immediate = 1,\n hourly = 2,\n daily = 3,\n weekly = 4,\n}\n\nexport type WorkoutLocation = {\n longitude: number;\n latitude: number;\n altitude: number;\n speed: number;\n timestamp: number;\n horizontalAccuracy: number;\n speedAccuracy: number;\n verticalAccuracy: number;\n};\n\nexport type WorkoutRoute = {\n locations: WorkoutLocation[];\n HKMetadataKeySyncIdentifier?: string;\n 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 getWheelchairUse: () => Promise<HKWheelchairUse>;\n\n enableBackgroundDelivery: (\n typeIdentifier: HKSampleTypeIdentifier,\n updateFrequency: HKUpdateFrequency\n ) => Promise<boolean>;\n disableBackgroundDelivery: (\n typeIdentifier: HKSampleTypeIdentifier\n ) => Promise<boolean>;\n disableAllBackgroundDelivery: () => Promise<boolean>;\n\n saveCorrelationSample: <TIdentifier extends HKCorrelationTypeIdentifier>(\n typeIdentifier: TIdentifier,\n samples: Omit<\n HKQuantitySampleRaw | HKCategorySampleRaw,\n 'startDate' | 'endDate' | 'uuid' | 'device'\n >[],\n start: string,\n end: string,\n metadata: MetadataMapperForCorrelationIdentifier<TIdentifier>\n ) => Promise<boolean>;\n\n saveWorkoutSample: (\n typeIdentifier: HKWorkoutActivityType,\n quantities: Omit<\n HKQuantitySampleRaw,\n 'startDate' | 'endDate' | 'uuid' | 'device'\n >[],\n start: string,\n end: string,\n metadata: HKWorkoutMetadata\n ) => Promise<boolean>;\n\n queryCorrelationSamples: <TIdentifier extends HKCorrelationTypeIdentifier>(\n typeIdentifier: TIdentifier,\n from: string,\n to: string\n ) => Promise<HKCorrelationRaw<TIdentifier>[]>;\n\n subscribeToObserverQuery(\n identifier: HKSampleTypeIdentifier\n ): Promise<QueryId>;\n unsubscribeQuery(queryId: QueryId): Promise<boolean>;\n authorizationStatusFor(\n type: HKSampleTypeIdentifier | HKCharacteristicTypeIdentifier\n ): Promise<boolean>;\n getRequestStatusForAuthorization(\n write: WritePermssions | {},\n read: ReadPermssions | {}\n ): Promise<HKAuthorizationRequestStatus>;\n requestAuthorization(\n write: WritePermssions | {},\n read: ReadPermssions | {}\n ): Promise<boolean>;\n saveQuantitySample: (\n identifier: HKQuantityTypeIdentifier,\n unit: HKUnit,\n value: number,\n start: string,\n end: string,\n metadata: Object\n ) => Promise<boolean>;\n 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<HKWorkoutRaw<TEnergy, TDistance>[]>;\n queryCategorySamples: <T extends HKCategoryTypeIdentifier>(\n identifier: T,\n from: string,\n to: string,\n limit: Number,\n ascending: boolean\n ) => Promise<HKCategorySampleRaw<T>[]>;\n 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<HKQuantitySampleRaw<TIdentifier, TUnit>[]>;\n saveCategorySample: <T extends HKCategoryTypeIdentifier>(\n identifier: T,\n value: HKCategoryValueForIdentifier<T>,\n start: string,\n end: string,\n metadata: Object\n ) => Promise<boolean>;\n queryStatisticsForQuantity: <TUnit extends HKUnit>(\n identifier: HKQuantityTypeIdentifier,\n unit: TUnit,\n from: string,\n to: string,\n options: HKStatisticsOptions[]\n ) => Promise<QueryStatisticsResponseRaw<TUnit>>;\n getPreferredUnits: (\n identifiers: HKQuantityTypeIdentifier[]\n ) => Promise<TypeToUnitMapping>;\n getWorkoutRoutes: (workoutUUID: string) => Promise<WorkoutRoute[]>;\n};\n\nconst Native =\n NativeModules.ReactNativeHealthkit as ReactNativeHealthkitTypeNative;\n\ntype OnChangeCallback = ({\n typeIdentifier,\n}: {\n typeIdentifier: HKSampleTypeIdentifier;\n}) => void;\n\ninterface HealthkitEventEmitter extends NativeEventEmitter {\n 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;;IAoBYA,wB;;;WAAAA,wB;EAAAA,wB,CAAAA,wB;EAAAA,wB,CAAAA,wB;EAAAA,wB,CAAAA,wB;GAAAA,wB,wCAAAA,wB;;IAMAC,wB;;;WAAAA,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;GAAAA,wB,wCAAAA,wB;;IAgBAC,6B;;;WAAAA,6B;EAAAA,6B,CAAAA,6B;EAAAA,6B,CAAAA,6B;GAAAA,6B,6CAAAA,6B;;IAKAC,qB;;;WAAAA,qB;EAAAA,qB,CAAAA,qB;EAAAA,qB,CAAAA,qB;EAAAA,qB,CAAAA,qB;EAA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FZ;IACYC,8B;;;WAAAA,8B;EAAAA,8B;EAAAA,8B;EAAAA,8B;EAAAA,8B;EAAAA,8B;GAAAA,8B,8CAAAA,8B;;IA8CAC,2B;;;WAAAA,2B;EAAAA,2B;EAAAA,2B;GAAAA,2B,2CAAAA,2B;;IAKAC,iB;;;WAAAA,iB;EAAAA,iB,CAAAA,iB;EAAAA,iB,CAAAA,iB;EAAAA,iB,CAAAA,iB;EAAAA,iB,CAAAA,iB;GAAAA,iB,iCAAAA,iB;;AA0IZ,MAAMC,MAAM,GACVC,0BAAA,CAAcC,oBADhB;AAgBO,MAAMC,YAAY,GAAG,IAAIC,+BAAJ,CAC1BH,0BAAA,CAAcC,oBADY,CAArB;;eAIQF,M"}
|
|
1
|
+
{"version":3,"names":["HKWorkoutTypeIdentifier","HKAudiogramTypeIdentifier","HKWorkoutRouteTypeIdentifier","HKDataTypeIdentifierHeartbeatSeries","HKHeartRateMotionContext","HKCategoryTypeIdentifier","HKCategoryValueAppleStandHour","HKWorkoutActivityType","HKWeatherCondition","HKQuantityTypeIdentifier","HKAuthorizationRequestStatus","HKAuthorizationStatus","HKBloodType","HKBiologicalSex","HKFitzpatrickSkinType","HKStatisticsOptions","HKCategoryValueCervicalMucusQuality","HKCategoryValueMenstrualFlow","HKCategoryValueOvulationTestResult","HKCategoryValueSleepAnalysis","HKCategoryValueAppetiteChanges","HKCategoryValuePresence","HKCategoryValueSeverity","HKCategoryValueNotApplicable","HKInsulinDeliveryReason","HKWheelchairUse","HKUnitSIPrefix","HKUnitSI","HKUnit","HKCharacteristicTypeIdentifier","HKCorrelationTypeIdentifier","HKUpdateFrequency","Native","NativeModules","ReactNativeHealthkit","EventEmitter","NativeEventEmitter"],"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'\nexport const HKAudiogramTypeIdentifier = 'HKAudiogramTypeIdentifier'\nexport const HKWorkoutRouteTypeIdentifier = 'HKWorkoutRouteTypeIdentifier'\nexport const HKDataTypeIdentifierHeartbeatSeries = 'HKDataTypeIdentifierHeartbeatSeries'\n\nexport type HKSampleTypeIdentifier =\n | HKCategoryTypeIdentifier\n | HKCorrelationTypeIdentifier\n | HKQuantityTypeIdentifier\n | typeof HKAudiogramTypeIdentifier\n | typeof HKDataTypeIdentifierHeartbeatSeries\n | typeof HKWorkoutRouteTypeIdentifier\n | typeof HKWorkoutTypeIdentifier;\n\nexport type TypeToUnitMapping = { readonly\n [key in HKQuantityTypeIdentifier]: HKUnit;\n};\n\nexport enum HKHeartRateMotionContext {\n active = 2,\n notSet = 0,\n sedentary = 1,\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}\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\nexport interface HKWorkoutMetadata\n extends HKGenericMetadata /* <TTemperatureUnit extends HKUnit> */ {\n readonly HKWeatherCondition?: HKWeatherCondition;\n readonly HKWeatherHumidity?: HKQuantity<HKUnit.Percent>;\n // HKWeatherTemperature: HKQuantity<TTemperatureUnit>\n}\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\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\n | HKCategoryValueCervicalMucusQuality\n | HKCategoryValueMenstrualFlow\n | HKCategoryValueOvulationTestResult\n | HKCategoryValuePresence\n | HKCategoryValuePresence\n | HKCategoryValueSeverity\n | HKCategoryValueSleepAnalysis\n | 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.mindfulSession\n ? HKCategoryValueNotApplicable\n : T extends HKCategoryTypeIdentifier.intermenstrualBleeding\n ? HKCategoryValueNotApplicable\n : T extends HKCategoryTypeIdentifier.highHeartRateEvent\n ? HKCategoryValueNotApplicable\n : T extends HKCategoryTypeIdentifier.sexualActivity\n ? HKCategoryValueNotApplicable\n : T extends HKCategoryTypeIdentifier.appleStandHour\n ? HKCategoryValueAppleStandHour\n : number;\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;\n readonly firmwareVersion: string;\n readonly hardwareVersion: string;\n readonly localIdentifier: string;\n readonly manufacturer: string;\n readonly model: string;\n readonly softwareVersion: string;\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}\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 HKCorrelationTypeIdentifier {\n bloodPressure = 'HKCorrelationTypeIdentifierBloodPressure',\n food = 'HKCorrelationTypeIdentifierFood',\n}\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 AuthorizationStatusFor = HKCharacteristicTypeIdentifier | HKSampleTypeIdentifier\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: AuthorizationStatusFor\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\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HKBloodType,\n HKCategorySampleRaw,\n HKCategoryTypeIdentifier,\n HKCategoryValueForIdentifier,\n HKCharacteristicTypeIdentifier,\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 energyUnit?: TEnergy;\n distanceUnit?: TDistance;\n}\n\nexport interface HKCategorySample<\n T extends HKCategoryTypeIdentifier = HKCategoryTypeIdentifier\n> extends Omit<HKCategorySampleRaw<T>, 'startDate' | 'endDate'> {\n startDate: Date;\n endDate: Date;\n}\n\nexport type GenericQueryOptions = {\n from?: Date;\n to?: Date;\n limit?: Number;\n ascending?: boolean;\n};\n\nexport interface HKWorkout<\n TEnergy extends HKUnit = HKUnit,\n TDistance extends HKUnit = HKUnit\n> extends Omit<HKWorkoutRaw<TEnergy, TDistance>, 'startDate' | 'endDate'> {\n startDate: Date;\n 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 'startDate' | 'endDate'\n > {\n startDate: Date;\n endDate: Date;\n}\n\nexport interface QueryStatisticsResponse<T extends HKUnit = HKUnit>\n extends Omit<\n QueryStatisticsResponseRaw<T>,\n 'mostRecentQuantityDateInterval'\n > {\n mostRecentQuantityDateInterval?: { from: Date; 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: 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<HKWorkout<TEnergy, TDistance>[]>;\n\nexport type AuthorizationStatusForFn = (\n type: HKSampleTypeIdentifier | HKCharacteristicTypeIdentifier\n) => Promise<boolean>;\n\nexport type QueryCategorySamplesFn = <T extends HKCategoryTypeIdentifier>(\n identifier: T,\n options: GenericQueryOptions\n) => Promise<HKCategorySample<T>[]>;\n\nexport type GetRequestStatusForAuthorizationFn = (\n read: (HKCharacteristicTypeIdentifier | HKSampleTypeIdentifier)[],\n write?: HKSampleTypeIdentifier[]\n) => Promise<HKAuthorizationRequestStatus>;\n\nexport type RequestAuthorizationFn = (\n read: (HKCharacteristicTypeIdentifier | HKSampleTypeIdentifier)[],\n write?: HKSampleTypeIdentifier[]\n) => Promise<boolean>;\n\nexport type SaveQuantitySampleFn = <TUnit extends HKQuantityTypeIdentifier>(\n identifier: TUnit,\n unit: HKUnit,\n value: number,\n options?: {\n start?: Date;\n end?: Date;\n 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 & { unit?: TUnit }\n) => Promise<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 start?: Date;\n end?: Date;\n 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>>;\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: HKQuantityTypeIdentifier[]\n) => Promise<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: (\n | Omit<HKCategorySample, 'startDate' | 'endDate' | 'uuid' | 'device'>\n | Omit<HKQuantitySample, 'startDate' | 'endDate' | 'uuid' | 'device'>\n )[],\n options?: {\n start?: Date;\n end?: Date;\n metadata?: MetadataMapperForCorrelationIdentifier<TIdentifier>;\n }\n) => Promise<boolean>;\n\nexport type SaveWorkoutSampleFn = (\n typeIdentifier: HKWorkoutActivityType,\n quantities: Omit<\n HKQuantitySample,\n 'startDate' | 'endDate' | 'uuid' | 'device'\n >[],\n start: Date,\n options?: {\n end?: Date;\n metadata?: HKWorkoutMetadata;\n }\n) => Promise<boolean>;\n\nexport interface HKCorrelation<TIdentifier extends HKCorrelationTypeIdentifier>\n extends Omit<\n HKCorrelationRaw<TIdentifier>,\n 'startDate' | 'endDate' | 'objects'\n > {\n objects: (HKQuantitySample | HKCategorySample)[];\n startDate: Date;\n endDate: Date;\n}\n\nexport type QueryCorrelationSamplesFn = <\n TIdentifier extends HKCorrelationTypeIdentifier\n>(\n typeIdentifier: TIdentifier,\n options: Omit<GenericQueryOptions, 'limit' | 'ascending'>\n) => Promise<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<WorkoutRoute[]>;\n\nexport type ReactNativeHealthkit = {\n authorizationStatusFor: AuthorizationStatusForFn;\n\n getBiologicalSex: GetBiologicalSexFn;\n getBloodType: GetBloodTypeFn;\n getDateOfBirth: GetDateOfBirthFn;\n getFitzpatrickSkinType: GetFitzpatrickSkinTypeFn;\n getMostRecentQuantitySample: GetMostRecentQuantitySampleFn;\n getMostRecentCategorySample: GetMostRecentCategorySampleFn;\n getMostRecentWorkout: GetMostRecentWorkoutFn;\n getPreferredUnit: GetPreferredUnitFn;\n getPreferredUnits: GetPreferredUnitsFn;\n getRequestStatusForAuthorization: GetRequestStatusForAuthorizationFn;\n getWheelchairUse: GetWheelchairUseFn;\n getWorkoutRoutes: GetWorkoutRoutesFn;\n\n buildUnitWithPrefix: (prefix: HKUnitSIPrefix, unit: HKUnitSI) => HKUnit;\n\n isHealthDataAvailable: IsHealthDataAvailableFn;\n\n queryCategorySamples: QueryCategorySamplesFn;\n queryQuantitySamples: QueryQuantitySamplesFn;\n queryStatisticsForQuantity: QueryStatisticsForQuantityFn;\n queryWorkouts: QueryWorkoutsFn;\n queryCorrelationSamples: QueryCorrelationSamplesFn;\n\n requestAuthorization: RequestAuthorizationFn;\n\n saveCategorySample: SaveCategorySampleFn;\n saveQuantitySample: SaveQuantitySampleFn;\n saveCorrelationSample: SaveCorrelationSampleFn;\n saveWorkoutSample: SaveWorkoutSampleFn;\n enableBackgroundDelivery: (\n typeIdentifier: HKSampleTypeIdentifier,\n updateFrequency: HKUpdateFrequency\n ) => Promise<boolean>;\n disableBackgroundDelivery: (\n typeIdentifier: HKSampleTypeIdentifier\n ) => Promise<boolean>;\n disableAllBackgroundDelivery: () => Promise<boolean>;\n\n subscribeToChanges: SubscribeToChangesFn;\n\n useMostRecentWorkout: MostRecentWorkoutHook;\n useMostRecentCategorySample: MostRecentCategorySampleHook;\n useMostRecentQuantitySample: MostRecentQuantitySampleHook;\n\n useSubscribeToChanges: SubscribeToChangesHook;\n};\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {\n HKAuthorizationRequestStatus,\n HKBiologicalSex,\n HKBloodType,\n HKCategorySampleRaw,\n HKCategoryTypeIdentifier,\n HKCategoryValueForIdentifier,\n HKCharacteristicTypeIdentifier,\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: HKCharacteristicTypeIdentifier | HKSampleTypeIdentifier\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 (HKCharacteristicTypeIdentifier | HKSampleTypeIdentifier)[],\n write?: readonly HKSampleTypeIdentifier[]\n) => Promise<HKAuthorizationRequestStatus>;\n\nexport type RequestAuthorizationFn = (\n read: readonly (HKCharacteristicTypeIdentifier | HKSampleTypeIdentifier)[],\n write?: readonly HKSampleTypeIdentifier[]\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>>;\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};\n"],"mappings":""}
|
package/lib/module/index.ios.js
CHANGED
|
@@ -29,22 +29,16 @@ function deserializeWorkout(sample) {
|
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
const deserializCategorySample = sample => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
};
|
|
37
|
-
};
|
|
32
|
+
const deserializCategorySample = sample => ({ ...sample,
|
|
33
|
+
startDate: new Date(sample.startDate),
|
|
34
|
+
endDate: new Date(sample.endDate)
|
|
35
|
+
});
|
|
38
36
|
|
|
39
|
-
const serializeDate = date =>
|
|
40
|
-
return date ? date.toISOString() : new Date(0).toISOString();
|
|
41
|
-
};
|
|
37
|
+
const serializeDate = date => date ? date.toISOString() : new Date(0).toISOString();
|
|
42
38
|
|
|
43
39
|
const prepareOptions = options => {
|
|
44
|
-
var _options$ascending;
|
|
45
|
-
|
|
46
40
|
const limit = !options.limit || options.limit === Infinity ? 0 : options.limit;
|
|
47
|
-
const ascending =
|
|
41
|
+
const ascending = options.ascending ?? limit === 0;
|
|
48
42
|
const from = serializeDate(options.from);
|
|
49
43
|
const to = serializeDate(options.to);
|
|
50
44
|
return {
|
|
@@ -62,6 +56,36 @@ const queryQuantitySamples = async (identifier, options) => {
|
|
|
62
56
|
return quantitySamples.map(deserializeSample);
|
|
63
57
|
};
|
|
64
58
|
|
|
59
|
+
async function getPreferredUnitsTyped(options) {
|
|
60
|
+
let energyUnit = options === null || options === void 0 ? void 0 : options.energyUnit;
|
|
61
|
+
let distanceUnit = options === null || options === void 0 ? void 0 : options.distanceUnit;
|
|
62
|
+
|
|
63
|
+
if (!energyUnit || !distanceUnit) {
|
|
64
|
+
const units = await Native.getPreferredUnits([HKQuantityTypeIdentifier.distanceWalkingRunning, HKQuantityTypeIdentifier.activeEnergyBurned]);
|
|
65
|
+
|
|
66
|
+
if (!energyUnit) {
|
|
67
|
+
energyUnit = units[HKQuantityTypeIdentifier.distanceWalkingRunning];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (!distanceUnit) {
|
|
71
|
+
distanceUnit = units[HKQuantityTypeIdentifier.activeEnergyBurned];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (!energyUnit) {
|
|
76
|
+
energyUnit = HKUnit.Kilocalories;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (!distanceUnit) {
|
|
80
|
+
distanceUnit = HKUnit.Meters;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return {
|
|
84
|
+
energyUnit,
|
|
85
|
+
distanceUnit
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
65
89
|
const subscribeToChanges = async (identifier, callback) => {
|
|
66
90
|
const subscription = EventEmitter.addListener('onChange', _ref => {
|
|
67
91
|
let {
|
|
@@ -72,11 +96,11 @@ const subscribeToChanges = async (identifier, callback) => {
|
|
|
72
96
|
callback();
|
|
73
97
|
}
|
|
74
98
|
});
|
|
75
|
-
const queryId = await Native.subscribeToObserverQuery(identifier).catch(error => {
|
|
99
|
+
const queryId = await Native.subscribeToObserverQuery(identifier).catch(async error => {
|
|
76
100
|
subscription.remove();
|
|
77
101
|
return Promise.reject(error);
|
|
78
102
|
});
|
|
79
|
-
return () => {
|
|
103
|
+
return async () => {
|
|
80
104
|
subscription.remove();
|
|
81
105
|
return Native.unsubscribeQuery(queryId);
|
|
82
106
|
};
|
|
@@ -85,7 +109,7 @@ const subscribeToChanges = async (identifier, callback) => {
|
|
|
85
109
|
const getMostRecentQuantitySample = async (identifier, unit) => {
|
|
86
110
|
const samples = await queryQuantitySamples(identifier, {
|
|
87
111
|
limit: 1,
|
|
88
|
-
unit
|
|
112
|
+
unit
|
|
89
113
|
});
|
|
90
114
|
return samples[0];
|
|
91
115
|
};
|
|
@@ -100,17 +124,20 @@ function useMostRecentWorkout(options) {
|
|
|
100
124
|
energyUnit,
|
|
101
125
|
distanceUnit
|
|
102
126
|
} = await getPreferredUnitsTyped(options);
|
|
103
|
-
cancelSubscription = await subscribeToChanges('HKWorkoutTypeIdentifier', () => {
|
|
104
|
-
getMostRecentWorkout({
|
|
127
|
+
cancelSubscription = await subscribeToChanges('HKWorkoutTypeIdentifier', async () => {
|
|
128
|
+
const w = await getMostRecentWorkout({
|
|
105
129
|
energyUnit,
|
|
106
130
|
distanceUnit
|
|
107
|
-
})
|
|
131
|
+
});
|
|
132
|
+
setWorkout(w);
|
|
108
133
|
});
|
|
109
134
|
};
|
|
110
135
|
|
|
111
|
-
init();
|
|
136
|
+
void init();
|
|
112
137
|
return () => {
|
|
113
|
-
|
|
138
|
+
var _cancelSubscription;
|
|
139
|
+
|
|
140
|
+
void ((_cancelSubscription = cancelSubscription) === null || _cancelSubscription === void 0 ? void 0 : _cancelSubscription());
|
|
114
141
|
};
|
|
115
142
|
}, [options]);
|
|
116
143
|
return workout;
|
|
@@ -124,15 +151,6 @@ const getMostRecentCategorySample = async identifier => {
|
|
|
124
151
|
return samples[0];
|
|
125
152
|
};
|
|
126
153
|
|
|
127
|
-
function useMostRecentCategorySample(identifier) {
|
|
128
|
-
const [category, setCategory] = useState(null);
|
|
129
|
-
const updater = useCallback(() => {
|
|
130
|
-
getMostRecentCategorySample(identifier).then(setCategory);
|
|
131
|
-
}, [identifier]);
|
|
132
|
-
useSubscribeToChanges(identifier, updater);
|
|
133
|
-
return category;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
154
|
function useSubscribeToChanges(identifier, onChange) {
|
|
137
155
|
useEffect(() => {
|
|
138
156
|
let cancelSubscription;
|
|
@@ -141,13 +159,24 @@ function useSubscribeToChanges(identifier, onChange) {
|
|
|
141
159
|
cancelSubscription = await subscribeToChanges(identifier, onChange);
|
|
142
160
|
};
|
|
143
161
|
|
|
144
|
-
init();
|
|
162
|
+
void init();
|
|
145
163
|
return () => {
|
|
146
|
-
|
|
164
|
+
var _cancelSubscription2;
|
|
165
|
+
|
|
166
|
+
void ((_cancelSubscription2 = cancelSubscription) === null || _cancelSubscription2 === void 0 ? void 0 : _cancelSubscription2());
|
|
147
167
|
};
|
|
148
168
|
}, [identifier, onChange]);
|
|
149
169
|
}
|
|
150
170
|
|
|
171
|
+
function useMostRecentCategorySample(identifier) {
|
|
172
|
+
const [category, setCategory] = useState(null);
|
|
173
|
+
const updater = useCallback(() => {
|
|
174
|
+
void getMostRecentCategorySample(identifier).then(setCategory);
|
|
175
|
+
}, [identifier]);
|
|
176
|
+
useSubscribeToChanges(identifier, updater);
|
|
177
|
+
return category;
|
|
178
|
+
}
|
|
179
|
+
|
|
151
180
|
function useMostRecentQuantitySample(identifier, unit) {
|
|
152
181
|
const [lastSample, setLastSample] = useState(null);
|
|
153
182
|
useEffect(() => {
|
|
@@ -155,22 +184,23 @@ function useMostRecentQuantitySample(identifier, unit) {
|
|
|
155
184
|
|
|
156
185
|
const init = async () => {
|
|
157
186
|
const actualUnit = await ensureUnit(identifier, unit);
|
|
158
|
-
cancelSubscription = await subscribeToChanges(identifier, () => {
|
|
159
|
-
getMostRecentQuantitySample(identifier, actualUnit)
|
|
160
|
-
|
|
161
|
-
});
|
|
187
|
+
cancelSubscription = await subscribeToChanges(identifier, async () => {
|
|
188
|
+
const value = await getMostRecentQuantitySample(identifier, actualUnit);
|
|
189
|
+
setLastSample(value);
|
|
162
190
|
});
|
|
163
191
|
};
|
|
164
192
|
|
|
165
|
-
init();
|
|
193
|
+
void init();
|
|
166
194
|
return () => {
|
|
167
|
-
|
|
195
|
+
var _cancelSubscription3;
|
|
196
|
+
|
|
197
|
+
void ((_cancelSubscription3 = cancelSubscription) === null || _cancelSubscription3 === void 0 ? void 0 : _cancelSubscription3());
|
|
168
198
|
};
|
|
169
199
|
}, [identifier, unit]);
|
|
170
200
|
return lastSample;
|
|
171
201
|
}
|
|
172
202
|
|
|
173
|
-
const saveQuantitySample = (identifier, unit, value, options) => {
|
|
203
|
+
const saveQuantitySample = async (identifier, unit, value, options) => {
|
|
174
204
|
const start = (options === null || options === void 0 ? void 0 : options.start) || (options === null || options === void 0 ? void 0 : options.end) || new Date();
|
|
175
205
|
const end = (options === null || options === void 0 ? void 0 : options.end) || (options === null || options === void 0 ? void 0 : options.start) || new Date();
|
|
176
206
|
const metadata = (options === null || options === void 0 ? void 0 : options.metadata) || {};
|
|
@@ -195,18 +225,14 @@ const queryStatisticsForQuantity = async (identifier, options, from, to, unit) =
|
|
|
195
225
|
return response;
|
|
196
226
|
};
|
|
197
227
|
|
|
198
|
-
const requestAuthorization = function (read) {
|
|
228
|
+
const requestAuthorization = async function (read) {
|
|
199
229
|
let write = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
200
|
-
const readPermissions = read.reduce((obj, cur) => {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
return { ...obj,
|
|
207
|
-
[cur]: true
|
|
208
|
-
};
|
|
209
|
-
}, {});
|
|
230
|
+
const readPermissions = read.reduce((obj, cur) => ({ ...obj,
|
|
231
|
+
[cur]: true
|
|
232
|
+
}), {});
|
|
233
|
+
const writePermissions = write.reduce((obj, cur) => ({ ...obj,
|
|
234
|
+
[cur]: true
|
|
235
|
+
}), {});
|
|
210
236
|
return Native.requestAuthorization(writePermissions, readPermissions);
|
|
211
237
|
};
|
|
212
238
|
|
|
@@ -215,18 +241,14 @@ const getDateOfBirth = async () => {
|
|
|
215
241
|
return new Date(dateOfBirth);
|
|
216
242
|
};
|
|
217
243
|
|
|
218
|
-
const getRequestStatusForAuthorization = function (read) {
|
|
244
|
+
const getRequestStatusForAuthorization = async function (read) {
|
|
219
245
|
let write = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
220
|
-
const readPermissions = read.reduce((obj, cur) => {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
return { ...obj,
|
|
227
|
-
[cur]: true
|
|
228
|
-
};
|
|
229
|
-
}, {});
|
|
246
|
+
const readPermissions = read.reduce((obj, cur) => ({ ...obj,
|
|
247
|
+
[cur]: true
|
|
248
|
+
}), {});
|
|
249
|
+
const writePermissions = write.reduce((obj, cur) => ({ ...obj,
|
|
250
|
+
[cur]: true
|
|
251
|
+
}), {});
|
|
230
252
|
return Native.getRequestStatusForAuthorization(writePermissions, readPermissions);
|
|
231
253
|
};
|
|
232
254
|
|
|
@@ -236,36 +258,6 @@ const queryCategorySamples = async (identifier, options) => {
|
|
|
236
258
|
return results.map(deserializCategorySample);
|
|
237
259
|
};
|
|
238
260
|
|
|
239
|
-
async function getPreferredUnitsTyped(options) {
|
|
240
|
-
let energyUnit = options === null || options === void 0 ? void 0 : options.energyUnit;
|
|
241
|
-
let distanceUnit = options === null || options === void 0 ? void 0 : options.distanceUnit;
|
|
242
|
-
|
|
243
|
-
if (!energyUnit || !distanceUnit) {
|
|
244
|
-
const units = await Native.getPreferredUnits([HKQuantityTypeIdentifier.distanceWalkingRunning, HKQuantityTypeIdentifier.activeEnergyBurned]);
|
|
245
|
-
|
|
246
|
-
if (!energyUnit) {
|
|
247
|
-
energyUnit = units[HKQuantityTypeIdentifier.distanceWalkingRunning];
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
if (!distanceUnit) {
|
|
251
|
-
distanceUnit = units[HKQuantityTypeIdentifier.activeEnergyBurned];
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
if (!energyUnit) {
|
|
256
|
-
energyUnit = HKUnit.Kilocalories;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
if (!distanceUnit) {
|
|
260
|
-
distanceUnit = HKUnit.Meters;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
return {
|
|
264
|
-
energyUnit,
|
|
265
|
-
distanceUnit
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
|
|
269
261
|
const queryWorkouts = async options => {
|
|
270
262
|
const {
|
|
271
263
|
energyUnit,
|
|
@@ -286,7 +278,7 @@ const getMostRecentWorkout = async options => {
|
|
|
286
278
|
return workouts[0];
|
|
287
279
|
};
|
|
288
280
|
|
|
289
|
-
function saveCategorySample(identifier, value, options) {
|
|
281
|
+
async function saveCategorySample(identifier, value, options) {
|
|
290
282
|
const start = (options === null || options === void 0 ? void 0 : options.start) || (options === null || options === void 0 ? void 0 : options.end) || new Date();
|
|
291
283
|
const end = (options === null || options === void 0 ? void 0 : options.end) || (options === null || options === void 0 ? void 0 : options.start) || new Date();
|
|
292
284
|
const metadata = (options === null || options === void 0 ? void 0 : options.metadata) || {};
|
|
@@ -298,13 +290,12 @@ const getPreferredUnits = async identifiers => {
|
|
|
298
290
|
return identifiers.map(i => units[i]);
|
|
299
291
|
};
|
|
300
292
|
|
|
301
|
-
const buildUnitWithPrefix = (prefix, unit) => {
|
|
302
|
-
return `${prefix}${unit}`;
|
|
303
|
-
};
|
|
293
|
+
const buildUnitWithPrefix = (prefix, unit) => `${prefix}${unit}`;
|
|
304
294
|
|
|
305
295
|
function deserializeCorrelation(s) {
|
|
306
296
|
return { ...s,
|
|
307
297
|
objects: s.objects.map(o => {
|
|
298
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
308
299
|
// @ts-ignore
|
|
309
300
|
if (o.quantity !== undefined) {
|
|
310
301
|
return deserializeSample(o);
|
|
@@ -333,29 +324,27 @@ const saveCorrelationSample = async (typeIdentifier, samples, options) => {
|
|
|
333
324
|
return Native.saveCorrelationSample(typeIdentifier, samples, start, end, ensureMetadata(options === null || options === void 0 ? void 0 : options.metadata));
|
|
334
325
|
};
|
|
335
326
|
|
|
336
|
-
const saveWorkoutSample = (typeIdentifier, quantities, _start, options) => {
|
|
327
|
+
const saveWorkoutSample = async (typeIdentifier, quantities, _start, options) => {
|
|
337
328
|
const start = _start.toISOString();
|
|
338
329
|
|
|
339
330
|
const end = ((options === null || options === void 0 ? void 0 : options.end) || new Date()).toISOString();
|
|
340
331
|
return Native.saveWorkoutSample(typeIdentifier, quantities, start, end, ensureMetadata(options === null || options === void 0 ? void 0 : options.metadata));
|
|
341
332
|
};
|
|
342
333
|
|
|
343
|
-
const getWorkoutRoutes = workoutUUID =>
|
|
344
|
-
return Native.getWorkoutRoutes(workoutUUID);
|
|
345
|
-
};
|
|
334
|
+
const getWorkoutRoutes = async workoutUUID => Native.getWorkoutRoutes(workoutUUID);
|
|
346
335
|
|
|
347
336
|
const Healthkit = {
|
|
348
|
-
authorizationStatusFor: Native.authorizationStatusFor,
|
|
349
|
-
isHealthDataAvailable: Native.isHealthDataAvailable,
|
|
337
|
+
authorizationStatusFor: Native.authorizationStatusFor.bind(Native),
|
|
338
|
+
isHealthDataAvailable: Native.isHealthDataAvailable.bind(Native),
|
|
350
339
|
buildUnitWithPrefix,
|
|
351
340
|
disableAllBackgroundDelivery: Native.disableAllBackgroundDelivery,
|
|
352
341
|
disableBackgroundDelivery: Native.disableBackgroundDelivery,
|
|
353
342
|
enableBackgroundDelivery: Native.enableBackgroundDelivery,
|
|
354
343
|
// simple convenience getters
|
|
355
|
-
getBiologicalSex: Native.getBiologicalSex,
|
|
356
|
-
getFitzpatrickSkinType: Native.getFitzpatrickSkinType,
|
|
344
|
+
getBiologicalSex: Native.getBiologicalSex.bind(Native),
|
|
345
|
+
getFitzpatrickSkinType: Native.getFitzpatrickSkinType.bind(Native),
|
|
357
346
|
getWheelchairUse: Native.getWheelchairUse,
|
|
358
|
-
getBloodType: Native.getBloodType,
|
|
347
|
+
getBloodType: Native.getBloodType.bind(Native),
|
|
359
348
|
getDateOfBirth,
|
|
360
349
|
getMostRecentQuantitySample,
|
|
361
350
|
getMostRecentCategorySample,
|