@kingstinct/react-native-healthkit 9.0.6 → 9.0.8

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 (67) hide show
  1. package/ios/CategoryTypeModule.swift +18 -21
  2. package/ios/CharacteristicTypeModule.swift +36 -21
  3. package/ios/CorrelationTypeModule.swift +18 -18
  4. package/ios/HeartbeatSeriesModule.swift +32 -32
  5. package/ios/QuantityTypeModule.swift +56 -57
  6. package/ios/Serializers.swift +12 -16
  7. package/ios/StateOfMindModule.swift +17 -17
  8. package/ios/WorkoutsModule.swift +59 -110
  9. package/lib/commonjs/healthkit.js +225 -0
  10. package/lib/commonjs/hooks/useStatisticsForQuantity.js +1 -1
  11. package/lib/commonjs/index.js +6 -209
  12. package/lib/module/healthkit.js +203 -0
  13. package/lib/module/hooks/useStatisticsForQuantity.js +1 -1
  14. package/lib/module/index.js +3 -203
  15. package/lib/typescript/healthkit.d.ts +69 -0
  16. package/lib/typescript/{index.ios.d.ts → healthkit.ios.d.ts} +11 -11
  17. package/lib/typescript/hooks/useHealthkitAuthorization.d.ts +1 -1
  18. package/lib/typescript/index.d.ts +3 -69
  19. package/lib/typescript/specs/CategoryTypeModule.nitro.d.ts +1 -1
  20. package/lib/typescript/specs/CharacteristicTypeModule.nitro.d.ts +2 -2
  21. package/lib/typescript/specs/CoreModule.nitro.d.ts +3 -3
  22. package/lib/typescript/specs/WorkoutsModule.nitro.d.ts +3 -0
  23. package/lib/typescript/types/Shared.d.ts +3 -3
  24. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.cpp +7 -48
  25. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.hpp +54 -154
  26. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Umbrella.hpp +0 -14
  27. package/nitrogen/generated/ios/c++/HybridCharacteristicTypeModuleSpecSwift.hpp +3 -2
  28. package/nitrogen/generated/ios/swift/Func_void_std__optional_std__chrono__system_clock__time_point_.swift +52 -0
  29. package/nitrogen/generated/ios/swift/HybridCharacteristicTypeModuleSpec.swift +2 -2
  30. package/nitrogen/generated/ios/swift/HybridCharacteristicTypeModuleSpec_cxx.swift +23 -11
  31. package/nitrogen/generated/shared/c++/HybridCharacteristicTypeModuleSpec.hpp +3 -2
  32. package/package.json +2 -2
  33. package/src/healthkit.ts +422 -0
  34. package/src/hooks/useHealthkitAuthorization.ts +2 -2
  35. package/src/hooks/useStatisticsForQuantity.ts +1 -3
  36. package/src/index.ts +3 -419
  37. package/src/specs/CategoryTypeModule.nitro.ts +1 -1
  38. package/src/specs/CharacteristicTypeModule.nitro.ts +2 -2
  39. package/src/specs/CoreModule.nitro.ts +5 -5
  40. package/src/specs/WorkoutsModule.nitro.ts +3 -0
  41. package/src/test-setup.ts +0 -1
  42. package/src/types/QueryOptions.ts +3 -3
  43. package/src/types/Shared.ts +6 -8
  44. package/ios/WorkoutSessionModule.swift +0 -182
  45. package/lib/commonjs/specs/WorkoutSessionModule.nitro.js +0 -19
  46. package/lib/module/specs/WorkoutSessionModule.nitro.js +0 -16
  47. package/lib/typescript/specs/WorkoutSessionModule.nitro.d.ts +0 -47
  48. package/nitrogen/generated/ios/c++/HybridWorkoutSessionModuleSpecSwift.cpp +0 -11
  49. package/nitrogen/generated/ios/c++/HybridWorkoutSessionModuleSpecSwift.hpp +0 -107
  50. package/nitrogen/generated/ios/swift/Func_void_WorkoutEventType.swift +0 -46
  51. package/nitrogen/generated/ios/swift/Func_void_WorkoutSessionState_WorkoutSessionState_std__chrono__system_clock__time_point.swift +0 -46
  52. package/nitrogen/generated/ios/swift/Func_void_std__chrono__system_clock__time_point.swift +0 -46
  53. package/nitrogen/generated/ios/swift/Func_void_std__vector_RemoteSessionSharableData_.swift +0 -46
  54. package/nitrogen/generated/ios/swift/HybridWorkoutSessionModuleSpec.swift +0 -49
  55. package/nitrogen/generated/ios/swift/HybridWorkoutSessionModuleSpec_cxx.swift +0 -133
  56. package/nitrogen/generated/ios/swift/RemoteSessionSharableData.swift +0 -46
  57. package/nitrogen/generated/ios/swift/WorkoutSessionMirroringStartHandlerOptions.swift +0 -118
  58. package/nitrogen/generated/ios/swift/WorkoutSessionState.swift +0 -56
  59. package/nitrogen/generated/shared/c++/HybridWorkoutSessionModuleSpec.cpp +0 -22
  60. package/nitrogen/generated/shared/c++/HybridWorkoutSessionModuleSpec.hpp +0 -68
  61. package/nitrogen/generated/shared/c++/RemoteSessionSharableData.hpp +0 -75
  62. package/nitrogen/generated/shared/c++/WorkoutSessionMirroringStartHandlerOptions.hpp +0 -92
  63. package/nitrogen/generated/shared/c++/WorkoutSessionState.hpp +0 -68
  64. package/src/specs/WorkoutSessionModule.nitro.ts +0 -71
  65. /package/lib/commonjs/{index.ios.js → healthkit.ios.js} +0 -0
  66. /package/lib/module/{index.ios.js → healthkit.ios.js} +0 -0
  67. /package/src/{index.ios.ts → healthkit.ios.ts} +0 -0
@@ -1,71 +0,0 @@
1
- import type { AnyMap, HybridObject } from 'react-native-nitro-modules'
2
- import type { WorkoutConfiguration } from '../types/WorkoutKit'
3
- import type { WorkoutEventType } from '../types/Workouts'
4
-
5
- export interface WorkoutSessionMirroringStartHandlerOptions {
6
- onError(errorMessage: string): void
7
- onStateChange(
8
- toState: WorkoutSessionState,
9
- fromState: WorkoutSessionState,
10
- date: Date,
11
- ): void
12
- onDataReceived(data: RemoteSessionSharableData[]): void
13
- onEventReceived(type: WorkoutEventType): void
14
- }
15
-
16
- export interface WorkoutSessionModule extends HybridObject<{ ios: 'swift' }> {
17
- /**
18
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648358-startwatchapp Apple Docs }
19
- */
20
- startWatchAppWithWorkoutConfiguration(
21
- workoutConfiguration: WorkoutConfiguration,
22
- ): Promise<boolean>
23
-
24
- workoutSessionMirroringStartHandler(
25
- /*onError: (event: WorkoutErrorEvent) => void,
26
- onStateChange: (event: WorkoutStateChangeEvent) => void,
27
- onDataReceived: (event: WorkoutDataReceivedEvent) => void,
28
- onEventReceived: (event: WorkoutEventReceivedEvent) => void,*/
29
- options: WorkoutSessionMirroringStartHandlerOptions,
30
- ): boolean
31
- }
32
-
33
- /**
34
- * @see {@link https://developer.apple.com/documentation/healthkit/hkworkoutsessionstate Apple Docs }
35
- */
36
- export enum WorkoutSessionState {
37
- NotStarted = 1,
38
- Running = 2,
39
- Ended = 3,
40
- Paused = 4,
41
- Prepared = 5,
42
- Stopped = 6,
43
- }
44
-
45
- export interface WorkoutStateChangeEvent {
46
- readonly toState: WorkoutSessionState
47
- readonly fromState: WorkoutSessionState
48
- readonly date: Date
49
- }
50
-
51
- export interface WorkoutErrorEvent {
52
- readonly error: string
53
- }
54
-
55
- export interface RemoteSessionSharableData {
56
- readonly type: string
57
- readonly payload: AnyMap
58
- }
59
-
60
- export interface WorkoutDataReceivedEvent {
61
- readonly data: readonly RemoteSessionSharableData[]
62
- }
63
-
64
- export interface WorkoutEventReceivedEvent {
65
- readonly type: WorkoutEventType
66
- }
67
-
68
- /*type OnRemoteWorkoutStateChangeCallback = ;
69
- type OnRemoteWorkoutErrorCallback = (event: WorkoutErrorEvent) => void;
70
- type OnRemoteWorkoutDataCallback = (event: WorkoutDataReceivedEvent) => void;
71
- type OnRemoteWorkoutEventReceivedCallback = (event: WorkoutEventReceivedEvent) => void;*/
File without changes
File without changes
File without changes