@kingstinct/react-native-healthkit 12.1.2 → 12.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ios/CategoryTypeModule.swift +49 -97
- package/ios/CharacteristicTypeModule.swift +77 -63
- package/ios/CoreModule.swift +324 -280
- package/ios/CorrelationTypeModule.swift +192 -144
- package/ios/ElectrocardiogramModule.swift +185 -194
- package/ios/HeartbeatSeriesModule.swift +123 -171
- package/ios/Helpers.swift +312 -571
- package/ios/MedicationModule.swift +259 -0
- package/ios/PredicateHelpers.swift +334 -0
- package/ios/QuantityTypeModule.swift +297 -378
- package/ios/Serializers.swift +273 -210
- package/ios/SourceProxy.swift +2 -2
- package/ios/StateOfMindModule.swift +179 -125
- package/ios/WorkoutProxy.swift +235 -112
- package/ios/WorkoutsModule.swift +214 -262
- package/lib/commonjs/healthkit.ios.js +22 -2
- package/lib/commonjs/healthkit.js +35 -5
- package/lib/commonjs/hooks/useStatisticsForQuantity.js +1 -1
- package/lib/commonjs/hooks/useSubscribeToCategorySamples.js +20 -0
- package/lib/commonjs/modules.js +2 -1
- package/lib/commonjs/specs/MedicationModule.nitro.js +27 -0
- package/lib/commonjs/types/Constants.js +2 -1
- package/lib/commonjs/types/QuantityType.js +8 -1
- package/lib/commonjs/types/QueryOptions.js +18 -0
- package/lib/commonjs/types/WeatherCondition.js +32 -32
- package/lib/commonjs/types/Workouts.js +1 -50
- package/lib/commonjs/utils/getCategorySampleById.js +1 -1
- package/lib/commonjs/utils/getQuantitySampleById.js +1 -1
- package/lib/commonjs/utils/getWorkoutById.js +1 -1
- package/lib/commonjs/utils/subscribeToCategorySamples.js +29 -0
- package/lib/commonjs/utils/subscribeToQuantitySamples.js +8 -25
- package/lib/module/healthkit.ios.js +20 -2
- package/lib/module/healthkit.js +32 -2
- package/lib/module/hooks/useStatisticsForQuantity.js +1 -1
- package/lib/module/hooks/useSubscribeToCategorySamples.js +17 -0
- package/lib/module/modules.js +1 -0
- package/lib/module/specs/MedicationModule.nitro.js +26 -0
- package/lib/module/types/Constants.js +1 -0
- package/lib/module/types/QuantityType.js +7 -0
- package/lib/module/types/QueryOptions.js +17 -1
- package/lib/module/types/WeatherCondition.js +31 -31
- package/lib/module/types/Workouts.js +0 -49
- package/lib/module/utils/getCategorySampleById.js +1 -1
- package/lib/module/utils/getQuantitySampleById.js +1 -1
- package/lib/module/utils/getWorkoutById.js +1 -1
- package/lib/module/utils/subscribeToCategorySamples.js +26 -0
- package/lib/module/utils/subscribeToQuantitySamples.js +8 -25
- package/lib/typescript/healthkit.d.ts +18 -9
- package/lib/typescript/healthkit.ios.d.ts +33 -15
- package/lib/typescript/hooks/useSubscribeToCategorySamples.d.ts +3 -0
- package/lib/typescript/modules.d.ts +2 -0
- package/lib/typescript/specs/CategoryTypeModule.nitro.d.ts +2 -2
- package/lib/typescript/specs/CoreModule.nitro.d.ts +2 -1
- package/lib/typescript/specs/CorrelationTypeModule.nitro.d.ts +4 -2
- package/lib/typescript/specs/ElectrocardiogramModule.nitro.d.ts +1 -1
- package/lib/typescript/specs/HeartbeatSeriesModule.nitro.d.ts +1 -1
- package/lib/typescript/specs/MedicationModule.nitro.d.ts +56 -0
- package/lib/typescript/specs/QuantityTypeModule.nitro.d.ts +4 -4
- package/lib/typescript/specs/StateOfMindModule.nitro.d.ts +4 -3
- package/lib/typescript/types/CategoryType.d.ts +10 -20
- package/lib/typescript/types/Constants.d.ts +1 -0
- package/lib/typescript/types/CorrelationType.d.ts +8 -10
- package/lib/typescript/types/ElectrocardiogramSample.d.ts +2 -12
- package/lib/typescript/types/HeartbeatSeries.d.ts +2 -14
- package/lib/typescript/types/QuantitySample.d.ts +2 -8
- package/lib/typescript/types/QuantityType.d.ts +7 -8
- package/lib/typescript/types/QuantityTypeIdentifier.d.ts +23 -23
- package/lib/typescript/types/QueryOptions.d.ts +43 -28
- package/lib/typescript/types/Shared.d.ts +52 -7
- package/lib/typescript/types/StateOfMind.d.ts +7 -10
- package/lib/typescript/types/Subscriptions.d.ts +12 -3
- package/lib/typescript/types/WeatherCondition.d.ts +1 -1
- package/lib/typescript/types/Workouts.d.ts +28 -81
- package/lib/typescript/utils/subscribeToCategorySamples.d.ts +5 -0
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.cpp +57 -0
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.hpp +592 -389
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Umbrella.hpp +65 -30
- package/nitrogen/generated/ios/ReactNativeHealthkitAutolinking.mm +8 -0
- package/nitrogen/generated/ios/ReactNativeHealthkitAutolinking.swift +15 -0
- package/nitrogen/generated/ios/c++/HybridCategoryTypeModuleSpecSwift.hpp +32 -26
- package/nitrogen/generated/ios/c++/HybridCoreModuleSpecSwift.hpp +36 -37
- package/nitrogen/generated/ios/c++/HybridCorrelationTypeModuleSpecSwift.hpp +55 -2
- package/nitrogen/generated/ios/c++/HybridElectrocardiogramModuleSpecSwift.hpp +36 -30
- package/nitrogen/generated/ios/c++/HybridHeartbeatSeriesModuleSpecSwift.hpp +35 -29
- package/nitrogen/generated/ios/c++/HybridMedicationModuleSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridMedicationModuleSpecSwift.hpp +181 -0
- package/nitrogen/generated/ios/c++/HybridQuantityTypeModuleSpecSwift.hpp +48 -42
- package/nitrogen/generated/ios/c++/HybridStateOfMindModuleSpecSwift.hpp +59 -36
- package/nitrogen/generated/ios/c++/HybridWorkoutProxySpecSwift.hpp +150 -29
- package/nitrogen/generated/ios/c++/HybridWorkoutsModuleSpecSwift.hpp +13 -28
- package/nitrogen/generated/ios/swift/AggregationStyle.swift +48 -0
- package/nitrogen/generated/ios/swift/CategorySample.swift +571 -24
- package/nitrogen/generated/ios/swift/ComparisonPredicateOperator.swift +2 -2
- package/nitrogen/generated/ios/swift/CorrelationSample.swift +640 -17
- package/nitrogen/generated/ios/swift/{PredicateWithStartAndEnd.swift → DateFilter.swift} +5 -5
- package/nitrogen/generated/ios/swift/ECGQueryOptionsWithAnchor.swift +11 -91
- package/nitrogen/generated/ios/swift/ECGQueryOptionsWithSortOrder.swift +11 -91
- package/nitrogen/generated/ios/swift/ElectrocardiogramSample.swift +570 -72
- package/nitrogen/generated/ios/swift/FilterForSamples.swift +349 -12
- package/nitrogen/generated/ios/swift/FilterForSamplesBase.swift +234 -0
- package/nitrogen/generated/ios/swift/FilterForWorkouts.swift +366 -0
- package/nitrogen/generated/ios/swift/FilterForWorkoutsBase.swift +240 -0
- package/nitrogen/generated/ios/swift/Func_void_MedicationDoseEventsWithAnchorResponse.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_QueryCorrelationSamplesWithAnchorResponse.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_StateOfMindSamplesWithAnchorResponse.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_MedicationDoseEvent_.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_UserAnnotatedMedication_.swift +47 -0
- package/nitrogen/generated/ios/swift/GeneralForm.swift +104 -0
- package/nitrogen/generated/ios/swift/HeartRateMotionContext.swift +44 -0
- package/nitrogen/generated/ios/swift/HeartbeatSeriesSample.swift +565 -37
- package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec_cxx.swift +2 -2
- package/nitrogen/generated/ios/swift/HybridCoreModuleSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridCoreModuleSpec_cxx.swift +19 -31
- package/nitrogen/generated/ios/swift/HybridCorrelationTypeModuleSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridCorrelationTypeModuleSpec_cxx.swift +21 -2
- package/nitrogen/generated/ios/swift/HybridElectrocardiogramModuleSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridElectrocardiogramModuleSpec_cxx.swift +2 -2
- package/nitrogen/generated/ios/swift/HybridHeartbeatSeriesModuleSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridHeartbeatSeriesModuleSpec_cxx.swift +2 -2
- package/nitrogen/generated/ios/swift/HybridMedicationModuleSpec.swift +60 -0
- package/nitrogen/generated/ios/swift/HybridMedicationModuleSpec_cxx.swift +208 -0
- package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec.swift +2 -2
- package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec_cxx.swift +9 -43
- package/nitrogen/generated/ios/swift/HybridStateOfMindModuleSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridStateOfMindModuleSpec_cxx.swift +21 -2
- package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec.swift +34 -6
- package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec_cxx.swift +376 -36
- package/nitrogen/generated/ios/swift/InsulinDeliveryReason.swift +40 -0
- package/nitrogen/generated/ios/swift/MedicationConcept.swift +80 -0
- package/nitrogen/generated/ios/swift/MedicationDoseEvent.swift +781 -0
- package/nitrogen/generated/ios/swift/MedicationDoseEventLogStatus.swift +56 -0
- package/nitrogen/generated/ios/swift/MedicationDoseEventScheduleType.swift +40 -0
- package/nitrogen/generated/ios/swift/MedicationDoseEventsWithAnchorResponse.swift +81 -0
- package/nitrogen/generated/ios/swift/ObjectTypeIdentifier.swift +16 -16
- package/nitrogen/generated/ios/swift/PredicateWithMetadataKey.swift +7 -7
- package/nitrogen/generated/ios/swift/QuantitySample.swift +574 -27
- package/nitrogen/generated/ios/swift/QuantityTypeIdentifier.swift +16 -16
- package/nitrogen/generated/ios/swift/QueryCorrelationSamplesWithAnchorResponse.swift +81 -0
- package/nitrogen/generated/ios/swift/QueryOptionsWithAnchor.swift +11 -91
- package/nitrogen/generated/ios/swift/QueryOptionsWithAnchorAndUnit.swift +11 -91
- package/nitrogen/generated/ios/swift/QueryOptionsWithSortOrder.swift +11 -91
- package/nitrogen/generated/ios/swift/QueryOptionsWithSortOrderAndUnit.swift +11 -91
- package/nitrogen/generated/ios/swift/RelatedCoding.swift +76 -0
- package/nitrogen/generated/ios/swift/SampleType.swift +68 -0
- package/nitrogen/generated/ios/swift/SampleTypeIdentifier.swift +16 -16
- package/nitrogen/generated/ios/swift/SampleTypeIdentifierWriteable.swift +0 -16
- package/nitrogen/generated/ios/swift/StateOfMindSample.swift +586 -58
- package/nitrogen/generated/ios/swift/StateOfMindSamplesWithAnchorResponse.swift +81 -0
- package/nitrogen/generated/ios/swift/StatisticsQueryOptions.swift +7 -75
- package/nitrogen/generated/ios/swift/UserAnnotatedMedication.swift +87 -0
- package/nitrogen/generated/ios/swift/WeatherCondition.swift +144 -0
- package/nitrogen/generated/ios/swift/WorkoutQueryOptions.swift +11 -105
- package/nitrogen/generated/ios/swift/WorkoutQueryOptionsWithAnchor.swift +11 -105
- package/nitrogen/generated/ios/swift/WorkoutSample.swift +751 -78
- package/nitrogen/generated/shared/c++/AggregationStyle.hpp +64 -0
- package/nitrogen/generated/shared/c++/CategorySample.hpp +126 -23
- package/nitrogen/generated/shared/c++/CorrelationSample.hpp +134 -12
- package/nitrogen/generated/shared/c++/{PredicateWithStartAndEnd.hpp → DateFilter.hpp} +10 -10
- package/nitrogen/generated/shared/c++/ECGQueryOptionsWithAnchor.hpp +12 -31
- package/nitrogen/generated/shared/c++/ECGQueryOptionsWithSortOrder.hpp +12 -31
- package/nitrogen/generated/shared/c++/ElectrocardiogramSample.hpp +135 -36
- package/nitrogen/generated/shared/c++/FilterForSamples.hpp +124 -0
- package/nitrogen/generated/shared/c++/FilterForSamplesBase.hpp +109 -0
- package/nitrogen/generated/shared/c++/FilterForWorkouts.hpp +131 -0
- package/nitrogen/generated/shared/c++/FilterForWorkoutsBase.hpp +116 -0
- package/nitrogen/generated/shared/c++/GeneralForm.hpp +140 -0
- package/nitrogen/generated/shared/c++/HeartRateMotionContext.hpp +67 -0
- package/nitrogen/generated/shared/c++/HeartbeatSeriesSample.hpp +131 -28
- package/nitrogen/generated/shared/c++/HybridCategoryTypeModuleSpec.hpp +1 -2
- package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.hpp +10 -28
- package/nitrogen/generated/shared/c++/HybridCorrelationTypeModuleSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridCorrelationTypeModuleSpec.hpp +11 -1
- package/nitrogen/generated/shared/c++/HybridElectrocardiogramModuleSpec.hpp +1 -2
- package/nitrogen/generated/shared/c++/HybridHeartbeatSeriesModuleSpec.hpp +1 -2
- package/nitrogen/generated/shared/c++/HybridMedicationModuleSpec.cpp +24 -0
- package/nitrogen/generated/shared/c++/HybridMedicationModuleSpec.hpp +80 -0
- package/nitrogen/generated/shared/c++/HybridQuantityTypeModuleSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridQuantityTypeModuleSpec.hpp +6 -25
- package/nitrogen/generated/shared/c++/HybridStateOfMindModuleSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridStateOfMindModuleSpec.hpp +9 -2
- package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.cpp +33 -5
- package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.hpp +56 -16
- package/nitrogen/generated/shared/c++/InsulinDeliveryReason.hpp +62 -0
- package/nitrogen/generated/shared/c++/MedicationConcept.hpp +93 -0
- package/nitrogen/generated/shared/c++/MedicationDoseEvent.hpp +240 -0
- package/nitrogen/generated/shared/c++/MedicationDoseEventLogStatus.hpp +66 -0
- package/nitrogen/generated/shared/c++/MedicationDoseEventScheduleType.hpp +62 -0
- package/nitrogen/generated/shared/c++/MedicationDoseEventsWithAnchorResponse.hpp +89 -0
- package/nitrogen/generated/shared/c++/ObjectTypeIdentifier.hpp +105 -105
- package/nitrogen/generated/shared/c++/PredicateWithMetadataKey.hpp +8 -8
- package/nitrogen/generated/shared/c++/QuantitySample.hpp +130 -27
- package/nitrogen/generated/shared/c++/QuantityTypeIdentifier.hpp +105 -105
- package/nitrogen/generated/shared/c++/QueryCorrelationSamplesWithAnchorResponse.hpp +89 -0
- package/nitrogen/generated/shared/c++/QueryOptionsWithAnchor.hpp +12 -31
- package/nitrogen/generated/shared/c++/QueryOptionsWithAnchorAndUnit.hpp +12 -31
- package/nitrogen/generated/shared/c++/QueryOptionsWithSortOrder.hpp +12 -31
- package/nitrogen/generated/shared/c++/QueryOptionsWithSortOrderAndUnit.hpp +12 -31
- package/nitrogen/generated/shared/c++/RelatedCoding.hpp +84 -0
- package/nitrogen/generated/shared/c++/SampleType.hpp +87 -0
- package/nitrogen/generated/shared/c++/SampleTypeIdentifier.hpp +105 -105
- package/nitrogen/generated/shared/c++/SampleTypeIdentifierWriteable.hpp +105 -121
- package/nitrogen/generated/shared/c++/StateOfMindSample.hpp +139 -36
- package/nitrogen/generated/shared/c++/StateOfMindSamplesWithAnchorResponse.hpp +89 -0
- package/nitrogen/generated/shared/c++/StatisticsQueryOptions.hpp +8 -27
- package/nitrogen/generated/shared/c++/UserAnnotatedMedication.hpp +90 -0
- package/nitrogen/generated/shared/c++/WeatherCondition.hpp +88 -0
- package/nitrogen/generated/shared/c++/WorkoutQueryOptions.hpp +12 -37
- package/nitrogen/generated/shared/c++/WorkoutQueryOptionsWithAnchor.hpp +12 -37
- package/nitrogen/generated/shared/c++/WorkoutSample.hpp +159 -35
- package/package.json +1 -1
- package/src/healthkit.ios.ts +30 -0
- package/src/healthkit.ts +68 -3
- package/src/hooks/useStatisticsForQuantity.ts +1 -1
- package/src/hooks/useSubscribeToCategorySamples.ts +31 -0
- package/src/modules.ts +4 -0
- package/src/specs/CategoryTypeModule.nitro.ts +2 -2
- package/src/specs/CoreModule.nitro.ts +3 -0
- package/src/specs/CorrelationTypeModule.nitro.ts +11 -3
- package/src/specs/ElectrocardiogramModule.nitro.ts +1 -1
- package/src/specs/HeartbeatSeriesModule.nitro.ts +1 -1
- package/src/specs/MedicationModule.nitro.ts +140 -0
- package/src/specs/QuantityTypeModule.nitro.ts +4 -7
- package/src/specs/StateOfMindModule.nitro.ts +10 -2
- package/src/types/CategoryType.ts +15 -22
- package/src/types/Constants.ts +3 -0
- package/src/types/CorrelationType.ts +10 -15
- package/src/types/ElectrocardiogramSample.ts +2 -14
- package/src/types/HeartbeatSeries.ts +2 -15
- package/src/types/QuantitySample.ts +2 -8
- package/src/types/QuantityType.ts +8 -17
- package/src/types/QuantityTypeIdentifier.ts +25 -25
- package/src/types/QueryOptions.ts +54 -43
- package/src/types/Shared.ts +74 -17
- package/src/types/StateOfMind.ts +8 -10
- package/src/types/Subscriptions.ts +19 -3
- package/src/types/WeatherCondition.ts +1 -1
- package/src/types/Workouts.ts +28 -91
- package/src/utils/getCategorySampleById.ts +1 -1
- package/src/utils/getQuantitySampleById.ts +1 -1
- package/src/utils/getWorkoutById.ts +1 -2
- package/src/utils/subscribeToCategorySamples.ts +38 -0
- package/src/utils/subscribeToQuantitySamples.ts +12 -37
- package/nitrogen/generated/ios/swift/FilterForSamplesAnd.swift +0 -94
- package/nitrogen/generated/ios/swift/FilterForSamplesOr.swift +0 -94
- package/nitrogen/generated/ios/swift/PredicateForSamples.swift +0 -21
- package/nitrogen/generated/ios/swift/PredicateForWorkouts.swift +0 -23
- package/nitrogen/generated/ios/swift/PredicateForWorkoutsAnd.swift +0 -108
- package/nitrogen/generated/ios/swift/PredicateForWorkoutsOr.swift +0 -108
- package/nitrogen/generated/ios/swift/PredicateFromWorkout.swift +0 -45
- package/nitrogen/generated/ios/swift/PredicateWithMetadataOperator.swift +0 -48
- package/nitrogen/generated/ios/swift/PredicateWithUUID.swift +0 -35
- package/nitrogen/generated/ios/swift/PredicateWithUUIDs.swift +0 -47
- package/nitrogen/generated/ios/swift/Variant_PredicateWithUUID_PredicateWithUUIDs_PredicateWithMetadataKey_PredicateWithStartAndEnd_PredicateFromWorkout_FilterForSamplesAnd_FilterForSamplesOr.swift +0 -23
- package/nitrogen/generated/ios/swift/Variant_PredicateWithUUID_PredicateWithUUIDs_PredicateWithMetadataKey_PredicateWithStartAndEnd_PredicateFromWorkout_WorkoutActivityTypePredicate_WorkoutDurationPredicate_PredicateForWorkoutsOr_PredicateForWorkoutsAnd.swift +0 -25
- package/nitrogen/generated/ios/swift/WorkoutActivityTypePredicate.swift +0 -35
- package/nitrogen/generated/shared/c++/FilterForSamplesAnd.hpp +0 -90
- package/nitrogen/generated/shared/c++/FilterForSamplesOr.hpp +0 -90
- package/nitrogen/generated/shared/c++/PredicateForWorkoutsAnd.hpp +0 -96
- package/nitrogen/generated/shared/c++/PredicateForWorkoutsOr.hpp +0 -96
- package/nitrogen/generated/shared/c++/PredicateFromWorkout.hpp +0 -77
- package/nitrogen/generated/shared/c++/PredicateWithMetadataOperator.hpp +0 -84
- package/nitrogen/generated/shared/c++/PredicateWithUUID.hpp +0 -75
- package/nitrogen/generated/shared/c++/PredicateWithUUIDs.hpp +0 -76
- package/nitrogen/generated/shared/c++/WorkoutActivityTypePredicate.hpp +0 -76
package/src/types/Shared.ts
CHANGED
|
@@ -12,27 +12,18 @@ import type {
|
|
|
12
12
|
WorkoutTypeIdentifier,
|
|
13
13
|
} from './Constants'
|
|
14
14
|
import type { CorrelationTypeIdentifier } from './CorrelationType'
|
|
15
|
+
import type { Device } from './Device'
|
|
16
|
+
import type {
|
|
17
|
+
HeartRateMotionContext,
|
|
18
|
+
InsulinDeliveryReason,
|
|
19
|
+
Quantity,
|
|
20
|
+
} from './QuantityType'
|
|
15
21
|
import type {
|
|
16
22
|
QuantityTypeIdentifier,
|
|
17
23
|
QuantityTypeIdentifierWriteable,
|
|
18
24
|
} from './QuantityTypeIdentifier'
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
readonly HKExternalUUID?: string
|
|
22
|
-
readonly HKTimeZone?: string
|
|
23
|
-
readonly HKWasUserEntered?: boolean
|
|
24
|
-
readonly HKDeviceSerialNumber?: string
|
|
25
|
-
readonly HKUDIDeviceIdentifier?: string
|
|
26
|
-
readonly HKUDIProductionIdentifier?: string
|
|
27
|
-
readonly HKDigitalSignature?: string
|
|
28
|
-
readonly HKDeviceName?: string
|
|
29
|
-
readonly HKDeviceManufacturerName?: string
|
|
30
|
-
readonly HKSyncIdentifier?: string
|
|
31
|
-
readonly HKSyncVersion?: number
|
|
32
|
-
readonly HKWasTakenInLab?: boolean
|
|
33
|
-
readonly HKReferenceRangeLowerLimit?: number
|
|
34
|
-
readonly HKReferenceRangeUpperLimit?: number
|
|
35
|
-
}
|
|
25
|
+
import type { SourceRevision } from './Source'
|
|
26
|
+
import type { WeatherCondition } from './WeatherCondition'
|
|
36
27
|
|
|
37
28
|
export interface DeletedSample {
|
|
38
29
|
readonly uuid: string
|
|
@@ -65,6 +56,23 @@ export type SampleTypeIdentifierWriteable =
|
|
|
65
56
|
| typeof WorkoutRouteTypeIdentifier
|
|
66
57
|
| typeof WorkoutTypeIdentifier
|
|
67
58
|
|
|
59
|
+
export interface GenericMetadata {
|
|
60
|
+
readonly HKExternalUUID?: string
|
|
61
|
+
readonly HKTimeZone?: string
|
|
62
|
+
readonly HKWasUserEntered?: boolean
|
|
63
|
+
readonly HKDeviceSerialNumber?: string
|
|
64
|
+
readonly HKUDIDeviceIdentifier?: string
|
|
65
|
+
readonly HKUDIProductionIdentifier?: string
|
|
66
|
+
readonly HKDigitalSignature?: string
|
|
67
|
+
readonly HKDeviceName?: string
|
|
68
|
+
readonly HKDeviceManufacturerName?: string
|
|
69
|
+
readonly HKSyncIdentifier?: string
|
|
70
|
+
readonly HKSyncVersion?: number
|
|
71
|
+
readonly HKWasTakenInLab?: boolean
|
|
72
|
+
readonly HKReferenceRangeLowerLimit?: number
|
|
73
|
+
readonly HKReferenceRangeUpperLimit?: number
|
|
74
|
+
}
|
|
75
|
+
|
|
68
76
|
/**
|
|
69
77
|
* Represents a type that identifies activity summary objects.
|
|
70
78
|
* @see {@link https://developer.apple.com/documentation/healthkit/hkactivitysummarytype Apple Docs HKActivitySummaryType}
|
|
@@ -77,3 +85,52 @@ export const ActivitySummaryTypeIdentifier =
|
|
|
77
85
|
* @see {@link https://developer.apple.com/documentation/healthkit/HKAudiogramSampleType Apple Docs HKAudiogramSampleType}
|
|
78
86
|
*/
|
|
79
87
|
export const AudiogramTypeIdentifier = 'HKAudiogramSampleType' as const
|
|
88
|
+
|
|
89
|
+
export interface BaseObject {
|
|
90
|
+
readonly uuid: string
|
|
91
|
+
readonly sourceRevision: SourceRevision
|
|
92
|
+
readonly device?: Device
|
|
93
|
+
readonly metadata: AnyMap
|
|
94
|
+
|
|
95
|
+
// metadata
|
|
96
|
+
readonly metadataExternalUUID?: string
|
|
97
|
+
readonly metadataTimeZone?: string
|
|
98
|
+
readonly metadataWasUserEntered?: boolean
|
|
99
|
+
readonly metadataDeviceSerialNumber?: string
|
|
100
|
+
readonly metadataUdiDeviceIdentifier?: string
|
|
101
|
+
readonly metadataUdiProductionIdentifier?: string
|
|
102
|
+
readonly metadataDigitalSignature?: string
|
|
103
|
+
readonly metadataDeviceName?: string
|
|
104
|
+
readonly metadataDeviceManufacturerName?: string
|
|
105
|
+
readonly metadataSyncIdentifier?: string
|
|
106
|
+
readonly metadataSyncVersion?: number
|
|
107
|
+
readonly metadataWasTakenInLab?: boolean
|
|
108
|
+
readonly metadataReferenceRangeLowerLimit?: number
|
|
109
|
+
readonly metadataReferenceRangeUpperLimit?: number
|
|
110
|
+
readonly metadataAlgorithmVersion?: number
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface SampleType {
|
|
114
|
+
identifier: string
|
|
115
|
+
allowsRecalibrationForEstimates: boolean
|
|
116
|
+
isMinimumDurationRestricted: boolean
|
|
117
|
+
isMaximumDurationRestricted: boolean
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface BaseSample extends BaseObject {
|
|
121
|
+
readonly sampleType: SampleType
|
|
122
|
+
readonly startDate: Date
|
|
123
|
+
readonly endDate: Date
|
|
124
|
+
readonly hasUndeterminedDuration: boolean
|
|
125
|
+
|
|
126
|
+
// metadata
|
|
127
|
+
readonly metadataWeatherCondition?: WeatherCondition
|
|
128
|
+
readonly metadataWeatherHumidity?: Quantity
|
|
129
|
+
readonly metadataWeatherTemperature?: Quantity
|
|
130
|
+
readonly metadataInsulinDeliveryReason?: InsulinDeliveryReason
|
|
131
|
+
/**
|
|
132
|
+
* postprandial or preprandial (https://developer.apple.com/documentation/healthkit/hkbloodglucosemealtime)
|
|
133
|
+
*/
|
|
134
|
+
// readonly metadataBloodGlucoseMealTime?: number
|
|
135
|
+
readonly metadataHeartRateMotionContext?: HeartRateMotionContext
|
|
136
|
+
}
|
package/src/types/StateOfMind.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Device } from './Device'
|
|
3
|
-
import type { SourceRevision } from './Source'
|
|
1
|
+
import type { BaseSample, DeletedSample } from './Shared'
|
|
4
2
|
|
|
5
3
|
export enum StateOfMindValenceClassification {
|
|
6
4
|
veryUnpleasant = 1,
|
|
@@ -12,13 +10,7 @@ export enum StateOfMindValenceClassification {
|
|
|
12
10
|
veryPleasant = 7,
|
|
13
11
|
}
|
|
14
12
|
|
|
15
|
-
export interface StateOfMindSample {
|
|
16
|
-
readonly uuid: string
|
|
17
|
-
readonly device?: Device
|
|
18
|
-
readonly startDate: Date
|
|
19
|
-
readonly endDate: Date
|
|
20
|
-
readonly metadata?: AnyMap
|
|
21
|
-
readonly sourceRevision?: SourceRevision
|
|
13
|
+
export interface StateOfMindSample extends BaseSample {
|
|
22
14
|
// State of mind sample properties
|
|
23
15
|
/**
|
|
24
16
|
* @see {@link https://developer.apple.com/documentation/healthkit/hkstateofmind/4337998-valence Apple Docs }
|
|
@@ -31,6 +23,12 @@ export interface StateOfMindSample {
|
|
|
31
23
|
readonly labels: readonly StateOfMindLabel[]
|
|
32
24
|
}
|
|
33
25
|
|
|
26
|
+
export interface StateOfMindSamplesWithAnchorResponse {
|
|
27
|
+
readonly samples: readonly StateOfMindSample[]
|
|
28
|
+
readonly deletedSamples: readonly DeletedSample[]
|
|
29
|
+
readonly newAnchor: string
|
|
30
|
+
}
|
|
31
|
+
|
|
34
32
|
/**
|
|
35
33
|
* @see {@link https://developer.apple.com/documentation/healthkit/hkstateofmind/label Apple Docs}
|
|
36
34
|
*/
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import type { CategorySample, CategorySampleTyped } from './CategoryType'
|
|
2
|
+
import type { CategoryTypeIdentifier } from './CategoryTypeIdentifier'
|
|
1
3
|
import type { QuantitySample } from './QuantitySample'
|
|
2
4
|
import type { QuantityTypeIdentifier } from './QuantityTypeIdentifier'
|
|
3
|
-
import type {
|
|
5
|
+
import type { SampleTypeIdentifier } from './Shared'
|
|
4
6
|
|
|
5
7
|
export interface EmitterSubscription {
|
|
6
8
|
remove: () => void
|
|
@@ -18,11 +20,25 @@ export interface OnQuantitySamplesCallbackError {
|
|
|
18
20
|
|
|
19
21
|
export interface OnQuantitySamplesCallbackSuccess {
|
|
20
22
|
readonly typeIdentifier: QuantityTypeIdentifier
|
|
21
|
-
readonly anchor: string
|
|
22
23
|
readonly samples: readonly QuantitySample[]
|
|
23
|
-
readonly deletedSamples: readonly DeletedSample[]
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export type OnQuantitySamplesCallback =
|
|
27
27
|
| OnQuantitySamplesCallbackError
|
|
28
28
|
| OnQuantitySamplesCallbackSuccess
|
|
29
|
+
|
|
30
|
+
export interface OnCategorySamplesCallbackError {
|
|
31
|
+
readonly typeIdentifier: CategoryTypeIdentifier
|
|
32
|
+
readonly errorMessage: string
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface OnCategorySamplesCallbackSuccess<
|
|
36
|
+
T extends CategoryTypeIdentifier,
|
|
37
|
+
> {
|
|
38
|
+
readonly typeIdentifier: CategoryTypeIdentifier
|
|
39
|
+
readonly samples: readonly CategorySampleTyped<T>[]
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export type OnCategorySamplesCallback<T extends CategoryTypeIdentifier> =
|
|
43
|
+
| OnCategorySamplesCallbackError
|
|
44
|
+
| OnCategorySamplesCallbackSuccess<T>
|
package/src/types/Workouts.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import type { AnyMap } from 'react-native-nitro-modules'
|
|
2
1
|
import type { WorkoutProxy } from '../specs/WorkoutProxy.nitro'
|
|
3
|
-
import type {
|
|
2
|
+
import type { BaseSample, ComparisonPredicateOperator } from '../types'
|
|
4
3
|
import type { Quantity } from './QuantityType'
|
|
5
|
-
import type {
|
|
6
|
-
import type { DeletedSample
|
|
7
|
-
import type { SourceRevision } from './Source'
|
|
4
|
+
import type { FilterForSamplesBase } from './QueryOptions'
|
|
5
|
+
import type { DeletedSample } from './Shared'
|
|
8
6
|
|
|
9
7
|
export enum WorkoutActivityType {
|
|
10
8
|
americanFootball = 1,
|
|
@@ -93,47 +91,6 @@ export enum WorkoutActivityType {
|
|
|
93
91
|
other = 3000,
|
|
94
92
|
}
|
|
95
93
|
|
|
96
|
-
// documented at https://developer.apple.com/documentation/healthkit/hkweathercondition
|
|
97
|
-
export enum WeatherCondition {
|
|
98
|
-
none = 0,
|
|
99
|
-
clear = 1,
|
|
100
|
-
fair = 2,
|
|
101
|
-
partlyCloudy = 3,
|
|
102
|
-
mostlyCloudy = 4,
|
|
103
|
-
cloudy = 5,
|
|
104
|
-
foggy = 6,
|
|
105
|
-
haze = 7,
|
|
106
|
-
windy = 8,
|
|
107
|
-
blustery = 9,
|
|
108
|
-
smoky = 10,
|
|
109
|
-
dust = 11,
|
|
110
|
-
snow = 12,
|
|
111
|
-
hail = 13,
|
|
112
|
-
sleet = 14,
|
|
113
|
-
freezingDrizzle = 15,
|
|
114
|
-
freezingRain = 16,
|
|
115
|
-
mixedRainAndHail = 17,
|
|
116
|
-
mixedRainAndSnow = 18,
|
|
117
|
-
mixedRainAndSleet = 19,
|
|
118
|
-
mixedSnowAndSleet = 20,
|
|
119
|
-
drizzle = 21,
|
|
120
|
-
scatteredShowers = 22,
|
|
121
|
-
showers = 23,
|
|
122
|
-
thunderstorms = 24,
|
|
123
|
-
tropicalStorm = 25,
|
|
124
|
-
hurricane = 26,
|
|
125
|
-
tornado = 27,
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export interface WorkoutMetadata extends GenericMetadata {
|
|
129
|
-
readonly HKWeatherCondition?: WeatherCondition
|
|
130
|
-
readonly HKWeatherHumidity?: Quantity
|
|
131
|
-
readonly HKWeatherTemperature?: Quantity
|
|
132
|
-
readonly HKAverageMETs?: Quantity
|
|
133
|
-
readonly HKElevationAscended?: Quantity
|
|
134
|
-
readonly HKIndoorWorkout?: boolean
|
|
135
|
-
}
|
|
136
|
-
|
|
137
94
|
export interface WorkoutEvent {
|
|
138
95
|
readonly type: WorkoutEventType
|
|
139
96
|
readonly startDate: Date
|
|
@@ -170,59 +127,38 @@ export interface QueryWorkoutSamplesWithAnchorResponse {
|
|
|
170
127
|
readonly newAnchor: string
|
|
171
128
|
}
|
|
172
129
|
|
|
173
|
-
type
|
|
174
|
-
readonly workoutActivityType: WorkoutActivityType
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
enum ComparisonPredicateOperator {
|
|
178
|
-
lessThan = 0,
|
|
179
|
-
lessThanOrEqualTo = 1,
|
|
180
|
-
greaterThan = 2,
|
|
181
|
-
greaterThanOrEqualTo = 3,
|
|
182
|
-
equalTo = 4,
|
|
183
|
-
notEqualTo = 5,
|
|
184
|
-
matches = 6,
|
|
185
|
-
like = 7,
|
|
186
|
-
beginsWith = 8,
|
|
187
|
-
endsWith = 9,
|
|
188
|
-
in = 10,
|
|
189
|
-
customSelector = 11,
|
|
190
|
-
contains = 99,
|
|
191
|
-
between = 100,
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
type WorkoutDurationPredicate = {
|
|
130
|
+
export type WorkoutDurationPredicate = {
|
|
195
131
|
readonly predicateOperator: ComparisonPredicateOperator
|
|
196
132
|
readonly durationInSeconds: number
|
|
197
133
|
}
|
|
198
134
|
|
|
199
|
-
export
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
export type PredicateForWorkoutsOr = {
|
|
205
|
-
readonly OR: readonly PredicateForWorkouts[]
|
|
135
|
+
export interface FilterForWorkoutsBase
|
|
136
|
+
extends Omit<FilterForSamplesBase, 'workout'> {
|
|
137
|
+
readonly workoutActivityType?: WorkoutActivityType
|
|
138
|
+
readonly duration?: WorkoutDurationPredicate
|
|
206
139
|
}
|
|
207
140
|
|
|
208
|
-
export
|
|
209
|
-
readonly
|
|
141
|
+
export interface FilterForWorkouts extends FilterForWorkoutsBase {
|
|
142
|
+
readonly OR?: FilterForWorkoutsBase[]
|
|
143
|
+
readonly NOT?: FilterForWorkoutsBase[]
|
|
144
|
+
readonly AND?: FilterForWorkoutsBase[]
|
|
210
145
|
}
|
|
211
146
|
|
|
212
|
-
export type FilterForWorkouts =
|
|
213
|
-
| PredicateForWorkouts
|
|
214
|
-
| PredicateForWorkoutsOr
|
|
215
|
-
| PredicateForWorkoutsAnd
|
|
216
|
-
|
|
217
147
|
export interface WorkoutQueryOptionsWithAnchor {
|
|
218
148
|
filter?: FilterForWorkouts
|
|
219
|
-
|
|
149
|
+
/**
|
|
150
|
+
* Specify -1, 0 or any non-positive number for fetching all samples
|
|
151
|
+
* */
|
|
152
|
+
limit: number
|
|
220
153
|
anchor?: string
|
|
221
154
|
}
|
|
222
155
|
|
|
223
156
|
export interface WorkoutQueryOptions {
|
|
224
157
|
filter?: FilterForWorkouts
|
|
225
|
-
|
|
158
|
+
/**
|
|
159
|
+
* Specify -1, 0 or any non-positive number for fetching all samples
|
|
160
|
+
* */
|
|
161
|
+
limit: number
|
|
226
162
|
ascending?: boolean
|
|
227
163
|
}
|
|
228
164
|
|
|
@@ -260,15 +196,16 @@ export interface WorkoutTotals {
|
|
|
260
196
|
readonly energyBurned?: number
|
|
261
197
|
}
|
|
262
198
|
|
|
263
|
-
export interface WorkoutSample {
|
|
264
|
-
readonly uuid: string
|
|
265
|
-
readonly device?: Device
|
|
199
|
+
export interface WorkoutSample extends BaseSample {
|
|
266
200
|
readonly workoutActivityType: WorkoutActivityType
|
|
267
201
|
readonly duration: Quantity
|
|
268
|
-
readonly startDate: Date
|
|
269
|
-
readonly endDate: Date
|
|
270
|
-
readonly metadata?: AnyMap
|
|
271
|
-
readonly sourceRevision?: SourceRevision
|
|
272
202
|
readonly events?: readonly WorkoutEvent[]
|
|
273
203
|
readonly activities?: readonly WorkoutActivity[]
|
|
204
|
+
|
|
205
|
+
readonly metadataAverageMETs?: Quantity
|
|
206
|
+
readonly metadataElevationAscended?: Quantity
|
|
207
|
+
readonly metadataElevationDescended?: Quantity
|
|
208
|
+
readonly metadataIndoorWorkout?: boolean
|
|
209
|
+
readonly metadataAverageSpeed?: Quantity
|
|
210
|
+
readonly metadataMaximumSpeed?: Quantity
|
|
274
211
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Workouts } from '../modules'
|
|
2
|
-
import type { WorkoutQueryOptions } from '../types/Workouts'
|
|
3
2
|
|
|
4
3
|
const getWorkoutById = async (uuid: string) => {
|
|
5
4
|
const workouts = await Workouts.queryWorkoutSamples({
|
|
6
5
|
limit: 1,
|
|
7
6
|
filter: {
|
|
8
|
-
|
|
7
|
+
uuids: [uuid],
|
|
9
8
|
},
|
|
10
9
|
})
|
|
11
10
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CategoryTypes } from '../modules'
|
|
2
|
+
import type { CategoryTypeIdentifier } from '../types'
|
|
3
|
+
import type { OnCategorySamplesCallback } from '../types/Subscriptions'
|
|
4
|
+
import { subscribeToChanges } from './subscribeToChanges'
|
|
5
|
+
|
|
6
|
+
export function subscribeToCategorySamples<T extends CategoryTypeIdentifier>(
|
|
7
|
+
identifier: T,
|
|
8
|
+
callback: (args: OnCategorySamplesCallback<T>) => void,
|
|
9
|
+
after = new Date(),
|
|
10
|
+
) {
|
|
11
|
+
return subscribeToChanges(identifier, async ({ errorMessage }) => {
|
|
12
|
+
if (errorMessage) {
|
|
13
|
+
return callback({
|
|
14
|
+
typeIdentifier: identifier,
|
|
15
|
+
errorMessage,
|
|
16
|
+
})
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const samplesAfterLast = await CategoryTypes.queryCategorySamples(
|
|
20
|
+
identifier,
|
|
21
|
+
{
|
|
22
|
+
limit: 0,
|
|
23
|
+
filter: {
|
|
24
|
+
date: {
|
|
25
|
+
startDate: after,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
if (samplesAfterLast.length > 0) {
|
|
32
|
+
callback({
|
|
33
|
+
typeIdentifier: identifier,
|
|
34
|
+
samples: samplesAfterLast,
|
|
35
|
+
})
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
}
|
|
@@ -6,26 +6,8 @@ import { subscribeToChanges } from './subscribeToChanges'
|
|
|
6
6
|
export const subscribeToQuantitySamples = (
|
|
7
7
|
identifier: QuantityTypeIdentifier,
|
|
8
8
|
callback: (args: OnQuantitySamplesCallback) => void,
|
|
9
|
-
after
|
|
9
|
+
after = new Date(),
|
|
10
10
|
) => {
|
|
11
|
-
let anchor: string | undefined
|
|
12
|
-
const afterDate = after ?? new Date()
|
|
13
|
-
|
|
14
|
-
const init = async () => {
|
|
15
|
-
// we need to do an initial query to get a handle for the deletedSamples
|
|
16
|
-
const { newAnchor } = await QuantityTypes.queryQuantitySamplesWithAnchor(
|
|
17
|
-
identifier,
|
|
18
|
-
{
|
|
19
|
-
filter: {
|
|
20
|
-
startDate: afterDate,
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
)
|
|
24
|
-
anchor = newAnchor
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
init()
|
|
28
|
-
|
|
29
11
|
return subscribeToChanges(identifier, async ({ errorMessage }) => {
|
|
30
12
|
if (errorMessage) {
|
|
31
13
|
return callback({
|
|
@@ -34,29 +16,22 @@ export const subscribeToQuantitySamples = (
|
|
|
34
16
|
})
|
|
35
17
|
}
|
|
36
18
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
await QuantityTypes.queryQuantitySamplesWithAnchor(identifier, {
|
|
42
|
-
anchor,
|
|
19
|
+
const samplesAfterLast = await QuantityTypes.queryQuantitySamples(
|
|
20
|
+
identifier,
|
|
21
|
+
{
|
|
22
|
+
limit: 0,
|
|
43
23
|
filter: {
|
|
44
|
-
|
|
24
|
+
date: {
|
|
25
|
+
startDate: after,
|
|
26
|
+
},
|
|
45
27
|
},
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
anchor = newAnchor
|
|
49
|
-
|
|
50
|
-
const hasNewSamples =
|
|
51
|
-
samples.length > 0 ||
|
|
52
|
-
(deletedSamples.length > 0 && hadAnchorWhenDoingQuery)
|
|
28
|
+
},
|
|
29
|
+
)
|
|
53
30
|
|
|
54
|
-
if (
|
|
31
|
+
if (samplesAfterLast.length > 0) {
|
|
55
32
|
callback({
|
|
56
33
|
typeIdentifier: identifier,
|
|
57
|
-
samples,
|
|
58
|
-
anchor: newAnchor,
|
|
59
|
-
deletedSamples: hadAnchorWhenDoingQuery ? deletedSamples : [],
|
|
34
|
+
samples: samplesAfterLast,
|
|
60
35
|
})
|
|
61
36
|
}
|
|
62
37
|
})
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// FilterForSamplesAnd.swift
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
import NitroModules
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Represents an instance of `FilterForSamplesAnd`, backed by a C++ struct.
|
|
12
|
-
*/
|
|
13
|
-
public typealias FilterForSamplesAnd = margelo.nitro.healthkit.FilterForSamplesAnd
|
|
14
|
-
|
|
15
|
-
public extension FilterForSamplesAnd {
|
|
16
|
-
private typealias bridge = margelo.nitro.healthkit.bridge.swift
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Create a new instance of `FilterForSamplesAnd`.
|
|
20
|
-
*/
|
|
21
|
-
init(AND: [PredicateForSamples]) {
|
|
22
|
-
self.init({ () -> bridge.std__vector_std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout__ in
|
|
23
|
-
var __vector = bridge.create_std__vector_std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout__(AND.count)
|
|
24
|
-
for __item in AND {
|
|
25
|
-
__vector.push_back({ () -> bridge.std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout_ in
|
|
26
|
-
switch __item {
|
|
27
|
-
case .first(let __value):
|
|
28
|
-
return bridge.create_std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout_(__value)
|
|
29
|
-
case .second(let __value):
|
|
30
|
-
return bridge.create_std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout_(__value)
|
|
31
|
-
case .third(let __value):
|
|
32
|
-
return bridge.create_std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout_(__value)
|
|
33
|
-
case .fourth(let __value):
|
|
34
|
-
return bridge.create_std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout_(__value)
|
|
35
|
-
case .fifth(let __value):
|
|
36
|
-
return bridge.create_std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout_(__value)
|
|
37
|
-
}
|
|
38
|
-
}().variant)
|
|
39
|
-
}
|
|
40
|
-
return __vector
|
|
41
|
-
}())
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
var AND: [PredicateForSamples] {
|
|
45
|
-
@inline(__always)
|
|
46
|
-
get {
|
|
47
|
-
return self.__AND.map({ __item in { () -> PredicateForSamples in
|
|
48
|
-
let __variant = bridge.std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout_(__item)
|
|
49
|
-
switch __variant.index() {
|
|
50
|
-
case 0:
|
|
51
|
-
let __actual = __variant.get_0()
|
|
52
|
-
return .first(__actual)
|
|
53
|
-
case 1:
|
|
54
|
-
let __actual = __variant.get_1()
|
|
55
|
-
return .second(__actual)
|
|
56
|
-
case 2:
|
|
57
|
-
let __actual = __variant.get_2()
|
|
58
|
-
return .third(__actual)
|
|
59
|
-
case 3:
|
|
60
|
-
let __actual = __variant.get_3()
|
|
61
|
-
return .fourth(__actual)
|
|
62
|
-
case 4:
|
|
63
|
-
let __actual = __variant.get_4()
|
|
64
|
-
return .fifth(__actual)
|
|
65
|
-
default:
|
|
66
|
-
fatalError("Variant can never have index \(__variant.index())!")
|
|
67
|
-
}
|
|
68
|
-
}() })
|
|
69
|
-
}
|
|
70
|
-
@inline(__always)
|
|
71
|
-
set {
|
|
72
|
-
self.__AND = { () -> bridge.std__vector_std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout__ in
|
|
73
|
-
var __vector = bridge.create_std__vector_std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout__(newValue.count)
|
|
74
|
-
for __item in newValue {
|
|
75
|
-
__vector.push_back({ () -> bridge.std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout_ in
|
|
76
|
-
switch __item {
|
|
77
|
-
case .first(let __value):
|
|
78
|
-
return bridge.create_std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout_(__value)
|
|
79
|
-
case .second(let __value):
|
|
80
|
-
return bridge.create_std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout_(__value)
|
|
81
|
-
case .third(let __value):
|
|
82
|
-
return bridge.create_std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout_(__value)
|
|
83
|
-
case .fourth(let __value):
|
|
84
|
-
return bridge.create_std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout_(__value)
|
|
85
|
-
case .fifth(let __value):
|
|
86
|
-
return bridge.create_std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout_(__value)
|
|
87
|
-
}
|
|
88
|
-
}().variant)
|
|
89
|
-
}
|
|
90
|
-
return __vector
|
|
91
|
-
}()
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// FilterForSamplesOr.swift
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
import NitroModules
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Represents an instance of `FilterForSamplesOr`, backed by a C++ struct.
|
|
12
|
-
*/
|
|
13
|
-
public typealias FilterForSamplesOr = margelo.nitro.healthkit.FilterForSamplesOr
|
|
14
|
-
|
|
15
|
-
public extension FilterForSamplesOr {
|
|
16
|
-
private typealias bridge = margelo.nitro.healthkit.bridge.swift
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Create a new instance of `FilterForSamplesOr`.
|
|
20
|
-
*/
|
|
21
|
-
init(OR: [PredicateForSamples]) {
|
|
22
|
-
self.init({ () -> bridge.std__vector_std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout__ in
|
|
23
|
-
var __vector = bridge.create_std__vector_std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout__(OR.count)
|
|
24
|
-
for __item in OR {
|
|
25
|
-
__vector.push_back({ () -> bridge.std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout_ in
|
|
26
|
-
switch __item {
|
|
27
|
-
case .first(let __value):
|
|
28
|
-
return bridge.create_std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout_(__value)
|
|
29
|
-
case .second(let __value):
|
|
30
|
-
return bridge.create_std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout_(__value)
|
|
31
|
-
case .third(let __value):
|
|
32
|
-
return bridge.create_std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout_(__value)
|
|
33
|
-
case .fourth(let __value):
|
|
34
|
-
return bridge.create_std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout_(__value)
|
|
35
|
-
case .fifth(let __value):
|
|
36
|
-
return bridge.create_std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout_(__value)
|
|
37
|
-
}
|
|
38
|
-
}().variant)
|
|
39
|
-
}
|
|
40
|
-
return __vector
|
|
41
|
-
}())
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
var OR: [PredicateForSamples] {
|
|
45
|
-
@inline(__always)
|
|
46
|
-
get {
|
|
47
|
-
return self.__OR.map({ __item in { () -> PredicateForSamples in
|
|
48
|
-
let __variant = bridge.std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout_(__item)
|
|
49
|
-
switch __variant.index() {
|
|
50
|
-
case 0:
|
|
51
|
-
let __actual = __variant.get_0()
|
|
52
|
-
return .first(__actual)
|
|
53
|
-
case 1:
|
|
54
|
-
let __actual = __variant.get_1()
|
|
55
|
-
return .second(__actual)
|
|
56
|
-
case 2:
|
|
57
|
-
let __actual = __variant.get_2()
|
|
58
|
-
return .third(__actual)
|
|
59
|
-
case 3:
|
|
60
|
-
let __actual = __variant.get_3()
|
|
61
|
-
return .fourth(__actual)
|
|
62
|
-
case 4:
|
|
63
|
-
let __actual = __variant.get_4()
|
|
64
|
-
return .fifth(__actual)
|
|
65
|
-
default:
|
|
66
|
-
fatalError("Variant can never have index \(__variant.index())!")
|
|
67
|
-
}
|
|
68
|
-
}() })
|
|
69
|
-
}
|
|
70
|
-
@inline(__always)
|
|
71
|
-
set {
|
|
72
|
-
self.__OR = { () -> bridge.std__vector_std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout__ in
|
|
73
|
-
var __vector = bridge.create_std__vector_std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout__(newValue.count)
|
|
74
|
-
for __item in newValue {
|
|
75
|
-
__vector.push_back({ () -> bridge.std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout_ in
|
|
76
|
-
switch __item {
|
|
77
|
-
case .first(let __value):
|
|
78
|
-
return bridge.create_std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout_(__value)
|
|
79
|
-
case .second(let __value):
|
|
80
|
-
return bridge.create_std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout_(__value)
|
|
81
|
-
case .third(let __value):
|
|
82
|
-
return bridge.create_std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout_(__value)
|
|
83
|
-
case .fourth(let __value):
|
|
84
|
-
return bridge.create_std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout_(__value)
|
|
85
|
-
case .fifth(let __value):
|
|
86
|
-
return bridge.create_std__variant_PredicateWithUUID__PredicateWithUUIDs__PredicateWithMetadataKey__PredicateWithStartAndEnd__PredicateFromWorkout_(__value)
|
|
87
|
-
}
|
|
88
|
-
}().variant)
|
|
89
|
-
}
|
|
90
|
-
return __vector
|
|
91
|
-
}()
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|