@kingstinct/react-native-healthkit 4.4.6 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ios/ReactNativeHealthkit.xcodeproj/project.xcworkspace/xcuserdata/robertherber.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/lib/commonjs/hooks/useHealthkitAuthorization.js +41 -0
- package/lib/commonjs/hooks/useHealthkitAuthorization.js.map +1 -0
- package/lib/commonjs/hooks/useIsHealthDataAvailable.js +29 -0
- package/lib/commonjs/hooks/useIsHealthDataAvailable.js.map +1 -0
- package/lib/commonjs/hooks/useMostRecentCategorySample.js +27 -0
- package/lib/commonjs/hooks/useMostRecentCategorySample.js.map +1 -0
- package/lib/commonjs/hooks/useMostRecentQuantitySample.js +43 -0
- package/lib/commonjs/hooks/useMostRecentQuantitySample.js.map +1 -0
- package/lib/commonjs/hooks/useMostRecentWorkout.js +60 -0
- package/lib/commonjs/hooks/useMostRecentWorkout.js.map +1 -0
- package/lib/commonjs/hooks/useStatisticsForQuantity.js +35 -0
- package/lib/commonjs/hooks/useStatisticsForQuantity.js.map +1 -0
- package/lib/commonjs/hooks/useSubscribeToChanges.js +37 -0
- package/lib/commonjs/hooks/useSubscribeToChanges.js.map +1 -0
- package/lib/commonjs/index.ios.js +66 -394
- package/lib/commonjs/index.ios.js.map +1 -1
- package/lib/commonjs/index.js +2 -15
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/native-types.js +170 -78
- package/lib/commonjs/native-types.js.map +1 -1
- package/lib/commonjs/types.js +13 -0
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/deserializeCategorySample.js +15 -0
- package/lib/commonjs/utils/deserializeCategorySample.js.map +1 -0
- package/lib/commonjs/utils/deserializeCorrelation.js +32 -0
- package/lib/commonjs/utils/deserializeCorrelation.js.map +1 -0
- package/lib/commonjs/utils/deserializeSample.js +17 -0
- package/lib/commonjs/utils/deserializeSample.js.map +1 -0
- package/lib/commonjs/utils/deserializeWorkout.js +17 -0
- package/lib/commonjs/utils/deserializeWorkout.js.map +1 -0
- package/lib/commonjs/utils/ensureMetadata.js +14 -0
- package/lib/commonjs/utils/ensureMetadata.js.map +1 -0
- package/lib/commonjs/utils/ensureUnit.js +23 -0
- package/lib/commonjs/utils/ensureUnit.js.map +1 -0
- package/lib/commonjs/utils/getDateOfBirth.js +19 -0
- package/lib/commonjs/utils/getDateOfBirth.js.map +1 -0
- package/lib/commonjs/utils/getMostRecentCategorySample.js +22 -0
- package/lib/commonjs/utils/getMostRecentCategorySample.js.map +1 -0
- package/lib/commonjs/utils/getMostRecentQuantitySample.js +22 -0
- package/lib/commonjs/utils/getMostRecentQuantitySample.js.map +1 -0
- package/lib/commonjs/utils/getMostRecentWorkout.js +24 -0
- package/lib/commonjs/utils/getMostRecentWorkout.js.map +1 -0
- package/lib/commonjs/utils/getPreferredUnit.js +19 -0
- package/lib/commonjs/utils/getPreferredUnit.js.map +1 -0
- package/lib/commonjs/utils/getPreferredUnits.js +19 -0
- package/lib/commonjs/utils/getPreferredUnits.js.map +1 -0
- package/lib/commonjs/utils/getPreferredUnitsTyped.js +46 -0
- package/lib/commonjs/utils/getPreferredUnitsTyped.js.map +1 -0
- package/lib/commonjs/utils/getRequestStatusForAuthorization.js +25 -0
- package/lib/commonjs/utils/getRequestStatusForAuthorization.js.map +1 -0
- package/lib/commonjs/utils/prepareOptions.js +27 -0
- package/lib/commonjs/utils/prepareOptions.js.map +1 -0
- package/lib/commonjs/utils/queryCategorySamples.js +24 -0
- package/lib/commonjs/utils/queryCategorySamples.js.map +1 -0
- package/lib/commonjs/utils/queryCorrelationSamples.js +24 -0
- package/lib/commonjs/utils/queryCorrelationSamples.js.map +1 -0
- package/lib/commonjs/utils/queryQuantitySamples.js +27 -0
- package/lib/commonjs/utils/queryQuantitySamples.js.map +1 -0
- package/lib/commonjs/utils/queryStatisticsForQuantity.js +34 -0
- package/lib/commonjs/utils/queryStatisticsForQuantity.js.map +1 -0
- package/lib/commonjs/utils/queryWorkouts.js +30 -0
- package/lib/commonjs/utils/queryWorkouts.js.map +1 -0
- package/lib/commonjs/utils/requestAuthorization.js +25 -0
- package/lib/commonjs/utils/requestAuthorization.js.map +1 -0
- package/lib/commonjs/utils/saveCategorySample.js +21 -0
- package/lib/commonjs/utils/saveCategorySample.js.map +1 -0
- package/lib/commonjs/utils/saveCorrelationSample.js +24 -0
- package/lib/commonjs/utils/saveCorrelationSample.js.map +1 -0
- package/lib/commonjs/utils/saveQuantitySample.js +21 -0
- package/lib/commonjs/utils/saveQuantitySample.js.map +1 -0
- package/lib/commonjs/utils/saveWorkoutSample.js +25 -0
- package/lib/commonjs/utils/saveWorkoutSample.js.map +1 -0
- package/lib/commonjs/utils/serializeDate.js +12 -0
- package/lib/commonjs/utils/serializeDate.js.map +1 -0
- package/lib/commonjs/utils/subscribeToChanges.js +37 -0
- package/lib/commonjs/utils/subscribeToChanges.js.map +1 -0
- package/lib/module/hooks/useHealthkitAuthorization.js +29 -0
- package/lib/module/hooks/useHealthkitAuthorization.js.map +1 -0
- package/lib/module/hooks/useIsHealthDataAvailable.js +18 -0
- package/lib/module/hooks/useIsHealthDataAvailable.js.map +1 -0
- package/lib/module/hooks/useMostRecentCategorySample.js +15 -0
- package/lib/module/hooks/useMostRecentCategorySample.js.map +1 -0
- package/lib/module/hooks/useMostRecentQuantitySample.js +30 -0
- package/lib/module/hooks/useMostRecentQuantitySample.js.map +1 -0
- package/lib/module/hooks/useMostRecentWorkout.js +47 -0
- package/lib/module/hooks/useMostRecentWorkout.js.map +1 -0
- package/lib/module/hooks/useStatisticsForQuantity.js +23 -0
- package/lib/module/hooks/useStatisticsForQuantity.js.map +1 -0
- package/lib/module/hooks/useSubscribeToChanges.js +26 -0
- package/lib/module/hooks/useSubscribeToChanges.js.map +1 -0
- package/lib/module/index.ios.js +32 -370
- package/lib/module/index.ios.js.map +1 -1
- package/lib/module/index.js +3 -5
- package/lib/module/index.js.map +1 -1
- package/lib/module/native-types.js +154 -74
- package/lib/module/native-types.js.map +1 -1
- package/lib/module/types.js +15 -0
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/deserializeCategorySample.js +7 -0
- package/lib/module/utils/deserializeCategorySample.js.map +1 -0
- package/lib/module/utils/deserializeCorrelation.js +21 -0
- package/lib/module/utils/deserializeCorrelation.js.map +1 -0
- package/lib/module/utils/deserializeSample.js +9 -0
- package/lib/module/utils/deserializeSample.js.map +1 -0
- package/lib/module/utils/deserializeWorkout.js +9 -0
- package/lib/module/utils/deserializeWorkout.js.map +1 -0
- package/lib/module/utils/ensureMetadata.js +6 -0
- package/lib/module/utils/ensureMetadata.js.map +1 -0
- package/lib/module/utils/ensureUnit.js +13 -0
- package/lib/module/utils/ensureUnit.js.map +1 -0
- package/lib/module/utils/getDateOfBirth.js +9 -0
- package/lib/module/utils/getDateOfBirth.js.map +1 -0
- package/lib/module/utils/getMostRecentCategorySample.js +12 -0
- package/lib/module/utils/getMostRecentCategorySample.js.map +1 -0
- package/lib/module/utils/getMostRecentQuantitySample.js +12 -0
- package/lib/module/utils/getMostRecentQuantitySample.js.map +1 -0
- package/lib/module/utils/getMostRecentWorkout.js +14 -0
- package/lib/module/utils/getMostRecentWorkout.js.map +1 -0
- package/lib/module/utils/getPreferredUnit.js +9 -0
- package/lib/module/utils/getPreferredUnit.js.map +1 -0
- package/lib/module/utils/getPreferredUnits.js +9 -0
- package/lib/module/utils/getPreferredUnits.js.map +1 -0
- package/lib/module/utils/getPreferredUnitsTyped.js +34 -0
- package/lib/module/utils/getPreferredUnitsTyped.js.map +1 -0
- package/lib/module/utils/getRequestStatusForAuthorization.js +15 -0
- package/lib/module/utils/getRequestStatusForAuthorization.js.map +1 -0
- package/lib/module/utils/prepareOptions.js +17 -0
- package/lib/module/utils/prepareOptions.js.map +1 -0
- package/lib/module/utils/queryCategorySamples.js +12 -0
- package/lib/module/utils/queryCategorySamples.js.map +1 -0
- package/lib/module/utils/queryCorrelationSamples.js +12 -0
- package/lib/module/utils/queryCorrelationSamples.js.map +1 -0
- package/lib/module/utils/queryQuantitySamples.js +14 -0
- package/lib/module/utils/queryQuantitySamples.js.map +1 -0
- package/lib/module/utils/queryStatisticsForQuantity.js +23 -0
- package/lib/module/utils/queryStatisticsForQuantity.js.map +1 -0
- package/lib/module/utils/queryWorkouts.js +17 -0
- package/lib/module/utils/queryWorkouts.js.map +1 -0
- package/lib/module/utils/requestAuthorization.js +15 -0
- package/lib/module/utils/requestAuthorization.js.map +1 -0
- package/lib/module/utils/saveCategorySample.js +11 -0
- package/lib/module/utils/saveCategorySample.js.map +1 -0
- package/lib/module/utils/saveCorrelationSample.js +13 -0
- package/lib/module/utils/saveCorrelationSample.js.map +1 -0
- package/lib/module/utils/saveQuantitySample.js +11 -0
- package/lib/module/utils/saveQuantitySample.js.map +1 -0
- package/lib/module/utils/saveWorkoutSample.js +14 -0
- package/lib/module/utils/saveWorkoutSample.js.map +1 -0
- package/lib/module/utils/serializeDate.js +4 -0
- package/lib/module/utils/serializeDate.js.map +1 -0
- package/lib/module/utils/subscribeToChanges.js +25 -0
- package/lib/module/utils/subscribeToChanges.js.map +1 -0
- package/lib/typescript/example-expo/App.d.ts +2 -0
- package/lib/typescript/src/hooks/useHealthkitAuthorization.d.ts +3 -0
- package/lib/typescript/src/hooks/useIsHealthDataAvailable.d.ts +2 -0
- package/lib/typescript/src/hooks/useMostRecentCategorySample.d.ts +4 -0
- package/lib/typescript/src/hooks/useMostRecentQuantitySample.d.ts +4 -0
- package/lib/typescript/src/hooks/useMostRecentWorkout.d.ts +7 -0
- package/lib/typescript/src/hooks/useStatisticsForQuantity.d.ts +4 -0
- package/lib/typescript/src/hooks/useSubscribeToChanges.d.ts +3 -0
- package/lib/typescript/src/index.d.ts +2 -3
- package/lib/typescript/src/index.ios.d.ts +48 -3
- package/lib/typescript/src/native-types.d.ts +169 -65
- package/lib/typescript/src/types.d.ts +14 -90
- package/lib/typescript/src/utils/deserializeCategorySample.d.ts +4 -0
- package/lib/typescript/src/utils/deserializeCorrelation.d.ts +4 -0
- package/lib/typescript/src/utils/deserializeSample.d.ts +4 -0
- package/lib/typescript/src/utils/deserializeWorkout.d.ts +4 -0
- package/lib/typescript/src/utils/ensureMetadata.d.ts +2 -0
- package/lib/typescript/src/utils/ensureUnit.d.ts +3 -0
- package/lib/typescript/src/utils/getDateOfBirth.d.ts +2 -0
- package/lib/typescript/src/utils/getMostRecentCategorySample.d.ts +3 -0
- package/lib/typescript/src/utils/getMostRecentQuantitySample.d.ts +3 -0
- package/lib/typescript/src/utils/getMostRecentWorkout.d.ts +5 -0
- package/lib/typescript/src/utils/getPreferredUnit.d.ts +4 -0
- package/lib/typescript/src/utils/getPreferredUnits.d.ts +4 -0
- package/lib/typescript/src/utils/getPreferredUnitsTyped.d.ts +9 -0
- package/lib/typescript/src/utils/getRequestStatusForAuthorization.d.ts +3 -0
- package/lib/typescript/src/utils/prepareOptions.d.ts +8 -0
- package/lib/typescript/src/utils/queryCategorySamples.d.ts +5 -0
- package/lib/typescript/src/utils/queryCorrelationSamples.d.ts +5 -0
- package/lib/typescript/src/utils/queryQuantitySamples.d.ts +7 -0
- package/lib/typescript/src/utils/queryStatisticsForQuantity.d.ts +14 -0
- package/lib/typescript/src/utils/queryWorkouts.d.ts +4 -0
- package/lib/typescript/src/utils/requestAuthorization.d.ts +3 -0
- package/lib/typescript/src/utils/saveCategorySample.d.ts +7 -0
- package/lib/typescript/src/utils/saveCorrelationSample.d.ts +8 -0
- package/lib/typescript/src/utils/saveQuantitySample.d.ts +7 -0
- package/lib/typescript/src/utils/saveWorkoutSample.d.ts +7 -0
- package/lib/typescript/src/utils/serializeDate.d.ts +2 -0
- package/lib/typescript/src/utils/subscribeToChanges.d.ts +3 -0
- package/package.json +17 -6
- package/src/hooks/useHealthkitAuthorization.ts +39 -0
- package/src/hooks/useIsHealthDataAvailable.ts +17 -0
- package/src/hooks/useMostRecentCategorySample.ts +24 -0
- package/src/hooks/useMostRecentQuantitySample.ts +39 -0
- package/src/hooks/useMostRecentWorkout.ts +60 -0
- package/src/hooks/useStatisticsForQuantity.ts +42 -0
- package/src/hooks/useSubscribeToChanges.ts +31 -0
- package/src/index.ios.tsx +36 -569
- package/src/index.tsx +5 -7
- package/src/native-types.ts +213 -74
- package/src/types.ts +41 -152
- package/src/utils/deserializeCategorySample.ts +12 -0
- package/src/utils/deserializeCorrelation.ts +28 -0
- package/src/utils/deserializeSample.ts +17 -0
- package/src/utils/deserializeWorkout.ts +14 -0
- package/src/utils/ensureMetadata.ts +5 -0
- package/src/utils/ensureUnit.ts +19 -0
- package/src/utils/getDateOfBirth.ts +8 -0
- package/src/utils/getMostRecentCategorySample.ts +18 -0
- package/src/utils/getMostRecentQuantitySample.ts +19 -0
- package/src/utils/getMostRecentWorkout.ts +27 -0
- package/src/utils/getPreferredUnit.ts +14 -0
- package/src/utils/getPreferredUnits.ts +14 -0
- package/src/utils/getPreferredUnitsTyped.ts +38 -0
- package/src/utils/getRequestStatusForAuthorization.ts +21 -0
- package/src/utils/prepareOptions.ts +15 -0
- package/src/utils/queryCategorySamples.ts +29 -0
- package/src/utils/queryCorrelationSamples.ts +29 -0
- package/src/utils/queryQuantitySamples.ts +36 -0
- package/src/utils/queryStatisticsForQuantity.ts +38 -0
- package/src/utils/queryWorkouts.ts +28 -0
- package/src/utils/requestAuthorization.ts +18 -0
- package/src/utils/saveCategorySample.ts +27 -0
- package/src/utils/saveCorrelationSample.ts +34 -0
- package/src/utils/saveQuantitySample.ts +29 -0
- package/src/utils/saveWorkoutSample.ts +28 -0
- package/src/utils/serializeDate.ts +3 -0
- package/src/utils/subscribeToChanges.ts +32 -0
|
@@ -1,5 +1,50 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import useMostRecentCategorySample from './hooks/useMostRecentCategorySample';
|
|
2
|
+
import useMostRecentQuantitySample from './hooks/useMostRecentQuantitySample';
|
|
3
|
+
import useMostRecentWorkout from './hooks/useMostRecentWorkout';
|
|
4
|
+
import useSubscribeToChanges from './hooks/useSubscribeToChanges';
|
|
5
|
+
import getMostRecentCategorySample from './utils/getMostRecentCategorySample';
|
|
6
|
+
import getMostRecentQuantitySample from './utils/getMostRecentQuantitySample';
|
|
7
|
+
import queryStatisticsForQuantity from './utils/queryStatisticsForQuantity';
|
|
8
|
+
import queryWorkouts from './utils/queryWorkouts';
|
|
9
|
+
import saveCategorySample from './utils/saveCategorySample';
|
|
10
|
+
import saveCorrelationSample from './utils/saveCorrelationSample';
|
|
11
|
+
import saveQuantitySample from './utils/saveQuantitySample';
|
|
12
|
+
import saveWorkoutSample from './utils/saveWorkoutSample';
|
|
13
|
+
declare const Healthkit: {
|
|
14
|
+
authorizationStatusFor: (type: import("./native-types").HealthkitReadAuthorization) => Promise<boolean>;
|
|
15
|
+
isHealthDataAvailable: () => Promise<boolean>;
|
|
16
|
+
disableAllBackgroundDelivery: () => Promise<boolean>;
|
|
17
|
+
disableBackgroundDelivery: (typeIdentifier: import("./native-types").HKSampleTypeIdentifier) => Promise<boolean>;
|
|
18
|
+
enableBackgroundDelivery: (typeIdentifier: import("./native-types").HKSampleTypeIdentifier, updateFrequency: import("./native-types").HKUpdateFrequency) => Promise<boolean>;
|
|
19
|
+
getBiologicalSex: () => Promise<import("./native-types").HKBiologicalSex>;
|
|
20
|
+
getFitzpatrickSkinType: () => Promise<import("./native-types").HKFitzpatrickSkinType>;
|
|
21
|
+
getWheelchairUse: () => Promise<import("./native-types").HKWheelchairUse>;
|
|
22
|
+
getBloodType: () => Promise<import("./native-types").HKBloodType>;
|
|
23
|
+
getWorkoutRoutes: (workoutUUID: string) => Promise<readonly import("./native-types").WorkoutRoute[]>;
|
|
24
|
+
getDateOfBirth: () => Promise<Date>;
|
|
25
|
+
getMostRecentQuantitySample: typeof getMostRecentQuantitySample;
|
|
26
|
+
getMostRecentCategorySample: typeof getMostRecentCategorySample;
|
|
27
|
+
getMostRecentWorkout: import("./utils/getMostRecentWorkout").GetMostRecentWorkoutFn;
|
|
28
|
+
getPreferredUnit: import("./utils/getPreferredUnit").GetPreferredUnitFn;
|
|
29
|
+
getPreferredUnits: import("./utils/getPreferredUnits").GetPreferredUnitsFn;
|
|
30
|
+
getRequestStatusForAuthorization: (read: readonly import("./native-types").HealthkitReadAuthorization[], write?: readonly import("./native-types").HKSampleTypeIdentifier[]) => Promise<import("./native-types").HKAuthorizationRequestStatus>;
|
|
31
|
+
queryCategorySamples: import("./utils/queryCategorySamples").QueryCategorySamplesFn;
|
|
32
|
+
queryCorrelationSamples: import("./utils/queryCorrelationSamples").QueryCorrelationSamplesFn;
|
|
33
|
+
queryQuantitySamples: import("./utils/queryQuantitySamples").QueryQuantitySamplesFn;
|
|
34
|
+
queryStatisticsForQuantity: typeof queryStatisticsForQuantity;
|
|
35
|
+
queryWorkouts: typeof queryWorkouts;
|
|
36
|
+
requestAuthorization: (read: readonly import("./native-types").HealthkitReadAuthorization[], write?: readonly import("./native-types").HKSampleTypeIdentifier[]) => Promise<boolean>;
|
|
37
|
+
saveCategorySample: typeof saveCategorySample;
|
|
38
|
+
saveCorrelationSample: typeof saveCorrelationSample;
|
|
39
|
+
saveQuantitySample: typeof saveQuantitySample;
|
|
40
|
+
saveWorkoutSample: typeof saveWorkoutSample;
|
|
41
|
+
subscribeToChanges: (identifier: import("./native-types").HKSampleTypeIdentifier, callback: () => void) => Promise<() => Promise<boolean>>;
|
|
42
|
+
useMostRecentCategorySample: typeof useMostRecentCategorySample;
|
|
43
|
+
useMostRecentQuantitySample: typeof useMostRecentQuantitySample;
|
|
44
|
+
useMostRecentWorkout: typeof useMostRecentWorkout;
|
|
45
|
+
useSubscribeToChanges: typeof useSubscribeToChanges;
|
|
46
|
+
useIsHealthDataAvailable: () => boolean | null;
|
|
47
|
+
useHealthkitAuthorization: (read: readonly import("./native-types").HealthkitReadAuthorization[], write?: readonly import("./native-types").HKSampleTypeIdentifier[] | undefined) => readonly [import("./native-types").HKAuthorizationRequestStatus | null, () => Promise<import("./native-types").HKAuthorizationRequestStatus>];
|
|
48
|
+
};
|
|
4
49
|
export * from './types';
|
|
5
50
|
export default Healthkit;
|
|
@@ -317,9 +317,9 @@ declare enum HKIndoorWorkout {
|
|
|
317
317
|
}
|
|
318
318
|
export interface HKWorkoutMetadata extends HKGenericMetadata {
|
|
319
319
|
readonly HKWeatherCondition?: HKWeatherCondition;
|
|
320
|
-
readonly HKWeatherHumidity?: HKQuantity<
|
|
321
|
-
readonly HKAverageMETs?: HKQuantity<HKUnit>;
|
|
322
|
-
readonly HKElevationAscended?: HKQuantity<
|
|
320
|
+
readonly HKWeatherHumidity?: HKQuantity<HKQuantityTypeIdentifier, HKUnits.Percent>;
|
|
321
|
+
readonly HKAverageMETs?: HKQuantity<HKQuantityTypeIdentifier, HKUnit>;
|
|
322
|
+
readonly HKElevationAscended?: HKQuantity<HKQuantityTypeIdentifier, LengthUnit>;
|
|
323
323
|
readonly HKIndoorWorkout?: HKIndoorWorkout;
|
|
324
324
|
}
|
|
325
325
|
export declare enum HKAuthorizationRequestStatus {
|
|
@@ -332,8 +332,8 @@ export declare enum HKAuthorizationStatus {
|
|
|
332
332
|
sharingDenied = 1,
|
|
333
333
|
sharingAuthorized = 2
|
|
334
334
|
}
|
|
335
|
-
export declare type HKQuantity<
|
|
336
|
-
readonly unit:
|
|
335
|
+
export declare type HKQuantity<TIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier> = UnitForIdentifier<TIdentifier>> = {
|
|
336
|
+
readonly unit: TUnit;
|
|
337
337
|
readonly quantity: number;
|
|
338
338
|
};
|
|
339
339
|
export declare enum HKBloodType {
|
|
@@ -372,17 +372,17 @@ export declare enum HKStatisticsOptions {
|
|
|
372
372
|
mostRecent = "mostRecent",
|
|
373
373
|
separateBySource = "separateBySource"
|
|
374
374
|
}
|
|
375
|
-
export declare type QueryStatisticsResponseRaw<
|
|
376
|
-
readonly averageQuantity?: HKQuantity<TUnit>;
|
|
377
|
-
readonly maximumQuantity?: HKQuantity<TUnit>;
|
|
378
|
-
readonly minimumQuantity?: HKQuantity<TUnit>;
|
|
379
|
-
readonly sumQuantity?: HKQuantity<TUnit>;
|
|
380
|
-
readonly mostRecentQuantity?: HKQuantity<TUnit>;
|
|
375
|
+
export declare type QueryStatisticsResponseRaw<TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier>> = {
|
|
376
|
+
readonly averageQuantity?: HKQuantity<TIdentifier, TUnit>;
|
|
377
|
+
readonly maximumQuantity?: HKQuantity<TIdentifier, TUnit>;
|
|
378
|
+
readonly minimumQuantity?: HKQuantity<TIdentifier, TUnit>;
|
|
379
|
+
readonly sumQuantity?: HKQuantity<TIdentifier, TUnit>;
|
|
380
|
+
readonly mostRecentQuantity?: HKQuantity<TIdentifier, TUnit>;
|
|
381
381
|
readonly mostRecentQuantityDateInterval?: {
|
|
382
382
|
readonly from: string;
|
|
383
383
|
readonly to: string;
|
|
384
384
|
};
|
|
385
|
-
readonly duration?: HKQuantity<
|
|
385
|
+
readonly duration?: HKQuantity<HKQuantityTypeIdentifier, TimeUnit>;
|
|
386
386
|
};
|
|
387
387
|
export declare enum HKCategoryValueCervicalMucusQuality {
|
|
388
388
|
dry = 1,
|
|
@@ -444,6 +444,7 @@ export declare type MetadataMapperForQuantityIdentifier<TQuantityTypeIdentifier
|
|
|
444
444
|
export declare type MetadataMapperForCorrelationIdentifier<TCorrelationTypeIdentifier = HKCorrelationTypeIdentifier> = TCorrelationTypeIdentifier extends HKCorrelationTypeIdentifier.food ? HKGenericMetadata & {
|
|
445
445
|
readonly HKFoodType?: string;
|
|
446
446
|
} : HKGenericMetadata;
|
|
447
|
+
export declare type UnitForIdentifier<T extends HKQuantityTypeIdentifier> = T extends HKQuantityTypeIdentifier.bloodGlucose ? BloodGlucoseUnit : T extends HKQuantityTypeIdentifier.appleExerciseTime | HKQuantityTypeIdentifier.appleMoveTime | HKQuantityTypeIdentifier.appleStandTime ? TimeUnit : T extends HKQuantityTypeIdentifier.activeEnergyBurned | HKQuantityTypeIdentifier.basalEnergyBurned | HKQuantityTypeIdentifier.dietaryEnergyConsumed ? EnergyUnit : T extends HKQuantityTypeIdentifier.distanceCycling | HKQuantityTypeIdentifier.distanceDownhillSnowSports | HKQuantityTypeIdentifier.distanceSwimming | HKQuantityTypeIdentifier.distanceWalkingRunning | HKQuantityTypeIdentifier.distanceWheelchair | HKQuantityTypeIdentifier.sixMinuteWalkTestDistance | HKQuantityTypeIdentifier.waistCircumference ? LengthUnit : T extends HKQuantityTypeIdentifier.bodyFatPercentage | HKQuantityTypeIdentifier.oxygenSaturation | HKQuantityTypeIdentifier.walkingAsymmetryPercentage | HKQuantityTypeIdentifier.walkingDoubleSupportPercentage ? HKUnits.Percent : T extends HKQuantityTypeIdentifier.basalBodyTemperature | HKQuantityTypeIdentifier.basalBodyTemperature ? TemperatureUnit : T extends HKQuantityTypeIdentifier.stairAscentSpeed | HKQuantityTypeIdentifier.stairDescentSpeed | HKQuantityTypeIdentifier.walkingSpeed | HKQuantityTypeIdentifier.walkingSpeed ? SpeedUnit<LengthUnit, TimeUnit> : T extends HKQuantityTypeIdentifier.flightsClimbed | HKQuantityTypeIdentifier.numberOfAlcoholicBeverages | HKQuantityTypeIdentifier.numberOfTimesFallen | HKQuantityTypeIdentifier.pushCount | HKQuantityTypeIdentifier.stepCount | HKQuantityTypeIdentifier.swimmingStrokeCount ? HKUnits.Count : T extends HKQuantityTypeIdentifier.dietaryBiotin | HKQuantityTypeIdentifier.dietaryCaffeine | HKQuantityTypeIdentifier.dietaryCalcium | HKQuantityTypeIdentifier.dietaryCarbohydrates | HKQuantityTypeIdentifier.dietaryChloride | HKQuantityTypeIdentifier.dietaryCholesterol | HKQuantityTypeIdentifier.dietaryChromium | HKQuantityTypeIdentifier.dietaryCopper | HKQuantityTypeIdentifier.dietaryFatMonounsaturated | HKQuantityTypeIdentifier.dietaryFatPolyunsaturated | HKQuantityTypeIdentifier.dietaryFatSaturated | HKQuantityTypeIdentifier.dietaryFatTotal | HKQuantityTypeIdentifier.dietaryFiber | HKQuantityTypeIdentifier.dietaryFolate | HKQuantityTypeIdentifier.dietaryIodine | HKQuantityTypeIdentifier.dietaryIodine | HKQuantityTypeIdentifier.dietaryIron | HKQuantityTypeIdentifier.dietaryMagnesium | HKQuantityTypeIdentifier.dietaryManganese | HKQuantityTypeIdentifier.dietaryMolybdenum | HKQuantityTypeIdentifier.dietaryNiacin | HKQuantityTypeIdentifier.dietaryPantothenicAcid | HKQuantityTypeIdentifier.dietaryPhosphorus | HKQuantityTypeIdentifier.dietaryPotassium | HKQuantityTypeIdentifier.dietaryProtein | HKQuantityTypeIdentifier.dietaryRiboflavin | HKQuantityTypeIdentifier.dietarySelenium | HKQuantityTypeIdentifier.dietarySodium | HKQuantityTypeIdentifier.dietarySugar | HKQuantityTypeIdentifier.dietaryThiamin | HKQuantityTypeIdentifier.dietaryVitaminA | HKQuantityTypeIdentifier.dietaryVitaminB6 | HKQuantityTypeIdentifier.dietaryVitaminB12 | HKQuantityTypeIdentifier.dietaryVitaminC | HKQuantityTypeIdentifier.dietaryVitaminD | HKQuantityTypeIdentifier.dietaryVitaminE | HKQuantityTypeIdentifier.dietaryVitaminK | HKQuantityTypeIdentifier.dietaryZinc ? MassUnit : T extends HKQuantityTypeIdentifier.dietaryWater ? VolumeUnit : T extends HKQuantityTypeIdentifier.insulinDelivery ? HKUnits.InternationalUnit | `${HKUnits.InternationalUnit}` : T extends HKQuantityTypeIdentifier.heartRate | HKQuantityTypeIdentifier.restingHeartRate | HKQuantityTypeIdentifier.walkingHeartRateAverage ? CountPerTime<TimeUnit> : HKUnit;
|
|
447
448
|
export declare type HKCategoryValueForIdentifier<T extends HKCategoryTypeIdentifier> = T extends HKCategoryTypeIdentifier.cervicalMucusQuality ? HKCategoryValueCervicalMucusQuality : T extends HKCategoryTypeIdentifier.menstrualFlow ? HKCategoryValueMenstrualFlow : T extends HKCategoryTypeIdentifier.ovulationTestResult ? HKCategoryValueOvulationTestResult : T extends HKCategoryTypeIdentifier.sleepAnalysis ? HKCategoryValueSleepAnalysis : T extends (HKCategoryTypeIdentifier.highHeartRateEvent | HKCategoryTypeIdentifier.intermenstrualBleeding | HKCategoryTypeIdentifier.mindfulSession | HKCategoryTypeIdentifier.sexualActivity) ? HKCategoryValueNotApplicable : T extends (HKCategoryTypeIdentifier.abdominalCramps | HKCategoryTypeIdentifier.abdominalCramps | HKCategoryTypeIdentifier.acne | HKCategoryTypeIdentifier.bladderIncontinence | HKCategoryTypeIdentifier.bloating | HKCategoryTypeIdentifier.breastPain | HKCategoryTypeIdentifier.chestTightnessOrPain | HKCategoryTypeIdentifier.chills | HKCategoryTypeIdentifier.constipation | HKCategoryTypeIdentifier.coughing | HKCategoryTypeIdentifier.diarrhea | HKCategoryTypeIdentifier.dizziness | HKCategoryTypeIdentifier.drySkin | HKCategoryTypeIdentifier.fainting | HKCategoryTypeIdentifier.fatigue | HKCategoryTypeIdentifier.fever | HKCategoryTypeIdentifier.generalizedBodyAche | HKCategoryTypeIdentifier.hairLoss | HKCategoryTypeIdentifier.headache | HKCategoryTypeIdentifier.heartburn | HKCategoryTypeIdentifier.hotFlashes | HKCategoryTypeIdentifier.lossOfSmell | HKCategoryTypeIdentifier.lossOfTaste | HKCategoryTypeIdentifier.lowerBackPain | HKCategoryTypeIdentifier.memoryLapse | HKCategoryTypeIdentifier.moodChanges | HKCategoryTypeIdentifier.nausea | HKCategoryTypeIdentifier.nightSweats | HKCategoryTypeIdentifier.pelvicPain | HKCategoryTypeIdentifier.rapidPoundingOrFlutteringHeartbeat | HKCategoryTypeIdentifier.runnyNose | HKCategoryTypeIdentifier.shortnessOfBreath | HKCategoryTypeIdentifier.sinusCongestion | HKCategoryTypeIdentifier.skippedHeartbeat | HKCategoryTypeIdentifier.soreThroat | HKCategoryTypeIdentifier.vaginalDryness | HKCategoryTypeIdentifier.vomiting | HKCategoryTypeIdentifier.wheezing) ? HKCategoryValueSeverity : T extends (HKCategoryTypeIdentifier.appetiteChanges | HKCategoryTypeIdentifier.sleepChanges) ? HKCategoryValuePresence : T extends HKCategoryTypeIdentifier.lowCardioFitnessEvent ? HKCategoryValueLowCardioFitnessEvent : T extends HKCategoryTypeIdentifier.pregnancyTestResult ? HKCategoryValuePregnancyTestResult : T extends HKCategoryTypeIdentifier.pregnancyTestResult ? HKCategoryValuePregnancyTestResult : T extends HKCategoryTypeIdentifier.appleStandHour ? HKCategoryValueAppleStandHour : number;
|
|
448
449
|
declare enum HKCategoryValuePregnancyTestResult {
|
|
449
450
|
positive = 2,
|
|
@@ -460,7 +461,8 @@ export declare enum HKWheelchairUse {
|
|
|
460
461
|
no = 1,
|
|
461
462
|
yes = 2
|
|
462
463
|
}
|
|
463
|
-
export declare enum
|
|
464
|
+
export declare enum HKMetricPrefix {
|
|
465
|
+
None = "",
|
|
464
466
|
Pico = "p",
|
|
465
467
|
Nano = "n",
|
|
466
468
|
Micro = "mc",
|
|
@@ -472,60 +474,160 @@ export declare enum HKUnitSIPrefix {
|
|
|
472
474
|
Kilo = "k",
|
|
473
475
|
Mega = "M",
|
|
474
476
|
Giga = "G",
|
|
475
|
-
Tera = "T"
|
|
477
|
+
Tera = "T",
|
|
478
|
+
Femto = "f"
|
|
476
479
|
}
|
|
477
|
-
export declare enum
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
Kelvin = "K",
|
|
481
|
-
Liters = "l",
|
|
482
|
-
Meters = "m",
|
|
483
|
-
Pascals = "Pa",
|
|
484
|
-
Seconds = "s",
|
|
485
|
-
Siemens = "S"
|
|
486
|
-
}
|
|
487
|
-
export declare enum HKUnit {
|
|
488
|
-
Grams = "g",
|
|
489
|
-
Joules = "J",
|
|
480
|
+
export declare enum HKUnitMetric {
|
|
481
|
+
Gram = "g",
|
|
482
|
+
Joule = "J",
|
|
490
483
|
Kelvin = "K",
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
484
|
+
Liter = "l",
|
|
485
|
+
Meter = "m",
|
|
486
|
+
Pascal = "Pa",
|
|
487
|
+
Second = "s",
|
|
488
|
+
Siemen = "S",
|
|
489
|
+
Hertz = "Hz",
|
|
490
|
+
Volt = "V"
|
|
491
|
+
}
|
|
492
|
+
export declare enum HKUnits {
|
|
500
493
|
DecibelHearingLevel = "dBHL",
|
|
501
494
|
DecibelSoundPressureLevel = "dBASPL",
|
|
502
|
-
|
|
503
|
-
|
|
495
|
+
Percent = "%",
|
|
496
|
+
Count = "count",
|
|
497
|
+
InternationalUnit = "IU"
|
|
498
|
+
}
|
|
499
|
+
export declare type MeterUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> = `${Prefix}${HKUnitMetric.Meter}`;
|
|
500
|
+
export declare type LiterUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> = `${Prefix}${HKUnitMetric.Liter}`;
|
|
501
|
+
export declare type GramUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> = `${Prefix}${HKUnitMetric.Gram}`;
|
|
502
|
+
export declare type PascalUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> = `${Prefix}${HKUnitMetric.Pascal}`;
|
|
503
|
+
export declare type SecondUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> = `${Prefix}${HKUnitMetric.Second}`;
|
|
504
|
+
export declare type JouleUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> = `${Prefix}${HKUnitMetric.Joule}`;
|
|
505
|
+
export declare type HertzUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> = `${Prefix}${HKUnitMetric.Hertz}`;
|
|
506
|
+
export declare type VoltUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> = `${Prefix}${HKUnitMetric.Volt}`;
|
|
507
|
+
export declare type SiemenUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> = `${Prefix}${HKUnitMetric.Siemen}`;
|
|
508
|
+
export declare type MoleUnit<MolarMass extends number> = `mol<${MolarMass}>`;
|
|
509
|
+
export declare type MoleUnitWith<MolarMass extends number, Prefix extends HKMetricPrefix = HKMetricPrefix.None> = `${Prefix}mol<${MolarMass}>`;
|
|
510
|
+
export declare type FrequencyUnit = HertzUnit<HKMetricPrefix>;
|
|
511
|
+
/**
|
|
512
|
+
* More SI prefixes also available as literals, just type the string
|
|
513
|
+
* @example 'cm', 'km'
|
|
514
|
+
*/
|
|
515
|
+
export declare enum UnitOfLength {
|
|
504
516
|
Feet = "ft",
|
|
505
|
-
|
|
506
|
-
|
|
517
|
+
/**
|
|
518
|
+
* More SI prefixes also available as literals, just type the string
|
|
519
|
+
* @example 'cm', 'km'
|
|
520
|
+
*/
|
|
521
|
+
Meter = "m",
|
|
522
|
+
Inches = "in",
|
|
523
|
+
Yards = "yd",
|
|
524
|
+
Miles = "mi"
|
|
525
|
+
}
|
|
526
|
+
export declare type LengthUnit = MeterUnit<HKMetricPrefix> | UnitOfLength;
|
|
527
|
+
/**
|
|
528
|
+
* More SI prefixes also available as literals, just type the string
|
|
529
|
+
* @example 'ml', 'cl'
|
|
530
|
+
*/
|
|
531
|
+
export declare enum UnitOfVolume {
|
|
507
532
|
ImperialCup = "cup_imp",
|
|
508
533
|
ImperialFluidOunces = "fl_oz_imp",
|
|
509
534
|
ImperialPint = "pt_imp",
|
|
510
|
-
Inches = "in",
|
|
511
|
-
InternationalUnit = "IU",
|
|
512
|
-
Kilocalories = "kcal",
|
|
513
|
-
LargeCalories = "Cal",
|
|
514
|
-
Miles = "mi",
|
|
515
|
-
MillimetersOfMercury = "mmHg",
|
|
516
|
-
Minutes = "min",
|
|
517
|
-
Ounces = "oz",
|
|
518
|
-
Percent = "%",
|
|
519
|
-
Pounds = "lb",
|
|
520
|
-
SmallCalories = "cal",
|
|
521
|
-
Stones = "st",
|
|
522
535
|
USCup = "cup_us",
|
|
523
536
|
USFluidOunces = "fl_oz_us",
|
|
524
537
|
USPint = "pt_us",
|
|
525
|
-
|
|
538
|
+
/**
|
|
539
|
+
* More SI prefixes also available as literals, just type the string
|
|
540
|
+
* @example 'ml', 'cl'
|
|
541
|
+
*/
|
|
542
|
+
Liter = "l"
|
|
543
|
+
}
|
|
544
|
+
export declare type VolumeUnit = LiterUnit<HKMetricPrefix> | UnitOfVolume;
|
|
545
|
+
/**
|
|
546
|
+
* More SI prefixes also available as literals, just type the string
|
|
547
|
+
* @example 'mg', 'kg'
|
|
548
|
+
*/
|
|
549
|
+
export declare enum UnitOfMass {
|
|
550
|
+
Ounces = "oz",
|
|
551
|
+
Stones = "st",
|
|
552
|
+
Pounds = "lb",
|
|
553
|
+
/**
|
|
554
|
+
* More SI prefixes also available as literals, just type the string
|
|
555
|
+
* @example 'mg', 'kg'
|
|
556
|
+
*/
|
|
557
|
+
Gram = "g"
|
|
558
|
+
}
|
|
559
|
+
/**
|
|
560
|
+
* More SI prefixes also available as literals, just type the string
|
|
561
|
+
* @example 'mg', 'kg'
|
|
562
|
+
*/
|
|
563
|
+
export declare type MassUnit = GramUnit<HKMetricPrefix> | UnitOfMass;
|
|
564
|
+
/**
|
|
565
|
+
* More SI prefixes also available as literals, just type the string
|
|
566
|
+
* @example 'kPa', 'hPa'
|
|
567
|
+
*/
|
|
568
|
+
export declare enum UnitOfPressure {
|
|
569
|
+
Atmospheres = "atm",
|
|
570
|
+
CentimetersOfWater = "cmAq",
|
|
571
|
+
MillimetersOfMercury = "mmHg",
|
|
572
|
+
InchesOfMercury = "inHg",
|
|
573
|
+
DecibelAWeightedSoundPressureLevel = "dBASPL",
|
|
574
|
+
/**
|
|
575
|
+
* More SI prefixes also available as literals, just type the string
|
|
576
|
+
* @example 'kPa', 'hPa'
|
|
577
|
+
*/
|
|
578
|
+
Pascals = "Pa"
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* More SI prefixes also available as literals, just type the string
|
|
582
|
+
* @example 'kPa', 'hPa'
|
|
583
|
+
*/
|
|
584
|
+
export declare type PressureUnit = PascalUnit<HKMetricPrefix> | UnitOfPressure;
|
|
585
|
+
/**
|
|
586
|
+
* More SI prefixes also available as literals, just type the string
|
|
587
|
+
* @example 'ms'
|
|
588
|
+
*/
|
|
589
|
+
export declare enum UnitOfTime {
|
|
590
|
+
Days = "d",
|
|
591
|
+
Minutes = "min",
|
|
592
|
+
Hours = "hr",
|
|
593
|
+
/**
|
|
594
|
+
* More SI prefixes also available as literals, just type the string
|
|
595
|
+
* @example 'ms'
|
|
596
|
+
*/
|
|
597
|
+
Seconds = "s"
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* More SI prefixes also available as literals, just type the string
|
|
601
|
+
* @example 'ms'
|
|
602
|
+
*/
|
|
603
|
+
export declare type TimeUnit = SecondUnit<HKMetricPrefix> | UnitOfTime;
|
|
604
|
+
export declare enum TemperatureUnit {
|
|
605
|
+
DegreesCelsius = "degC",
|
|
606
|
+
DegreesFahrenheit = "degF",
|
|
607
|
+
Kelvin = "K"
|
|
608
|
+
}
|
|
609
|
+
/**
|
|
610
|
+
* More SI prefixes also available as literals, just type the string
|
|
611
|
+
* @example 'kJ'
|
|
612
|
+
*/
|
|
613
|
+
export declare enum UnitOfEnergy {
|
|
614
|
+
Kilocalories = "kcal",
|
|
615
|
+
LargeCalories = "Cal",
|
|
616
|
+
SmallCalories = "cal",
|
|
617
|
+
/**
|
|
618
|
+
* More SI prefixes also available as literals, just type the string
|
|
619
|
+
* @example 'kJ'
|
|
620
|
+
*/
|
|
621
|
+
Joules = "J"
|
|
622
|
+
}
|
|
623
|
+
export declare type EnergyUnit = JouleUnit<HKMetricPrefix> | UnitOfEnergy;
|
|
624
|
+
export declare enum BloodGlucoseUnit {
|
|
526
625
|
GlucoseMmolPerL = "mmol<180.15588000005408>/l",
|
|
527
626
|
GlucoseMgPerDl = "mg/dL"
|
|
528
627
|
}
|
|
628
|
+
export declare type SpeedUnit<TLength extends LengthUnit, TTime extends TimeUnit> = `${TLength}/${TTime}`;
|
|
629
|
+
export declare type CountPerTime<TTime extends TimeUnit> = `count/${TTime}`;
|
|
630
|
+
export declare type HKUnit = BloodGlucoseUnit | CountPerTime<TimeUnit> | EnergyUnit | FrequencyUnit | HKUnits | LengthUnit | MassUnit | PressureUnit | SpeedUnit<LengthUnit, TimeUnit> | TemperatureUnit | TimeUnit | VolumeUnit | `${BloodGlucoseUnit}` | `${EnergyUnit}` | `${FrequencyUnit}` | `${HKUnits}` | `${LengthUnit}` | `${MassUnit}` | `${PressureUnit}` | `${TemperatureUnit}` | `${TimeUnit}` | `${VolumeUnit}`;
|
|
529
631
|
export declare type HKDevice = {
|
|
530
632
|
readonly name: string;
|
|
531
633
|
readonly firmwareVersion: string | null;
|
|
@@ -545,7 +647,7 @@ export declare type HKSourceRevision = {
|
|
|
545
647
|
readonly operatingSystemVersion?: string;
|
|
546
648
|
readonly productType?: string;
|
|
547
649
|
};
|
|
548
|
-
export declare type HKQuantitySampleRaw<TQuantityIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier, TUnit extends
|
|
650
|
+
export declare type HKQuantitySampleRaw<TQuantityIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TQuantityIdentifier> = UnitForIdentifier<TQuantityIdentifier>> = {
|
|
549
651
|
readonly uuid: string;
|
|
550
652
|
readonly device?: HKDevice;
|
|
551
653
|
readonly quantityType: TQuantityIdentifier;
|
|
@@ -556,15 +658,17 @@ export declare type HKQuantitySampleRaw<TQuantityIdentifier extends HKQuantityTy
|
|
|
556
658
|
readonly metadata: MetadataMapperForQuantityIdentifier<TQuantityIdentifier>;
|
|
557
659
|
readonly sourceRevision?: HKSourceRevision;
|
|
558
660
|
};
|
|
559
|
-
export declare type
|
|
661
|
+
export declare type HKQuantitySampleRawForSaving<TQuantityIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TQuantityIdentifier> = UnitForIdentifier<TQuantityIdentifier>> = Omit<HKQuantitySampleRaw<TQuantityIdentifier, TUnit>, 'device' | 'endDate' | 'startDate' | 'uuid'>;
|
|
662
|
+
export declare type HKCategorySampleRawForSaving<TCategory extends HKCategoryTypeIdentifier = HKCategoryTypeIdentifier> = Omit<HKCategorySampleRaw<TCategory>, 'device' | 'endDate' | 'startDate' | 'uuid'>;
|
|
663
|
+
export declare type HKWorkoutRaw<TEnergy extends EnergyUnit, TDistance extends LengthUnit> = {
|
|
560
664
|
readonly uuid: string;
|
|
561
665
|
readonly device?: HKDevice;
|
|
562
666
|
readonly workoutActivityType: HKWorkoutActivityType;
|
|
563
667
|
readonly duration: number;
|
|
564
|
-
readonly totalDistance?: HKQuantity<TDistance>;
|
|
565
|
-
readonly totalEnergyBurned?: HKQuantity<TEnergy>;
|
|
566
|
-
readonly totalSwimmingStrokeCount?: HKQuantity<
|
|
567
|
-
readonly totalFlightsClimbed?: HKQuantity<
|
|
668
|
+
readonly totalDistance?: HKQuantity<HKQuantityTypeIdentifier, TDistance>;
|
|
669
|
+
readonly totalEnergyBurned?: HKQuantity<HKQuantityTypeIdentifier, TEnergy>;
|
|
670
|
+
readonly totalSwimmingStrokeCount?: HKQuantity<HKQuantityTypeIdentifier, HKUnits.Count>;
|
|
671
|
+
readonly totalFlightsClimbed?: HKQuantity<HKQuantityTypeIdentifier, HKUnits.Count>;
|
|
568
672
|
readonly startDate: string;
|
|
569
673
|
readonly endDate: string;
|
|
570
674
|
readonly metadata?: HKWorkoutMetadata;
|
|
@@ -633,20 +737,20 @@ declare type ReactNativeHealthkitTypeNative = {
|
|
|
633
737
|
readonly enableBackgroundDelivery: (typeIdentifier: HKSampleTypeIdentifier, updateFrequency: HKUpdateFrequency) => Promise<boolean>;
|
|
634
738
|
readonly disableBackgroundDelivery: (typeIdentifier: HKSampleTypeIdentifier) => Promise<boolean>;
|
|
635
739
|
readonly disableAllBackgroundDelivery: () => Promise<boolean>;
|
|
636
|
-
readonly saveCorrelationSample: <TIdentifier extends HKCorrelationTypeIdentifier>(typeIdentifier: TIdentifier, samples:
|
|
637
|
-
readonly saveWorkoutSample: (typeIdentifier: HKWorkoutActivityType, quantities: readonly
|
|
740
|
+
readonly saveCorrelationSample: <TIdentifier extends HKCorrelationTypeIdentifier, TSamples extends readonly (HKCategorySampleRawForSaving | HKQuantitySampleRawForSaving)[]>(typeIdentifier: TIdentifier, samples: TSamples, start: string, end: string, metadata: MetadataMapperForCorrelationIdentifier<TIdentifier>) => Promise<boolean>;
|
|
741
|
+
readonly saveWorkoutSample: (typeIdentifier: HKWorkoutActivityType, quantities: readonly HKQuantitySampleRawForSaving[], start: string, end: string, metadata: HKWorkoutMetadata) => Promise<boolean>;
|
|
638
742
|
readonly queryCorrelationSamples: <TIdentifier extends HKCorrelationTypeIdentifier>(typeIdentifier: TIdentifier, from: string, to: string) => Promise<readonly HKCorrelationRaw<TIdentifier>[]>;
|
|
639
743
|
subscribeToObserverQuery(identifier: HKSampleTypeIdentifier): Promise<QueryId>;
|
|
640
744
|
unsubscribeQuery(queryId: QueryId): Promise<boolean>;
|
|
641
745
|
authorizationStatusFor(type: HealthkitReadAuthorization): Promise<boolean>;
|
|
642
746
|
getRequestStatusForAuthorization(write: WritePermissions, read: ReadPermissions): Promise<HKAuthorizationRequestStatus>;
|
|
643
747
|
requestAuthorization(write: WritePermissions, read: ReadPermissions): Promise<boolean>;
|
|
644
|
-
readonly saveQuantitySample: (identifier:
|
|
645
|
-
readonly queryWorkoutSamples: <TEnergy extends
|
|
748
|
+
readonly saveQuantitySample: <TType extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TType> = UnitForIdentifier<TType>>(identifier: TType, unit: TUnit, value: number, start: string, end: string, metadata: unknown) => Promise<boolean>;
|
|
749
|
+
readonly queryWorkoutSamples: <TEnergy extends EnergyUnit, TDistance extends LengthUnit>(energyUnit: TEnergy, distanceUnit: TDistance, from: string, to: string, limit: number, ascending: boolean) => Promise<readonly HKWorkoutRaw<TEnergy, TDistance>[]>;
|
|
646
750
|
readonly queryCategorySamples: <T extends HKCategoryTypeIdentifier>(identifier: T, from: string, to: string, limit: number, ascending: boolean) => Promise<readonly HKCategorySampleRaw<T>[]>;
|
|
647
|
-
readonly queryQuantitySamples: <
|
|
751
|
+
readonly queryQuantitySamples: <TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier>>(identifier: TIdentifier, unit: TUnit, from: string, to: string, limit: number, ascending: boolean) => Promise<readonly HKQuantitySampleRaw<TIdentifier, TUnit>[]>;
|
|
648
752
|
readonly saveCategorySample: <T extends HKCategoryTypeIdentifier>(identifier: T, value: HKCategoryValueForIdentifier<T>, start: string, end: string, metadata: unknown) => Promise<boolean>;
|
|
649
|
-
readonly queryStatisticsForQuantity: <TUnit extends
|
|
753
|
+
readonly queryStatisticsForQuantity: <TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier>>(identifier: HKQuantityTypeIdentifier, unit: TUnit, from: string, to: string, options: readonly HKStatisticsOptions[]) => Promise<QueryStatisticsResponseRaw<TIdentifier, TUnit>>;
|
|
650
754
|
readonly getPreferredUnits: (identifiers: readonly HKQuantityTypeIdentifier[]) => Promise<TypeToUnitMapping>;
|
|
651
755
|
readonly getWorkoutRoutes: (workoutUUID: string) => Promise<readonly WorkoutRoute[]>;
|
|
652
756
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { EnergyUnit, HKCategorySampleRaw, HKCategoryTypeIdentifier, HKCorrelationRaw, HKCorrelationTypeIdentifier, HKDevice, HKQuantityTypeIdentifier, HKSourceRevision, HKUnit, HKWorkoutRaw, LengthUnit, MetadataMapperForQuantityIdentifier, QueryStatisticsResponseRaw, UnitForIdentifier } from './native-types';
|
|
2
|
+
export * from './native-types';
|
|
2
3
|
export interface QueryWorkoutsOptions<TEnergy extends HKUnit, TDistance extends HKUnit> extends GenericQueryOptions {
|
|
3
4
|
readonly energyUnit?: TEnergy;
|
|
4
5
|
readonly distanceUnit?: TDistance;
|
|
@@ -13,108 +14,31 @@ export declare type GenericQueryOptions = {
|
|
|
13
14
|
readonly limit?: number;
|
|
14
15
|
readonly ascending?: boolean;
|
|
15
16
|
};
|
|
16
|
-
export interface HKWorkout<TEnergy extends
|
|
17
|
+
export interface HKWorkout<TEnergy extends EnergyUnit = EnergyUnit, TDistance extends LengthUnit = LengthUnit> extends Omit<HKWorkoutRaw<TEnergy, TDistance>, 'endDate' | 'startDate'> {
|
|
17
18
|
readonly startDate: Date;
|
|
18
19
|
readonly endDate: Date;
|
|
19
20
|
}
|
|
20
|
-
export interface HKQuantitySample<TIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier, TUnit extends
|
|
21
|
+
export interface HKQuantitySample<TIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier> = UnitForIdentifier<TIdentifier>> {
|
|
22
|
+
readonly uuid: string;
|
|
23
|
+
readonly device?: HKDevice;
|
|
24
|
+
readonly quantityType: TIdentifier;
|
|
25
|
+
readonly quantity: number;
|
|
26
|
+
readonly unit: TUnit;
|
|
27
|
+
readonly metadata?: MetadataMapperForQuantityIdentifier<TIdentifier>;
|
|
28
|
+
readonly sourceRevision?: HKSourceRevision;
|
|
21
29
|
readonly startDate: Date;
|
|
22
30
|
readonly endDate: Date;
|
|
23
31
|
}
|
|
24
|
-
export interface QueryStatisticsResponse<
|
|
32
|
+
export interface QueryStatisticsResponse<TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier> = UnitForIdentifier<TIdentifier>> extends Omit<QueryStatisticsResponseRaw<TIdentifier, TUnit>, 'mostRecentQuantityDateInterval'> {
|
|
25
33
|
readonly mostRecentQuantityDateInterval?: {
|
|
26
34
|
readonly from: Date;
|
|
27
35
|
readonly to: Date;
|
|
28
36
|
};
|
|
29
37
|
}
|
|
30
|
-
declare type
|
|
31
|
-
export declare type
|
|
32
|
-
export declare type GetBloodTypeFn = () => Promise<HKBloodType>;
|
|
33
|
-
export declare type GetDateOfBirthFn = () => Promise<Date>;
|
|
34
|
-
export declare type GetBiologicalSexFn = () => Promise<HKBiologicalSex>;
|
|
35
|
-
export declare type GetWheelchairUseFn = () => Promise<HKWheelchairUse>;
|
|
36
|
-
export declare type GetFitzpatrickSkinTypeFn = () => Promise<HKFitzpatrickSkinType>;
|
|
37
|
-
export declare type QueryStatisticsForQuantityFn = <TUnit extends HKUnit>(identifier: HKQuantityTypeIdentifier, options: readonly HKStatisticsOptions[], from: Date, to?: Date, unit?: TUnit) => Promise<QueryStatisticsResponse<TUnit>>;
|
|
38
|
-
export declare type QueryWorkoutsFn = <TEnergy extends HKUnit, TDistance extends HKUnit>(options: QueryWorkoutsOptions<TEnergy, TDistance>) => Promise<readonly HKWorkout<TEnergy, TDistance>[]>;
|
|
39
|
-
export declare type AuthorizationStatusForFn = (type: HealthkitReadAuthorization) => Promise<boolean>;
|
|
40
|
-
export declare type QueryCategorySamplesFn = <T extends HKCategoryTypeIdentifier>(identifier: T, options: GenericQueryOptions) => Promise<readonly HKCategorySample<T>[]>;
|
|
41
|
-
export declare type GetRequestStatusForAuthorizationFn = (read: readonly HealthkitReadAuthorization[], write?: readonly HealthkitWriteAuthorization[]) => Promise<HKAuthorizationRequestStatus>;
|
|
42
|
-
export declare type RequestAuthorizationFn = (read: readonly HealthkitReadAuthorization[], write?: readonly HealthkitWriteAuthorization[]) => Promise<boolean>;
|
|
43
|
-
export declare type SaveQuantitySampleFn = <TUnit extends HKQuantityTypeIdentifier>(identifier: TUnit, unit: HKUnit, value: number, options?: {
|
|
44
|
-
readonly start?: Date;
|
|
45
|
-
readonly end?: Date;
|
|
46
|
-
readonly metadata?: MetadataMapperForQuantityIdentifier<TUnit>;
|
|
47
|
-
}) => Promise<boolean>;
|
|
48
|
-
export declare type QueryQuantitySamplesFn = <TIdentifier extends HKQuantityTypeIdentifier, TUnit extends HKUnit = HKUnit>(identifier: TIdentifier, options: GenericQueryOptions & {
|
|
49
|
-
readonly unit?: TUnit;
|
|
50
|
-
}) => Promise<readonly HKQuantitySample<TIdentifier, TUnit>[]>;
|
|
51
|
-
export declare type SubscribeToChangesFn = (identifier: HKSampleTypeIdentifier, callback: () => void) => Promise<UnsubscribeFunction>;
|
|
52
|
-
export declare type SaveCategorySampleFn = <T extends HKCategoryTypeIdentifier>(identifier: T, value: HKCategoryValueForIdentifier<T>, options?: {
|
|
53
|
-
readonly start?: Date;
|
|
54
|
-
readonly end?: Date;
|
|
55
|
-
readonly metadata?: MetadataMapperForCategoryIdentifier<T>;
|
|
56
|
-
}) => Promise<boolean>;
|
|
57
|
-
export declare type GetMostRecentCategorySampleFn = <T extends HKCategoryTypeIdentifier>(identifier: T) => Promise<HKCategorySample<T> | null>;
|
|
58
|
-
export declare type MostRecentCategorySampleHook = <T extends HKCategoryTypeIdentifier>(identifier: T) => HKCategorySample<T> | null;
|
|
59
|
-
export declare type MostRecentCorrelationSampleHook = <T extends HKCorrelationTypeIdentifier>(identifer: T) => HKCorrelation<T> | null;
|
|
60
|
-
export declare type GetMostRecentQuantitySampleFn = <TIdentifier extends HKQuantityTypeIdentifier, TUnit extends HKUnit>(identifier: TIdentifier, unit?: TUnit) => Promise<HKQuantitySample<TIdentifier, TUnit> | null>;
|
|
61
|
-
export declare type MostRecentQuantitySampleHook = <TIdentifier extends HKQuantityTypeIdentifier, TUnit extends HKUnit>(identifier: TIdentifier, unit?: TUnit) => HKQuantitySample<TIdentifier, TUnit> | null;
|
|
62
|
-
export declare type GetMostRecentWorkoutFn = <TEnergy extends HKUnit, TDistance extends HKUnit>(options?: Pick<QueryWorkoutsOptions<TEnergy, TDistance>, 'distanceUnit' | 'energyUnit'>) => Promise<HKWorkout<TEnergy, TDistance> | null>;
|
|
63
|
-
export declare type MostRecentWorkoutHook = <TEnergy extends HKUnit, TDistance extends HKUnit>(options?: Pick<QueryWorkoutsOptions<TEnergy, TDistance>, 'distanceUnit' | 'energyUnit'>) => HKWorkout<TEnergy, TDistance> | null;
|
|
64
|
-
export declare type GetPreferredUnitsFn = (identifiers: readonly HKQuantityTypeIdentifier[]) => Promise<readonly HKUnit[]>;
|
|
65
|
-
export declare type GetPreferredUnitFn = (identifier: HKQuantityTypeIdentifier) => Promise<HKUnit>;
|
|
66
|
-
export declare type SaveCorrelationSampleFn = <TIdentifier extends HKCorrelationTypeIdentifier>(typeIdentifier: TIdentifier, samples: readonly (Omit<HKCategorySample, 'device' | 'endDate' | 'startDate' | 'uuid'> | Omit<HKQuantitySample, 'device' | 'endDate' | 'startDate' | 'uuid'>)[], options?: {
|
|
67
|
-
readonly start?: Date;
|
|
68
|
-
readonly end?: Date;
|
|
69
|
-
readonly metadata?: MetadataMapperForCorrelationIdentifier<TIdentifier>;
|
|
70
|
-
}) => Promise<boolean>;
|
|
71
|
-
export declare type SaveWorkoutSampleFn = (typeIdentifier: HKWorkoutActivityType, quantities: readonly Omit<HKQuantitySample, 'device' | 'endDate' | 'startDate' | 'uuid'>[], start: Date, options?: {
|
|
72
|
-
readonly end?: Date;
|
|
73
|
-
readonly metadata?: HKWorkoutMetadata;
|
|
74
|
-
}) => Promise<boolean>;
|
|
38
|
+
export declare type HKCategorySampleForSaving = Omit<HKCategorySample, 'device' | 'endDate' | 'startDate' | 'uuid'>;
|
|
39
|
+
export declare type HKQuantitySampleForSaving = Omit<HKQuantitySample, 'device' | 'endDate' | 'startDate' | 'uuid'>;
|
|
75
40
|
export interface HKCorrelation<TIdentifier extends HKCorrelationTypeIdentifier> extends Omit<HKCorrelationRaw<TIdentifier>, 'endDate' | 'objects' | 'startDate'> {
|
|
76
41
|
readonly objects: readonly (HKCategorySample | HKQuantitySample)[];
|
|
77
42
|
readonly startDate: Date;
|
|
78
43
|
readonly endDate: Date;
|
|
79
44
|
}
|
|
80
|
-
export declare type QueryCorrelationSamplesFn = <TIdentifier extends HKCorrelationTypeIdentifier>(typeIdentifier: TIdentifier, options: Omit<GenericQueryOptions, 'ascending' | 'limit'>) => Promise<readonly HKCorrelation<TIdentifier>[]>;
|
|
81
|
-
export declare type SubscribeToChangesHook = <TIdentifier extends HKSampleTypeIdentifier>(identifier: TIdentifier, onChange: () => void, runInitialUpdate?: boolean) => void;
|
|
82
|
-
export declare type GetWorkoutRoutesFn = (workoutUUID: string) => Promise<readonly WorkoutRoute[]>;
|
|
83
|
-
export declare type ReactNativeHealthkit = {
|
|
84
|
-
readonly authorizationStatusFor: AuthorizationStatusForFn;
|
|
85
|
-
readonly getBiologicalSex: GetBiologicalSexFn;
|
|
86
|
-
readonly getBloodType: GetBloodTypeFn;
|
|
87
|
-
readonly getDateOfBirth: GetDateOfBirthFn;
|
|
88
|
-
readonly getFitzpatrickSkinType: GetFitzpatrickSkinTypeFn;
|
|
89
|
-
readonly getMostRecentQuantitySample: GetMostRecentQuantitySampleFn;
|
|
90
|
-
readonly getMostRecentCategorySample: GetMostRecentCategorySampleFn;
|
|
91
|
-
readonly getMostRecentWorkout: GetMostRecentWorkoutFn;
|
|
92
|
-
readonly getPreferredUnit: GetPreferredUnitFn;
|
|
93
|
-
readonly getPreferredUnits: GetPreferredUnitsFn;
|
|
94
|
-
readonly getRequestStatusForAuthorization: GetRequestStatusForAuthorizationFn;
|
|
95
|
-
readonly getWheelchairUse: GetWheelchairUseFn;
|
|
96
|
-
readonly getWorkoutRoutes: GetWorkoutRoutesFn;
|
|
97
|
-
readonly buildUnitWithPrefix: (prefix: HKUnitSIPrefix, unit: HKUnitSI) => HKUnit;
|
|
98
|
-
readonly isHealthDataAvailable: IsHealthDataAvailableFn;
|
|
99
|
-
readonly queryCategorySamples: QueryCategorySamplesFn;
|
|
100
|
-
readonly queryQuantitySamples: QueryQuantitySamplesFn;
|
|
101
|
-
readonly queryStatisticsForQuantity: QueryStatisticsForQuantityFn;
|
|
102
|
-
readonly queryWorkouts: QueryWorkoutsFn;
|
|
103
|
-
readonly queryCorrelationSamples: QueryCorrelationSamplesFn;
|
|
104
|
-
readonly requestAuthorization: RequestAuthorizationFn;
|
|
105
|
-
readonly saveCategorySample: SaveCategorySampleFn;
|
|
106
|
-
readonly saveQuantitySample: SaveQuantitySampleFn;
|
|
107
|
-
readonly saveCorrelationSample: SaveCorrelationSampleFn;
|
|
108
|
-
readonly saveWorkoutSample: SaveWorkoutSampleFn;
|
|
109
|
-
readonly enableBackgroundDelivery: (typeIdentifier: HKSampleTypeIdentifier, updateFrequency: HKUpdateFrequency) => Promise<boolean>;
|
|
110
|
-
readonly disableBackgroundDelivery: (typeIdentifier: HKSampleTypeIdentifier) => Promise<boolean>;
|
|
111
|
-
readonly disableAllBackgroundDelivery: () => Promise<boolean>;
|
|
112
|
-
readonly subscribeToChanges: SubscribeToChangesFn;
|
|
113
|
-
readonly useMostRecentWorkout: MostRecentWorkoutHook;
|
|
114
|
-
readonly useMostRecentCategorySample: MostRecentCategorySampleHook;
|
|
115
|
-
readonly useMostRecentQuantitySample: MostRecentQuantitySampleHook;
|
|
116
|
-
readonly useSubscribeToChanges: SubscribeToChangesHook;
|
|
117
|
-
readonly useIsHealthDataAvailable: () => boolean | null;
|
|
118
|
-
readonly useHealthkitAuthorization: (read: readonly HealthkitReadAuthorization[], write?: readonly HealthkitWriteAuthorization[]) => readonly [authorizationStatus: HKAuthorizationRequestStatus | null, request: () => Promise<HKAuthorizationRequestStatus | null>];
|
|
119
|
-
};
|
|
120
|
-
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { HKCategorySampleRaw, HKCategoryTypeIdentifier } from '../native-types';
|
|
2
|
+
import type { HKCategorySample } from '../types';
|
|
3
|
+
declare const deserializCategorySample: <T extends HKCategoryTypeIdentifier>(sample: HKCategorySampleRaw<T>) => HKCategorySample<T>;
|
|
4
|
+
export default deserializCategorySample;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { HKCorrelationRaw, HKCorrelationTypeIdentifier } from '../native-types';
|
|
2
|
+
import type { HKCorrelation } from '../types';
|
|
3
|
+
declare function deserializeCorrelation<TIdentifier extends HKCorrelationTypeIdentifier>(s: HKCorrelationRaw<TIdentifier>): HKCorrelation<TIdentifier>;
|
|
4
|
+
export default deserializeCorrelation;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { HKQuantitySampleRaw, HKQuantityTypeIdentifier, UnitForIdentifier } from '../native-types';
|
|
2
|
+
import type { HKQuantitySample } from '../types';
|
|
3
|
+
declare function deserializeSample<TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier>>(sample: HKQuantitySampleRaw<TIdentifier, TUnit>): HKQuantitySample<TIdentifier, TUnit>;
|
|
4
|
+
export default deserializeSample;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { EnergyUnit, HKWorkoutRaw, LengthUnit } from '../native-types';
|
|
2
|
+
import type { HKWorkout } from '../types';
|
|
3
|
+
declare function deserializeWorkout<TEnergy extends EnergyUnit, TDistance extends LengthUnit>(sample: HKWorkoutRaw<TEnergy, TDistance>): HKWorkout<TEnergy, TDistance>;
|
|
4
|
+
export default deserializeWorkout;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { HKQuantityTypeIdentifier, UnitForIdentifier } from '../native-types';
|
|
2
|
+
declare const ensureUnit: <TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier>>(type: TIdentifier, providedUnit?: TUnit | undefined) => Promise<TUnit>;
|
|
3
|
+
export default ensureUnit;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { HKQuantityTypeIdentifier, UnitForIdentifier } from '../native-types';
|
|
2
|
+
declare function getMostRecentQuantitySample<TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier>>(identifier: TIdentifier, unit: TUnit): Promise<import("..").HKQuantitySample<TIdentifier, UnitForIdentifier<TIdentifier>> | null>;
|
|
3
|
+
export default getMostRecentQuantitySample;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { EnergyUnit, LengthUnit } from '../native-types';
|
|
2
|
+
import type { HKWorkout, QueryWorkoutsOptions } from '../types';
|
|
3
|
+
export declare type GetMostRecentWorkoutFn = <TEnergy extends EnergyUnit, TDistance extends LengthUnit>(options?: Pick<QueryWorkoutsOptions<TEnergy, TDistance>, 'distanceUnit' | 'energyUnit'>) => Promise<HKWorkout<TEnergy, TDistance> | null>;
|
|
4
|
+
declare const getMostRecentWorkout: GetMostRecentWorkoutFn;
|
|
5
|
+
export default getMostRecentWorkout;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { HKQuantityTypeIdentifier, HKUnit } from '../native-types';
|
|
2
|
+
export declare type GetPreferredUnitsFn = (identifiers: readonly HKQuantityTypeIdentifier[]) => Promise<readonly HKUnit[]>;
|
|
3
|
+
declare const getPreferredUnits: GetPreferredUnitsFn;
|
|
4
|
+
export default getPreferredUnits;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HKUnit } from '../native-types';
|
|
2
|
+
declare function getPreferredUnitsTyped<TEnergy extends HKUnit, TDistance extends HKUnit>(options?: {
|
|
3
|
+
readonly energyUnit?: TEnergy;
|
|
4
|
+
readonly distanceUnit?: TDistance;
|
|
5
|
+
}): Promise<{
|
|
6
|
+
energyUnit: TEnergy;
|
|
7
|
+
distanceUnit: TDistance;
|
|
8
|
+
}>;
|
|
9
|
+
export default getPreferredUnitsTyped;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { HealthkitReadAuthorization, HealthkitWriteAuthorization } from '../native-types';
|
|
2
|
+
declare const getRequestStatusForAuthorization: (read: readonly HealthkitReadAuthorization[], write?: readonly HealthkitWriteAuthorization[]) => Promise<import("../native-types").HKAuthorizationRequestStatus>;
|
|
3
|
+
export default getRequestStatusForAuthorization;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HKCategoryTypeIdentifier } from '../native-types';
|
|
2
|
+
import type { GenericQueryOptions, HKCategorySample } from '../types';
|
|
3
|
+
export declare type QueryCategorySamplesFn = <T extends HKCategoryTypeIdentifier>(identifier: T, options: GenericQueryOptions) => Promise<readonly HKCategorySample<T>[]>;
|
|
4
|
+
declare const queryCategorySamples: QueryCategorySamplesFn;
|
|
5
|
+
export default queryCategorySamples;
|