@kingstinct/react-native-healthkit 8.6.0 → 8.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ios/ReactNativeHealthkit.m +5 -0
- package/ios/ReactNativeHealthkit.swift +25 -118
- package/lib/commonjs/hooks/useHealthkitAuthorization.test.js +1 -2
- package/lib/commonjs/hooks/useHealthkitAuthorization.test.js.map +1 -1
- package/lib/commonjs/hooks/useIsHealthDataAvailable.test.js +1 -2
- package/lib/commonjs/hooks/useIsHealthDataAvailable.test.js.map +1 -1
- package/lib/commonjs/index.ios.js +11 -12
- package/lib/commonjs/index.ios.js.map +1 -1
- package/lib/commonjs/index.js +1 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.native.js +4 -4
- package/lib/commonjs/index.native.js.map +1 -1
- package/lib/commonjs/index.web.js +1 -2
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/native-types.js +711 -4
- package/lib/commonjs/native-types.js.map +1 -1
- package/lib/commonjs/test-setup.js +2 -2
- package/lib/commonjs/test-setup.js.map +1 -1
- package/lib/commonjs/utils/deleteWorkoutSample.js +11 -0
- package/lib/commonjs/utils/deleteWorkoutSample.js.map +1 -0
- package/lib/commonjs/utils/deserializeCategorySample.test.js +1 -2
- package/lib/commonjs/utils/deserializeCategorySample.test.js.map +1 -1
- package/lib/commonjs/utils/getPreferredUnitsTyped.js +1 -2
- package/lib/commonjs/utils/getPreferredUnitsTyped.js.map +1 -1
- package/lib/commonjs/utils/subscribeToChanges.js +1 -2
- package/lib/commonjs/utils/subscribeToChanges.js.map +1 -1
- package/lib/module/index.ios.js +3 -3
- package/lib/module/index.ios.js.map +1 -1
- package/lib/module/index.native.js +3 -3
- package/lib/module/index.native.js.map +1 -1
- package/lib/module/native-types.js +711 -4
- package/lib/module/native-types.js.map +1 -1
- package/lib/module/test-setup.js +2 -2
- package/lib/module/test-setup.js.map +1 -1
- package/lib/module/utils/deleteWorkoutSample.js +4 -0
- package/lib/module/utils/deleteWorkoutSample.js.map +1 -0
- package/lib/typescript/src/index.ios.d.ts +10 -10
- package/lib/typescript/src/index.native.d.ts +2 -2
- package/lib/typescript/src/native-types.d.ts +134 -137
- package/lib/typescript/src/utils/deleteWorkoutSample.d.ts +3 -0
- package/lib/typescript/src/utils/ensureUnit.d.ts +1 -1
- package/lib/typescript/src/utils/queryStateOfMindSamples.d.ts +4 -4
- package/lib/typescript/src/utils/queryStatisticsForQuantity.d.ts +1 -1
- package/package.json +19 -19
- package/src/index.ios.tsx +3 -3
- package/src/index.native.tsx +3 -3
- package/src/native-types.ts +3 -5
- package/src/test-setup.ts +1 -1
- package/src/utils/deleteWorkoutSample.ts +7 -0
- package/lib/commonjs/utils/workoutSessionMirroringStartHandler.js +0 -17
- package/lib/commonjs/utils/workoutSessionMirroringStartHandler.js.map +0 -1
- package/lib/module/utils/workoutSessionMirroringStartHandler.js +0 -11
- package/lib/module/utils/workoutSessionMirroringStartHandler.js.map +0 -1
- package/lib/typescript/src/utils/workoutSessionMirroringStartHandler.d.ts +0 -8
- package/src/utils/workoutSessionMirroringStartHandler.ts +0 -11
|
@@ -75,6 +75,11 @@ RCT_EXTERN_METHOD(deleteSamples:(NSString)typeIdentifier
|
|
|
75
75
|
reject:(RCTPromiseRejectBlock)reject
|
|
76
76
|
)
|
|
77
77
|
|
|
78
|
+
RCT_EXTERN_METHOD(deleteWorkoutSample:(NSString)uuid
|
|
79
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
80
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
81
|
+
)
|
|
82
|
+
|
|
78
83
|
RCT_EXTERN_METHOD(subscribeToObserverQuery:(NSString)typeIdentifier
|
|
79
84
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
80
85
|
reject:(RCTPromiseRejectBlock)reject
|
|
@@ -13,15 +13,6 @@ class ReactNativeHealthkit: RCTEventEmitter {
|
|
|
13
13
|
var _dateFormatter: ISO8601DateFormatter
|
|
14
14
|
var _hasListeners = false
|
|
15
15
|
|
|
16
|
-
#if os(iOS)
|
|
17
|
-
@available(iOS 17.0, *)
|
|
18
|
-
var _workoutSession: HKWorkoutSession? {
|
|
19
|
-
get { return __session as? HKWorkoutSession }
|
|
20
|
-
set { __session = newValue }
|
|
21
|
-
}
|
|
22
|
-
private var __session: Any?
|
|
23
|
-
#endif
|
|
24
|
-
|
|
25
16
|
override init() {
|
|
26
17
|
self._runningQueries = [String: HKQuery]()
|
|
27
18
|
self._dateFormatter = ISO8601DateFormatter()
|
|
@@ -344,6 +335,30 @@ class ReactNativeHealthkit: RCTEventEmitter {
|
|
|
344
335
|
}
|
|
345
336
|
}
|
|
346
337
|
|
|
338
|
+
@objc(deleteWorkoutSample:resolve:reject:)
|
|
339
|
+
func deleteWorkoutSample(
|
|
340
|
+
uuid: String,
|
|
341
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
342
|
+
reject: @escaping RCTPromiseRejectBlock
|
|
343
|
+
) {
|
|
344
|
+
guard let store = _store else {
|
|
345
|
+
return reject(INIT_ERROR, INIT_ERROR_MESSAGE, nil)
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
guard let workoutUUID = UUID.init(uuidString: uuid) else {
|
|
349
|
+
return reject(TYPE_IDENTIFIER_ERROR, "Failed to initialize UUID from string", nil)
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
let samplePredicate = HKQuery.predicateForObject(with: workoutUUID)
|
|
353
|
+
|
|
354
|
+
store.deleteObjects(of: HKObjectType.workoutType(), predicate: samplePredicate) { (success: Bool, _: Int, error: Error?) in
|
|
355
|
+
guard let err = error else {
|
|
356
|
+
return resolve(success)
|
|
357
|
+
}
|
|
358
|
+
reject(GENERIC_ERROR, err.localizedDescription, error)
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
|
|
347
362
|
@objc(saveCorrelationSample:samples:start:end:metadata:resolve:reject:)
|
|
348
363
|
func saveCorrelationSample(
|
|
349
364
|
typeIdentifier: String,
|
|
@@ -840,7 +855,7 @@ class ReactNativeHealthkit: RCTEventEmitter {
|
|
|
840
855
|
) {
|
|
841
856
|
if error == nil {
|
|
842
857
|
DispatchQueue.main.async {
|
|
843
|
-
if self.
|
|
858
|
+
if self._hasListeners {
|
|
844
859
|
self.sendEvent(
|
|
845
860
|
withName: "onChange",
|
|
846
861
|
body: [
|
|
@@ -2314,113 +2329,5 @@ class ReactNativeHealthkit: RCTEventEmitter {
|
|
|
2314
2329
|
resolve(success)
|
|
2315
2330
|
}
|
|
2316
2331
|
}
|
|
2317
|
-
|
|
2318
|
-
@available(iOS 17.0.0, *)
|
|
2319
|
-
@objc(workoutSessionMirroringStartHandler:reject:)
|
|
2320
|
-
func workoutSessionMirroringStartHandler(
|
|
2321
|
-
resolve: @escaping RCTPromiseResolveBlock,
|
|
2322
|
-
reject: @escaping RCTPromiseRejectBlock
|
|
2323
|
-
) {
|
|
2324
|
-
guard let store = _store else {
|
|
2325
|
-
return reject(INIT_ERROR, INIT_ERROR_MESSAGE, nil)
|
|
2326
|
-
}
|
|
2327
|
-
|
|
2328
|
-
store.workoutSessionMirroringStartHandler = { [weak self] mirroringSession in
|
|
2329
|
-
self?._workoutSession = mirroringSession
|
|
2330
|
-
self?._workoutSession?.delegate = self
|
|
2331
|
-
}
|
|
2332
|
-
|
|
2333
|
-
resolve(true)
|
|
2334
|
-
}
|
|
2335
|
-
|
|
2336
2332
|
}
|
|
2337
2333
|
|
|
2338
|
-
// MARK: - HKWorkoutSessionDelegate
|
|
2339
|
-
|
|
2340
|
-
extension ReactNativeHealthkit: HKWorkoutSessionDelegate {
|
|
2341
|
-
|
|
2342
|
-
@available(iOS 17.0.0, *)
|
|
2343
|
-
func workoutSession(
|
|
2344
|
-
_ workoutSession: HKWorkoutSession,
|
|
2345
|
-
didChangeTo toState: HKWorkoutSessionState,
|
|
2346
|
-
from fromState: HKWorkoutSessionState,
|
|
2347
|
-
date: Date
|
|
2348
|
-
) {
|
|
2349
|
-
Task { @MainActor [weak self] in
|
|
2350
|
-
guard let self = self else { return }
|
|
2351
|
-
|
|
2352
|
-
if self.bridge != nil && self.bridge.isValid {
|
|
2353
|
-
self.sendEvent(withName: "onRemoteWorkoutStateChange", body: [
|
|
2354
|
-
"toState": toState.rawValue,
|
|
2355
|
-
"fromState": fromState.rawValue,
|
|
2356
|
-
"date": self._dateFormatter.string(from: date)
|
|
2357
|
-
])
|
|
2358
|
-
}
|
|
2359
|
-
}
|
|
2360
|
-
}
|
|
2361
|
-
|
|
2362
|
-
@available(iOS 17.0.0, *)
|
|
2363
|
-
func workoutSession(_ workoutSession: HKWorkoutSession, didFailWithError error: any Error) {
|
|
2364
|
-
Task { @MainActor [weak self] in
|
|
2365
|
-
guard let self = self else { return }
|
|
2366
|
-
|
|
2367
|
-
if self.bridge != nil && self.bridge.isValid {
|
|
2368
|
-
self.sendEvent(
|
|
2369
|
-
withName: "onRemoteWorkoutError",
|
|
2370
|
-
body: ["error": error.localizedDescription]
|
|
2371
|
-
)
|
|
2372
|
-
}
|
|
2373
|
-
}
|
|
2374
|
-
}
|
|
2375
|
-
|
|
2376
|
-
@available(iOS 17.0.0, *)
|
|
2377
|
-
func workoutSession(
|
|
2378
|
-
_ workoutSession: HKWorkoutSession,
|
|
2379
|
-
didReceiveDataFromRemoteWorkoutSession data: [Data]
|
|
2380
|
-
) {
|
|
2381
|
-
Task { [weak self] in
|
|
2382
|
-
guard let self = self else { return }
|
|
2383
|
-
|
|
2384
|
-
do {
|
|
2385
|
-
let serializedData = try data.compactMap { dataItem -> [String: Any]? in
|
|
2386
|
-
guard let json = try? JSONSerialization.jsonObject(with: dataItem) as? [String: Any] else {
|
|
2387
|
-
return nil
|
|
2388
|
-
}
|
|
2389
|
-
return json
|
|
2390
|
-
}
|
|
2391
|
-
|
|
2392
|
-
await MainActor.run { [weak self] in
|
|
2393
|
-
guard let self = self else { return }
|
|
2394
|
-
|
|
2395
|
-
if let bridge = self.bridge, bridge.isValid {
|
|
2396
|
-
self.sendEvent(
|
|
2397
|
-
withName: "onRemoteWorkoutDataReceived",
|
|
2398
|
-
body: ["data": serializedData]
|
|
2399
|
-
)
|
|
2400
|
-
}
|
|
2401
|
-
}
|
|
2402
|
-
} catch {
|
|
2403
|
-
await MainActor.run { [weak self] in
|
|
2404
|
-
guard let self = self else { return }
|
|
2405
|
-
|
|
2406
|
-
if self.bridge != nil && self.bridge.isValid {
|
|
2407
|
-
self.sendEvent(
|
|
2408
|
-
withName: "onRemoteWorkoutError",
|
|
2409
|
-
body: ["error": error.localizedDescription]
|
|
2410
|
-
)
|
|
2411
|
-
}
|
|
2412
|
-
}
|
|
2413
|
-
}
|
|
2414
|
-
}
|
|
2415
|
-
}
|
|
2416
|
-
|
|
2417
|
-
@available(iOS 17.0, *)
|
|
2418
|
-
func workoutSession(_ workoutSession: HKWorkoutSession, didGenerate event: HKWorkoutEvent) {
|
|
2419
|
-
if self.bridge != nil && self.bridge.isValid {
|
|
2420
|
-
self.sendEvent(
|
|
2421
|
-
withName: "onRemoteWorkoutEventReceived",
|
|
2422
|
-
body: ["type": event.type.rawValue]
|
|
2423
|
-
)
|
|
2424
|
-
}
|
|
2425
|
-
}
|
|
2426
|
-
}
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
var _reactNative = require("@testing-library/react-native");
|
|
4
4
|
var _testUtils = _interopRequireDefault(require("../test-utils"));
|
|
5
5
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
6
|
-
function
|
|
7
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
6
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
8
7
|
describe('useHealthkitAuthorization', () => {
|
|
9
8
|
let NativeTypes;
|
|
10
9
|
let useHealthkitAuthorization;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_testUtils","_interopRequireDefault","e","__esModule","default","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_testUtils","_interopRequireDefault","e","__esModule","default","_interopRequireWildcard","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","describe","NativeTypes","useHealthkitAuthorization","beforeAll","Promise","resolve","then","test","HKAuthorizationRequestStatus","HKCategoryTypeIdentifier","Native","jest","spyOn","mockReturnValue","shouldRequest","result","renderHook","abdominalCramps","waitForNextUpdate","expect","current","toBe","spy","unnecessary","retVal","act"],"sources":["useHealthkitAuthorization.test.ts"],"sourcesContent":["import { renderHook, act } from '@testing-library/react-native'\n\nimport waitForNextUpdate from '../test-utils'\n\ndescribe('useHealthkitAuthorization', () => {\n let NativeTypes: typeof import('../native-types')\n let useHealthkitAuthorization: typeof import('./useHealthkitAuthorization').default\n beforeAll(async () => {\n NativeTypes = await import('../native-types')\n useHealthkitAuthorization = (await import('./useHealthkitAuthorization')).default\n })\n\n test('should return shouldRequest', async () => {\n const { HKAuthorizationRequestStatus, HKCategoryTypeIdentifier, default: Native } = NativeTypes\n\n jest.spyOn(Native, 'getRequestStatusForAuthorization').mockReturnValue(Promise.resolve(HKAuthorizationRequestStatus.shouldRequest))\n\n const { result } = renderHook(() => useHealthkitAuthorization([HKCategoryTypeIdentifier.abdominalCramps]))\n\n await waitForNextUpdate()\n\n expect(result.current[0]).toBe(HKAuthorizationRequestStatus.shouldRequest)\n })\n\n test('should request permissions', async () => {\n const { HKAuthorizationRequestStatus, HKCategoryTypeIdentifier, default: Native } = NativeTypes\n\n const spy = jest.spyOn(Native, 'getRequestStatusForAuthorization').mockReturnValue(Promise.resolve(HKAuthorizationRequestStatus.shouldRequest))\n jest.spyOn(Native, 'requestAuthorization').mockReturnValue(Promise.resolve(true))\n\n const { result } = renderHook(() => useHealthkitAuthorization([HKCategoryTypeIdentifier.abdominalCramps]))\n\n await waitForNextUpdate()\n\n spy.mockReturnValue(Promise.resolve(HKAuthorizationRequestStatus.unnecessary))\n\n let retVal: typeof HKAuthorizationRequestStatus | undefined\n await act(async () => {\n const r = await result.current[1]() as unknown as typeof HKAuthorizationRequestStatus\n retVal = r\n })\n\n expect(result.current[0]).toBe(HKAuthorizationRequestStatus.unnecessary)\n expect(retVal).toBe(HKAuthorizationRequestStatus.unnecessary)\n })\n\n test('should return unnecessary', async () => {\n const { HKAuthorizationRequestStatus, HKCategoryTypeIdentifier, default: Native } = NativeTypes\n\n jest.spyOn(Native, 'getRequestStatusForAuthorization').mockReturnValue(Promise.resolve(HKAuthorizationRequestStatus.unnecessary))\n\n const { result } = renderHook(() => useHealthkitAuthorization([HKCategoryTypeIdentifier.abdominalCramps]))\n\n await waitForNextUpdate()\n\n expect(result.current[0]).toBe(HKAuthorizationRequestStatus.unnecessary)\n })\n\n test('should return null before initalizing', async () => {\n const { HKCategoryTypeIdentifier } = NativeTypes\n\n const { result } = renderHook(() => useHealthkitAuthorization([HKCategoryTypeIdentifier.abdominalCramps]))\n\n expect(result.current[0]).toBe(null)\n\n await waitForNextUpdate()\n })\n})\n"],"mappings":";;AAAA,IAAAA,YAAA,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,uCAAuC,EAAE,YAAY;IACxD,MAAM;MAAEE;IAAyB,CAAC,GAAGR,WAAW;IAEhD,MAAM;MAAEc;IAAO,CAAC,GAAG,IAAAC,uBAAU,EAAC,MAAMd,yBAAyB,CAAC,CAACO,wBAAwB,CAACQ,eAAe,CAAC,CAAC,CAAC;IAE1GE,MAAM,CAACJ,MAAM,CAACK,OAAO,CAAC,CAAC,CAAC,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC;IAEpC,MAAM,IAAAH,kBAAiB,EAAC,CAAC;EAC3B,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
var _reactNative = require("@testing-library/react-native");
|
|
4
4
|
var _testUtils = _interopRequireDefault(require("../test-utils"));
|
|
5
5
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
6
|
-
function
|
|
7
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
6
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
8
7
|
describe('useIsHealthDataAvailable', () => {
|
|
9
8
|
test('should return false', async () => {
|
|
10
9
|
const useIsHealthDataAvailable = (await Promise.resolve().then(() => _interopRequireWildcard(require('./useIsHealthDataAvailable')))).default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_testUtils","_interopRequireDefault","e","__esModule","default","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_testUtils","_interopRequireDefault","e","__esModule","default","_interopRequireWildcard","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","describe","test","useIsHealthDataAvailable","Promise","resolve","then","Native","jest","spyOn","mockReturnValue","result","renderHook","waitForNextUpdate","expect","current","toBe"],"sources":["useIsHealthDataAvailable.test.ts"],"sourcesContent":["import { renderHook } from '@testing-library/react-native'\n\nimport waitForNextUpdate from '../test-utils'\n\ndescribe('useIsHealthDataAvailable', () => {\n test('should return false', async () => {\n const useIsHealthDataAvailable = (await import('./useIsHealthDataAvailable')).default\n const { default: Native } = await import('../native-types')\n jest.spyOn(Native, 'isHealthDataAvailable').mockReturnValue(Promise.resolve(false))\n\n const { result } = renderHook(useIsHealthDataAvailable)\n\n await waitForNextUpdate()\n\n expect(result.current).toBe(false)\n })\n\n test('should return true', async () => {\n const useIsHealthDataAvailable = (await import('./useIsHealthDataAvailable')).default\n const { default: Native } = await import('../native-types')\n jest.spyOn(Native, 'isHealthDataAvailable').mockReturnValue(Promise.resolve(true))\n\n const { result } = renderHook(useIsHealthDataAvailable)\n\n await waitForNextUpdate()\n\n expect(result.current).toBe(true)\n })\n\n test('should return null before initalizing', async () => {\n const useIsHealthDataAvailable = (await import('./useIsHealthDataAvailable')).default\n const { result } = renderHook(useIsHealthDataAvailable)\n\n expect(result.current).toBe(null)\n\n await waitForNextUpdate()\n })\n})\n"],"mappings":";;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,UAAA,G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xD,MAAMC,wBAAwB,GAAG,CAAC,MAAAC,OAAA,CAAAC,OAAA,GAAAC,IAAA,OAAAtB,uBAAA,CAAAN,OAAA,CAAa,4BAA4B,GAAC,EAAEK,OAAO;IACrF,MAAM;MAAE4B;IAAO,CAAC,GAAG,IAAAC,uBAAU,EAACT,wBAAwB,CAAC;IAEvDW,MAAM,CAACH,MAAM,CAACI,OAAO,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC;IAEjC,MAAM,IAAAH,kBAAiB,EAAC,CAAC;EAC3B,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -27,6 +27,7 @@ var _exportNames = {
|
|
|
27
27
|
useSubscribeToChanges: true,
|
|
28
28
|
deleteQuantitySample: true,
|
|
29
29
|
deleteSamples: true,
|
|
30
|
+
deleteWorkoutSample: true,
|
|
30
31
|
getDateOfBirth: true,
|
|
31
32
|
getMostRecentCategorySample: true,
|
|
32
33
|
getMostRecentQuantitySample: true,
|
|
@@ -56,8 +57,7 @@ var _exportNames = {
|
|
|
56
57
|
saveWorkoutRoute: true,
|
|
57
58
|
saveWorkoutSample: true,
|
|
58
59
|
startWatchApp: true,
|
|
59
|
-
subscribeToChanges: true
|
|
60
|
-
workoutSessionMirroringStartHandler: true
|
|
60
|
+
subscribeToChanges: true
|
|
61
61
|
};
|
|
62
62
|
exports.default = exports.availableQuantityTypes = exports.authorizationStatusFor = void 0;
|
|
63
63
|
Object.defineProperty(exports, "deleteQuantitySample", {
|
|
@@ -72,6 +72,12 @@ Object.defineProperty(exports, "deleteSamples", {
|
|
|
72
72
|
return _deleteSamples.default;
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
|
+
Object.defineProperty(exports, "deleteWorkoutSample", {
|
|
76
|
+
enumerable: true,
|
|
77
|
+
get: function () {
|
|
78
|
+
return _deleteWorkoutSample.default;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
75
81
|
exports.getBloodType = exports.getBiologicalSex = exports.enableBackgroundDelivery = exports.disableBackgroundDelivery = exports.disableAllBackgroundDelivery = void 0;
|
|
76
82
|
Object.defineProperty(exports, "getDateOfBirth", {
|
|
77
83
|
enumerable: true,
|
|
@@ -305,12 +311,6 @@ Object.defineProperty(exports, "useSubscribeToChanges", {
|
|
|
305
311
|
return _useSubscribeToChanges.default;
|
|
306
312
|
}
|
|
307
313
|
});
|
|
308
|
-
Object.defineProperty(exports, "workoutSessionMirroringStartHandler", {
|
|
309
|
-
enumerable: true,
|
|
310
|
-
get: function () {
|
|
311
|
-
return _workoutSessionMirroringStartHandler.default;
|
|
312
|
-
}
|
|
313
|
-
});
|
|
314
314
|
var _reactNative = require("react-native");
|
|
315
315
|
var _useHealthkitAuthorization = _interopRequireDefault(require("./hooks/useHealthkitAuthorization"));
|
|
316
316
|
var _useIsHealthDataAvailable = _interopRequireDefault(require("./hooks/useIsHealthDataAvailable"));
|
|
@@ -323,6 +323,7 @@ var _useSubscribeToChanges = _interopRequireDefault(require("./hooks/useSubscrib
|
|
|
323
323
|
var _nativeTypes = _interopRequireWildcard(require("./native-types"));
|
|
324
324
|
var _deleteQuantitySample = _interopRequireDefault(require("./utils/deleteQuantitySample"));
|
|
325
325
|
var _deleteSamples = _interopRequireDefault(require("./utils/deleteSamples"));
|
|
326
|
+
var _deleteWorkoutSample = _interopRequireDefault(require("./utils/deleteWorkoutSample"));
|
|
326
327
|
var _getDateOfBirth = _interopRequireDefault(require("./utils/getDateOfBirth"));
|
|
327
328
|
var _getMostRecentCategorySample = _interopRequireDefault(require("./utils/getMostRecentCategorySample"));
|
|
328
329
|
var _getMostRecentQuantitySample = _interopRequireDefault(require("./utils/getMostRecentQuantitySample"));
|
|
@@ -353,7 +354,6 @@ var _saveWorkoutRoute = _interopRequireDefault(require("./utils/saveWorkoutRoute
|
|
|
353
354
|
var _saveWorkoutSample = _interopRequireDefault(require("./utils/saveWorkoutSample"));
|
|
354
355
|
var _startWatchApp = _interopRequireDefault(require("./utils/startWatchApp"));
|
|
355
356
|
var _subscribeToChanges = _interopRequireDefault(require("./utils/subscribeToChanges"));
|
|
356
|
-
var _workoutSessionMirroringStartHandler = _interopRequireDefault(require("./utils/workoutSessionMirroringStartHandler"));
|
|
357
357
|
var _types = require("./types");
|
|
358
358
|
Object.keys(_types).forEach(function (key) {
|
|
359
359
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -366,8 +366,7 @@ Object.keys(_types).forEach(function (key) {
|
|
|
366
366
|
}
|
|
367
367
|
});
|
|
368
368
|
});
|
|
369
|
-
function
|
|
370
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
369
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
371
370
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
372
371
|
const currentMajorVersionIOS = _reactNative.Platform.OS === 'ios' ? parseInt(_reactNative.Platform.Version, 10) : 0;
|
|
373
372
|
const allQuantityTypesList = [...Object.values(_nativeTypes.HKQuantityTypeIdentifier)];
|
|
@@ -484,6 +483,7 @@ var _default = exports.default = {
|
|
|
484
483
|
// delete methods
|
|
485
484
|
deleteQuantitySample: _deleteQuantitySample.default,
|
|
486
485
|
deleteSamples: _deleteSamples.default,
|
|
486
|
+
deleteWorkoutSample: _deleteWorkoutSample.default,
|
|
487
487
|
// save methods
|
|
488
488
|
/**
|
|
489
489
|
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614168-savecategorysample save(_:withCompletion:) (Apple Docs)}
|
|
@@ -498,7 +498,6 @@ var _default = exports.default = {
|
|
|
498
498
|
// subscriptions
|
|
499
499
|
subscribeToChanges: _subscribeToChanges.default,
|
|
500
500
|
startWatchApp: _startWatchApp.default,
|
|
501
|
-
workoutSessionMirroringStartHandler: _workoutSessionMirroringStartHandler.default,
|
|
502
501
|
/**
|
|
503
502
|
* @returns the most recent sample for the given category type.
|
|
504
503
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_useHealthkitAuthorization","_interopRequireDefault","_useIsHealthDataAvailable","_useMostRecentCategorySample","_useMostRecentQuantitySample","_useMostRecentWorkout","_useSources","_useStatisticsForQuantity","_useSubscribeToChanges","_nativeTypes","_interopRequireWildcard","_deleteQuantitySample","_deleteSamples","_getDateOfBirth","_getMostRecentCategorySample","_getMostRecentQuantitySample","_getMostRecentWorkout","_getPreferredUnit","_getPreferredUnits","_getRequestStatusForAuthorization","_getWorkoutPlanById","_queryCategorySamples","_queryCategorySamplesWithAnchor","_queryCorrelationSamples","_queryHeartbeatSeriesSamples","_queryHeartbeatSeriesSamplesWithAnchor","_queryQuantitySamples","_queryQuantitySamplesWithAnchor","_querySources","_queryStateOfMindSamples","_queryStatisticsCollectionForQuantity","_queryStatisticsForQuantity","_queryWorkouts","_queryWorkoutSamplesWithAnchor","_requestAuthorization","_saveCategorySample","_saveCorrelationSample","_saveQuantitySample","_saveStateOfMindSample","_saveWorkoutRoute","_saveWorkoutSample","_startWatchApp","_subscribeToChanges","_workoutSessionMirroringStartHandler","_types","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","n","__proto__","a","getOwnPropertyDescriptor","u","i","set","currentMajorVersionIOS","Platform","OS","parseInt","Version","allQuantityTypesList","values","HKQuantityTypeIdentifier","availableQuantityTypes","majorVersionIOS","filter","type","cyclingCadence","cyclingFunctionalThresholdPower","cyclingPower","cyclingSpeed","physicalEffort","timeInDaylight","includes","authorizationStatusFor","Native","bind","isHealthDataAvailable","isProtectedDataAvailable","disableBackgroundDelivery","disableAllBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","getFitzpatrickSkinType","getWheelchairUse","getBloodType","getWorkoutRoutes","_default","getDateOfBirth","getMostRecentQuantitySample","getMostRecentCategorySample","getMostRecentWorkout","getWorkoutPlanById","getPreferredUnit","getPreferredUnits","getRequestStatusForAuthorization","queryCategorySamples","queryCategorySamplesWithAnchor","queryCorrelationSamples","queryHeartbeatSeriesSamples","queryHeartbeatSeriesSamplesWithAnchor","queryQuantitySamples","queryQuantitySamplesWithAnchor","queryStatisticsForQuantity","queryStatisticsCollectionForQuantity","queryWorkouts","queryWorkoutSamples","queryWorkoutSamplesWithAnchor","querySources","requestAuthorization","deleteQuantitySample","deleteSamples","saveCategorySample","saveCorrelationSample","saveQuantitySample","saveWorkoutSample","saveWorkoutRoute","saveStateOfMindSample","subscribeToChanges","startWatchApp","workoutSessionMirroringStartHandler","useMostRecentCategorySample","useMostRecentQuantitySample","useMostRecentWorkout","useSubscribeToChanges","useIsHealthDataAvailable","useHealthkitAuthorization","useSources","useStatisticsForQuantity","queryStateOfMindSamples"],"sources":["index.ios.tsx"],"sourcesContent":["import { Platform } from 'react-native'\n\nimport useHealthkitAuthorization from './hooks/useHealthkitAuthorization'\nimport useIsHealthDataAvailable from './hooks/useIsHealthDataAvailable'\nimport useMostRecentCategorySample from './hooks/useMostRecentCategorySample'\nimport useMostRecentQuantitySample from './hooks/useMostRecentQuantitySample'\nimport useMostRecentWorkout from './hooks/useMostRecentWorkout'\nimport useSources from './hooks/useSources'\nimport useStatisticsForQuantity from './hooks/useStatisticsForQuantity'\nimport useSubscribeToChanges from './hooks/useSubscribeToChanges'\nimport Native, { HKQuantityTypeIdentifier } from './native-types'\nimport deleteQuantitySample from './utils/deleteQuantitySample'\nimport deleteSamples from './utils/deleteSamples'\nimport getDateOfBirth from './utils/getDateOfBirth'\nimport getMostRecentCategorySample from './utils/getMostRecentCategorySample'\nimport getMostRecentQuantitySample from './utils/getMostRecentQuantitySample'\nimport getMostRecentWorkout from './utils/getMostRecentWorkout'\nimport getPreferredUnit from './utils/getPreferredUnit'\nimport getPreferredUnits from './utils/getPreferredUnits'\nimport getRequestStatusForAuthorization from './utils/getRequestStatusForAuthorization'\nimport getWorkoutPlanById from './utils/getWorkoutPlanById'\nimport queryCategorySamples from './utils/queryCategorySamples'\nimport queryCategorySamplesWithAnchor from './utils/queryCategorySamplesWithAnchor'\nimport queryCorrelationSamples from './utils/queryCorrelationSamples'\nimport queryHeartbeatSeriesSamples from './utils/queryHeartbeatSeriesSamples'\nimport queryHeartbeatSeriesSamplesWithAnchor from './utils/queryHeartbeatSeriesSamplesWithAnchor'\nimport queryQuantitySamples from './utils/queryQuantitySamples'\nimport queryQuantitySamplesWithAnchor from './utils/queryQuantitySamplesWithAnchor'\nimport querySources from './utils/querySources'\nimport { queryStateOfMindSamples } from './utils/queryStateOfMindSamples'\nimport queryStatisticsCollectionForQuantity from './utils/queryStatisticsCollectionForQuantity'\nimport queryStatisticsForQuantity from './utils/queryStatisticsForQuantity'\nimport queryWorkoutSamples from './utils/queryWorkouts'\nimport queryWorkoutSamplesWithAnchor from './utils/queryWorkoutSamplesWithAnchor'\nimport requestAuthorization from './utils/requestAuthorization'\nimport saveCategorySample from './utils/saveCategorySample'\nimport saveCorrelationSample from './utils/saveCorrelationSample'\nimport saveQuantitySample from './utils/saveQuantitySample'\nimport saveStateOfMindSample from './utils/saveStateOfMindSample'\nimport saveWorkoutRoute from './utils/saveWorkoutRoute'\nimport saveWorkoutSample from './utils/saveWorkoutSample'\nimport startWatchApp from './utils/startWatchApp'\nimport subscribeToChanges from './utils/subscribeToChanges'\nimport workoutSessionMirroringStartHandler from './utils/workoutSessionMirroringStartHandler'\n\nconst currentMajorVersionIOS = Platform.OS === 'ios' ? parseInt(Platform.Version, 10) : 0\n\nconst allQuantityTypesList = [...Object.values(HKQuantityTypeIdentifier)]\n\nconst availableQuantityTypes = (majorVersionIOS = currentMajorVersionIOS) => {\n if (majorVersionIOS >= 17) {\n return allQuantityTypesList\n }\n\n // remove types that are not available before iOS 17\n return allQuantityTypesList.filter((type) => ![\n HKQuantityTypeIdentifier.cyclingCadence,\n HKQuantityTypeIdentifier.cyclingFunctionalThresholdPower,\n HKQuantityTypeIdentifier.cyclingPower,\n HKQuantityTypeIdentifier.cyclingSpeed,\n HKQuantityTypeIdentifier.physicalEffort,\n HKQuantityTypeIdentifier.timeInDaylight,\n ].includes(type))\n}\n\nconst authorizationStatusFor = Native.authorizationStatusFor.bind(Native)\nconst isHealthDataAvailable = Native.isHealthDataAvailable.bind(Native)\nconst isProtectedDataAvailable = Native.isProtectedDataAvailable.bind(Native)\nconst disableBackgroundDelivery = Native.disableBackgroundDelivery.bind(Native)\nconst disableAllBackgroundDelivery = Native.disableAllBackgroundDelivery.bind(Native)\nconst enableBackgroundDelivery = Native.enableBackgroundDelivery.bind(Native)\nconst getBiologicalSex = Native.getBiologicalSex.bind(Native)\nconst getFitzpatrickSkinType = Native.getFitzpatrickSkinType.bind(Native)\nconst getWheelchairUse = Native.getWheelchairUse.bind(Native)\nconst getBloodType = Native.getBloodType.bind(Native)\nconst getWorkoutRoutes = Native.getWorkoutRoutes.bind(Native)\n\n/**\n * @see {@link https://developer.apple.com/documentation/healthkit/about_the_healthkit_framework About the HealthKit Framework (Apple Docs)}\n */\nexport default {\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614154-authorizationstatus authorizationStatus(for:) (Apple Docs) }\n * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Authorizing access to health data (Apple Docs) }\n */\n authorizationStatusFor,\n\n /**\n *\n * @returns All available quantity types for the current iOS version (currently excluding types that are not available before iOS 17)\n */\n availableQuantityTypes,\n\n /**\n * @description By default, HealthKit data is available on iOS and watchOS. HealthKit data is also available on iPadOS 17 or later. However, devices running in an enterprise environment may restrict access to HealthKit data.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable isHealthDataAvailable() (Apple Docs)}\n * @returns {boolean} true if HealthKit is available; otherwise, false.\n */\n isHealthDataAvailable,\n\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614181-isprotecteddataavailable isProtectedDataAvailable() (Apple Docs)}\n * @see {@link https://developer.apple.com/documentation/healthkit/protecting_user_privacy#3705074 Protecting User Privacy - Access encrypted data (Apple Docs)}\n * @returns {boolean} A Boolean value that indicates whether content protection is active.\n */\n isProtectedDataAvailable,\n\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614158-disableallbackgrounddelivery disableAllBackgroundDelivery(completion:) (Apple Docs)}\n */\n disableAllBackgroundDelivery,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614177-disablebackgrounddelivery disableBackgroundDelivery(for:withCompletion:) (Apple Docs)}\n */\n disableBackgroundDelivery,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614175-enablebackgrounddelivery enableBackgroundDelivery(for:frequency:withCompletion:) (Apple Docs)}\n */\n enableBackgroundDelivery,\n\n // simple convenience getters\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614171-biologicalsex biologicalSex() (Apple Docs)}\n */\n getBiologicalSex,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614161-fitzpatrickskintype fitzpatrickSkinType() (Apple Docs)}\n */\n getFitzpatrickSkinType,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648356-wheelchairuse wheelchairUse() (Apple Docs)}\n */\n getWheelchairUse,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614164-bloodtype bloodType() (Apple Docs)}\n */\n getBloodType,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648357-dateofbirthcomponents dateOfBirthComponents() (Apple Docs)}\n */\n getDateOfBirth,\n\n getMostRecentQuantitySample,\n getMostRecentCategorySample,\n getMostRecentWorkout,\n\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/workouts_and_activity_rings/reading_route_data Reading route data (Apple Docs)}\n * @see {@link https://developer.apple.com/documentation/healthkit/hkworkoutroutequery HKWorkoutRouteQuery (Apple Docs)}\n */\n getWorkoutRoutes,\n getWorkoutPlanById,\n\n getPreferredUnit,\n getPreferredUnits,\n getRequestStatusForAuthorization,\n\n // query methods\n queryCategorySamples,\n queryCategorySamplesWithAnchor,\n queryCorrelationSamples,\n queryHeartbeatSeriesSamples,\n queryHeartbeatSeriesSamplesWithAnchor,\n queryQuantitySamples,\n queryQuantitySamplesWithAnchor,\n queryStatisticsForQuantity,\n queryStatisticsCollectionForQuantity,\n /**\n * @deprecated Use queryWorkoutSamples instead\n */\n queryWorkouts: queryWorkoutSamples,\n queryWorkoutSamples,\n queryWorkoutSamplesWithAnchor,\n querySources,\n\n requestAuthorization,\n\n // delete methods\n deleteQuantitySample,\n deleteSamples,\n\n // save methods\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614168-savecategorysample save(_:withCompletion:) (Apple Docs)}\n * @see {@link https://developer.apple.com/documentation/healthkit/saving_data_to_healthkit Saving data to HealthKit (Apple Docs)}\n */\n saveCategorySample,\n saveCorrelationSample,\n saveQuantitySample,\n saveWorkoutSample,\n saveWorkoutRoute,\n saveStateOfMindSample,\n\n // subscriptions\n subscribeToChanges,\n\n startWatchApp,\n workoutSessionMirroringStartHandler,\n\n /**\n * @returns the most recent sample for the given category type.\n */\n useMostRecentCategorySample,\n /**\n * @returns the most recent sample for the given quantity type.\n */\n useMostRecentQuantitySample,\n /**\n * @returns the most recent workout sample.\n */\n useMostRecentWorkout,\n useSubscribeToChanges,\n /**\n * @description By default, HealthKit data is available on iOS and watchOS. HealthKit data is also available on iPadOS 17 or later. However, devices running in an enterprise environment may restrict access to HealthKit data.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable Apple Docs}\n * @returns {boolean | null} true if HealthKit is available; otherwise, false. null while initializing.\n */\n useIsHealthDataAvailable,\n /**\n * @description Hook to retrieve the current authorization status for the given types, and request authorization if needed.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614152-requestauthorization Apple Docs - requestAuthorization}\n * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Apple Docs - Authorizing access to health data}\n */\n useHealthkitAuthorization,\n useSources,\n useStatisticsForQuantity,\n queryStateOfMindSamples,\n}\n\nconst queryWorkouts = queryWorkoutSamples\n\nexport {\n authorizationStatusFor,\n availableQuantityTypes,\n disableAllBackgroundDelivery,\n disableBackgroundDelivery,\n enableBackgroundDelivery,\n getBiologicalSex,\n getBloodType,\n getDateOfBirth,\n getFitzpatrickSkinType,\n getMostRecentCategorySample,\n getMostRecentQuantitySample,\n getMostRecentWorkout,\n getPreferredUnit,\n getPreferredUnits,\n getRequestStatusForAuthorization,\n getWheelchairUse,\n getWorkoutRoutes,\n isHealthDataAvailable,\n queryCategorySamples,\n queryCategorySamplesWithAnchor,\n queryCorrelationSamples,\n queryHeartbeatSeriesSamples,\n queryHeartbeatSeriesSamplesWithAnchor,\n queryQuantitySamples,\n queryQuantitySamplesWithAnchor,\n queryStatisticsForQuantity,\n queryStatisticsCollectionForQuantity,\n /**\n * @deprecated Use queryWorkoutSamples instead\n */\n queryWorkouts,\n queryWorkoutSamples,\n queryWorkoutSamplesWithAnchor,\n querySources,\n requestAuthorization,\n deleteQuantitySample,\n deleteSamples,\n getWorkoutPlanById,\n saveCategorySample,\n saveStateOfMindSample,\n saveCorrelationSample,\n saveQuantitySample,\n saveWorkoutSample,\n saveWorkoutRoute,\n subscribeToChanges,\n startWatchApp,\n workoutSessionMirroringStartHandler,\n useMostRecentCategorySample,\n useMostRecentQuantitySample,\n useMostRecentWorkout,\n useSubscribeToChanges,\n useHealthkitAuthorization,\n useIsHealthDataAvailable,\n useSources,\n useStatisticsForQuantity,\n isProtectedDataAvailable,\n queryStateOfMindSamples,\n}\n\nexport * from './types'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,0BAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,yBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,4BAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,4BAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,qBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,WAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,yBAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,sBAAA,GAAAP,sBAAA,CAAAF,OAAA;AACA,IAAAU,YAAA,GAAAC,uBAAA,CAAAX,OAAA;AACA,IAAAY,qBAAA,GAAAV,sBAAA,CAAAF,OAAA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ACpC;AACF;AACA;EACEC,aAAa,EAAEC,sBAAmB;EAClCA,mBAAmB,EAAnBA,sBAAmB;EACnBC,6BAA6B,EAA7BA,sCAA6B;EAC7BC,YAAY,EAAZA,qBAAY;EAEZC,oBAAoB,EAApBA,6BAAoB;EAEpB;EACAC,oBAAoB,EAApBA,6BAAoB;EACpBC,aAAa,EAAbA,sBAAa;EAEb;EACA;AACF;AACA;AACA;EACEC,kBAAkB,EAAlBA,2BAAkB;EAClBC,qBAAqB,EAArBA,8BAAqB;EACrBC,kBAAkB,EAAlBA,2BAAkB;EAClBC,iBAAiB,EAAjBA,0BAAiB;EACjBC,gBAAgB,EAAhBA,yBAAgB;EAChBC,qBAAqB,EAArBA,8BAAqB;EAErB;EACAC,kBAAkB,EAAlBA,2BAAkB;EAElBC,aAAa,EAAbA,sBAAa;EACbC,mCAAmC,EAAnCA,4CAAmC;EAEnC;AACF;AACA;EACEC,2BAA2B,EAA3BA,oCAA2B;EAC3B;AACF;AACA;EACEC,2BAA2B,EAA3BA,oCAA2B;EAC3B;AACF;AACA;EACEC,oBAAoB,EAApBA,6BAAoB;EACpBC,qBAAqB,EAArBA,8BAAqB;EACrB;AACF;AACA;AACA;AACA;EACEC,wBAAwB,EAAxBA,iCAAwB;EACxB;AACF;AACA;AACA;AACA;EACEC,yBAAyB,EAAzBA,kCAAyB;EACzBC,UAAU,EAAVA,mBAAU;EACVC,wBAAwB,EAAxBA,iCAAwB;EACxBC,uBAAuB,EAAvBA;AACF,CAAC;AAED,MAAMxB,aAAa,GAAArE,OAAA,CAAAqE,aAAA,GAAGC,sBAAmB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_useHealthkitAuthorization","_interopRequireDefault","_useIsHealthDataAvailable","_useMostRecentCategorySample","_useMostRecentQuantitySample","_useMostRecentWorkout","_useSources","_useStatisticsForQuantity","_useSubscribeToChanges","_nativeTypes","_interopRequireWildcard","_deleteQuantitySample","_deleteSamples","_deleteWorkoutSample","_getDateOfBirth","_getMostRecentCategorySample","_getMostRecentQuantitySample","_getMostRecentWorkout","_getPreferredUnit","_getPreferredUnits","_getRequestStatusForAuthorization","_getWorkoutPlanById","_queryCategorySamples","_queryCategorySamplesWithAnchor","_queryCorrelationSamples","_queryHeartbeatSeriesSamples","_queryHeartbeatSeriesSamplesWithAnchor","_queryQuantitySamples","_queryQuantitySamplesWithAnchor","_querySources","_queryStateOfMindSamples","_queryStatisticsCollectionForQuantity","_queryStatisticsForQuantity","_queryWorkouts","_queryWorkoutSamplesWithAnchor","_requestAuthorization","_saveCategorySample","_saveCorrelationSample","_saveQuantitySample","_saveStateOfMindSample","_saveWorkoutRoute","_saveWorkoutSample","_startWatchApp","_subscribeToChanges","_types","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","set","getOwnPropertyDescriptor","currentMajorVersionIOS","Platform","OS","parseInt","Version","allQuantityTypesList","values","HKQuantityTypeIdentifier","availableQuantityTypes","majorVersionIOS","filter","type","cyclingCadence","cyclingFunctionalThresholdPower","cyclingPower","cyclingSpeed","physicalEffort","timeInDaylight","includes","authorizationStatusFor","Native","bind","isHealthDataAvailable","isProtectedDataAvailable","disableBackgroundDelivery","disableAllBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","getFitzpatrickSkinType","getWheelchairUse","getBloodType","getWorkoutRoutes","_default","getDateOfBirth","getMostRecentQuantitySample","getMostRecentCategorySample","getMostRecentWorkout","getWorkoutPlanById","getPreferredUnit","getPreferredUnits","getRequestStatusForAuthorization","queryCategorySamples","queryCategorySamplesWithAnchor","queryCorrelationSamples","queryHeartbeatSeriesSamples","queryHeartbeatSeriesSamplesWithAnchor","queryQuantitySamples","queryQuantitySamplesWithAnchor","queryStatisticsForQuantity","queryStatisticsCollectionForQuantity","queryWorkouts","queryWorkoutSamples","queryWorkoutSamplesWithAnchor","querySources","requestAuthorization","deleteQuantitySample","deleteSamples","deleteWorkoutSample","saveCategorySample","saveCorrelationSample","saveQuantitySample","saveWorkoutSample","saveWorkoutRoute","saveStateOfMindSample","subscribeToChanges","startWatchApp","useMostRecentCategorySample","useMostRecentQuantitySample","useMostRecentWorkout","useSubscribeToChanges","useIsHealthDataAvailable","useHealthkitAuthorization","useSources","useStatisticsForQuantity","queryStateOfMindSamples"],"sources":["index.ios.tsx"],"sourcesContent":["import { Platform } from 'react-native'\n\nimport useHealthkitAuthorization from './hooks/useHealthkitAuthorization'\nimport useIsHealthDataAvailable from './hooks/useIsHealthDataAvailable'\nimport useMostRecentCategorySample from './hooks/useMostRecentCategorySample'\nimport useMostRecentQuantitySample from './hooks/useMostRecentQuantitySample'\nimport useMostRecentWorkout from './hooks/useMostRecentWorkout'\nimport useSources from './hooks/useSources'\nimport useStatisticsForQuantity from './hooks/useStatisticsForQuantity'\nimport useSubscribeToChanges from './hooks/useSubscribeToChanges'\nimport Native, { HKQuantityTypeIdentifier } from './native-types'\nimport deleteQuantitySample from './utils/deleteQuantitySample'\nimport deleteSamples from './utils/deleteSamples'\nimport deleteWorkoutSample from './utils/deleteWorkoutSample'\nimport getDateOfBirth from './utils/getDateOfBirth'\nimport getMostRecentCategorySample from './utils/getMostRecentCategorySample'\nimport getMostRecentQuantitySample from './utils/getMostRecentQuantitySample'\nimport getMostRecentWorkout from './utils/getMostRecentWorkout'\nimport getPreferredUnit from './utils/getPreferredUnit'\nimport getPreferredUnits from './utils/getPreferredUnits'\nimport getRequestStatusForAuthorization from './utils/getRequestStatusForAuthorization'\nimport getWorkoutPlanById from './utils/getWorkoutPlanById'\nimport queryCategorySamples from './utils/queryCategorySamples'\nimport queryCategorySamplesWithAnchor from './utils/queryCategorySamplesWithAnchor'\nimport queryCorrelationSamples from './utils/queryCorrelationSamples'\nimport queryHeartbeatSeriesSamples from './utils/queryHeartbeatSeriesSamples'\nimport queryHeartbeatSeriesSamplesWithAnchor from './utils/queryHeartbeatSeriesSamplesWithAnchor'\nimport queryQuantitySamples from './utils/queryQuantitySamples'\nimport queryQuantitySamplesWithAnchor from './utils/queryQuantitySamplesWithAnchor'\nimport querySources from './utils/querySources'\nimport { queryStateOfMindSamples } from './utils/queryStateOfMindSamples'\nimport queryStatisticsCollectionForQuantity from './utils/queryStatisticsCollectionForQuantity'\nimport queryStatisticsForQuantity from './utils/queryStatisticsForQuantity'\nimport queryWorkoutSamples from './utils/queryWorkouts'\nimport queryWorkoutSamplesWithAnchor from './utils/queryWorkoutSamplesWithAnchor'\nimport requestAuthorization from './utils/requestAuthorization'\nimport saveCategorySample from './utils/saveCategorySample'\nimport saveCorrelationSample from './utils/saveCorrelationSample'\nimport saveQuantitySample from './utils/saveQuantitySample'\nimport saveStateOfMindSample from './utils/saveStateOfMindSample'\nimport saveWorkoutRoute from './utils/saveWorkoutRoute'\nimport saveWorkoutSample from './utils/saveWorkoutSample'\nimport startWatchApp from './utils/startWatchApp'\nimport subscribeToChanges from './utils/subscribeToChanges'\n\nconst currentMajorVersionIOS = Platform.OS === 'ios' ? parseInt(Platform.Version, 10) : 0\n\nconst allQuantityTypesList = [...Object.values(HKQuantityTypeIdentifier)]\n\nconst availableQuantityTypes = (majorVersionIOS = currentMajorVersionIOS) => {\n if (majorVersionIOS >= 17) {\n return allQuantityTypesList\n }\n\n // remove types that are not available before iOS 17\n return allQuantityTypesList.filter((type) => ![\n HKQuantityTypeIdentifier.cyclingCadence,\n HKQuantityTypeIdentifier.cyclingFunctionalThresholdPower,\n HKQuantityTypeIdentifier.cyclingPower,\n HKQuantityTypeIdentifier.cyclingSpeed,\n HKQuantityTypeIdentifier.physicalEffort,\n HKQuantityTypeIdentifier.timeInDaylight,\n ].includes(type))\n}\n\nconst authorizationStatusFor = Native.authorizationStatusFor.bind(Native)\nconst isHealthDataAvailable = Native.isHealthDataAvailable.bind(Native)\nconst isProtectedDataAvailable = Native.isProtectedDataAvailable.bind(Native)\nconst disableBackgroundDelivery = Native.disableBackgroundDelivery.bind(Native)\nconst disableAllBackgroundDelivery = Native.disableAllBackgroundDelivery.bind(Native)\nconst enableBackgroundDelivery = Native.enableBackgroundDelivery.bind(Native)\nconst getBiologicalSex = Native.getBiologicalSex.bind(Native)\nconst getFitzpatrickSkinType = Native.getFitzpatrickSkinType.bind(Native)\nconst getWheelchairUse = Native.getWheelchairUse.bind(Native)\nconst getBloodType = Native.getBloodType.bind(Native)\nconst getWorkoutRoutes = Native.getWorkoutRoutes.bind(Native)\n\n/**\n * @see {@link https://developer.apple.com/documentation/healthkit/about_the_healthkit_framework About the HealthKit Framework (Apple Docs)}\n */\nexport default {\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614154-authorizationstatus authorizationStatus(for:) (Apple Docs) }\n * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Authorizing access to health data (Apple Docs) }\n */\n authorizationStatusFor,\n\n /**\n *\n * @returns All available quantity types for the current iOS version (currently excluding types that are not available before iOS 17)\n */\n availableQuantityTypes,\n\n /**\n * @description By default, HealthKit data is available on iOS and watchOS. HealthKit data is also available on iPadOS 17 or later. However, devices running in an enterprise environment may restrict access to HealthKit data.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable isHealthDataAvailable() (Apple Docs)}\n * @returns {boolean} true if HealthKit is available; otherwise, false.\n */\n isHealthDataAvailable,\n\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614181-isprotecteddataavailable isProtectedDataAvailable() (Apple Docs)}\n * @see {@link https://developer.apple.com/documentation/healthkit/protecting_user_privacy#3705074 Protecting User Privacy - Access encrypted data (Apple Docs)}\n * @returns {boolean} A Boolean value that indicates whether content protection is active.\n */\n isProtectedDataAvailable,\n\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614158-disableallbackgrounddelivery disableAllBackgroundDelivery(completion:) (Apple Docs)}\n */\n disableAllBackgroundDelivery,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614177-disablebackgrounddelivery disableBackgroundDelivery(for:withCompletion:) (Apple Docs)}\n */\n disableBackgroundDelivery,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614175-enablebackgrounddelivery enableBackgroundDelivery(for:frequency:withCompletion:) (Apple Docs)}\n */\n enableBackgroundDelivery,\n\n // simple convenience getters\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614171-biologicalsex biologicalSex() (Apple Docs)}\n */\n getBiologicalSex,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614161-fitzpatrickskintype fitzpatrickSkinType() (Apple Docs)}\n */\n getFitzpatrickSkinType,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648356-wheelchairuse wheelchairUse() (Apple Docs)}\n */\n getWheelchairUse,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614164-bloodtype bloodType() (Apple Docs)}\n */\n getBloodType,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648357-dateofbirthcomponents dateOfBirthComponents() (Apple Docs)}\n */\n getDateOfBirth,\n\n getMostRecentQuantitySample,\n getMostRecentCategorySample,\n getMostRecentWorkout,\n\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/workouts_and_activity_rings/reading_route_data Reading route data (Apple Docs)}\n * @see {@link https://developer.apple.com/documentation/healthkit/hkworkoutroutequery HKWorkoutRouteQuery (Apple Docs)}\n */\n getWorkoutRoutes,\n getWorkoutPlanById,\n\n getPreferredUnit,\n getPreferredUnits,\n getRequestStatusForAuthorization,\n\n // query methods\n queryCategorySamples,\n queryCategorySamplesWithAnchor,\n queryCorrelationSamples,\n queryHeartbeatSeriesSamples,\n queryHeartbeatSeriesSamplesWithAnchor,\n queryQuantitySamples,\n queryQuantitySamplesWithAnchor,\n queryStatisticsForQuantity,\n queryStatisticsCollectionForQuantity,\n /**\n * @deprecated Use queryWorkoutSamples instead\n */\n queryWorkouts: queryWorkoutSamples,\n queryWorkoutSamples,\n queryWorkoutSamplesWithAnchor,\n querySources,\n\n requestAuthorization,\n\n // delete methods\n deleteQuantitySample,\n deleteSamples,\n deleteWorkoutSample,\n\n // save methods\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614168-savecategorysample save(_:withCompletion:) (Apple Docs)}\n * @see {@link https://developer.apple.com/documentation/healthkit/saving_data_to_healthkit Saving data to HealthKit (Apple Docs)}\n */\n saveCategorySample,\n saveCorrelationSample,\n saveQuantitySample,\n saveWorkoutSample,\n saveWorkoutRoute,\n saveStateOfMindSample,\n\n // subscriptions\n subscribeToChanges,\n\n startWatchApp,\n\n /**\n * @returns the most recent sample for the given category type.\n */\n useMostRecentCategorySample,\n /**\n * @returns the most recent sample for the given quantity type.\n */\n useMostRecentQuantitySample,\n /**\n * @returns the most recent workout sample.\n */\n useMostRecentWorkout,\n useSubscribeToChanges,\n /**\n * @description By default, HealthKit data is available on iOS and watchOS. HealthKit data is also available on iPadOS 17 or later. However, devices running in an enterprise environment may restrict access to HealthKit data.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable Apple Docs}\n * @returns {boolean | null} true if HealthKit is available; otherwise, false. null while initializing.\n */\n useIsHealthDataAvailable,\n /**\n * @description Hook to retrieve the current authorization status for the given types, and request authorization if needed.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614152-requestauthorization Apple Docs - requestAuthorization}\n * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Apple Docs - Authorizing access to health data}\n */\n useHealthkitAuthorization,\n useSources,\n useStatisticsForQuantity,\n queryStateOfMindSamples,\n}\n\nconst queryWorkouts = queryWorkoutSamples\n\nexport {\n authorizationStatusFor,\n availableQuantityTypes,\n disableAllBackgroundDelivery,\n disableBackgroundDelivery,\n enableBackgroundDelivery,\n getBiologicalSex,\n getBloodType,\n getDateOfBirth,\n getFitzpatrickSkinType,\n getMostRecentCategorySample,\n getMostRecentQuantitySample,\n getMostRecentWorkout,\n getPreferredUnit,\n getPreferredUnits,\n getRequestStatusForAuthorization,\n getWheelchairUse,\n getWorkoutRoutes,\n isHealthDataAvailable,\n queryCategorySamples,\n queryCategorySamplesWithAnchor,\n queryCorrelationSamples,\n queryHeartbeatSeriesSamples,\n queryHeartbeatSeriesSamplesWithAnchor,\n queryQuantitySamples,\n queryQuantitySamplesWithAnchor,\n queryStatisticsForQuantity,\n queryStatisticsCollectionForQuantity,\n /**\n * @deprecated Use queryWorkoutSamples instead\n */\n queryWorkouts,\n queryWorkoutSamples,\n queryWorkoutSamplesWithAnchor,\n querySources,\n requestAuthorization,\n deleteQuantitySample,\n deleteSamples,\n deleteWorkoutSample,\n getWorkoutPlanById,\n saveCategorySample,\n saveStateOfMindSample,\n saveCorrelationSample,\n saveQuantitySample,\n saveWorkoutSample,\n saveWorkoutRoute,\n subscribeToChanges,\n startWatchApp,\n useMostRecentCategorySample,\n useMostRecentQuantitySample,\n useMostRecentWorkout,\n useSubscribeToChanges,\n useHealthkitAuthorization,\n useIsHealthDataAvailable,\n useSources,\n useStatisticsForQuantity,\n isProtectedDataAvailable,\n queryStateOfMindSamples,\n}\n\nexport * from './types'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,0BAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,yBAAA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AAA,CAAAoE,aAAA,GAAGC,sBAAmB","ignoreList":[]}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -17,7 +17,6 @@ Object.keys(_index).forEach(function (key) {
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
});
|
|
20
|
-
function
|
|
21
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
20
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
22
21
|
var _default = exports.default = _index.default;
|
|
23
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_index","_interopRequireWildcard","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","
|
|
1
|
+
{"version":3,"names":["_index","_interopRequireWildcard","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","set","getOwnPropertyDescriptor","_default","Healthkit"],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B,MAAA,CAAAS,cAAA,KAAAT,MAAA,CAAAyB,wBAAA,CAAAb,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAR,GAAA,IAAAQ,CAAA,CAAAK,GAAA,IAAAN,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAAA,IAAAa,QAAA,GAAAlB,OAAA,CAAAc,OAAA,GAEZK,cAAS","ignoreList":[]}
|
|
@@ -8,6 +8,7 @@ var _exportNames = {
|
|
|
8
8
|
availableQuantityTypes: true,
|
|
9
9
|
deleteQuantitySample: true,
|
|
10
10
|
deleteSamples: true,
|
|
11
|
+
deleteWorkoutSample: true,
|
|
11
12
|
disableAllBackgroundDelivery: true,
|
|
12
13
|
disableBackgroundDelivery: true,
|
|
13
14
|
enableBackgroundDelivery: true,
|
|
@@ -48,7 +49,6 @@ var _exportNames = {
|
|
|
48
49
|
saveWorkoutSample: true,
|
|
49
50
|
subscribeToChanges: true,
|
|
50
51
|
startWatchApp: true,
|
|
51
|
-
workoutSessionMirroringStartHandler: true,
|
|
52
52
|
useHealthkitAuthorization: true,
|
|
53
53
|
useIsHealthDataAvailable: true,
|
|
54
54
|
useMostRecentCategorySample: true,
|
|
@@ -59,7 +59,7 @@ var _exportNames = {
|
|
|
59
59
|
useSubscribeToChanges: true,
|
|
60
60
|
queryStateOfMindSamples: true
|
|
61
61
|
};
|
|
62
|
-
exports.
|
|
62
|
+
exports.useSubscribeToChanges = exports.useStatisticsForQuantity = exports.useSources = exports.useMostRecentWorkout = exports.useMostRecentQuantitySample = exports.useMostRecentCategorySample = exports.useIsHealthDataAvailable = exports.useHealthkitAuthorization = exports.subscribeToChanges = exports.startWatchApp = exports.saveWorkoutSample = exports.saveWorkoutRoute = exports.saveStateOfMindSample = exports.saveQuantitySample = exports.saveCorrelationSample = exports.saveCategorySample = exports.requestAuthorization = exports.queryWorkouts = exports.queryWorkoutSamplesWithAnchor = exports.queryWorkoutSamples = exports.queryStatisticsForQuantity = exports.queryStatisticsCollectionForQuantity = exports.queryStateOfMindSamples = exports.querySources = exports.queryQuantitySamplesWithAnchor = exports.queryQuantitySamples = exports.queryHeartbeatSeriesSamplesWithAnchor = exports.queryHeartbeatSeriesSamples = exports.queryCorrelationSamples = exports.queryCategorySamplesWithAnchor = exports.queryCategorySamples = exports.isProtectedDataAvailable = exports.isHealthDataAvailable = exports.getWorkoutRoutes = exports.getWorkoutPlanById = exports.getWheelchairUse = exports.getRequestStatusForAuthorization = exports.getPreferredUnits = exports.getPreferredUnit = exports.getMostRecentWorkout = exports.getMostRecentQuantitySample = exports.getMostRecentCategorySample = exports.getFitzpatrickSkinType = exports.getDateOfBirth = exports.getBloodType = exports.getBiologicalSex = exports.enableBackgroundDelivery = exports.disableBackgroundDelivery = exports.disableAllBackgroundDelivery = exports.deleteWorkoutSample = exports.deleteSamples = exports.deleteQuantitySample = exports.default = exports.availableQuantityTypes = exports.authorizationStatusFor = void 0;
|
|
63
63
|
var _reactNative = require("react-native");
|
|
64
64
|
var _nativeTypes = require("./native-types");
|
|
65
65
|
var _types = require("./types");
|
|
@@ -154,6 +154,7 @@ const authorizationStatusFor = exports.authorizationStatusFor = UnavailableFn(Pr
|
|
|
154
154
|
requestAuthorization = exports.requestAuthorization = UnavailableFn(Promise.resolve(false)),
|
|
155
155
|
deleteQuantitySample = exports.deleteQuantitySample = UnavailableFn(Promise.resolve(false)),
|
|
156
156
|
deleteSamples = exports.deleteSamples = UnavailableFn(Promise.resolve(false)),
|
|
157
|
+
deleteWorkoutSample = exports.deleteWorkoutSample = UnavailableFn(Promise.resolve(false)),
|
|
157
158
|
getWorkoutPlanById = exports.getWorkoutPlanById = UnavailableFn(Promise.resolve(null)),
|
|
158
159
|
saveCategorySample = exports.saveCategorySample = UnavailableFn(Promise.resolve(false)),
|
|
159
160
|
saveStateOfMindSample = exports.saveStateOfMindSample = UnavailableFn(Promise.resolve(false)),
|
|
@@ -163,7 +164,6 @@ const authorizationStatusFor = exports.authorizationStatusFor = UnavailableFn(Pr
|
|
|
163
164
|
saveWorkoutRoute = exports.saveWorkoutRoute = UnavailableFn(Promise.resolve(false)),
|
|
164
165
|
subscribeToChanges = exports.subscribeToChanges = UnavailableFn(Promise.resolve(async () => Promise.resolve(false))),
|
|
165
166
|
startWatchApp = exports.startWatchApp = UnavailableFn(async () => Promise.resolve(false)),
|
|
166
|
-
workoutSessionMirroringStartHandler = exports.workoutSessionMirroringStartHandler = UnavailableFn(Promise.resolve(false)),
|
|
167
167
|
useMostRecentCategorySample = exports.useMostRecentCategorySample = UnavailableFn(null),
|
|
168
168
|
useMostRecentQuantitySample = exports.useMostRecentQuantitySample = UnavailableFn(null),
|
|
169
169
|
useMostRecentWorkout = exports.useMostRecentWorkout = UnavailableFn(null),
|
|
@@ -180,6 +180,7 @@ const Healthkit = {
|
|
|
180
180
|
availableQuantityTypes,
|
|
181
181
|
deleteQuantitySample,
|
|
182
182
|
deleteSamples,
|
|
183
|
+
deleteWorkoutSample,
|
|
183
184
|
disableAllBackgroundDelivery,
|
|
184
185
|
disableBackgroundDelivery,
|
|
185
186
|
enableBackgroundDelivery,
|
|
@@ -220,7 +221,6 @@ const Healthkit = {
|
|
|
220
221
|
saveWorkoutSample,
|
|
221
222
|
subscribeToChanges,
|
|
222
223
|
startWatchApp,
|
|
223
|
-
workoutSessionMirroringStartHandler,
|
|
224
224
|
useHealthkitAuthorization,
|
|
225
225
|
useIsHealthDataAvailable,
|
|
226
226
|
useMostRecentCategorySample,
|