@kingstinct/react-native-healthkit 11.1.2 → 12.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/README.md +5 -3
  2. package/ios/CoreModule.swift +6 -6
  3. package/ios/Helpers.swift +5 -5
  4. package/ios/QuantityTypeModule.swift +5 -19
  5. package/ios/WorkoutsModule.swift +14 -14
  6. package/lib/commonjs/healthkit.ios.js +11 -6
  7. package/lib/commonjs/healthkit.js +12 -4
  8. package/lib/commonjs/hooks/useHealthkitAuthorization.js +14 -8
  9. package/lib/commonjs/hooks/useSubscribeToQuantitySamples.js +20 -0
  10. package/lib/commonjs/utils/subscribeToQuantitySamples.js +47 -0
  11. package/lib/module/healthkit.ios.js +6 -4
  12. package/lib/module/healthkit.js +11 -3
  13. package/lib/module/hooks/useHealthkitAuthorization.js +14 -8
  14. package/lib/module/hooks/useSubscribeToQuantitySamples.js +17 -0
  15. package/lib/module/utils/subscribeToQuantitySamples.js +43 -0
  16. package/lib/typescript/healthkit.d.ts +19 -9
  17. package/lib/typescript/healthkit.ios.d.ts +27 -18
  18. package/lib/typescript/hooks/useHealthkitAuthorization.d.ts +4 -1
  19. package/lib/typescript/hooks/useSubscribeToQuantitySamples.d.ts +3 -0
  20. package/lib/typescript/specs/CharacteristicTypeModule.nitro.d.ts +2 -2
  21. package/lib/typescript/specs/CoreModule.nitro.d.ts +7 -2
  22. package/lib/typescript/specs/QuantityTypeModule.nitro.d.ts +1 -1
  23. package/lib/typescript/specs/WorkoutProxy.nitro.d.ts +3 -11
  24. package/lib/typescript/specs/WorkoutsModule.nitro.d.ts +1 -1
  25. package/lib/typescript/types/Device.d.ts +8 -8
  26. package/lib/typescript/types/Source.d.ts +2 -2
  27. package/lib/typescript/types/Subscriptions.d.ts +14 -1
  28. package/lib/typescript/types/Workouts.d.ts +1 -1
  29. package/lib/typescript/utils/subscribeToQuantitySamples.d.ts +5 -0
  30. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.hpp +94 -55
  31. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Umbrella.hpp +3 -2
  32. package/nitrogen/generated/ios/c++/HybridCategoryTypeModuleSpecSwift.hpp +3 -2
  33. package/nitrogen/generated/ios/c++/HybridCharacteristicTypeModuleSpecSwift.hpp +3 -0
  34. package/nitrogen/generated/ios/c++/HybridCoreModuleSpecSwift.hpp +10 -4
  35. package/nitrogen/generated/ios/c++/HybridCorrelationTypeModuleSpecSwift.hpp +3 -2
  36. package/nitrogen/generated/ios/c++/HybridElectrocardiogramModuleSpecSwift.hpp +3 -2
  37. package/nitrogen/generated/ios/c++/HybridHeartbeatSeriesModuleSpecSwift.hpp +3 -2
  38. package/nitrogen/generated/ios/c++/HybridQuantityTypeModuleSpecSwift.hpp +4 -3
  39. package/nitrogen/generated/ios/c++/HybridSourceProxySpecSwift.hpp +3 -0
  40. package/nitrogen/generated/ios/c++/HybridStateOfMindModuleSpecSwift.hpp +3 -2
  41. package/nitrogen/generated/ios/c++/HybridWorkoutProxySpecSwift.hpp +7 -22
  42. package/nitrogen/generated/ios/c++/HybridWorkoutsModuleSpecSwift.hpp +5 -4
  43. package/nitrogen/generated/ios/swift/AuthDataTypes.swift +108 -0
  44. package/nitrogen/generated/ios/swift/ECGQueryOptionsWithSortOrder.swift +16 -2
  45. package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec.swift +8 -0
  46. package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec_cxx.swift +10 -1
  47. package/nitrogen/generated/ios/swift/HybridCharacteristicTypeModuleSpec.swift +8 -0
  48. package/nitrogen/generated/ios/swift/HybridCharacteristicTypeModuleSpec_cxx.swift +10 -1
  49. package/nitrogen/generated/ios/swift/HybridCoreModuleSpec.swift +10 -2
  50. package/nitrogen/generated/ios/swift/HybridCoreModuleSpec_cxx.swift +24 -36
  51. package/nitrogen/generated/ios/swift/HybridCorrelationTypeModuleSpec.swift +8 -0
  52. package/nitrogen/generated/ios/swift/HybridCorrelationTypeModuleSpec_cxx.swift +10 -1
  53. package/nitrogen/generated/ios/swift/HybridElectrocardiogramModuleSpec.swift +8 -0
  54. package/nitrogen/generated/ios/swift/HybridElectrocardiogramModuleSpec_cxx.swift +10 -1
  55. package/nitrogen/generated/ios/swift/HybridHeartbeatSeriesModuleSpec.swift +8 -0
  56. package/nitrogen/generated/ios/swift/HybridHeartbeatSeriesModuleSpec_cxx.swift +10 -1
  57. package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec.swift +9 -1
  58. package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec_cxx.swift +13 -12
  59. package/nitrogen/generated/ios/swift/HybridSourceProxySpec.swift +7 -0
  60. package/nitrogen/generated/ios/swift/HybridSourceProxySpec_cxx.swift +9 -1
  61. package/nitrogen/generated/ios/swift/HybridStateOfMindModuleSpec.swift +8 -0
  62. package/nitrogen/generated/ios/swift/HybridStateOfMindModuleSpec_cxx.swift +11 -10
  63. package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec.swift +8 -4
  64. package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec_cxx.swift +10 -53
  65. package/nitrogen/generated/ios/swift/HybridWorkoutsModuleSpec.swift +9 -1
  66. package/nitrogen/generated/ios/swift/HybridWorkoutsModuleSpec_cxx.swift +19 -3
  67. package/nitrogen/generated/ios/swift/PredicateWithMetadataKey.swift +21 -21
  68. package/nitrogen/generated/ios/swift/PredicateWithStartAndEnd.swift +16 -2
  69. package/nitrogen/generated/ios/swift/QueryOptionsWithSortOrder.swift +8 -1
  70. package/nitrogen/generated/ios/swift/QueryOptionsWithSortOrderAndUnit.swift +8 -1
  71. package/nitrogen/generated/ios/swift/StateOfMindSample.swift +29 -21
  72. package/nitrogen/generated/ios/swift/{Variant_String_Double_Bool_Date.swift → Variant_Bool_String_Double_Date.swift} +6 -6
  73. package/nitrogen/generated/ios/swift/WorkoutQueryOptions.swift +8 -1
  74. package/nitrogen/generated/shared/c++/AuthDataTypes.hpp +85 -0
  75. package/nitrogen/generated/shared/c++/CategorySample.hpp +0 -2
  76. package/nitrogen/generated/shared/c++/CategorySampleForSaving.hpp +0 -2
  77. package/nitrogen/generated/shared/c++/CorrelationSample.hpp +0 -2
  78. package/nitrogen/generated/shared/c++/DeletedSample.hpp +1 -2
  79. package/nitrogen/generated/shared/c++/ElectrocardiogramSample.hpp +0 -2
  80. package/nitrogen/generated/shared/c++/HeartbeatSeriesSample.hpp +0 -2
  81. package/nitrogen/generated/shared/c++/HybridCategoryTypeModuleSpec.hpp +0 -2
  82. package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.hpp +5 -5
  83. package/nitrogen/generated/shared/c++/HybridCorrelationTypeModuleSpec.hpp +0 -2
  84. package/nitrogen/generated/shared/c++/HybridQuantityTypeModuleSpec.hpp +1 -3
  85. package/nitrogen/generated/shared/c++/HybridStateOfMindModuleSpec.hpp +0 -2
  86. package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.cpp +0 -4
  87. package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.hpp +4 -10
  88. package/nitrogen/generated/shared/c++/HybridWorkoutsModuleSpec.hpp +2 -3
  89. package/nitrogen/generated/shared/c++/PredicateWithMetadataKey.hpp +5 -5
  90. package/nitrogen/generated/shared/c++/QuantitySample.hpp +0 -2
  91. package/nitrogen/generated/shared/c++/QuantitySampleForSaving.hpp +0 -2
  92. package/nitrogen/generated/shared/c++/StateOfMindSample.hpp +0 -2
  93. package/nitrogen/generated/shared/c++/WorkoutSample.hpp +0 -2
  94. package/package.json +7 -7
  95. package/src/healthkit.ios.ts +11 -6
  96. package/src/healthkit.ts +19 -6
  97. package/src/hooks/useHealthkitAuthorization.test.ts +12 -4
  98. package/src/hooks/useHealthkitAuthorization.ts +20 -14
  99. package/src/hooks/useSubscribeToQuantitySamples.ts +31 -0
  100. package/src/specs/CategoryTypeModule.nitro.ts +1 -1
  101. package/src/specs/CharacteristicTypeModule.nitro.ts +2 -2
  102. package/src/specs/CoreModule.nitro.ts +8 -6
  103. package/src/specs/QuantityTypeModule.nitro.ts +1 -1
  104. package/src/specs/WorkoutProxy.nitro.ts +3 -16
  105. package/src/specs/WorkoutsModule.nitro.ts +2 -2
  106. package/src/types/Device.ts +8 -8
  107. package/src/types/InterfaceVerificationExample.ts +2 -2
  108. package/src/types/Source.ts +2 -2
  109. package/src/types/Subscriptions.ts +19 -1
  110. package/src/types/Workouts.ts +1 -1
  111. package/src/utils/subscribeToQuantitySamples.ts +63 -0
@@ -12,13 +12,15 @@ export declare const disableAllBackgroundDelivery: () => Promise<boolean>;
12
12
  export declare const disableBackgroundDelivery: (typeIdentifier: import("./types").ObjectTypeIdentifier) => Promise<boolean>;
13
13
  export declare const enableBackgroundDelivery: (typeIdentifier: import("./types").ObjectTypeIdentifier, updateFrequency: import("./types").UpdateFrequency) => Promise<boolean>;
14
14
  export declare const getPreferredUnits: (identifiers: readonly import("./types").QuantityTypeIdentifier[], forceUpdate?: boolean) => Promise<import("./types").IdentifierWithUnit[]>;
15
- export declare const getRequestStatusForAuthorization: (toShare: readonly import("./types").SampleTypeIdentifierWriteable[], toRead: readonly import("./types").ObjectTypeIdentifier[]) => Promise<AuthorizationRequestStatus>;
15
+ export declare const getRequestStatusForAuthorization: (toCheck: import("./specs/CoreModule.nitro").AuthDataTypes) => Promise<AuthorizationRequestStatus>;
16
16
  export declare const isHealthDataAvailable: () => boolean;
17
17
  export declare const isHealthDataAvailableAsync: () => Promise<boolean>;
18
18
  export declare const querySources: (identifier: import("./types").SampleTypeIdentifier) => Promise<readonly import("./specs/SourceProxy.nitro").SourceProxy[]>;
19
- export declare const requestAuthorization: (toShare: readonly import("./types").SampleTypeIdentifierWriteable[], toRead: readonly import("./types").ObjectTypeIdentifier[]) => Promise<boolean>;
19
+ export declare const requestAuthorization: (toRequest: import("./specs/CoreModule.nitro").AuthDataTypes) => Promise<boolean>;
20
20
  export declare const deleteObjects: (objectTypeIdentifier: import("./types").ObjectTypeIdentifier, filter: import("./types").FilterForSamples) => Promise<number>;
21
- export declare const subscribeToChanges: (typeIdentifier: import("./types").SampleTypeIdentifier, callback: (args: import("./types").OnChangeCallbackArgs) => void) => string;
21
+ export declare const subscribeToChanges: (identifier: import("./types").SampleTypeIdentifier, callback: (args: import("./types").OnChangeCallbackArgs) => void) => {
22
+ remove: () => boolean;
23
+ };
22
24
  export declare const isProtectedDataAvailable: () => boolean;
23
25
  export declare const isObjectTypeAvailable: (objectTypeIdentifier: import("./types").ObjectTypeIdentifier) => boolean;
24
26
  export declare const isObjectTypeAvailableAsync: (objectTypeIdentifier: import("./types").ObjectTypeIdentifier) => Promise<boolean>;
@@ -26,13 +28,13 @@ export declare const areObjectTypesAvailable: (objectTypeIdentifiers: readonly i
26
28
  export declare const areObjectTypesAvailableAsync: (objectTypeIdentifiers: import("./types").ObjectTypeIdentifier[]) => Promise<Record<string, boolean>>;
27
29
  export declare const getBiologicalSex: () => BiologicalSex;
28
30
  export declare const getBloodType: () => BloodType;
29
- export declare const getDateOfBirth: () => Date | null;
31
+ export declare const getDateOfBirth: () => Date | undefined;
30
32
  export declare const getFitzpatrickSkinType: () => FitzpatrickSkinType;
31
33
  export declare const getWheelchairUse: () => WheelchairUse;
32
34
  export declare const queryQuantitySamples: (identifier: import("./types").QuantityTypeIdentifier, options?: import("./types").QueryOptionsWithSortOrderAndUnit) => Promise<readonly QuantitySample[]>;
33
35
  export declare const queryQuantitySamplesWithAnchor: (identifier: import("./types").QuantityTypeIdentifier, options: import("./types").QueryOptionsWithAnchorAndUnit) => Promise<import("./types").QuantitySamplesWithAnchorResponse>;
34
36
  export declare const queryStatisticsForQuantity: (identifier: import("./types").QuantityTypeIdentifier, statistics: readonly import("./types").StatisticsOptions[], options?: import("./types").StatisticsQueryOptions) => Promise<import("./types").QueryStatisticsResponse>;
35
- export declare const queryStatisticsCollectionForQuantity: (identifier: import("./types").QuantityTypeIdentifier, statistics: readonly import("./types").StatisticsOptions[], anchorDate: string, intervalComponents: import("./types").IntervalComponents, options?: import("./types").StatisticsQueryOptions) => Promise<readonly import("./types").QueryStatisticsResponse[]>;
37
+ export declare const queryStatisticsCollectionForQuantity: (identifier: import("./types").QuantityTypeIdentifier, statistics: readonly import("./types").StatisticsOptions[], anchorDate: Date, intervalComponents: import("./types").IntervalComponents, options?: import("./types").StatisticsQueryOptions) => Promise<readonly import("./types").QueryStatisticsResponse[]>;
36
38
  export declare const saveQuantitySample: (identifier: import("./types").QuantityTypeIdentifier, unit: string, value: number, start: Date, end: Date, metadata: import("react-native-nitro-modules").AnyMap) => Promise<boolean>;
37
39
  export declare const isQuantityCompatibleWithUnit: (identifier: import("./types").QuantityTypeIdentifier, unit: string) => boolean;
38
40
  export declare function queryCategorySamples<T extends CategoryTypeIdentifier>(_categoryTypeIdentifier: T, _options?: QueryOptionsWithSortOrder): Promise<CategorySampleTyped<T>[]>;
@@ -46,7 +48,7 @@ export declare const queryElectrocardiogramSamples: (options?: import("./types/E
46
48
  export declare const queryElectrocardiogramSamplesWithAnchor: (options: import("./types/ElectrocardiogramSample").ECGQueryOptionsWithAnchor) => Promise<import("./types/ElectrocardiogramSample").ElectrocardiogramSamplesWithAnchorResponse>;
47
49
  export declare const queryWorkoutSamples: (options: import("./types").WorkoutQueryOptions) => Promise<WorkoutProxy[]>;
48
50
  export declare const queryWorkoutSamplesWithAnchor: (options: import("./types").WorkoutQueryOptionsWithAnchor) => Promise<import("./types").QueryWorkoutSamplesWithAnchorResponse>;
49
- export declare const saveWorkoutSample: (workoutActivityType: import("./types").WorkoutActivityType, quantities: readonly import("./types").QuantitySampleForSaving[], startDate: Date, endDate: Date, totals: import("./types").WorkoutTotals, metadata: import("react-native-nitro-modules").AnyMap) => Promise<WorkoutProxy>;
51
+ export declare const saveWorkoutSample: (workoutActivityType: import("./types").WorkoutActivityType, quantities: readonly import("./types").QuantitySampleForSaving[], startDate: Date, endDate: Date, totals?: import("./types").WorkoutTotals, metadata?: import("react-native-nitro-modules").AnyMap) => Promise<WorkoutProxy>;
50
52
  export declare const startWatchApp: (workoutConfiguration: import("./types").WorkoutConfiguration) => Promise<boolean>;
51
53
  export declare const queryStateOfMindSamples: (options?: QueryOptionsWithSortOrder) => Promise<readonly import("./types").StateOfMindSample[]>;
52
54
  export declare const saveStateOfMindSample: (date: Date, kind: import("./types").StateOfMindKind, valence: number, labels: readonly import("./types").StateOfMindLabel[], associations: readonly import("./types").StateOfMindAssociation[], metadata?: import("react-native-nitro-modules").AnyMap) => Promise<boolean>;
@@ -58,15 +60,23 @@ export declare function useMostRecentCategorySample<T extends CategoryTypeIdenti
58
60
  export declare const useMostRecentQuantitySample: typeof import("./healthkit.ios").useMostRecentQuantitySample;
59
61
  export declare const useMostRecentWorkout: typeof import("./healthkit.ios").useMostRecentWorkout;
60
62
  export declare const useSubscribeToChanges: typeof import("./healthkit.ios").useSubscribeToChanges;
61
- export declare const useHealthkitAuthorization: (read: readonly import("./types").ObjectTypeIdentifier[], write?: readonly import("./types").SampleTypeIdentifierWriteable[]) => readonly [AuthorizationRequestStatus | null, () => Promise<AuthorizationRequestStatus>];
63
+ export declare const useHealthkitAuthorization: ({ toWrite, toRead, }: {
64
+ toRead?: readonly import("./types").ObjectTypeIdentifier[];
65
+ toWrite?: readonly import("./types").SampleTypeIdentifierWriteable[];
66
+ }) => readonly [AuthorizationRequestStatus | null, () => Promise<AuthorizationRequestStatus>];
62
67
  export declare const useIsHealthDataAvailable: () => boolean | null;
63
68
  export declare const useSources: typeof import("./healthkit.ios").useSources;
64
69
  export declare const useStatisticsForQuantity: typeof import("./healthkit.ios").useStatisticsForQuantity;
65
70
  export declare const getBiologicalSexAsync: () => Promise<BiologicalSex>;
66
71
  export declare const getBloodTypeAsync: () => Promise<BloodType>;
67
- export declare const getDateOfBirthAsync: () => Promise<Date | null>;
72
+ export declare const getDateOfBirthAsync: () => Promise<Date | undefined>;
68
73
  export declare const getFitzpatrickSkinTypeAsync: () => Promise<FitzpatrickSkinType>;
69
74
  export declare const getWheelchairUseAsync: () => Promise<WheelchairUse>;
70
- export declare const unsubscribeQueries: (queryIds: string[]) => number;
75
+ declare const subscribeToQuantitySamples: (identifier: import("./types").QuantityTypeIdentifier, callback: (args: import("./types").OnQuantitySamplesCallback) => void, after?: Date) => {
76
+ remove: () => boolean;
77
+ };
78
+ export { subscribeToQuantitySamples };
79
+ declare const useSubscribeToQuantitySamples: typeof import("./healthkit.ios").useSubscribeToQuantitySamples;
80
+ export { useSubscribeToQuantitySamples };
71
81
  declare const _default: typeof ReactNativeHealthkit;
72
82
  export default _default;
@@ -6,11 +6,14 @@ import useMostRecentWorkout from './hooks/useMostRecentWorkout';
6
6
  import useSources from './hooks/useSources';
7
7
  import useStatisticsForQuantity from './hooks/useStatisticsForQuantity';
8
8
  import useSubscribeToChanges from './hooks/useSubscribeToChanges';
9
+ import useSubscribeToQuantitySamples from './hooks/useSubscribeToQuantitySamples';
9
10
  import type { QuantityTypeIdentifier } from './types/QuantityTypeIdentifier';
10
11
  import getMostRecentCategorySample from './utils/getMostRecentCategorySample';
11
12
  import getMostRecentQuantitySample from './utils/getMostRecentQuantitySample';
12
13
  import getMostRecentWorkout from './utils/getMostRecentWorkout';
13
14
  import getPreferredUnit from './utils/getPreferredUnit';
15
+ import { subscribeToChanges } from './utils/subscribeToChanges';
16
+ import { subscribeToQuantitySamples } from './utils/subscribeToQuantitySamples';
14
17
  export * from './types';
15
18
  declare const currentMajorVersionIOS: number;
16
19
  /**
@@ -21,7 +24,7 @@ type QuantityTypesIOS17Plus = 'HKQuantityTypeIdentifierCyclingCadence' | 'HKQuan
21
24
  * Available quantity types for iOS versions before iOS 17
22
25
  */
23
26
  export type AvailableQuantityTypesBeforeIOS17 = Exclude<QuantityTypeIdentifier, QuantityTypesIOS17Plus>;
24
- export { getMostRecentCategorySample, getMostRecentQuantitySample, getMostRecentWorkout, getPreferredUnit, useMostRecentCategorySample, useMostRecentQuantitySample, useMostRecentWorkout, useSubscribeToChanges, useHealthkitAuthorization, useIsHealthDataAvailable, useSources, useStatisticsForQuantity, };
27
+ export { getMostRecentCategorySample, getMostRecentQuantitySample, getMostRecentWorkout, getPreferredUnit, subscribeToChanges, subscribeToQuantitySamples, useHealthkitAuthorization, useIsHealthDataAvailable, useMostRecentCategorySample, useMostRecentQuantitySample, useMostRecentWorkout, useSources, useStatisticsForQuantity, useSubscribeToChanges, useSubscribeToQuantitySamples, };
25
28
  /**
26
29
  * Available quantity types for iOS 17 and later (all quantity types)
27
30
  */
@@ -38,10 +41,10 @@ export declare const disableBackgroundDelivery: (typeIdentifier: import("./types
38
41
  export declare const enableBackgroundDelivery: (typeIdentifier: import("./types").ObjectTypeIdentifier, updateFrequency: import("./types").UpdateFrequency) => Promise<boolean>;
39
42
  export declare const getBiologicalSex: () => import("./types").BiologicalSex;
40
43
  export declare const getBloodType: () => import("./types").BloodType;
41
- export declare const getDateOfBirth: () => Date | null;
44
+ export declare const getDateOfBirth: () => Date | undefined;
42
45
  export declare const getFitzpatrickSkinType: () => import("./types").FitzpatrickSkinType;
43
46
  export declare const getPreferredUnits: (identifiers: readonly QuantityTypeIdentifier[], forceUpdate?: boolean) => Promise<import("./types").IdentifierWithUnit[]>;
44
- export declare const getRequestStatusForAuthorization: (toShare: readonly import("./types").SampleTypeIdentifierWriteable[], toRead: readonly import("./types").ObjectTypeIdentifier[]) => Promise<import("./types").AuthorizationRequestStatus>;
47
+ export declare const getRequestStatusForAuthorization: (toCheck: import("./specs/CoreModule.nitro").AuthDataTypes) => Promise<import("./types").AuthorizationRequestStatus>;
45
48
  export declare const getWheelchairUse: () => import("./types").WheelchairUse;
46
49
  export declare const isHealthDataAvailable: () => boolean;
47
50
  export declare const isHealthDataAvailableAsync: () => Promise<boolean>;
@@ -55,30 +58,28 @@ export declare const queryElectrocardiogramSamplesWithAnchor: (options: import("
55
58
  export declare const queryQuantitySamples: (identifier: QuantityTypeIdentifier, options?: import("./types").QueryOptionsWithSortOrderAndUnit) => Promise<readonly import("./types").QuantitySample[]>;
56
59
  export declare const queryQuantitySamplesWithAnchor: (identifier: QuantityTypeIdentifier, options: import("./types").QueryOptionsWithAnchorAndUnit) => Promise<import("./types").QuantitySamplesWithAnchorResponse>;
57
60
  export declare const queryStatisticsForQuantity: (identifier: QuantityTypeIdentifier, statistics: readonly import("./types").StatisticsOptions[], options?: import("./types").StatisticsQueryOptions) => Promise<import("./types").QueryStatisticsResponse>;
58
- export declare const queryStatisticsCollectionForQuantity: (identifier: QuantityTypeIdentifier, statistics: readonly import("./types").StatisticsOptions[], anchorDate: string, intervalComponents: import("./types").IntervalComponents, options?: import("./types").StatisticsQueryOptions) => Promise<readonly import("./types").QueryStatisticsResponse[]>;
61
+ export declare const queryStatisticsCollectionForQuantity: (identifier: QuantityTypeIdentifier, statistics: readonly import("./types").StatisticsOptions[], anchorDate: Date, intervalComponents: import("./types").IntervalComponents, options?: import("./types").StatisticsQueryOptions) => Promise<readonly import("./types").QueryStatisticsResponse[]>;
59
62
  export declare const queryWorkoutSamples: (options: import("./types").WorkoutQueryOptions) => Promise<import("./specs/WorkoutProxy.nitro").WorkoutProxy[]>;
60
63
  export declare const queryWorkoutSamplesWithAnchor: (options: import("./types").WorkoutQueryOptionsWithAnchor) => Promise<import("./types").QueryWorkoutSamplesWithAnchorResponse>;
61
64
  export declare const querySources: (identifier: import("./types").SampleTypeIdentifier) => Promise<readonly import("./specs/SourceProxy.nitro").SourceProxy[]>;
62
- export declare const requestAuthorization: (toShare: readonly import("./types").SampleTypeIdentifierWriteable[], toRead: readonly import("./types").ObjectTypeIdentifier[]) => Promise<boolean>;
65
+ export declare const requestAuthorization: (toRequest: import("./specs/CoreModule.nitro").AuthDataTypes) => Promise<boolean>;
63
66
  export declare const deleteObjects: (objectTypeIdentifier: import("./types").ObjectTypeIdentifier, filter: import("./types").FilterForSamples) => Promise<number>;
64
67
  export declare const saveCategorySample: <T extends import("./types").CategoryTypeIdentifier>(identifier: T, value: import("./types").CategoryValueForIdentifier, startDate: Date, endDate: Date, metadata: import("./types").MetadataForCategoryIdentifier<T>) => Promise<boolean>;
65
68
  export declare const saveCorrelationSample: (typeIdentifier: import("./types").CorrelationTypeIdentifier, samples: import("./types").SampleForSaving[], start: Date, end: Date, metadata: import("react-native-nitro-modules").AnyMap) => Promise<boolean>;
66
69
  export declare const saveQuantitySample: (identifier: QuantityTypeIdentifier, unit: string, value: number, start: Date, end: Date, metadata: import("react-native-nitro-modules").AnyMap) => Promise<boolean>;
67
- export declare const saveWorkoutSample: (workoutActivityType: import("./types").WorkoutActivityType, quantities: readonly import("./types").QuantitySampleForSaving[], startDate: Date, endDate: Date, totals: import("./types").WorkoutTotals, metadata: import("react-native-nitro-modules").AnyMap) => Promise<import("./specs/WorkoutProxy.nitro").WorkoutProxy>;
68
- export declare const subscribeToChanges: (typeIdentifier: import("./types").SampleTypeIdentifier, callback: (args: import("./types").OnChangeCallbackArgs) => void) => string;
70
+ export declare const saveWorkoutSample: (workoutActivityType: import("./types").WorkoutActivityType, quantities: readonly import("./types").QuantitySampleForSaving[], startDate: Date, endDate: Date, totals?: import("./types").WorkoutTotals, metadata?: import("react-native-nitro-modules").AnyMap) => Promise<import("./specs/WorkoutProxy.nitro").WorkoutProxy>;
69
71
  export declare const startWatchApp: (workoutConfiguration: import("./types").WorkoutConfiguration) => Promise<boolean>;
70
72
  export declare const isProtectedDataAvailable: () => boolean;
71
73
  export declare const queryStateOfMindSamples: (options?: import("./types").QueryOptionsWithSortOrder) => Promise<readonly import("./types").StateOfMindSample[]>;
72
74
  export declare const saveStateOfMindSample: (date: Date, kind: import("./types").StateOfMindKind, valence: number, labels: readonly import("./types").StateOfMindLabel[], associations: readonly import("./types").StateOfMindAssociation[], metadata?: import("react-native-nitro-modules").AnyMap) => Promise<boolean>;
73
75
  export declare const isQuantityCompatibleWithUnit: (identifier: QuantityTypeIdentifier, unit: string) => boolean;
74
- export declare const unsubscribeQueries: (queryIds: string[]) => number;
75
76
  export declare const isObjectTypeAvailable: (objectTypeIdentifier: import("./types").ObjectTypeIdentifier) => boolean;
76
77
  export declare const isObjectTypeAvailableAsync: (objectTypeIdentifier: import("./types").ObjectTypeIdentifier) => Promise<boolean>;
77
78
  export declare const areObjectTypesAvailable: (objectTypeIdentifiers: readonly import("./types").ObjectTypeIdentifier[]) => Record<string, boolean>;
78
79
  export declare const areObjectTypesAvailableAsync: (objectTypeIdentifiers: import("./types").ObjectTypeIdentifier[]) => Promise<Record<string, boolean>>;
79
80
  export declare const getBiologicalSexAsync: () => Promise<import("./types").BiologicalSex>;
80
81
  export declare const getBloodTypeAsync: () => Promise<import("./types").BloodType>;
81
- export declare const getDateOfBirthAsync: () => Promise<Date | null>;
82
+ export declare const getDateOfBirthAsync: () => Promise<Date | undefined>;
82
83
  export declare const getFitzpatrickSkinTypeAsync: () => Promise<import("./types").FitzpatrickSkinType>;
83
84
  export declare const getWheelchairUseAsync: () => Promise<import("./types").WheelchairUse>;
84
85
  declare const _default: {
@@ -93,11 +94,11 @@ declare const _default: {
93
94
  enableBackgroundDelivery: (typeIdentifier: import("./types").ObjectTypeIdentifier, updateFrequency: import("./types").UpdateFrequency) => Promise<boolean>;
94
95
  getBiologicalSex: () => import("./types").BiologicalSex;
95
96
  getBloodType: () => import("./types").BloodType;
96
- getDateOfBirth: () => Date | null;
97
+ getDateOfBirth: () => Date | undefined;
97
98
  getFitzpatrickSkinType: () => import("./types").FitzpatrickSkinType;
98
99
  getBiologicalSexAsync: () => Promise<import("./types").BiologicalSex>;
99
100
  getBloodTypeAsync: () => Promise<import("./types").BloodType>;
100
- getDateOfBirthAsync: () => Promise<Date | null>;
101
+ getDateOfBirthAsync: () => Promise<Date | undefined>;
101
102
  getFitzpatrickSkinTypeAsync: () => Promise<import("./types").FitzpatrickSkinType>;
102
103
  getWheelchairUseAsync: () => Promise<import("./types").WheelchairUse>;
103
104
  getMostRecentCategorySample: typeof getMostRecentCategorySample;
@@ -105,7 +106,7 @@ declare const _default: {
105
106
  getMostRecentWorkout: () => Promise<import("./specs/WorkoutProxy.nitro").WorkoutProxy | undefined>;
106
107
  getPreferredUnits: (identifiers: readonly QuantityTypeIdentifier[], forceUpdate?: boolean) => Promise<import("./types").IdentifierWithUnit[]>;
107
108
  getPreferredUnit: (quantityType: QuantityTypeIdentifier) => Promise<string>;
108
- getRequestStatusForAuthorization: (toShare: readonly import("./types").SampleTypeIdentifierWriteable[], toRead: readonly import("./types").ObjectTypeIdentifier[]) => Promise<import("./types").AuthorizationRequestStatus>;
109
+ getRequestStatusForAuthorization: (toCheck: import("./specs/CoreModule.nitro").AuthDataTypes) => Promise<import("./types").AuthorizationRequestStatus>;
109
110
  getWheelchairUse: () => import("./types").WheelchairUse;
110
111
  isHealthDataAvailable: () => boolean;
111
112
  isHealthDataAvailableAsync: () => Promise<boolean>;
@@ -119,18 +120,22 @@ declare const _default: {
119
120
  queryQuantitySamples: (identifier: QuantityTypeIdentifier, options?: import("./types").QueryOptionsWithSortOrderAndUnit) => Promise<readonly import("./types").QuantitySample[]>;
120
121
  queryQuantitySamplesWithAnchor: (identifier: QuantityTypeIdentifier, options: import("./types").QueryOptionsWithAnchorAndUnit) => Promise<import("./types").QuantitySamplesWithAnchorResponse>;
121
122
  queryStatisticsForQuantity: (identifier: QuantityTypeIdentifier, statistics: readonly import("./types").StatisticsOptions[], options?: import("./types").StatisticsQueryOptions) => Promise<import("./types").QueryStatisticsResponse>;
122
- queryStatisticsCollectionForQuantity: (identifier: QuantityTypeIdentifier, statistics: readonly import("./types").StatisticsOptions[], anchorDate: string, intervalComponents: import("./types").IntervalComponents, options?: import("./types").StatisticsQueryOptions) => Promise<readonly import("./types").QueryStatisticsResponse[]>;
123
+ queryStatisticsCollectionForQuantity: (identifier: QuantityTypeIdentifier, statistics: readonly import("./types").StatisticsOptions[], anchorDate: Date, intervalComponents: import("./types").IntervalComponents, options?: import("./types").StatisticsQueryOptions) => Promise<readonly import("./types").QueryStatisticsResponse[]>;
123
124
  queryWorkoutSamples: (options: import("./types").WorkoutQueryOptions) => Promise<import("./specs/WorkoutProxy.nitro").WorkoutProxy[]>;
124
125
  queryWorkoutSamplesWithAnchor: (options: import("./types").WorkoutQueryOptionsWithAnchor) => Promise<import("./types").QueryWorkoutSamplesWithAnchorResponse>;
125
126
  querySources: (identifier: import("./types").SampleTypeIdentifier) => Promise<readonly import("./specs/SourceProxy.nitro").SourceProxy[]>;
126
- requestAuthorization: (toShare: readonly import("./types").SampleTypeIdentifierWriteable[], toRead: readonly import("./types").ObjectTypeIdentifier[]) => Promise<boolean>;
127
+ requestAuthorization: (toRequest: import("./specs/CoreModule.nitro").AuthDataTypes) => Promise<boolean>;
127
128
  deleteObjects: (objectTypeIdentifier: import("./types").ObjectTypeIdentifier, filter: import("./types").FilterForSamples) => Promise<number>;
128
129
  saveCategorySample: <T extends import("./types").CategoryTypeIdentifier>(identifier: T, value: import("./types").CategoryValueForIdentifier, startDate: Date, endDate: Date, metadata: import("./types").MetadataForCategoryIdentifier<T>) => Promise<boolean>;
129
130
  saveCorrelationSample: (typeIdentifier: import("./types").CorrelationTypeIdentifier, samples: import("./types").SampleForSaving[], start: Date, end: Date, metadata: import("react-native-nitro-modules").AnyMap) => Promise<boolean>;
130
131
  saveQuantitySample: (identifier: QuantityTypeIdentifier, unit: string, value: number, start: Date, end: Date, metadata: import("react-native-nitro-modules").AnyMap) => Promise<boolean>;
131
- saveWorkoutSample: (workoutActivityType: import("./types").WorkoutActivityType, quantities: readonly import("./types").QuantitySampleForSaving[], startDate: Date, endDate: Date, totals: import("./types").WorkoutTotals, metadata: import("react-native-nitro-modules").AnyMap) => Promise<import("./specs/WorkoutProxy.nitro").WorkoutProxy>;
132
- subscribeToChanges: (typeIdentifier: import("./types").SampleTypeIdentifier, callback: (args: import("./types").OnChangeCallbackArgs) => void) => string;
133
- unsubscribeQueries: (queryIds: string[]) => number;
132
+ saveWorkoutSample: (workoutActivityType: import("./types").WorkoutActivityType, quantities: readonly import("./types").QuantitySampleForSaving[], startDate: Date, endDate: Date, totals?: import("./types").WorkoutTotals, metadata?: import("react-native-nitro-modules").AnyMap) => Promise<import("./specs/WorkoutProxy.nitro").WorkoutProxy>;
133
+ subscribeToChanges: (identifier: import("./types").SampleTypeIdentifier, callback: (args: import("./types").OnChangeCallbackArgs) => void) => {
134
+ remove: () => boolean;
135
+ };
136
+ subscribeToQuantitySamples: (identifier: QuantityTypeIdentifier, callback: (args: import("./types").OnQuantitySamplesCallback) => void, after?: Date) => {
137
+ remove: () => boolean;
138
+ };
134
139
  startWatchApp: (workoutConfiguration: import("./types").WorkoutConfiguration) => Promise<boolean>;
135
140
  isProtectedDataAvailable: () => boolean;
136
141
  queryStateOfMindSamples: (options?: import("./types").QueryOptionsWithSortOrder) => Promise<readonly import("./types").StateOfMindSample[]>;
@@ -139,7 +144,11 @@ declare const _default: {
139
144
  useMostRecentQuantitySample: typeof useMostRecentQuantitySample;
140
145
  useMostRecentWorkout: typeof useMostRecentWorkout;
141
146
  useSubscribeToChanges: typeof useSubscribeToChanges;
142
- useHealthkitAuthorization: (read: readonly import("./types").ObjectTypeIdentifier[], write?: readonly import("./types").SampleTypeIdentifierWriteable[]) => readonly [import("./types").AuthorizationRequestStatus | null, () => Promise<import("./types").AuthorizationRequestStatus>];
147
+ useSubscribeToQuantitySamples: typeof useSubscribeToQuantitySamples;
148
+ useHealthkitAuthorization: ({ toWrite, toRead, }: {
149
+ toRead?: readonly import("./types").ObjectTypeIdentifier[];
150
+ toWrite?: readonly import("./types").SampleTypeIdentifierWriteable[];
151
+ }) => readonly [import("./types").AuthorizationRequestStatus | null, () => Promise<import("./types").AuthorizationRequestStatus>];
143
152
  useIsHealthDataAvailable: () => boolean | null;
144
153
  useSources: typeof useSources;
145
154
  useStatisticsForQuantity: typeof useStatisticsForQuantity;
@@ -5,5 +5,8 @@ import type { ObjectTypeIdentifier, SampleTypeIdentifierWriteable } from '../typ
5
5
  * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614152-requestauthorization Apple Docs - requestAuthorization}
6
6
  * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Apple Docs - Authorizing access to health data}
7
7
  */
8
- export declare const useHealthkitAuthorization: (read: readonly ObjectTypeIdentifier[], write?: readonly SampleTypeIdentifierWriteable[]) => readonly [AuthorizationRequestStatus | null, () => Promise<AuthorizationRequestStatus>];
8
+ export declare const useHealthkitAuthorization: ({ toWrite, toRead, }: {
9
+ toRead?: readonly ObjectTypeIdentifier[];
10
+ toWrite?: readonly SampleTypeIdentifierWriteable[];
11
+ }) => readonly [AuthorizationRequestStatus | null, () => Promise<AuthorizationRequestStatus>];
9
12
  export default useHealthkitAuthorization;
@@ -0,0 +1,3 @@
1
+ import type { OnQuantitySamplesCallback, QuantityTypeIdentifier } from '../types';
2
+ export declare function useSubscribeToQuantitySamples<TIdentifier extends QuantityTypeIdentifier>(identifier: TIdentifier, onChange: (args: OnQuantitySamplesCallback) => void): void;
3
+ export default useSubscribeToQuantitySamples;
@@ -4,12 +4,12 @@ export interface CharacteristicTypeModule extends HybridObject<{
4
4
  ios: 'swift';
5
5
  }> {
6
6
  getBloodType(): BloodType;
7
- getDateOfBirth(): Date | null;
7
+ getDateOfBirth(): Date | undefined;
8
8
  getBiologicalSex(): BiologicalSex;
9
9
  getFitzpatrickSkinType(): FitzpatrickSkinType;
10
10
  getWheelchairUse(): WheelchairUse;
11
11
  getBloodTypeAsync(): Promise<BloodType>;
12
- getDateOfBirthAsync(): Promise<Date | null>;
12
+ getDateOfBirthAsync(): Promise<Date | undefined>;
13
13
  getBiologicalSexAsync(): Promise<BiologicalSex>;
14
14
  getFitzpatrickSkinTypeAsync(): Promise<FitzpatrickSkinType>;
15
15
  getWheelchairUseAsync(): Promise<WheelchairUse>;
@@ -7,6 +7,10 @@ import type { ObjectTypeIdentifier, SampleTypeIdentifier, SampleTypeIdentifierWr
7
7
  import type { OnChangeCallbackArgs } from '../types/Subscriptions';
8
8
  import type { IdentifierWithUnit } from '../types/Units';
9
9
  import type { SourceProxy } from './SourceProxy.nitro';
10
+ export interface AuthDataTypes {
11
+ toShare?: readonly SampleTypeIdentifierWriteable[];
12
+ toRead?: readonly ObjectTypeIdentifier[];
13
+ }
10
14
  export interface CoreModule extends HybridObject<{
11
15
  ios: 'swift';
12
16
  }> {
@@ -41,17 +45,18 @@ export interface CoreModule extends HybridObject<{
41
45
  unsubscribeQueries(queryIds: string[]): number;
42
46
  unsubscribeQueriesAsync(queryIds: string[]): Promise<number>;
43
47
  /**
48
+ * Returns the app’s authorization status for sharing the specified data type.
44
49
  * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614154-authorizationstatus Apple Docs }
45
50
  */
46
51
  authorizationStatusFor(type: ObjectTypeIdentifier): AuthorizationStatus;
47
52
  /**
48
53
  * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/2994346-getrequeststatusforauthorization Apple Docs }
49
54
  */
50
- getRequestStatusForAuthorization(toShare: readonly SampleTypeIdentifierWriteable[], toRead: readonly ObjectTypeIdentifier[]): Promise<AuthorizationRequestStatus>;
55
+ getRequestStatusForAuthorization(toCheck: AuthDataTypes): Promise<AuthorizationRequestStatus>;
51
56
  /**
52
57
  * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614152-requestauthorization Apple Docs }
53
58
  */
54
- requestAuthorization(toShare: readonly SampleTypeIdentifierWriteable[], toRead: readonly ObjectTypeIdentifier[]): Promise<boolean>;
59
+ requestAuthorization(toRequest: AuthDataTypes): Promise<boolean>;
55
60
  deleteObjects(objectTypeIdentifier: ObjectTypeIdentifier, filter: FilterForSamples): Promise<number>;
56
61
  isObjectTypeAvailable(objectTypeIdentifier: ObjectTypeIdentifier): boolean;
57
62
  areObjectTypesAvailable(objectTypeIdentifiers: readonly ObjectTypeIdentifier[]): Record<string, boolean>;
@@ -11,6 +11,6 @@ export interface QuantityTypeModule extends HybridObject<{
11
11
  deleteQuantitySamples(identifier: QuantityTypeIdentifier, filter: FilterForSamples): Promise<boolean>;
12
12
  queryQuantitySamples(identifier: QuantityTypeIdentifier, options?: QueryOptionsWithSortOrderAndUnit): Promise<readonly QuantitySample[]>;
13
13
  queryStatisticsForQuantity(identifier: QuantityTypeIdentifier, statistics: readonly StatisticsOptions[], options?: StatisticsQueryOptions): Promise<QueryStatisticsResponse>;
14
- queryStatisticsCollectionForQuantity(identifier: QuantityTypeIdentifier, statistics: readonly StatisticsOptions[], anchorDate: string, intervalComponents: IntervalComponents, options?: StatisticsQueryOptions): Promise<readonly QueryStatisticsResponse[]>;
14
+ queryStatisticsCollectionForQuantity(identifier: QuantityTypeIdentifier, statistics: readonly StatisticsOptions[], anchorDate: Date, intervalComponents: IntervalComponents, options?: StatisticsQueryOptions): Promise<readonly QueryStatisticsResponse[]>;
15
15
  queryQuantitySamplesWithAnchor(identifier: QuantityTypeIdentifier, options: QueryOptionsWithAnchorAndUnit): Promise<QuantitySamplesWithAnchorResponse>;
16
16
  }
@@ -1,21 +1,13 @@
1
1
  import type { HybridObject } from 'react-native-nitro-modules';
2
- import type { Quantity, QuantityTypeIdentifier, QueryStatisticsResponse } from '../types';
2
+ import type { QuantityTypeIdentifier, QueryStatisticsResponse } from '../types';
3
3
  import type { LocationForSaving, WorkoutPlan, WorkoutRoute, WorkoutSample } from '../types/Workouts';
4
4
  export interface WorkoutProxy extends HybridObject<{
5
5
  ios: 'swift';
6
6
  }>, WorkoutSample {
7
7
  toJSON(key?: string): WorkoutSample;
8
8
  saveWorkoutRoute(locations: readonly LocationForSaving[]): Promise<boolean>;
9
- getWorkoutPlan(): Promise<WorkoutPlan | null>;
9
+ getWorkoutPlan(): Promise<WorkoutPlan | undefined>;
10
10
  getWorkoutRoutes(): Promise<readonly WorkoutRoute[]>;
11
- getStatistic(quantityType: QuantityTypeIdentifier, unitOverride?: string): Promise<QueryStatisticsResponse | null>;
11
+ getStatistic(quantityType: QuantityTypeIdentifier, unitOverride?: string): Promise<QueryStatisticsResponse | undefined>;
12
12
  getAllStatistics(): Promise<Record<string, QueryStatisticsResponse>>;
13
- /** @deprecated Use allStatistics or statistic() method instead */
14
- readonly totalDistance?: Quantity;
15
- /** @deprecated Use allStatistics or statistic() method instead */
16
- readonly totalEnergyBurned?: Quantity;
17
- /** @deprecated Use allStatistics or statistic() method instead */
18
- readonly totalSwimmingStrokeCount?: Quantity;
19
- /** @deprecated Use allStatistics or statistic() method instead */
20
- readonly totalFlightsClimbed?: Quantity;
21
13
  }
@@ -6,7 +6,7 @@ import type { WorkoutProxy } from './WorkoutProxy.nitro';
6
6
  export interface WorkoutsModule extends HybridObject<{
7
7
  ios: 'swift';
8
8
  }> {
9
- saveWorkoutSample(workoutActivityType: WorkoutActivityType, quantities: readonly QuantitySampleForSaving[], startDate: Date, endDate: Date, totals: WorkoutTotals, metadata: AnyMap): Promise<WorkoutProxy>;
9
+ saveWorkoutSample(workoutActivityType: WorkoutActivityType, quantities: readonly QuantitySampleForSaving[], startDate: Date, endDate: Date, totals?: WorkoutTotals, metadata?: AnyMap): Promise<WorkoutProxy>;
10
10
  queryWorkoutSamplesWithAnchor(options: WorkoutQueryOptionsWithAnchor): Promise<QueryWorkoutSamplesWithAnchorResponse>;
11
11
  queryWorkoutSamples(options: WorkoutQueryOptions): Promise<WorkoutProxy[]>;
12
12
  /**
@@ -2,12 +2,12 @@
2
2
  * @see {@link https://developer.apple.com/documentation/healthkit/hkdevice Apple Docs }
3
3
  */
4
4
  export interface Device {
5
- readonly name: string | null;
6
- readonly firmwareVersion: string | null;
7
- readonly hardwareVersion: string | null;
8
- readonly localIdentifier: string | null;
9
- readonly manufacturer: string | null;
10
- readonly model: string | null;
11
- readonly softwareVersion: string | null;
12
- readonly udiDeviceIdentifier: string | null;
5
+ readonly name?: string;
6
+ readonly firmwareVersion?: string;
7
+ readonly hardwareVersion?: string;
8
+ readonly localIdentifier?: string;
9
+ readonly manufacturer?: string;
10
+ readonly model?: string;
11
+ readonly softwareVersion?: string;
12
+ readonly udiDeviceIdentifier?: string;
13
13
  }
@@ -5,6 +5,6 @@ import type { SourceProxy } from '../specs/SourceProxy.nitro';
5
5
  export interface SourceRevision {
6
6
  readonly source?: SourceProxy;
7
7
  readonly version?: string;
8
- readonly operatingSystemVersion?: string | null;
9
- readonly productType?: string | null;
8
+ readonly operatingSystemVersion?: string;
9
+ readonly productType?: string;
10
10
  }
@@ -1,4 +1,6 @@
1
- import type { SampleTypeIdentifier } from './Shared';
1
+ import type { QuantitySample } from './QuantitySample';
2
+ import type { QuantityTypeIdentifier } from './QuantityTypeIdentifier';
3
+ import type { DeletedSample, SampleTypeIdentifier } from './Shared';
2
4
  export interface EmitterSubscription {
3
5
  remove: () => void;
4
6
  }
@@ -6,3 +8,14 @@ export interface OnChangeCallbackArgs {
6
8
  readonly typeIdentifier: SampleTypeIdentifier;
7
9
  readonly errorMessage?: string;
8
10
  }
11
+ export interface OnQuantitySamplesCallbackError {
12
+ readonly typeIdentifier: QuantityTypeIdentifier;
13
+ readonly errorMessage: string;
14
+ }
15
+ export interface OnQuantitySamplesCallbackSuccess {
16
+ readonly typeIdentifier: QuantityTypeIdentifier;
17
+ readonly anchor: string;
18
+ readonly samples: readonly QuantitySample[];
19
+ readonly deletedSamples: readonly DeletedSample[];
20
+ }
21
+ export type OnQuantitySamplesCallback = OnQuantitySamplesCallbackError | OnQuantitySamplesCallbackSuccess;
@@ -205,7 +205,7 @@ export interface WorkoutRouteLocation {
205
205
  readonly altitude: number;
206
206
  readonly course: number;
207
207
  readonly date: Date;
208
- readonly distance: number | null;
208
+ readonly distance?: number;
209
209
  readonly horizontalAccuracy: number;
210
210
  readonly latitude: number;
211
211
  readonly longitude: number;
@@ -0,0 +1,5 @@
1
+ import type { QuantityTypeIdentifier } from '../types';
2
+ import type { OnQuantitySamplesCallback } from '../types/Subscriptions';
3
+ export declare const subscribeToQuantitySamples: (identifier: QuantityTypeIdentifier, callback: (args: OnQuantitySamplesCallback) => void, after?: Date) => {
4
+ remove: () => boolean;
5
+ };