@kingstinct/react-native-healthkit 13.4.0 → 14.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/ReactNativeHealthkit.podspec +1 -0
  2. package/app.plugin.ts +40 -2
  3. package/ios/BackgroundDeliveryManager.swift +196 -0
  4. package/ios/CategoryTypeModule.swift +1 -1
  5. package/ios/CoreModule.swift +24 -0
  6. package/ios/CorrelationTypeModule.swift +2 -35
  7. package/ios/ElectrocardiogramModule.swift +2 -34
  8. package/ios/HeartbeatSeriesModule.swift +2 -34
  9. package/ios/MedicationModule.swift +3 -35
  10. package/ios/PredicateHelpers.swift +2 -2
  11. package/ios/QuantityTypeModule.swift +11 -11
  12. package/ios/Serializers.swift +58 -90
  13. package/ios/StateOfMindModule.swift +2 -34
  14. package/ios/WorkoutProxy.swift +3 -149
  15. package/ios/generated/HealthkitGenerated.swift +52 -0
  16. package/lib/commonjs/generated/healthkit.generated.js +745 -0
  17. package/lib/commonjs/healthkit.ios.js +51 -17
  18. package/lib/commonjs/healthkit.js +120 -34
  19. package/lib/commonjs/specs/QuantityTypeModule.nitro.js +1 -0
  20. package/lib/commonjs/type-tests/generated-typing.js +2 -0
  21. package/lib/commonjs/types/CategoryType.js +19 -99
  22. package/lib/commonjs/types/Medication.js +2 -0
  23. package/lib/commonjs/types/MetadataEnums.js +17 -0
  24. package/lib/commonjs/types/QuantityType.js +4 -15
  25. package/lib/commonjs/types/WeatherCondition.js +2 -32
  26. package/lib/commonjs/types/Workouts.js +3 -98
  27. package/lib/commonjs/types/index.js +2 -0
  28. package/lib/module/generated/healthkit.generated.js +742 -0
  29. package/lib/module/healthkit.ios.js +49 -15
  30. package/lib/module/healthkit.js +94 -20
  31. package/lib/module/specs/QuantityTypeModule.nitro.js +1 -0
  32. package/lib/module/type-tests/generated-typing.js +1 -0
  33. package/lib/module/types/CategoryType.js +2 -98
  34. package/lib/module/types/Medication.js +1 -0
  35. package/lib/module/types/MetadataEnums.js +1 -0
  36. package/lib/module/types/QuantityType.js +2 -14
  37. package/lib/module/types/WeatherCondition.js +1 -32
  38. package/lib/module/types/Workouts.js +2 -98
  39. package/lib/module/types/index.js +2 -0
  40. package/lib/typescript/generated/healthkit.generated.d.ts +1006 -0
  41. package/lib/typescript/healthkit.d.ts +39 -36
  42. package/lib/typescript/healthkit.ios.d.ts +64 -53
  43. package/lib/typescript/hooks/useMostRecentQuantitySample.d.ts +3 -2
  44. package/lib/typescript/hooks/useMostRecentWorkout.d.ts +2 -2
  45. package/lib/typescript/hooks/useQuantitySampleById.d.ts +5 -4
  46. package/lib/typescript/hooks/useStatisticsForQuantity.d.ts +2 -2
  47. package/lib/typescript/hooks/useSubscribeToQuantitySamples.d.ts +1 -1
  48. package/lib/typescript/modules.d.ts +2 -2
  49. package/lib/typescript/specs/CategoryTypeModule.nitro.d.ts +3 -3
  50. package/lib/typescript/specs/CoreModule.nitro.d.ts +15 -0
  51. package/lib/typescript/specs/QuantityTypeModule.nitro.d.ts +20 -9
  52. package/lib/typescript/type-tests/generated-typing.d.ts +1 -0
  53. package/lib/typescript/types/CategoryType.d.ts +10 -104
  54. package/lib/typescript/types/CategoryTypeIdentifier.d.ts +1 -61
  55. package/lib/typescript/types/CorrelationType.d.ts +8 -2
  56. package/lib/typescript/types/ElectrocardiogramSample.d.ts +8 -1
  57. package/lib/typescript/types/HeartbeatSeries.d.ts +8 -1
  58. package/lib/typescript/types/InterfaceVerification.d.ts +14 -1
  59. package/lib/typescript/types/Medication.d.ts +10 -0
  60. package/lib/typescript/types/MetadataEnums.d.ts +1 -0
  61. package/lib/typescript/types/QuantitySample.d.ts +9 -1
  62. package/lib/typescript/types/QuantityType.d.ts +14 -18
  63. package/lib/typescript/types/QuantityTypeIdentifier.d.ts +1 -671
  64. package/lib/typescript/types/QueryOptions.d.ts +8 -4
  65. package/lib/typescript/types/Shared.d.ts +12 -41
  66. package/lib/typescript/types/StateOfMind.d.ts +8 -1
  67. package/lib/typescript/types/Subscriptions.d.ts +11 -11
  68. package/lib/typescript/types/WeatherCondition.d.ts +1 -30
  69. package/lib/typescript/types/Workouts.d.ts +18 -104
  70. package/lib/typescript/types/index.d.ts +2 -0
  71. package/lib/typescript/utils/getMostRecentQuantitySample.d.ts +2 -1
  72. package/lib/typescript/utils/getMostRecentWorkout.d.ts +2 -1
  73. package/lib/typescript/utils/getPreferredUnit.d.ts +2 -1
  74. package/lib/typescript/utils/getQuantitySampleById.d.ts +2 -1
  75. package/lib/typescript/utils/subscribeToQuantitySamples.d.ts +1 -1
  76. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.hpp +55 -109
  77. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Umbrella.hpp +12 -18
  78. package/nitrogen/generated/ios/c++/HybridCategoryTypeModuleSpecSwift.hpp +5 -14
  79. package/nitrogen/generated/ios/c++/HybridCoreModuleSpecSwift.hpp +18 -2
  80. package/nitrogen/generated/ios/c++/HybridCorrelationTypeModuleSpecSwift.hpp +1 -13
  81. package/nitrogen/generated/ios/c++/HybridElectrocardiogramModuleSpecSwift.hpp +1 -13
  82. package/nitrogen/generated/ios/c++/HybridHeartbeatSeriesModuleSpecSwift.hpp +2 -14
  83. package/nitrogen/generated/ios/c++/HybridMedicationModuleSpecSwift.hpp +1 -13
  84. package/nitrogen/generated/ios/c++/HybridQuantityTypeModuleSpecSwift.hpp +19 -28
  85. package/nitrogen/generated/ios/c++/HybridStateOfMindModuleSpecSwift.hpp +2 -14
  86. package/nitrogen/generated/ios/c++/HybridWorkoutProxySpecSwift.hpp +2 -115
  87. package/nitrogen/generated/ios/swift/CategorySample.swift +4 -329
  88. package/nitrogen/generated/ios/swift/CategoryTypeIdentifier.swift +112 -108
  89. package/nitrogen/generated/ios/swift/CategoryTypeIdentifierWriteable.swift +292 -0
  90. package/nitrogen/generated/ios/swift/CorrelationSample.swift +4 -347
  91. package/nitrogen/generated/ios/swift/ElectrocardiogramSample.swift +4 -329
  92. package/nitrogen/generated/ios/swift/FilterForWorkouts.swift +30 -30
  93. package/nitrogen/generated/ios/swift/FilterForWorkoutsBase.swift +30 -30
  94. package/nitrogen/generated/ios/swift/GeneralForm.swift +4 -4
  95. package/nitrogen/generated/ios/swift/HeartbeatSeriesSample.swift +4 -329
  96. package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec.swift +1 -1
  97. package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec_cxx.swift +1 -1
  98. package/nitrogen/generated/ios/swift/HybridCoreModuleSpec.swift +2 -0
  99. package/nitrogen/generated/ios/swift/HybridCoreModuleSpec_cxx.swift +38 -0
  100. package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec.swift +6 -6
  101. package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec_cxx.swift +6 -6
  102. package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec.swift +1 -27
  103. package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec_cxx.swift +2 -340
  104. package/nitrogen/generated/ios/swift/MedicationDoseEvent.swift +4 -329
  105. package/nitrogen/generated/ios/swift/ObjectTypeIdentifier.swift +492 -492
  106. package/nitrogen/generated/ios/swift/QuantitySample.swift +4 -329
  107. package/nitrogen/generated/ios/swift/QuantityTypeIdentifier.swift +380 -384
  108. package/nitrogen/generated/ios/swift/QuantityTypeIdentifierWriteable.swift +372 -376
  109. package/nitrogen/generated/ios/swift/{QueryOptionsWithAnchorAndUnit.swift → QueryOptionsWithAnchorAndStringUnit.swift} +5 -5
  110. package/nitrogen/generated/ios/swift/{QueryOptionsWithSortOrderAndUnit.swift → QueryOptionsWithSortOrderAndStringUnit.swift} +5 -5
  111. package/nitrogen/generated/ios/swift/QueryStatisticsResponseFromSingleSource.swift +37 -37
  112. package/nitrogen/generated/ios/swift/SampleTypeIdentifier.swift +492 -492
  113. package/nitrogen/generated/ios/swift/SampleTypeIdentifierWriteable.swift +482 -486
  114. package/nitrogen/generated/ios/swift/StateOfMindSample.swift +4 -329
  115. package/nitrogen/generated/ios/swift/{StatisticsQueryOptions.swift → StatisticsQueryOptionsWithStringUnit.swift} +5 -5
  116. package/nitrogen/generated/ios/swift/WorkoutSample.swift +4 -402
  117. package/nitrogen/generated/shared/c++/CategorySample.hpp +8 -100
  118. package/nitrogen/generated/shared/c++/CategoryTypeIdentifier.hpp +153 -149
  119. package/nitrogen/generated/shared/c++/CategoryTypeIdentifierWriteable.hpp +328 -0
  120. package/nitrogen/generated/shared/c++/CorrelationSample.hpp +9 -105
  121. package/nitrogen/generated/shared/c++/ElectrocardiogramSample.hpp +7 -99
  122. package/nitrogen/generated/shared/c++/FilterForWorkouts.hpp +13 -13
  123. package/nitrogen/generated/shared/c++/FilterForWorkoutsBase.hpp +13 -13
  124. package/nitrogen/generated/shared/c++/GeneralForm.hpp +7 -7
  125. package/nitrogen/generated/shared/c++/HeartbeatSeriesSample.hpp +8 -100
  126. package/nitrogen/generated/shared/c++/HybridCategoryTypeModuleSpec.hpp +5 -2
  127. package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.cpp +2 -0
  128. package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.hpp +4 -2
  129. package/nitrogen/generated/shared/c++/HybridQuantityTypeModuleSpec.hpp +15 -15
  130. package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.cpp +1 -27
  131. package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.hpp +2 -37
  132. package/nitrogen/generated/shared/c++/MedicationDoseEvent.hpp +7 -99
  133. package/nitrogen/generated/shared/c++/ObjectTypeIdentifier.hpp +565 -565
  134. package/nitrogen/generated/shared/c++/QuantitySample.hpp +8 -100
  135. package/nitrogen/generated/shared/c++/QuantityTypeIdentifier.hpp +407 -411
  136. package/nitrogen/generated/shared/c++/QuantityTypeIdentifierWriteable.hpp +398 -402
  137. package/nitrogen/generated/shared/c++/{QueryOptionsWithAnchorAndUnit.hpp → QueryOptionsWithAnchorAndStringUnit.hpp} +11 -11
  138. package/nitrogen/generated/shared/c++/{QueryOptionsWithSortOrderAndUnit.hpp → QueryOptionsWithSortOrderAndStringUnit.hpp} +11 -11
  139. package/nitrogen/generated/shared/c++/QueryStatisticsResponseFromSingleSource.hpp +12 -12
  140. package/nitrogen/generated/shared/c++/SampleTypeIdentifier.hpp +559 -559
  141. package/nitrogen/generated/shared/c++/SampleTypeIdentifierWriteable.hpp +541 -545
  142. package/nitrogen/generated/shared/c++/StateOfMindSample.hpp +8 -100
  143. package/nitrogen/generated/shared/c++/{StatisticsQueryOptions.hpp → StatisticsQueryOptionsWithStringUnit.hpp} +11 -11
  144. package/nitrogen/generated/shared/c++/WorkoutSample.hpp +7 -120
  145. package/package.json +5 -2
  146. package/src/generated/healthkit-schema.json +3680 -0
  147. package/src/generated/healthkit.generated.ts +1307 -0
  148. package/src/healthkit.ios.ts +225 -19
  149. package/src/healthkit.ts +181 -55
  150. package/src/hooks/useMostRecentQuantitySample.ts +6 -5
  151. package/src/hooks/useMostRecentWorkout.ts +2 -2
  152. package/src/hooks/useQuantitySampleById.ts +6 -5
  153. package/src/hooks/useStatisticsForQuantity.ts +2 -1
  154. package/src/hooks/useSubscribeToQuantitySamples.ts +1 -1
  155. package/src/modules.ts +7 -2
  156. package/src/specs/CategoryTypeModule.nitro.ts +8 -5
  157. package/src/specs/CoreModule.nitro.ts +20 -0
  158. package/src/specs/QuantityTypeModule.nitro.ts +81 -7
  159. package/src/test-setup.ts +2 -0
  160. package/src/type-tests/generated-typing.ts +133 -0
  161. package/src/types/CategoryType.ts +52 -148
  162. package/src/types/CategoryTypeIdentifier.ts +5 -134
  163. package/src/types/CorrelationType.ts +13 -3
  164. package/src/types/ElectrocardiogramSample.ts +13 -1
  165. package/src/types/HeartbeatSeries.ts +13 -1
  166. package/src/types/InterfaceVerification.ts +38 -1
  167. package/src/types/Medication.ts +19 -0
  168. package/src/types/MetadataEnums.ts +15 -0
  169. package/src/types/QuantitySample.ts +14 -2
  170. package/src/types/QuantityType.ts +22 -122
  171. package/src/types/QuantityTypeIdentifier.ts +5 -772
  172. package/src/types/QueryOptions.ts +11 -4
  173. package/src/types/Shared.ts +22 -49
  174. package/src/types/StateOfMind.ts +13 -1
  175. package/src/types/Subscriptions.ts +19 -13
  176. package/src/types/WeatherCondition.ts +1 -31
  177. package/src/types/Workouts.ts +44 -108
  178. package/src/types/index.ts +2 -0
  179. package/src/utils/getMostRecentQuantitySample.ts +4 -3
  180. package/src/utils/getMostRecentWorkout.ts +5 -2
  181. package/src/utils/getPreferredUnit.ts +5 -4
  182. package/src/utils/getQuantitySampleById.ts +4 -3
  183. package/src/utils/subscribeToQuantitySamples.ts +5 -3
  184. package/nitrogen/generated/ios/swift/HeartRateMotionContext.swift +0 -44
  185. package/nitrogen/generated/ios/swift/InsulinDeliveryReason.swift +0 -40
  186. package/nitrogen/generated/ios/swift/WeatherCondition.swift +0 -144
  187. package/nitrogen/generated/shared/c++/HeartRateMotionContext.hpp +0 -67
  188. package/nitrogen/generated/shared/c++/InsulinDeliveryReason.hpp +0 -62
  189. package/nitrogen/generated/shared/c++/WeatherCondition.hpp +0 -88
@@ -66,10 +66,14 @@ export interface QueryOptionsWithAnchor extends GenericQueryOptions {
66
66
  export interface QueryOptionsWithSortOrder extends GenericQueryOptions {
67
67
  readonly ascending?: boolean;
68
68
  }
69
- export interface QueryOptionsWithSortOrderAndUnit extends QueryOptionsWithSortOrder {
70
- readonly unit?: string;
69
+ export interface QueryOptionsWithSortOrderAndUnit<TUnit extends string = string> extends QueryOptionsWithSortOrder {
70
+ readonly unit?: TUnit;
71
71
  }
72
- export interface QueryOptionsWithAnchorAndUnit extends QueryOptionsWithAnchor {
73
- readonly unit?: string;
72
+ export interface QueryOptionsWithAnchorAndUnit<TUnit extends string = string> extends QueryOptionsWithAnchor {
73
+ readonly unit?: TUnit;
74
+ }
75
+ export interface QueryOptionsWithSortOrderAndStringUnit extends QueryOptionsWithSortOrderAndUnit<string> {
76
+ }
77
+ export interface QueryOptionsWithAnchorAndStringUnit extends QueryOptionsWithAnchorAndUnit<string> {
74
78
  }
75
79
  export {};
@@ -1,13 +1,12 @@
1
1
  import type { AnyMap } from 'react-native-nitro-modules';
2
+ import type { KnownObjectMetadata, KnownSampleMetadata } from '../generated/healthkit.generated';
2
3
  import type { CategoryTypeIdentifier, CategoryTypeIdentifierWriteable } from './CategoryTypeIdentifier';
3
4
  import type { CharacteristicTypeIdentifier } from './Characteristics';
4
5
  import type { ActivitySummaryTypeIdentifier, AudiogramTypeIdentifier, ElectrocardiogramTypeIdentifier, HeartbeatSeriesTypeIdentifier, HKVisionPrescriptionTypeIdentifier, StateOfMindTypeIdentifier, UserAnnotatedMedicationTypeIdentifier, WorkoutRouteTypeIdentifier, WorkoutTypeIdentifier } from './Constants';
5
6
  import type { CorrelationTypeIdentifier } from './CorrelationType';
6
7
  import type { Device } from './Device';
7
- import type { HeartRateMotionContext, InsulinDeliveryReason, Quantity } from './QuantityType';
8
8
  import type { QuantityTypeIdentifier, QuantityTypeIdentifierWriteable } from './QuantityTypeIdentifier';
9
9
  import type { SourceRevision } from './Source';
10
- import type { WeatherCondition } from './WeatherCondition';
11
10
  export interface DeletedSample {
12
11
  readonly uuid: string;
13
12
  readonly metadata?: AnyMap;
@@ -16,42 +15,21 @@ export type ObjectTypeIdentifier = CharacteristicTypeIdentifier | SampleTypeIden
16
15
  export type PerObjectTypeIdentifier = typeof HKVisionPrescriptionTypeIdentifier | typeof UserAnnotatedMedicationTypeIdentifier;
17
16
  export type SampleTypeIdentifier = CategoryTypeIdentifier | CorrelationTypeIdentifier | QuantityTypeIdentifier | typeof StateOfMindTypeIdentifier | typeof AudiogramTypeIdentifier | typeof HeartbeatSeriesTypeIdentifier | typeof WorkoutRouteTypeIdentifier | typeof WorkoutTypeIdentifier | typeof ElectrocardiogramTypeIdentifier;
18
17
  export type SampleTypeIdentifierWriteable = CategoryTypeIdentifierWriteable | CorrelationTypeIdentifier | QuantityTypeIdentifierWriteable | typeof StateOfMindTypeIdentifier | typeof AudiogramTypeIdentifier | typeof HeartbeatSeriesTypeIdentifier | typeof WorkoutRouteTypeIdentifier | typeof WorkoutTypeIdentifier;
19
- export interface GenericMetadata {
20
- readonly HKExternalUUID?: string;
21
- readonly HKTimeZone?: string;
22
- readonly HKWasUserEntered?: boolean;
23
- readonly HKDeviceSerialNumber?: string;
24
- readonly HKUDIDeviceIdentifier?: string;
25
- readonly HKUDIProductionIdentifier?: string;
26
- readonly HKDigitalSignature?: string;
27
- readonly HKDeviceName?: string;
28
- readonly HKDeviceManufacturerName?: string;
29
- readonly HKSyncIdentifier?: string;
30
- readonly HKSyncVersion?: number;
31
- readonly HKWasTakenInLab?: boolean;
32
- readonly HKReferenceRangeLowerLimit?: number;
33
- readonly HKReferenceRangeUpperLimit?: number;
34
- }
18
+ export type MetadataWithUnknown<T extends object> = AnyMap & T;
19
+ export type GenericMetadata = AnyMap & KnownObjectMetadata;
20
+ export type WithTypedMetadata<T, TMetadata extends object> = Omit<T, 'metadata'> & {
21
+ readonly metadata: AnyMap & TMetadata;
22
+ };
23
+ export type WithOptionalTypedMetadata<T, TMetadata extends object> = Omit<T, 'metadata'> & {
24
+ readonly metadata?: AnyMap & TMetadata;
25
+ };
26
+ export type BaseObjectTyped<TMetadata extends object = KnownObjectMetadata> = WithTypedMetadata<BaseObject, TMetadata>;
27
+ export type BaseSampleTyped<TMetadata extends object = KnownSampleMetadata> = WithTypedMetadata<BaseSample, TMetadata>;
35
28
  export interface BaseObject {
36
29
  readonly uuid: string;
37
30
  readonly sourceRevision: SourceRevision;
38
31
  readonly device?: Device;
39
32
  readonly metadata: AnyMap;
40
- readonly metadataExternalUUID?: string;
41
- readonly metadataTimeZone?: string;
42
- readonly metadataWasUserEntered?: boolean;
43
- readonly metadataDeviceSerialNumber?: string;
44
- readonly metadataUdiDeviceIdentifier?: string;
45
- readonly metadataUdiProductionIdentifier?: string;
46
- readonly metadataDigitalSignature?: string;
47
- readonly metadataDeviceName?: string;
48
- readonly metadataDeviceManufacturerName?: string;
49
- readonly metadataSyncIdentifier?: string;
50
- readonly metadataSyncVersion?: number;
51
- readonly metadataWasTakenInLab?: boolean;
52
- readonly metadataReferenceRangeLowerLimit?: number;
53
- readonly metadataReferenceRangeUpperLimit?: number;
54
- readonly metadataAlgorithmVersion?: number;
55
33
  }
56
34
  export interface SampleType {
57
35
  identifier: string;
@@ -64,12 +42,5 @@ export interface BaseSample extends BaseObject {
64
42
  readonly startDate: Date;
65
43
  readonly endDate: Date;
66
44
  readonly hasUndeterminedDuration: boolean;
67
- readonly metadataWeatherCondition?: WeatherCondition;
68
- readonly metadataWeatherHumidity?: Quantity;
69
- readonly metadataWeatherTemperature?: Quantity;
70
- readonly metadataInsulinDeliveryReason?: InsulinDeliveryReason;
71
- /**
72
- * postprandial or preprandial (https://developer.apple.com/documentation/healthkit/hkbloodglucosemealtime)
73
- */
74
- readonly metadataHeartRateMotionContext?: HeartRateMotionContext;
45
+ readonly metadata: AnyMap;
75
46
  }
@@ -1,4 +1,5 @@
1
- import type { BaseSample, DeletedSample } from './Shared';
1
+ import type { KnownSampleMetadata } from '../generated/healthkit.generated';
2
+ import type { BaseSample, DeletedSample, WithTypedMetadata } from './Shared';
2
3
  export declare enum StateOfMindValenceClassification {
3
4
  veryUnpleasant = 1,
4
5
  unpleasant = 2,
@@ -19,11 +20,17 @@ export interface StateOfMindSample extends BaseSample {
19
20
  readonly associations: readonly StateOfMindAssociation[];
20
21
  readonly labels: readonly StateOfMindLabel[];
21
22
  }
23
+ export type StateOfMindSampleTyped = WithTypedMetadata<StateOfMindSample, KnownSampleMetadata>;
22
24
  export interface StateOfMindSamplesWithAnchorResponse {
23
25
  readonly samples: readonly StateOfMindSample[];
24
26
  readonly deletedSamples: readonly DeletedSample[];
25
27
  readonly newAnchor: string;
26
28
  }
29
+ export interface StateOfMindSamplesWithAnchorResponseTyped {
30
+ readonly samples: readonly StateOfMindSampleTyped[];
31
+ readonly deletedSamples: readonly DeletedSample[];
32
+ readonly newAnchor: string;
33
+ }
27
34
  /**
28
35
  * @see {@link https://developer.apple.com/documentation/healthkit/hkstateofmind/label Apple Docs}
29
36
  */
@@ -1,6 +1,6 @@
1
1
  import type { CategorySampleTyped } from './CategoryType';
2
2
  import type { CategoryTypeIdentifier } from './CategoryTypeIdentifier';
3
- import type { QuantitySample } from './QuantitySample';
3
+ import type { QuantitySampleTyped } from './QuantitySample';
4
4
  import type { QuantityTypeIdentifier } from './QuantityTypeIdentifier';
5
5
  import type { SampleTypeIdentifier } from './Shared';
6
6
  export interface EmitterSubscription {
@@ -10,21 +10,21 @@ export interface OnChangeCallbackArgs {
10
10
  readonly typeIdentifier: SampleTypeIdentifier;
11
11
  readonly errorMessage?: string;
12
12
  }
13
- export interface OnQuantitySamplesCallbackError {
14
- readonly typeIdentifier: QuantityTypeIdentifier;
13
+ export interface OnQuantitySamplesCallbackError<T extends QuantityTypeIdentifier = QuantityTypeIdentifier> {
14
+ readonly typeIdentifier: T;
15
15
  readonly errorMessage: string;
16
16
  }
17
- export interface OnQuantitySamplesCallbackSuccess {
18
- readonly typeIdentifier: QuantityTypeIdentifier;
19
- readonly samples: readonly QuantitySample[];
17
+ export interface OnQuantitySamplesCallbackSuccess<T extends QuantityTypeIdentifier = QuantityTypeIdentifier> {
18
+ readonly typeIdentifier: T;
19
+ readonly samples: readonly QuantitySampleTyped<T>[];
20
20
  }
21
- export type OnQuantitySamplesCallback = OnQuantitySamplesCallbackError | OnQuantitySamplesCallbackSuccess;
22
- export interface OnCategorySamplesCallbackError {
23
- readonly typeIdentifier: CategoryTypeIdentifier;
21
+ export type OnQuantitySamplesCallback<T extends QuantityTypeIdentifier = QuantityTypeIdentifier> = OnQuantitySamplesCallbackError<T> | OnQuantitySamplesCallbackSuccess<T>;
22
+ export interface OnCategorySamplesCallbackError<T extends CategoryTypeIdentifier = CategoryTypeIdentifier> {
23
+ readonly typeIdentifier: T;
24
24
  readonly errorMessage: string;
25
25
  }
26
26
  export interface OnCategorySamplesCallbackSuccess<T extends CategoryTypeIdentifier> {
27
- readonly typeIdentifier: CategoryTypeIdentifier;
27
+ readonly typeIdentifier: T;
28
28
  readonly samples: readonly CategorySampleTyped<T>[];
29
29
  }
30
- export type OnCategorySamplesCallback<T extends CategoryTypeIdentifier> = OnCategorySamplesCallbackError | OnCategorySamplesCallbackSuccess<T>;
30
+ export type OnCategorySamplesCallback<T extends CategoryTypeIdentifier> = OnCategorySamplesCallbackError<T> | OnCategorySamplesCallbackSuccess<T>;
@@ -1,30 +1 @@
1
- export declare enum WeatherCondition {
2
- none = 0,
3
- clear = 1,
4
- fair = 2,
5
- partlyCloudy = 3,
6
- mostlyCloudy = 4,
7
- cloudy = 5,
8
- foggy = 6,
9
- haze = 7,
10
- windy = 8,
11
- blustery = 9,
12
- smoky = 10,
13
- dust = 11,
14
- snow = 12,
15
- hail = 13,
16
- sleet = 14,
17
- freezingDrizzle = 15,
18
- freezingRain = 16,
19
- mixedRainAndHail = 17,
20
- mixedRainAndSnow = 18,
21
- mixedRainAndSleet = 19,
22
- mixedSnowAndSleet = 20,
23
- drizzle = 21,
24
- scatteredShowers = 22,
25
- showers = 23,
26
- thunderstorms = 24,
27
- tropicalStorm = 25,
28
- hurricane = 26,
29
- tornado = 27
30
- }
1
+ export { WeatherCondition } from '../generated/healthkit.generated';
@@ -1,111 +1,19 @@
1
1
  import type { AnyMap } from 'react-native-nitro-modules';
2
+ import type { WorkoutEventTypedMetadata, WorkoutTypedMetadata } from '../generated/healthkit.generated';
3
+ import { WorkoutActivityType, WorkoutEventType } from '../generated/healthkit.generated';
2
4
  import type { WorkoutProxy } from '../specs/WorkoutProxy.nitro';
3
5
  import type { BaseSample, ComparisonPredicateOperator } from '../types';
4
6
  import type { Quantity } from './QuantityType';
5
7
  import type { FilterForSamplesBase } from './QueryOptions';
6
- import type { DeletedSample } from './Shared';
7
- export declare enum WorkoutActivityType {
8
- americanFootball = 1,
9
- archery = 2,
10
- australianFootball = 3,
11
- badminton = 4,
12
- baseball = 5,
13
- basketball = 6,
14
- bowling = 7,
15
- boxing = 8,// See also HKWorkoutActivityTypeKickboxing.,
16
- climbing = 9,
17
- cricket = 10,
18
- crossTraining = 11,// Any mix of cardio and/or strength training. See also HKWorkoutActivityTypeCoreTraining and HKWorkoutActivityTypeFlexibility.,
19
- curling = 12,
20
- cycling = 13,
21
- dance = 14,
22
- danceInspiredTraining = 15,// This enum remains available to access older data.,
23
- elliptical = 16,
24
- equestrianSports = 17,// Polo, Horse Racing, Horse Riding, etc.,
25
- fencing = 18,
26
- fishing = 19,
27
- functionalStrengthTraining = 20,// Primarily free weights and/or body weight and/or accessories,
28
- golf = 21,
29
- gymnastics = 22,
30
- handball = 23,
31
- hiking = 24,
32
- hockey = 25,// Ice Hockey, Field Hockey, etc.,
33
- hunting = 26,
34
- lacrosse = 27,
35
- martialArts = 28,
36
- mindAndBody = 29,// Qigong, meditation, etc.,
37
- mixedMetabolicCardioTraining = 30,// This enum remains available to access older data.,
38
- paddleSports = 31,// Canoeing, Kayaking, Outrigger, Stand Up Paddle Board, etc.,
39
- play = 32,// Dodge Ball, Hopscotch, Tetherball, Jungle Gym, etc.,
40
- preparationAndRecovery = 33,// Foam rolling, stretching, etc.,
41
- racquetball = 34,
42
- rowing = 35,
43
- rugby = 36,
44
- running = 37,
45
- sailing = 38,
46
- skatingSports = 39,// Ice Skating, Speed Skating, Inline Skating, Skateboarding, etc.,
47
- snowSports = 40,// Sledding, Snowmobiling, Building a Snowman, etc. See also HKWorkoutActivityTypeCrossCountrySkiing, HKWorkoutActivityTypeSnowboarding, and HKWorkoutActivityTypeDownhillSkiing.,
48
- soccer = 41,
49
- softball = 42,
50
- squash = 43,
51
- stairClimbing = 44,// See also HKWorkoutActivityTypeStairs and HKWorkoutActivityTypeStepTraining.,
52
- surfingSports = 45,// Traditional Surfing, Kite Surfing, Wind Surfing, etc.,
53
- swimming = 46,
54
- tableTennis = 47,
55
- tennis = 48,
56
- trackAndField = 49,// Shot Put, Javelin, Pole Vaulting, etc.,
57
- traditionalStrengthTraining = 50,// Primarily machines and/or free weights,
58
- volleyball = 51,
59
- walking = 52,
60
- waterFitness = 53,
61
- waterPolo = 54,
62
- waterSports = 55,// Water Skiing, Wake Boarding, etc.,
63
- wrestling = 56,
64
- yoga = 57,
65
- barre = 58,// HKWorkoutActivityTypeDanceInspiredTraining,
66
- coreTraining = 59,
67
- crossCountrySkiing = 60,
68
- downhillSkiing = 61,
69
- flexibility = 62,
70
- highIntensityIntervalTraining = 63,
71
- jumpRope = 64,
72
- kickboxing = 65,
73
- pilates = 66,// HKWorkoutActivityTypeDanceInspiredTraining,
74
- snowboarding = 67,
75
- stairs = 68,
76
- stepTraining = 69,
77
- wheelchairWalkPace = 70,
78
- wheelchairRunPace = 71,
79
- taiChi = 72,
80
- mixedCardio = 73,// HKWorkoutActivityTypeMixedMetabolicCardioTraining,
81
- handCycling = 74,
82
- discSports = 75,
83
- fitnessGaming = 76,
84
- cardioDance = 77,
85
- socialDance = 78,
86
- pickleball = 79,
87
- cooldown = 80,
88
- swimBikeRun = 82,
89
- transition = 83,
90
- underwaterDiving = 84,
91
- other = 3000
92
- }
8
+ import type { DeletedSample, WithOptionalTypedMetadata, WithTypedMetadata } from './Shared';
9
+ export { WorkoutActivityType, WorkoutEventType };
93
10
  export interface WorkoutEvent {
94
11
  readonly type: WorkoutEventType;
95
12
  readonly startDate: Date;
96
13
  readonly endDate: Date;
97
14
  readonly metadata?: AnyMap;
98
15
  }
99
- export declare enum WorkoutEventType {
100
- pause = 1,
101
- resume = 2,
102
- lap = 3,
103
- marker = 4,
104
- motionPaused = 5,
105
- motionResumed = 6,
106
- segment = 7,
107
- pauseOrResumeRequest = 8
108
- }
16
+ export type WorkoutEventTyped = WithOptionalTypedMetadata<WorkoutEvent, WorkoutEventTypedMetadata>;
109
17
  export interface WorkoutActivity {
110
18
  readonly startDate: Date;
111
19
  readonly endDate: Date;
@@ -122,6 +30,11 @@ export interface QueryWorkoutSamplesWithAnchorResponse {
122
30
  readonly deletedSamples: readonly DeletedSample[];
123
31
  readonly newAnchor: string;
124
32
  }
33
+ export interface QueryWorkoutSamplesWithAnchorResponseTyped {
34
+ readonly workouts: readonly WorkoutProxyTyped[];
35
+ readonly deletedSamples: readonly DeletedSample[];
36
+ readonly newAnchor: string;
37
+ }
125
38
  export type WorkoutDurationPredicate = {
126
39
  readonly predicateOperator: ComparisonPredicateOperator;
127
40
  readonly durationInSeconds: number;
@@ -181,7 +94,7 @@ export interface WorkoutTotals {
181
94
  readonly distance?: number;
182
95
  readonly energyBurned?: number;
183
96
  }
184
- export interface WorkoutSample extends BaseSample {
97
+ export interface WorkoutSample extends Omit<BaseSample, 'metadata'> {
185
98
  readonly workoutActivityType: WorkoutActivityType;
186
99
  readonly duration: Quantity;
187
100
  readonly totalEnergyBurned?: Quantity;
@@ -190,10 +103,11 @@ export interface WorkoutSample extends BaseSample {
190
103
  readonly totalFlightsClimbed?: Quantity;
191
104
  readonly events?: readonly WorkoutEvent[];
192
105
  readonly activities?: readonly WorkoutActivity[];
193
- readonly metadataAverageMETs?: Quantity;
194
- readonly metadataElevationAscended?: Quantity;
195
- readonly metadataElevationDescended?: Quantity;
196
- readonly metadataIndoorWorkout?: boolean;
197
- readonly metadataAverageSpeed?: Quantity;
198
- readonly metadataMaximumSpeed?: Quantity;
106
+ readonly metadata: AnyMap;
199
107
  }
108
+ export type WorkoutSampleTyped = WithTypedMetadata<Omit<WorkoutSample, 'events'> & {
109
+ readonly events?: readonly WorkoutEventTyped[];
110
+ }, WorkoutTypedMetadata>;
111
+ export type WorkoutProxyTyped = Omit<WorkoutProxy, keyof WorkoutSample | 'toJSON'> & WorkoutSampleTyped & {
112
+ toJSON(key?: string): WorkoutSampleTyped;
113
+ };
@@ -7,6 +7,8 @@ export * from './Constants';
7
7
  export * from './CorrelationType';
8
8
  export * from './Device';
9
9
  export * from './HeartbeatSeries';
10
+ export * from './Medication';
11
+ export * from './MetadataEnums';
10
12
  export * from './QuantitySample';
11
13
  export * from './QuantityType';
12
14
  export * from './QuantityTypeIdentifier';
@@ -1,3 +1,4 @@
1
+ import type { UnitForIdentifier } from '../types/QuantityType';
1
2
  import type { QuantityTypeIdentifier } from '../types/QuantityTypeIdentifier';
2
- declare function getMostRecentQuantitySample(identifier: QuantityTypeIdentifier, unit?: string): Promise<import("..").QuantitySample | undefined>;
3
+ declare function getMostRecentQuantitySample<T extends QuantityTypeIdentifier>(identifier: T, unit?: UnitForIdentifier<T>): Promise<import("..").QuantitySampleTyped<T> | undefined>;
3
4
  export default getMostRecentQuantitySample;
@@ -1,2 +1,3 @@
1
- declare const getMostRecentWorkout: () => Promise<import("../specs/WorkoutProxy.nitro").WorkoutProxy | undefined>;
1
+ import type { WorkoutProxyTyped } from '../types/Workouts';
2
+ declare const getMostRecentWorkout: () => Promise<WorkoutProxyTyped | undefined>;
2
3
  export default getMostRecentWorkout;
@@ -1,3 +1,4 @@
1
+ import type { UnitForIdentifier } from '../types/QuantityType';
1
2
  import type { QuantityTypeIdentifier } from '../types/QuantityTypeIdentifier';
2
- declare const getPreferredUnit: (quantityType: QuantityTypeIdentifier) => Promise<string>;
3
+ declare const getPreferredUnit: <T extends QuantityTypeIdentifier>(quantityType: T) => Promise<UnitForIdentifier<T>>;
3
4
  export default getPreferredUnit;
@@ -1,3 +1,4 @@
1
+ import type { UnitForIdentifier } from '../types/QuantityType';
1
2
  import type { QuantityTypeIdentifier } from '../types/QuantityTypeIdentifier';
2
- declare function getQuantitySampleById(identifier: QuantityTypeIdentifier, uuid: string, unit?: string): Promise<import("..").QuantitySample | undefined>;
3
+ declare function getQuantitySampleById<T extends QuantityTypeIdentifier>(identifier: T, uuid: string, unit?: UnitForIdentifier<T>): Promise<import("..").QuantitySampleTyped<T> | undefined>;
3
4
  export default getQuantitySampleById;
@@ -1,5 +1,5 @@
1
1
  import type { QuantityTypeIdentifier } from '../types';
2
2
  import type { OnQuantitySamplesCallback } from '../types/Subscriptions';
3
- export declare const subscribeToQuantitySamples: (identifier: QuantityTypeIdentifier, callback: (args: OnQuantitySamplesCallback) => void, after?: Date) => {
3
+ export declare const subscribeToQuantitySamples: <TIdentifier extends QuantityTypeIdentifier>(identifier: TIdentifier, callback: (args: OnQuantitySamplesCallback<TIdentifier>) => void, after?: Date) => {
4
4
  remove: () => boolean;
5
5
  };
@@ -62,8 +62,6 @@ namespace margelo::nitro::healthkit { struct FilterForWorkouts; }
62
62
  namespace margelo::nitro::healthkit { enum class FitzpatrickSkinType; }
63
63
  // Forward declaration of `GeneralForm` to properly resolve imports.
64
64
  namespace margelo::nitro::healthkit { enum class GeneralForm; }
65
- // Forward declaration of `HeartRateMotionContext` to properly resolve imports.
66
- namespace margelo::nitro::healthkit { enum class HeartRateMotionContext; }
67
65
  // Forward declaration of `HeartbeatSeriesSample` to properly resolve imports.
68
66
  namespace margelo::nitro::healthkit { struct HeartbeatSeriesSample; }
69
67
  // Forward declaration of `HeartbeatSeriesSamplesWithAnchorResponse` to properly resolve imports.
@@ -96,8 +94,6 @@ namespace margelo::nitro::healthkit { class HybridWorkoutProxySpec; }
96
94
  namespace margelo::nitro::healthkit { class HybridWorkoutsModuleSpec; }
97
95
  // Forward declaration of `IdentifierWithUnit` to properly resolve imports.
98
96
  namespace margelo::nitro::healthkit { struct IdentifierWithUnit; }
99
- // Forward declaration of `InsulinDeliveryReason` to properly resolve imports.
100
- namespace margelo::nitro::healthkit { enum class InsulinDeliveryReason; }
101
97
  // Forward declaration of `LocationForSaving` to properly resolve imports.
102
98
  namespace margelo::nitro::healthkit { struct LocationForSaving; }
103
99
  // Forward declaration of `MedicationConcept` to properly resolve imports.
@@ -162,12 +158,10 @@ namespace margelo::nitro::healthkit { struct StateOfMindSamplesWithAnchorRespons
162
158
  namespace margelo::nitro::healthkit { enum class StateOfMindValenceClassification; }
163
159
  // Forward declaration of `StatisticsOptions` to properly resolve imports.
164
160
  namespace margelo::nitro::healthkit { enum class StatisticsOptions; }
165
- // Forward declaration of `StatisticsQueryOptions` to properly resolve imports.
166
- namespace margelo::nitro::healthkit { struct StatisticsQueryOptions; }
161
+ // Forward declaration of `StatisticsQueryOptionsWithStringUnit` to properly resolve imports.
162
+ namespace margelo::nitro::healthkit { struct StatisticsQueryOptionsWithStringUnit; }
167
163
  // Forward declaration of `UserAnnotatedMedication` to properly resolve imports.
168
164
  namespace margelo::nitro::healthkit { struct UserAnnotatedMedication; }
169
- // Forward declaration of `WeatherCondition` to properly resolve imports.
170
- namespace margelo::nitro::healthkit { enum class WeatherCondition; }
171
165
  // Forward declaration of `WheelchairUse` to properly resolve imports.
172
166
  namespace margelo::nitro::healthkit { enum class WheelchairUse; }
173
167
  // Forward declaration of `WorkoutActivityType` to properly resolve imports.
@@ -247,7 +241,6 @@ namespace ReactNativeHealthkit { class HybridWorkoutsModuleSpec_cxx; }
247
241
  #include "FilterForWorkoutsBase.hpp"
248
242
  #include "FitzpatrickSkinType.hpp"
249
243
  #include "GeneralForm.hpp"
250
- #include "HeartRateMotionContext.hpp"
251
244
  #include "Heartbeat.hpp"
252
245
  #include "HeartbeatSeriesSample.hpp"
253
246
  #include "HeartbeatSeriesSamplesWithAnchorResponse.hpp"
@@ -264,7 +257,6 @@ namespace ReactNativeHealthkit { class HybridWorkoutsModuleSpec_cxx; }
264
257
  #include "HybridWorkoutProxySpec.hpp"
265
258
  #include "HybridWorkoutsModuleSpec.hpp"
266
259
  #include "IdentifierWithUnit.hpp"
267
- #include "InsulinDeliveryReason.hpp"
268
260
  #include "LocationForSaving.hpp"
269
261
  #include "MedicationConcept.hpp"
270
262
  #include "MedicationDoseEvent.hpp"
@@ -297,9 +289,8 @@ namespace ReactNativeHealthkit { class HybridWorkoutsModuleSpec_cxx; }
297
289
  #include "StateOfMindSamplesWithAnchorResponse.hpp"
298
290
  #include "StateOfMindValenceClassification.hpp"
299
291
  #include "StatisticsOptions.hpp"
300
- #include "StatisticsQueryOptions.hpp"
292
+ #include "StatisticsQueryOptionsWithStringUnit.hpp"
301
293
  #include "UserAnnotatedMedication.hpp"
302
- #include "WeatherCondition.hpp"
303
294
  #include "WheelchairUse.hpp"
304
295
  #include "WorkoutActivity.hpp"
305
296
  #include "WorkoutActivityType.hpp"
@@ -332,66 +323,6 @@ namespace ReactNativeHealthkit { class HybridWorkoutsModuleSpec_cxx; }
332
323
  */
333
324
  namespace margelo::nitro::healthkit::bridge::swift {
334
325
 
335
- // pragma MARK: std::optional<WeatherCondition>
336
- /**
337
- * Specialized version of `std::optional<WeatherCondition>`.
338
- */
339
- using std__optional_WeatherCondition_ = std::optional<WeatherCondition>;
340
- inline std::optional<WeatherCondition> create_std__optional_WeatherCondition_(const WeatherCondition& value) noexcept {
341
- return std::optional<WeatherCondition>(value);
342
- }
343
- inline bool has_value_std__optional_WeatherCondition_(const std::optional<WeatherCondition>& optional) noexcept {
344
- return optional.has_value();
345
- }
346
- inline WeatherCondition get_std__optional_WeatherCondition_(const std::optional<WeatherCondition>& optional) noexcept {
347
- return optional.value();
348
- }
349
-
350
- // pragma MARK: std::optional<Quantity>
351
- /**
352
- * Specialized version of `std::optional<Quantity>`.
353
- */
354
- using std__optional_Quantity_ = std::optional<Quantity>;
355
- inline std::optional<Quantity> create_std__optional_Quantity_(const Quantity& value) noexcept {
356
- return std::optional<Quantity>(value);
357
- }
358
- inline bool has_value_std__optional_Quantity_(const std::optional<Quantity>& optional) noexcept {
359
- return optional.has_value();
360
- }
361
- inline Quantity get_std__optional_Quantity_(const std::optional<Quantity>& optional) noexcept {
362
- return optional.value();
363
- }
364
-
365
- // pragma MARK: std::optional<InsulinDeliveryReason>
366
- /**
367
- * Specialized version of `std::optional<InsulinDeliveryReason>`.
368
- */
369
- using std__optional_InsulinDeliveryReason_ = std::optional<InsulinDeliveryReason>;
370
- inline std::optional<InsulinDeliveryReason> create_std__optional_InsulinDeliveryReason_(const InsulinDeliveryReason& value) noexcept {
371
- return std::optional<InsulinDeliveryReason>(value);
372
- }
373
- inline bool has_value_std__optional_InsulinDeliveryReason_(const std::optional<InsulinDeliveryReason>& optional) noexcept {
374
- return optional.has_value();
375
- }
376
- inline InsulinDeliveryReason get_std__optional_InsulinDeliveryReason_(const std::optional<InsulinDeliveryReason>& optional) noexcept {
377
- return optional.value();
378
- }
379
-
380
- // pragma MARK: std::optional<HeartRateMotionContext>
381
- /**
382
- * Specialized version of `std::optional<HeartRateMotionContext>`.
383
- */
384
- using std__optional_HeartRateMotionContext_ = std::optional<HeartRateMotionContext>;
385
- inline std::optional<HeartRateMotionContext> create_std__optional_HeartRateMotionContext_(const HeartRateMotionContext& value) noexcept {
386
- return std::optional<HeartRateMotionContext>(value);
387
- }
388
- inline bool has_value_std__optional_HeartRateMotionContext_(const std::optional<HeartRateMotionContext>& optional) noexcept {
389
- return optional.has_value();
390
- }
391
- inline HeartRateMotionContext get_std__optional_HeartRateMotionContext_(const std::optional<HeartRateMotionContext>& optional) noexcept {
392
- return optional.value();
393
- }
394
-
395
326
  // pragma MARK: std::shared_ptr<HybridSourceProxySpec>
396
327
  /**
397
328
  * Specialized version of `std::shared_ptr<HybridSourceProxySpec>`.
@@ -434,36 +365,6 @@ namespace margelo::nitro::healthkit::bridge::swift {
434
365
  return optional.value();
435
366
  }
436
367
 
437
- // pragma MARK: std::optional<bool>
438
- /**
439
- * Specialized version of `std::optional<bool>`.
440
- */
441
- using std__optional_bool_ = std::optional<bool>;
442
- inline std::optional<bool> create_std__optional_bool_(const bool& value) noexcept {
443
- return std::optional<bool>(value);
444
- }
445
- inline bool has_value_std__optional_bool_(const std::optional<bool>& optional) noexcept {
446
- return optional.has_value();
447
- }
448
- inline bool get_std__optional_bool_(const std::optional<bool>& optional) noexcept {
449
- return optional.value();
450
- }
451
-
452
- // pragma MARK: std::optional<double>
453
- /**
454
- * Specialized version of `std::optional<double>`.
455
- */
456
- using std__optional_double_ = std::optional<double>;
457
- inline std::optional<double> create_std__optional_double_(const double& value) noexcept {
458
- return std::optional<double>(value);
459
- }
460
- inline bool has_value_std__optional_double_(const std::optional<double>& optional) noexcept {
461
- return optional.has_value();
462
- }
463
- inline double get_std__optional_double_(const std::optional<double>& optional) noexcept {
464
- return optional.value();
465
- }
466
-
467
368
  // pragma MARK: std::optional<CategorySample>
468
369
  /**
469
370
  * Specialized version of `std::optional<CategorySample>`.
@@ -595,6 +496,21 @@ namespace margelo::nitro::healthkit::bridge::swift {
595
496
  return Func_void_std__vector_CategorySample__Wrapper(std::move(value));
596
497
  }
597
498
 
499
+ // pragma MARK: std::optional<bool>
500
+ /**
501
+ * Specialized version of `std::optional<bool>`.
502
+ */
503
+ using std__optional_bool_ = std::optional<bool>;
504
+ inline std::optional<bool> create_std__optional_bool_(const bool& value) noexcept {
505
+ return std::optional<bool>(value);
506
+ }
507
+ inline bool has_value_std__optional_bool_(const std::optional<bool>& optional) noexcept {
508
+ return optional.has_value();
509
+ }
510
+ inline bool get_std__optional_bool_(const std::optional<bool>& optional) noexcept {
511
+ return optional.value();
512
+ }
513
+
598
514
  // pragma MARK: std::vector<std::shared_ptr<HybridSourceProxySpec>>
599
515
  /**
600
516
  * Specialized version of `std::vector<std::shared_ptr<HybridSourceProxySpec>>`.
@@ -1937,6 +1853,21 @@ namespace margelo::nitro::healthkit::bridge::swift {
1937
1853
  return Result<std::shared_ptr<Promise<QueryCorrelationSamplesWithAnchorResponse>>>::withError(error);
1938
1854
  }
1939
1855
 
1856
+ // pragma MARK: std::optional<double>
1857
+ /**
1858
+ * Specialized version of `std::optional<double>`.
1859
+ */
1860
+ using std__optional_double_ = std::optional<double>;
1861
+ inline std::optional<double> create_std__optional_double_(const double& value) noexcept {
1862
+ return std::optional<double>(value);
1863
+ }
1864
+ inline bool has_value_std__optional_double_(const std::optional<double>& optional) noexcept {
1865
+ return optional.has_value();
1866
+ }
1867
+ inline double get_std__optional_double_(const std::optional<double>& optional) noexcept {
1868
+ return optional.value();
1869
+ }
1870
+
1940
1871
  // pragma MARK: std::vector<ElectrocardiogramVoltage>
1941
1872
  /**
1942
1873
  * Specialized version of `std::vector<ElectrocardiogramVoltage>`.
@@ -2460,6 +2391,21 @@ namespace margelo::nitro::healthkit::bridge::swift {
2460
2391
  return Func_void_std__vector_QuantitySample__Wrapper(std::move(value));
2461
2392
  }
2462
2393
 
2394
+ // pragma MARK: std::optional<Quantity>
2395
+ /**
2396
+ * Specialized version of `std::optional<Quantity>`.
2397
+ */
2398
+ using std__optional_Quantity_ = std::optional<Quantity>;
2399
+ inline std::optional<Quantity> create_std__optional_Quantity_(const Quantity& value) noexcept {
2400
+ return std::optional<Quantity>(value);
2401
+ }
2402
+ inline bool has_value_std__optional_Quantity_(const std::optional<Quantity>& optional) noexcept {
2403
+ return optional.has_value();
2404
+ }
2405
+ inline Quantity get_std__optional_Quantity_(const std::optional<Quantity>& optional) noexcept {
2406
+ return optional.value();
2407
+ }
2408
+
2463
2409
  // pragma MARK: std::optional<QuantityDateInterval>
2464
2410
  /**
2465
2411
  * Specialized version of `std::optional<QuantityDateInterval>`.
@@ -2520,18 +2466,18 @@ namespace margelo::nitro::healthkit::bridge::swift {
2520
2466
  return vector;
2521
2467
  }
2522
2468
 
2523
- // pragma MARK: std::optional<StatisticsQueryOptions>
2469
+ // pragma MARK: std::optional<StatisticsQueryOptionsWithStringUnit>
2524
2470
  /**
2525
- * Specialized version of `std::optional<StatisticsQueryOptions>`.
2471
+ * Specialized version of `std::optional<StatisticsQueryOptionsWithStringUnit>`.
2526
2472
  */
2527
- using std__optional_StatisticsQueryOptions_ = std::optional<StatisticsQueryOptions>;
2528
- inline std::optional<StatisticsQueryOptions> create_std__optional_StatisticsQueryOptions_(const StatisticsQueryOptions& value) noexcept {
2529
- return std::optional<StatisticsQueryOptions>(value);
2473
+ using std__optional_StatisticsQueryOptionsWithStringUnit_ = std::optional<StatisticsQueryOptionsWithStringUnit>;
2474
+ inline std::optional<StatisticsQueryOptionsWithStringUnit> create_std__optional_StatisticsQueryOptionsWithStringUnit_(const StatisticsQueryOptionsWithStringUnit& value) noexcept {
2475
+ return std::optional<StatisticsQueryOptionsWithStringUnit>(value);
2530
2476
  }
2531
- inline bool has_value_std__optional_StatisticsQueryOptions_(const std::optional<StatisticsQueryOptions>& optional) noexcept {
2477
+ inline bool has_value_std__optional_StatisticsQueryOptionsWithStringUnit_(const std::optional<StatisticsQueryOptionsWithStringUnit>& optional) noexcept {
2532
2478
  return optional.has_value();
2533
2479
  }
2534
- inline StatisticsQueryOptions get_std__optional_StatisticsQueryOptions_(const std::optional<StatisticsQueryOptions>& optional) noexcept {
2480
+ inline StatisticsQueryOptionsWithStringUnit get_std__optional_StatisticsQueryOptionsWithStringUnit_(const std::optional<StatisticsQueryOptionsWithStringUnit>& optional) noexcept {
2535
2481
  return optional.value();
2536
2482
  }
2537
2483