@kingstinct/react-native-healthkit 6.0.0 → 6.1.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/app.plugin.js +69 -0
- package/ios/ReactNativeHealthkit.m +9 -0
- package/ios/ReactNativeHealthkit.swift +137 -0
- package/lib/commonjs/index.ios.js +3 -0
- package/lib/commonjs/index.ios.js.map +1 -1
- package/lib/commonjs/index.js +5 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/jest.setup.js +1 -0
- package/lib/commonjs/jest.setup.js.map +1 -1
- package/lib/commonjs/native-types.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/deserializeHeartbeatSeriesSample.js +17 -0
- package/lib/commonjs/utils/deserializeHeartbeatSeriesSample.js.map +1 -0
- package/lib/commonjs/utils/queryHeartbeatSeriesSamples.js +28 -0
- package/lib/commonjs/utils/queryHeartbeatSeriesSamples.js.map +1 -0
- package/lib/module/index.ios.js +2 -0
- package/lib/module/index.ios.js.map +1 -1
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/jest.setup.js +1 -0
- package/lib/module/jest.setup.js.map +1 -1
- package/lib/module/native-types.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/deserializeHeartbeatSeriesSample.js +9 -0
- package/lib/module/utils/deserializeHeartbeatSeriesSample.js.map +1 -0
- package/lib/module/utils/queryHeartbeatSeriesSamples.js +16 -0
- package/lib/module/utils/queryHeartbeatSeriesSamples.js.map +1 -0
- package/lib/typescript/src/index.ios.d.ts +1 -0
- package/lib/typescript/src/native-types.d.ts +26 -0
- package/lib/typescript/src/types.d.ts +5 -1
- package/lib/typescript/src/utils/deserializeHeartbeatSeriesSample.d.ts +4 -0
- package/lib/typescript/src/utils/queryHeartbeatSeriesSamples.d.ts +10 -0
- package/package.json +3 -2
- package/src/index.ios.tsx +2 -0
- package/src/index.tsx +5 -0
- package/src/jest.setup.ts +1 -0
- package/src/native-types.ts +37 -0
- package/src/types.ts +6 -0
- package/src/utils/deserializeHeartbeatSeriesSample.ts +12 -0
- package/src/utils/queryHeartbeatSeriesSamples.ts +34 -0
package/app.plugin.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/* eslint-disable import/no-extraneous-dependencies, functional/immutable-data, no-param-reassign, @typescript-eslint/no-var-requires */
|
|
2
|
+
const {
|
|
3
|
+
withPlugins,
|
|
4
|
+
createRunOncePlugin,
|
|
5
|
+
withEntitlementsPlist,
|
|
6
|
+
withInfoPlist,
|
|
7
|
+
} = require('@expo/config-plugins')
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @typedef ConfigPlugin
|
|
11
|
+
* @type {import('@expo/config-plugins').ConfigPlugin<T>}
|
|
12
|
+
* @template T = void
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
// please note that the BackgroundConfig currently doesn't actually enable background delivery for any types, but you
|
|
16
|
+
// can set it to false if you don't want the entitlement
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @typedef BackgroundConfig
|
|
20
|
+
* @type {false | Partial<Record<
|
|
21
|
+
* import('./src/native-types').HKSampleTypeIdentifier,
|
|
22
|
+
* import('./src/native-types').HKUpdateFrequency
|
|
23
|
+
* >>}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @typedef InfoPlistConfig
|
|
27
|
+
* @type {{
|
|
28
|
+
* NSHealthShareUsageDescription?: string | false,
|
|
29
|
+
* NSHealthUpdateUsageDescription?: string | false
|
|
30
|
+
* }}
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @typedef AppPluginConfig
|
|
35
|
+
* @type {InfoPlistConfig & { background?: BackgroundConfig }}
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @type {ConfigPlugin<{background: BackgroundConfig}>}
|
|
40
|
+
*/
|
|
41
|
+
const withEntitlementsPlugin = (config, { background }) => withEntitlementsPlist(config, (config) => {
|
|
42
|
+
config.modResults['com.apple.developer.healthkit'] = true
|
|
43
|
+
config.modResults['com.apple.developer.healthkit.background-delivery'] = background !== false
|
|
44
|
+
return config
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @type {ConfigPlugin<InfoPlistConfig>}
|
|
49
|
+
*/
|
|
50
|
+
const withInfoPlistPlugin = (config, { NSHealthShareUsageDescription, NSHealthUpdateUsageDescription }) => withInfoPlist(config, (config) => {
|
|
51
|
+
config.modResults.NSHealthShareUsageDescription = NSHealthShareUsageDescription || (NSHealthShareUsageDescription === false ? undefined : `${config.name} wants to read your health data`)
|
|
52
|
+
config.modResults.NSHealthUpdateUsageDescription = NSHealthUpdateUsageDescription || (NSHealthUpdateUsageDescription === false ? undefined : `${config.name} wants to update your health data`)
|
|
53
|
+
return config
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
const pkg = require('./package.json')
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @type {ConfigPlugin<AppPluginConfig>}
|
|
60
|
+
*/
|
|
61
|
+
const healthkitAppPlugin = (config, { NSHealthShareUsageDescription, NSHealthUpdateUsageDescription, background }) => withPlugins(config, [
|
|
62
|
+
[withEntitlementsPlugin, { background }],
|
|
63
|
+
[withInfoPlistPlugin, { NSHealthShareUsageDescription, NSHealthUpdateUsageDescription }],
|
|
64
|
+
])
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @type {ConfigPlugin<AppPluginConfig>}
|
|
68
|
+
*/
|
|
69
|
+
module.exports = createRunOncePlugin(healthkitAppPlugin, pkg.name, pkg.version)
|
|
@@ -99,6 +99,15 @@ RCT_EXTERN_METHOD(queryWorkoutSamples:(NSString)energyUnitString
|
|
|
99
99
|
reject:(RCTPromiseRejectBlock)reject
|
|
100
100
|
)
|
|
101
101
|
|
|
102
|
+
RCT_EXTERN_METHOD(queryHeartbeatSeriesSamples:(NSDate)from
|
|
103
|
+
to:(NSDate)to
|
|
104
|
+
limit:(NSInteger)limit
|
|
105
|
+
ascending:(BOOL)ascending
|
|
106
|
+
anchor:(NSString)anchor
|
|
107
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
108
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
109
|
+
)
|
|
110
|
+
|
|
102
111
|
RCT_EXTERN_METHOD(queryCategorySamples:(NSString)typeIdentifier
|
|
103
112
|
from:(NSDate)from
|
|
104
113
|
to:(NSDate)to
|
|
@@ -1422,4 +1422,141 @@ class ReactNativeHealthkit: RCTEventEmitter {
|
|
|
1422
1422
|
}
|
|
1423
1423
|
}
|
|
1424
1424
|
}
|
|
1425
|
+
|
|
1426
|
+
typealias HKAnchoredObjectQueryResult = (samples: [HKSample], deletedSamples: [HKDeletedObject]?, newAnchor: HKQueryAnchor?);
|
|
1427
|
+
|
|
1428
|
+
@available(iOS 13.0.0, *)
|
|
1429
|
+
func _queryHeartbeatSeriesSamples(
|
|
1430
|
+
store: HKHealthStore,
|
|
1431
|
+
predicate: NSPredicate?,
|
|
1432
|
+
limit: Int,
|
|
1433
|
+
anchor: HKQueryAnchor?
|
|
1434
|
+
) async throws -> HKAnchoredObjectQueryResult {
|
|
1435
|
+
let queryResult = try await withCheckedThrowingContinuation {
|
|
1436
|
+
(continuation: CheckedContinuation<HKAnchoredObjectQueryResult, Error>) in
|
|
1437
|
+
let query = HKAnchoredObjectQuery(
|
|
1438
|
+
type: HKSeriesType.heartbeat(),
|
|
1439
|
+
predicate: predicate,
|
|
1440
|
+
anchor: anchor,
|
|
1441
|
+
limit: limit
|
|
1442
|
+
) { (
|
|
1443
|
+
query: HKAnchoredObjectQuery,
|
|
1444
|
+
s: [HKSample]?,
|
|
1445
|
+
deletedSamples: [HKDeletedObject]?,
|
|
1446
|
+
newAnchor: HKQueryAnchor?,
|
|
1447
|
+
error: Error?
|
|
1448
|
+
) in
|
|
1449
|
+
if let err = error {
|
|
1450
|
+
continuation.resume(throwing: err);
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
guard let samples = s else {
|
|
1454
|
+
fatalError("Should not fail");
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
continuation.resume(returning: HKAnchoredObjectQueryResult(samples: samples, deletedSamples: deletedSamples, newAnchor: newAnchor));
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
store.execute(query);
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
return queryResult;
|
|
1464
|
+
}
|
|
1465
|
+
|
|
1466
|
+
@available(iOS 13.0.0, *)
|
|
1467
|
+
func getHeartbeatSeriesHeartbeats(store: HKHealthStore, sample: HKHeartbeatSeriesSample) async throws -> [Dictionary<String, Any>] {
|
|
1468
|
+
let beatTimes = try await withCheckedThrowingContinuation {
|
|
1469
|
+
(continuation: CheckedContinuation<[Dictionary<String, Any>], Error>) in
|
|
1470
|
+
var allBeats: [Dictionary<String, Any>] = [];
|
|
1471
|
+
|
|
1472
|
+
let query = HKHeartbeatSeriesQuery(heartbeatSeries: sample) { (
|
|
1473
|
+
query: HKHeartbeatSeriesQuery,
|
|
1474
|
+
timeSinceSeriesStart: TimeInterval,
|
|
1475
|
+
precededByGap: Bool,
|
|
1476
|
+
done: Bool,
|
|
1477
|
+
error: Error?
|
|
1478
|
+
) in
|
|
1479
|
+
if let err = error {
|
|
1480
|
+
continuation.resume(throwing: err);
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
let timeDict: Dictionary<String, Any> = [
|
|
1484
|
+
"timeSinceSeriesStart": timeSinceSeriesStart,
|
|
1485
|
+
"precededByGap": precededByGap
|
|
1486
|
+
];
|
|
1487
|
+
|
|
1488
|
+
allBeats.append(timeDict);
|
|
1489
|
+
|
|
1490
|
+
if done {
|
|
1491
|
+
continuation.resume(returning: allBeats);
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
store.execute(query);
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
return beatTimes;
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
@available(iOS 13.0.0, *)
|
|
1502
|
+
func getSerializedHeartbeatSeriesSample(store: HKHealthStore, sample: HKHeartbeatSeriesSample) async throws -> Dictionary<String, Any> {
|
|
1503
|
+
let sampleMetadata = self.serializeMetadata(metadata: sample.metadata) as! Dictionary<String, Any>;
|
|
1504
|
+
let sampleHeartbeats = try await getHeartbeatSeriesHeartbeats(store: store, sample: sample);
|
|
1505
|
+
|
|
1506
|
+
return [
|
|
1507
|
+
"uuid": sample.uuid.uuidString,
|
|
1508
|
+
"device": self.serializeDevice(_device: sample.device) as Any,
|
|
1509
|
+
"startDate": self._dateFormatter.string(from: sample.startDate),
|
|
1510
|
+
"endDate": self._dateFormatter.string(from: sample.endDate),
|
|
1511
|
+
"heartbeats": sampleHeartbeats as Any,
|
|
1512
|
+
"metadata": self.serializeMetadata(metadata: sample.metadata),
|
|
1513
|
+
"sourceRevision": self.serializeSourceRevision(_sourceRevision: sample.sourceRevision) as Any
|
|
1514
|
+
];
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
@available(iOS 13.0.0, *)
|
|
1518
|
+
@objc(queryHeartbeatSeriesSamples:to:limit:ascending:anchor:resolve:reject:)
|
|
1519
|
+
func queryHeartbeatSeriesSamples(
|
|
1520
|
+
from: Date,
|
|
1521
|
+
to: Date,
|
|
1522
|
+
limit: Int,
|
|
1523
|
+
ascending: Bool,
|
|
1524
|
+
anchor: String,
|
|
1525
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
1526
|
+
reject: @escaping RCTPromiseRejectBlock
|
|
1527
|
+
) {
|
|
1528
|
+
guard let store = _store else {
|
|
1529
|
+
return reject(INIT_ERROR, INIT_ERROR_MESSAGE, nil);
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
Task {
|
|
1533
|
+
do {
|
|
1534
|
+
let from = from.timeIntervalSince1970 > 0 ? from : nil;
|
|
1535
|
+
let to = to.timeIntervalSince1970 > 0 ? to : nil;
|
|
1536
|
+
|
|
1537
|
+
let predicate = from != nil || to != nil ? HKQuery.predicateForSamples(withStart: from, end: to, options: [HKQueryOptions.strictEndDate, HKQueryOptions.strictStartDate]) : nil;
|
|
1538
|
+
|
|
1539
|
+
let limit = limit == 0 ? HKObjectQueryNoLimit : limit;
|
|
1540
|
+
|
|
1541
|
+
let actualAnchor = anchor.isEmpty ? nil : base64StringToHKQueryAnchor(base64String: anchor);
|
|
1542
|
+
|
|
1543
|
+
let queryResult = try await _queryHeartbeatSeriesSamples(store: store, predicate: predicate, limit: limit, anchor: actualAnchor);
|
|
1544
|
+
|
|
1545
|
+
var allHeartbeatSamples: [Dictionary<String, Any>] = [];
|
|
1546
|
+
for sample in queryResult.samples as! [HKHeartbeatSeriesSample] {
|
|
1547
|
+
allHeartbeatSamples.append(try await getSerializedHeartbeatSeriesSample(store: store, sample: sample));
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1550
|
+
resolve([
|
|
1551
|
+
"samples": allHeartbeatSamples as Any,
|
|
1552
|
+
"deletedSamples": queryResult.deletedSamples?.map({ sample in
|
|
1553
|
+
return serializeDeletedSample(sample: sample)
|
|
1554
|
+
}) as Any,
|
|
1555
|
+
"newAnchor": serializeAnchor(anchor: queryResult.newAnchor) as Any
|
|
1556
|
+
]);
|
|
1557
|
+
} catch {
|
|
1558
|
+
reject(GENERIC_ERROR, error.localizedDescription, error);
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1425
1562
|
}
|
|
@@ -42,6 +42,8 @@ var _queryCategorySamples = _interopRequireDefault(require("./utils/queryCategor
|
|
|
42
42
|
|
|
43
43
|
var _queryCorrelationSamples = _interopRequireDefault(require("./utils/queryCorrelationSamples"));
|
|
44
44
|
|
|
45
|
+
var _queryHeartbeatSeriesSamples = _interopRequireDefault(require("./utils/queryHeartbeatSeriesSamples"));
|
|
46
|
+
|
|
45
47
|
var _queryQuantitySamples = _interopRequireDefault(require("./utils/queryQuantitySamples"));
|
|
46
48
|
|
|
47
49
|
var _querySources = _interopRequireDefault(require("./utils/querySources"));
|
|
@@ -101,6 +103,7 @@ const Healthkit = {
|
|
|
101
103
|
// query methods
|
|
102
104
|
queryCategorySamples: _queryCategorySamples.default,
|
|
103
105
|
queryCorrelationSamples: _queryCorrelationSamples.default,
|
|
106
|
+
queryHeartbeatSeriesSamples: _queryHeartbeatSeriesSamples.default,
|
|
104
107
|
queryQuantitySamples: _queryQuantitySamples.default,
|
|
105
108
|
queryStatisticsForQuantity: _queryStatisticsForQuantity.default,
|
|
106
109
|
queryWorkouts: _queryWorkouts.default,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Healthkit","authorizationStatusFor","Native","bind","isHealthDataAvailable","canAccessProtectedData","disableAllBackgroundDelivery","disableBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","getFitzpatrickSkinType","getWheelchairUse","getBloodType","getWorkoutRoutes","getDateOfBirth","getMostRecentQuantitySample","getMostRecentCategorySample","getMostRecentWorkout","getPreferredUnit","getPreferredUnits","getRequestStatusForAuthorization","queryCategorySamples","queryCorrelationSamples","queryQuantitySamples","queryStatisticsForQuantity","queryWorkouts","querySources","requestAuthorization","deleteQuantitySample","deleteSamples","saveCategorySample","saveCorrelationSample","saveQuantitySample","saveWorkoutSample","subscribeToChanges","useMostRecentCategorySample","useMostRecentQuantitySample","useMostRecentWorkout","useSubscribeToChanges","useIsHealthDataAvailable","useHealthkitAuthorization"],"sources":["index.ios.tsx"],"sourcesContent":["import 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 useSubscribeToChanges from './hooks/useSubscribeToChanges'\nimport Native 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 queryCategorySamples from './utils/queryCategorySamples'\nimport queryCorrelationSamples from './utils/queryCorrelationSamples'\nimport queryQuantitySamples from './utils/queryQuantitySamples'\nimport querySources from './utils/querySources'\nimport queryStatisticsForQuantity from './utils/queryStatisticsForQuantity'\nimport queryWorkouts from './utils/queryWorkouts'\nimport requestAuthorization from './utils/requestAuthorization'\nimport saveCategorySample from './utils/saveCategorySample'\nimport saveCorrelationSample from './utils/saveCorrelationSample'\nimport saveQuantitySample from './utils/saveQuantitySample'\nimport saveWorkoutSample from './utils/saveWorkoutSample'\nimport subscribeToChanges from './utils/subscribeToChanges'\n\nconst Healthkit = {\n authorizationStatusFor: Native.authorizationStatusFor.bind(Native),\n\n isHealthDataAvailable: Native.isHealthDataAvailable.bind(Native),\n canAccessProtectedData: Native.canAccessProtectedData.bind(Native),\n\n disableAllBackgroundDelivery:\n Native.disableAllBackgroundDelivery.bind(Native),\n disableBackgroundDelivery: Native.disableBackgroundDelivery.bind(Native),\n enableBackgroundDelivery: Native.enableBackgroundDelivery.bind(Native),\n\n // simple convenience getters\n getBiologicalSex: Native.getBiologicalSex.bind(Native),\n getFitzpatrickSkinType: Native.getFitzpatrickSkinType.bind(Native),\n getWheelchairUse: Native.getWheelchairUse.bind(Native),\n getBloodType: Native.getBloodType.bind(Native),\n\n getWorkoutRoutes: Native.getWorkoutRoutes.bind(Native),\n\n getDateOfBirth,\n\n getMostRecentQuantitySample,\n getMostRecentCategorySample,\n getMostRecentWorkout,\n\n getPreferredUnit,\n getPreferredUnits,\n getRequestStatusForAuthorization,\n\n // query methods\n queryCategorySamples,\n queryCorrelationSamples,\n queryQuantitySamples,\n queryStatisticsForQuantity,\n queryWorkouts,\n querySources,\n\n requestAuthorization,\n\n // delete methods\n deleteQuantitySample,\n deleteSamples,\n\n // save methods\n saveCategorySample,\n saveCorrelationSample,\n saveQuantitySample,\n saveWorkoutSample,\n\n // subscriptions\n subscribeToChanges,\n\n // hooks\n useMostRecentCategorySample,\n\n useMostRecentQuantitySample,\n useMostRecentWorkout,\n\n useSubscribeToChanges,\n\n useIsHealthDataAvailable,\n useHealthkitAuthorization,\n}\n\nexport * from './types'\n\nexport default Healthkit\n"],"mappings":";;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;
|
|
1
|
+
{"version":3,"names":["Healthkit","authorizationStatusFor","Native","bind","isHealthDataAvailable","canAccessProtectedData","disableAllBackgroundDelivery","disableBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","getFitzpatrickSkinType","getWheelchairUse","getBloodType","getWorkoutRoutes","getDateOfBirth","getMostRecentQuantitySample","getMostRecentCategorySample","getMostRecentWorkout","getPreferredUnit","getPreferredUnits","getRequestStatusForAuthorization","queryCategorySamples","queryCorrelationSamples","queryHeartbeatSeriesSamples","queryQuantitySamples","queryStatisticsForQuantity","queryWorkouts","querySources","requestAuthorization","deleteQuantitySample","deleteSamples","saveCategorySample","saveCorrelationSample","saveQuantitySample","saveWorkoutSample","subscribeToChanges","useMostRecentCategorySample","useMostRecentQuantitySample","useMostRecentWorkout","useSubscribeToChanges","useIsHealthDataAvailable","useHealthkitAuthorization"],"sources":["index.ios.tsx"],"sourcesContent":["import 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 useSubscribeToChanges from './hooks/useSubscribeToChanges'\nimport Native 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 queryCategorySamples from './utils/queryCategorySamples'\nimport queryCorrelationSamples from './utils/queryCorrelationSamples'\nimport queryHeartbeatSeriesSamples from './utils/queryHeartbeatSeriesSamples'\nimport queryQuantitySamples from './utils/queryQuantitySamples'\nimport querySources from './utils/querySources'\nimport queryStatisticsForQuantity from './utils/queryStatisticsForQuantity'\nimport queryWorkouts from './utils/queryWorkouts'\nimport requestAuthorization from './utils/requestAuthorization'\nimport saveCategorySample from './utils/saveCategorySample'\nimport saveCorrelationSample from './utils/saveCorrelationSample'\nimport saveQuantitySample from './utils/saveQuantitySample'\nimport saveWorkoutSample from './utils/saveWorkoutSample'\nimport subscribeToChanges from './utils/subscribeToChanges'\n\nconst Healthkit = {\n authorizationStatusFor: Native.authorizationStatusFor.bind(Native),\n\n isHealthDataAvailable: Native.isHealthDataAvailable.bind(Native),\n canAccessProtectedData: Native.canAccessProtectedData.bind(Native),\n\n disableAllBackgroundDelivery:\n Native.disableAllBackgroundDelivery.bind(Native),\n disableBackgroundDelivery: Native.disableBackgroundDelivery.bind(Native),\n enableBackgroundDelivery: Native.enableBackgroundDelivery.bind(Native),\n\n // simple convenience getters\n getBiologicalSex: Native.getBiologicalSex.bind(Native),\n getFitzpatrickSkinType: Native.getFitzpatrickSkinType.bind(Native),\n getWheelchairUse: Native.getWheelchairUse.bind(Native),\n getBloodType: Native.getBloodType.bind(Native),\n\n getWorkoutRoutes: Native.getWorkoutRoutes.bind(Native),\n\n getDateOfBirth,\n\n getMostRecentQuantitySample,\n getMostRecentCategorySample,\n getMostRecentWorkout,\n\n getPreferredUnit,\n getPreferredUnits,\n getRequestStatusForAuthorization,\n\n // query methods\n queryCategorySamples,\n queryCorrelationSamples,\n queryHeartbeatSeriesSamples,\n queryQuantitySamples,\n queryStatisticsForQuantity,\n queryWorkouts,\n querySources,\n\n requestAuthorization,\n\n // delete methods\n deleteQuantitySample,\n deleteSamples,\n\n // save methods\n saveCategorySample,\n saveCorrelationSample,\n saveQuantitySample,\n saveWorkoutSample,\n\n // subscriptions\n subscribeToChanges,\n\n // hooks\n useMostRecentCategorySample,\n\n useMostRecentQuantitySample,\n useMostRecentWorkout,\n\n useSubscribeToChanges,\n\n useIsHealthDataAvailable,\n useHealthkitAuthorization,\n}\n\nexport * from './types'\n\nexport default Healthkit\n"],"mappings":";;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAmEA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AAjEA,MAAMA,SAAS,GAAG;EAChBC,sBAAsB,EAAEC,oBAAA,CAAOD,sBAAP,CAA8BE,IAA9B,CAAmCD,oBAAnC,CADR;EAGhBE,qBAAqB,EAAEF,oBAAA,CAAOE,qBAAP,CAA6BD,IAA7B,CAAkCD,oBAAlC,CAHP;EAIhBG,sBAAsB,EAAEH,oBAAA,CAAOG,sBAAP,CAA8BF,IAA9B,CAAmCD,oBAAnC,CAJR;EAMhBI,4BAA4B,EAC1BJ,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gB;EA4ChB;EACAC,kBAAkB,EAAlBA,2BA7CgB;EA8ChBC,qBAAqB,EAArBA,8BA9CgB;EA+ChBC,kBAAkB,EAAlBA,2BA/CgB;EAgDhBC,iBAAiB,EAAjBA,0BAhDgB;EAkDhB;EACAC,kBAAkB,EAAlBA,2BAnDgB;EAqDhB;EACAC,2BAA2B,EAA3BA,oCAtDgB;EAwDhBC,2BAA2B,EAA3BA,oCAxDgB;EAyDhBC,oBAAoB,EAApBA,6BAzDgB;EA2DhBC,qBAAqB,EAArBA,8BA3DgB;EA6DhBC,wBAAwB,EAAxBA,iCA7DgB;EA8DhBC,yBAAyB,EAAzBA;AA9DgB,CAAlB;eAmEezC,S"}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -62,6 +62,11 @@ const Healthkit = {
|
|
|
62
62
|
newAnchor: ''
|
|
63
63
|
})),
|
|
64
64
|
queryCorrelationSamples: UnavailableFn(Promise.resolve([])),
|
|
65
|
+
queryHeartbeatSeriesSamples: UnavailableFn(Promise.resolve({
|
|
66
|
+
samples: [],
|
|
67
|
+
deletedSamples: [],
|
|
68
|
+
newAnchor: ''
|
|
69
|
+
})),
|
|
65
70
|
queryQuantitySamples: UnavailableFn(Promise.resolve({
|
|
66
71
|
samples: [],
|
|
67
72
|
deletedSamples: [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["notAvailableError","Platform","OS","hasWarned","UnavailableFn","retVal","console","warn","Healthkit","authorizationStatusFor","Promise","resolve","disableAllBackgroundDelivery","disableBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","HKBiologicalSex","notSet","getBloodType","HKBloodType","getDateOfBirth","Date","getFitzpatrickSkinType","HKFitzpatrickSkinType","getMostRecentCategorySample","getMostRecentQuantitySample","getMostRecentWorkout","getPreferredUnit","HKUnits","Count","getPreferredUnits","getRequestStatusForAuthorization","HKAuthorizationRequestStatus","unknown","getWheelchairUse","HKWheelchairUse","getWorkoutRoutes","isHealthDataAvailable","queryCategorySamples","samples","deletedSamples","newAnchor","queryCorrelationSamples","queryQuantitySamples","queryStatisticsForQuantity","averageQuantity","undefined","maximumQuantity","minimumQuantity","sumQuantity","mostRecentQuantity","mostRecentQuantityDateInterval","duration","queryWorkouts","querySources","requestAuthorization","deleteQuantitySample","deleteSamples","saveCategorySample","saveCorrelationSample","saveQuantitySample","saveWorkoutSample","subscribeToChanges","useMostRecentCategorySample","useMostRecentQuantitySample","useMostRecentWorkout","useSubscribeToChanges","useHealthkitAuthorization","useIsHealthDataAvailable","canAccessProtectedData"],"sources":["index.tsx"],"sourcesContent":["import { Platform } from 'react-native'\n\nimport {\n HKAuthorizationRequestStatus, HKBiologicalSex, HKBloodType, HKFitzpatrickSkinType, HKQuantityTypeIdentifier, HKUnits, HKWheelchairUse, QueryQuantitySamplesResponseRaw,\n} from './native-types'\n\nimport type ReactNativeHealthkit from './index.ios'\n\nconst notAvailableError = `[@kingstinct/react-native-healthkit] Platform \"${\n Platform.OS\n}\" not supported`\n\nlet hasWarned = false\n\nfunction UnavailableFn<T = unknown>(retVal: T) {\n return () => {\n if (!hasWarned) {\n // eslint-disable-next-line no-console\n console.warn(notAvailableError)\n hasWarned = true\n }\n return retVal\n }\n}\n\nconst Healthkit: typeof ReactNativeHealthkit = {\n authorizationStatusFor: UnavailableFn(Promise.resolve(false)),\n disableAllBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n disableBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n enableBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n getBiologicalSex: UnavailableFn(Promise.resolve(HKBiologicalSex.notSet)),\n getBloodType: UnavailableFn(Promise.resolve(HKBloodType.notSet)),\n getDateOfBirth: UnavailableFn(Promise.resolve(new Date(0))),\n getFitzpatrickSkinType: UnavailableFn(Promise.resolve(HKFitzpatrickSkinType.notSet)),\n getMostRecentCategorySample: UnavailableFn(Promise.resolve(null)),\n getMostRecentQuantitySample: UnavailableFn(Promise.resolve(null)),\n getMostRecentWorkout: UnavailableFn(Promise.resolve(null)),\n getPreferredUnit: UnavailableFn(Promise.resolve(HKUnits.Count)),\n getPreferredUnits: UnavailableFn(Promise.resolve([])),\n getRequestStatusForAuthorization: UnavailableFn(Promise.resolve(HKAuthorizationRequestStatus.unknown)),\n getWheelchairUse: UnavailableFn(Promise.resolve(HKWheelchairUse.notSet)),\n getWorkoutRoutes: UnavailableFn(Promise.resolve([])),\n isHealthDataAvailable: async () => Promise.resolve(false),\n queryCategorySamples: UnavailableFn(Promise.resolve({\n samples: [],\n deletedSamples: [],\n newAnchor: '',\n })),\n queryCorrelationSamples: UnavailableFn(Promise.resolve([])),\n queryQuantitySamples: UnavailableFn(Promise.resolve({\n samples: [],\n deletedSamples: [],\n newAnchor: '',\n })),\n queryStatisticsForQuantity: UnavailableFn(Promise.resolve({\n averageQuantity: undefined,\n maximumQuantity: undefined,\n minimumQuantity: undefined,\n sumQuantity: undefined,\n mostRecentQuantity: undefined,\n mostRecentQuantityDateInterval: undefined,\n duration: undefined,\n })),\n queryWorkouts: UnavailableFn(Promise.resolve([])),\n querySources: UnavailableFn(Promise.resolve([])),\n requestAuthorization: UnavailableFn(Promise.resolve(false)),\n deleteQuantitySample: UnavailableFn(Promise.resolve(false)),\n deleteSamples: UnavailableFn(Promise.resolve(false)),\n saveCategorySample: UnavailableFn(Promise.resolve(false)),\n saveCorrelationSample: UnavailableFn(Promise.resolve(false)),\n saveQuantitySample: UnavailableFn(Promise.resolve(false)),\n saveWorkoutSample: UnavailableFn(Promise.resolve(false)),\n subscribeToChanges: UnavailableFn(Promise.resolve(async () => Promise.resolve(false))),\n useMostRecentCategorySample: UnavailableFn(null),\n useMostRecentQuantitySample: UnavailableFn(null),\n useMostRecentWorkout: UnavailableFn(null),\n useSubscribeToChanges: UnavailableFn([null, () => null]),\n useHealthkitAuthorization: UnavailableFn([null, async () => Promise.resolve(HKAuthorizationRequestStatus.unknown)] as const),\n useIsHealthDataAvailable: () => false,\n canAccessProtectedData: async () => Promise.resolve(false),\n}\n\nexport * from './types'\n\nexport default Healthkit\n"],"mappings":";;;;;;;;AAAA;;AAEA;;
|
|
1
|
+
{"version":3,"names":["notAvailableError","Platform","OS","hasWarned","UnavailableFn","retVal","console","warn","Healthkit","authorizationStatusFor","Promise","resolve","disableAllBackgroundDelivery","disableBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","HKBiologicalSex","notSet","getBloodType","HKBloodType","getDateOfBirth","Date","getFitzpatrickSkinType","HKFitzpatrickSkinType","getMostRecentCategorySample","getMostRecentQuantitySample","getMostRecentWorkout","getPreferredUnit","HKUnits","Count","getPreferredUnits","getRequestStatusForAuthorization","HKAuthorizationRequestStatus","unknown","getWheelchairUse","HKWheelchairUse","getWorkoutRoutes","isHealthDataAvailable","queryCategorySamples","samples","deletedSamples","newAnchor","queryCorrelationSamples","queryHeartbeatSeriesSamples","queryQuantitySamples","queryStatisticsForQuantity","averageQuantity","undefined","maximumQuantity","minimumQuantity","sumQuantity","mostRecentQuantity","mostRecentQuantityDateInterval","duration","queryWorkouts","querySources","requestAuthorization","deleteQuantitySample","deleteSamples","saveCategorySample","saveCorrelationSample","saveQuantitySample","saveWorkoutSample","subscribeToChanges","useMostRecentCategorySample","useMostRecentQuantitySample","useMostRecentWorkout","useSubscribeToChanges","useHealthkitAuthorization","useIsHealthDataAvailable","canAccessProtectedData"],"sources":["index.tsx"],"sourcesContent":["import { Platform } from 'react-native'\n\nimport {\n HKAuthorizationRequestStatus, HKBiologicalSex, HKBloodType, HKFitzpatrickSkinType, HKQuantityTypeIdentifier, HKUnits, HKWheelchairUse, QueryQuantitySamplesResponseRaw,\n} from './native-types'\n\nimport type ReactNativeHealthkit from './index.ios'\n\nconst notAvailableError = `[@kingstinct/react-native-healthkit] Platform \"${\n Platform.OS\n}\" not supported`\n\nlet hasWarned = false\n\nfunction UnavailableFn<T = unknown>(retVal: T) {\n return () => {\n if (!hasWarned) {\n // eslint-disable-next-line no-console\n console.warn(notAvailableError)\n hasWarned = true\n }\n return retVal\n }\n}\n\nconst Healthkit: typeof ReactNativeHealthkit = {\n authorizationStatusFor: UnavailableFn(Promise.resolve(false)),\n disableAllBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n disableBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n enableBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n getBiologicalSex: UnavailableFn(Promise.resolve(HKBiologicalSex.notSet)),\n getBloodType: UnavailableFn(Promise.resolve(HKBloodType.notSet)),\n getDateOfBirth: UnavailableFn(Promise.resolve(new Date(0))),\n getFitzpatrickSkinType: UnavailableFn(Promise.resolve(HKFitzpatrickSkinType.notSet)),\n getMostRecentCategorySample: UnavailableFn(Promise.resolve(null)),\n getMostRecentQuantitySample: UnavailableFn(Promise.resolve(null)),\n getMostRecentWorkout: UnavailableFn(Promise.resolve(null)),\n getPreferredUnit: UnavailableFn(Promise.resolve(HKUnits.Count)),\n getPreferredUnits: UnavailableFn(Promise.resolve([])),\n getRequestStatusForAuthorization: UnavailableFn(Promise.resolve(HKAuthorizationRequestStatus.unknown)),\n getWheelchairUse: UnavailableFn(Promise.resolve(HKWheelchairUse.notSet)),\n getWorkoutRoutes: UnavailableFn(Promise.resolve([])),\n isHealthDataAvailable: async () => Promise.resolve(false),\n queryCategorySamples: UnavailableFn(Promise.resolve({\n samples: [],\n deletedSamples: [],\n newAnchor: '',\n })),\n queryCorrelationSamples: UnavailableFn(Promise.resolve([])),\n queryHeartbeatSeriesSamples: UnavailableFn(Promise.resolve({\n samples: [],\n deletedSamples: [],\n newAnchor: '',\n })),\n queryQuantitySamples: UnavailableFn(Promise.resolve({\n samples: [],\n deletedSamples: [],\n newAnchor: '',\n })),\n queryStatisticsForQuantity: UnavailableFn(Promise.resolve({\n averageQuantity: undefined,\n maximumQuantity: undefined,\n minimumQuantity: undefined,\n sumQuantity: undefined,\n mostRecentQuantity: undefined,\n mostRecentQuantityDateInterval: undefined,\n duration: undefined,\n })),\n queryWorkouts: UnavailableFn(Promise.resolve([])),\n querySources: UnavailableFn(Promise.resolve([])),\n requestAuthorization: UnavailableFn(Promise.resolve(false)),\n deleteQuantitySample: UnavailableFn(Promise.resolve(false)),\n deleteSamples: UnavailableFn(Promise.resolve(false)),\n saveCategorySample: UnavailableFn(Promise.resolve(false)),\n saveCorrelationSample: UnavailableFn(Promise.resolve(false)),\n saveQuantitySample: UnavailableFn(Promise.resolve(false)),\n saveWorkoutSample: UnavailableFn(Promise.resolve(false)),\n subscribeToChanges: UnavailableFn(Promise.resolve(async () => Promise.resolve(false))),\n useMostRecentCategorySample: UnavailableFn(null),\n useMostRecentQuantitySample: UnavailableFn(null),\n useMostRecentWorkout: UnavailableFn(null),\n useSubscribeToChanges: UnavailableFn([null, () => null]),\n useHealthkitAuthorization: UnavailableFn([null, async () => Promise.resolve(HKAuthorizationRequestStatus.unknown)] as const),\n useIsHealthDataAvailable: () => false,\n canAccessProtectedData: async () => Promise.resolve(false),\n}\n\nexport * from './types'\n\nexport default Healthkit\n"],"mappings":";;;;;;;;AAAA;;AAEA;;AAqFA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AA/EA,MAAMA,iBAAiB,GAAI,kDACzBC,qBAAA,CAASC,EACV,iBAFD;AAIA,IAAIC,SAAS,GAAG,KAAhB;;AAEA,SAASC,aAAT,CAAoCC,MAApC,EAA+C;EAC7C,OAAO,MAAM;IACX,IAAI,CAACF,SAAL,EAAgB;MACd;MACAG,OAAO,CAACC,IAAR,CAAaP,iBAAb;MACAG,SAAS,GAAG,IAAZ;IACD;;IACD,OAAOE,MAAP;EACD,CAPD;AAQD;;AAED,MAAMG,SAAsC,GAAG;EAC7CC,sBAAsB,EAAEL,aAAa,CAACM,OAAO,CAACC,OAAR,CAAgB,KAAhB,CAAD,CADQ;EAE7CC,4BAA4B,EAAER,aAAa,CAACM,OAAO,CAACC,OAAR,CAAgB,KAAhB,CAAD,CAFE;EAG7CE,yBAAyB,EAAET,aAAa,CAACM,OAAO,CA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(),
|
|
27
|
+
queryHeartbeatSeriesSamples: jest.fn(),
|
|
27
28
|
queryQuantitySamples: jest.fn(),
|
|
28
29
|
querySources: jest.fn(),
|
|
29
30
|
queryStatisticsForQuantity: jest.fn(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["mockModule","isHealthDataAvailable","jest","fn","addListener","removeListeners","authorizationStatusFor","requestAuthorization","saveQuantitySample","deleteQuantitySample","deleteSamples","disableAllBackgroundDelivery","disableBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","getBloodType","getDateOfBirth","getFitzpatrickSkinType","getPreferredUnits","getRequestStatusForAuthorization","getWheelchairUse","getWorkoutRoutes","queryCategorySamples","queryCorrelationSamples","queryQuantitySamples","querySources","queryStatisticsForQuantity","queryWorkoutSamples","saveCategorySample","saveCorrelationSample","saveWorkoutSample","subscribeToObserverQuery","unsubscribeQuery","canAccessProtectedData","NativeModules","ReactNativeHealthkit"],"sources":["jest.setup.ts"],"sourcesContent":["import { NativeModule, NativeModules } from 'react-native'\n\nimport type Native from './native-types'\n\nconst mockModule: (NativeModule & typeof Native) = {\n isHealthDataAvailable: jest.fn(),\n addListener: jest.fn(),\n removeListeners: jest.fn(),\n authorizationStatusFor: jest.fn(),\n requestAuthorization: jest.fn(),\n saveQuantitySample: jest.fn(),\n deleteQuantitySample: jest.fn(),\n deleteSamples: jest.fn(),\n disableAllBackgroundDelivery: jest.fn(),\n disableBackgroundDelivery: jest.fn(),\n enableBackgroundDelivery: jest.fn(),\n getBiologicalSex: jest.fn(),\n getBloodType: jest.fn(),\n getDateOfBirth: jest.fn(),\n getFitzpatrickSkinType: jest.fn(),\n getPreferredUnits: jest.fn(),\n getRequestStatusForAuthorization: jest.fn(),\n getWheelchairUse: jest.fn(),\n getWorkoutRoutes: jest.fn(),\n queryCategorySamples: jest.fn(),\n queryCorrelationSamples: jest.fn(),\n queryQuantitySamples: jest.fn(),\n querySources: jest.fn(),\n queryStatisticsForQuantity: jest.fn(),\n queryWorkoutSamples: jest.fn(),\n saveCategorySample: jest.fn(),\n saveCorrelationSample: jest.fn(),\n saveWorkoutSample: jest.fn(),\n subscribeToObserverQuery: jest.fn(),\n unsubscribeQuery: jest.fn(),\n canAccessProtectedData: jest.fn(),\n}\n\nNativeModules.ReactNativeHealthkit = mockModule\n"],"mappings":";;AAAA;;AAIA,MAAMA,UAA0C,GAAG;EACjDC,qBAAqB,EAAEC,IAAI,CAACC,EAAL,EAD0B;EAEjDC,WAAW,EAAEF,IAAI,CAACC,EAAL,EAFoC;EAGjDE,eAAe,EAAEH,IAAI,CAACC,EAAL,EAHgC;EAIjDG,sBAAsB,EAAEJ,IAAI,CAACC,EAAL,EAJyB;EAKjDI,oBAAoB,EAAEL,IAAI,CAACC,EAAL,EAL2B;EAMjDK,kBAAkB,EAAEN,IAAI,CAACC,EAAL,EAN6B;EAOjDM,oBAAoB,EAAEP,IAAI,CAACC,EAAL,EAP2B;EAQjDO,aAAa,EAAER,IAAI,CAACC,EAAL,EARkC;EASjDQ,4BAA4B,EAAET,IAAI,CAACC,EAAL,EATmB;EAUjDS,yBAAyB,EAAEV,IAAI,CAACC,EAAL,EAVsB;EAWjDU,wBAAwB,EAAEX,IAAI,CAACC,EAAL,EAXuB;EAYjDW,gBAAgB,EAAEZ,IAAI,CAACC,EAAL,EAZ+B;EAajDY,YAAY,EAAEb,IAAI,CAACC,EAAL,EAbmC;EAcjDa,cAAc,EAAEd,IAAI,CAACC,EAAL,EAdiC;EAejDc,sBAAsB,EAAEf,IAAI,CAACC,EAAL,EAfyB;EAgBjDe,iBAAiB,EAAEhB,IAAI,CAACC,EAAL,EAhB8B;EAiBjDgB,gCAAgC,EAAEjB,IAAI,CAACC,EAAL,EAjBe;EAkBjDiB,gBAAgB,EAAElB,IAAI,CAACC,EAAL,EAlB+B;EAmBjDkB,gBAAgB,EAAEnB,IAAI,CAACC,EAAL,EAnB+B;EAoBjDmB,oBAAoB,EAAEpB,IAAI,CAACC,EAAL,EApB2B;EAqBjDoB,uBAAuB,EAAErB,IAAI,CAACC,EAAL,EArBwB;EAsBjDqB,
|
|
1
|
+
{"version":3,"names":["mockModule","isHealthDataAvailable","jest","fn","addListener","removeListeners","authorizationStatusFor","requestAuthorization","saveQuantitySample","deleteQuantitySample","deleteSamples","disableAllBackgroundDelivery","disableBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","getBloodType","getDateOfBirth","getFitzpatrickSkinType","getPreferredUnits","getRequestStatusForAuthorization","getWheelchairUse","getWorkoutRoutes","queryCategorySamples","queryCorrelationSamples","queryHeartbeatSeriesSamples","queryQuantitySamples","querySources","queryStatisticsForQuantity","queryWorkoutSamples","saveCategorySample","saveCorrelationSample","saveWorkoutSample","subscribeToObserverQuery","unsubscribeQuery","canAccessProtectedData","NativeModules","ReactNativeHealthkit"],"sources":["jest.setup.ts"],"sourcesContent":["import { NativeModule, NativeModules } from 'react-native'\n\nimport type Native from './native-types'\n\nconst mockModule: (NativeModule & typeof Native) = {\n isHealthDataAvailable: jest.fn(),\n addListener: jest.fn(),\n removeListeners: jest.fn(),\n authorizationStatusFor: jest.fn(),\n requestAuthorization: jest.fn(),\n saveQuantitySample: jest.fn(),\n deleteQuantitySample: jest.fn(),\n deleteSamples: jest.fn(),\n disableAllBackgroundDelivery: jest.fn(),\n disableBackgroundDelivery: jest.fn(),\n enableBackgroundDelivery: jest.fn(),\n getBiologicalSex: jest.fn(),\n getBloodType: jest.fn(),\n getDateOfBirth: jest.fn(),\n getFitzpatrickSkinType: jest.fn(),\n getPreferredUnits: jest.fn(),\n getRequestStatusForAuthorization: jest.fn(),\n getWheelchairUse: jest.fn(),\n getWorkoutRoutes: jest.fn(),\n queryCategorySamples: jest.fn(),\n queryCorrelationSamples: jest.fn(),\n queryHeartbeatSeriesSamples: jest.fn(),\n queryQuantitySamples: jest.fn(),\n querySources: jest.fn(),\n queryStatisticsForQuantity: jest.fn(),\n queryWorkoutSamples: jest.fn(),\n saveCategorySample: jest.fn(),\n saveCorrelationSample: jest.fn(),\n saveWorkoutSample: jest.fn(),\n subscribeToObserverQuery: jest.fn(),\n unsubscribeQuery: jest.fn(),\n canAccessProtectedData: jest.fn(),\n}\n\nNativeModules.ReactNativeHealthkit = mockModule\n"],"mappings":";;AAAA;;AAIA,MAAMA,UAA0C,GAAG;EACjDC,qBAAqB,EAAEC,IAAI,CAACC,EAAL,EAD0B;EAEjDC,WAAW,EAAEF,IAAI,CAACC,EAAL,EAFoC;EAGjDE,eAAe,EAAEH,IAAI,CAACC,EAAL,EAHgC;EAIjDG,sBAAsB,EAAEJ,IAAI,CAACC,EAAL,EAJyB;EAKjDI,oBAAoB,EAAEL,IAAI,CAACC,EAAL,EAL2B;EAMjDK,kBAAkB,EAAEN,IAAI,CAACC,EAAL,EAN6B;EAOjDM,oBAAoB,EAAEP,IAAI,CAACC,EAAL,EAP2B;EAQjDO,aAAa,EAAER,IAAI,CAACC,EAAL,EARkC;EASjDQ,4BAA4B,EAAET,IAAI,CAACC,EAAL,EATmB;EAUjDS,yBAAyB,EAAEV,IAAI,CAACC,EAAL,EAVsB;EAWjDU,wBAAwB,EAAEX,IAAI,CAACC,EAAL,EAXuB;EAYjDW,gBAAgB,EAAEZ,IAAI,CAACC,EAAL,EAZ+B;EAajDY,YAAY,EAAEb,IAAI,CAACC,EAAL,EAbmC;EAcjDa,cAAc,EAAEd,IAAI,CAACC,EAAL,EAdiC;EAejDc,sBAAsB,EAAEf,IAAI,CAACC,EAAL,EAfyB;EAgBjDe,iBAAiB,EAAEhB,IAAI,CAACC,EAAL,EAhB8B;EAiBjDgB,gCAAgC,EAAEjB,IAAI,CAACC,EAAL,EAjBe;EAkBjDiB,gBAAgB,EAAElB,IAAI,CAACC,EAAL,EAlB+B;EAmBjDkB,gBAAgB,EAAEnB,IAAI,CAACC,EAAL,EAnB+B;EAoBjDmB,oBAAoB,EAAEpB,IAAI,CAACC,EAAL,EApB2B;EAqBjDoB,uBAAuB,EAAErB,IAAI,CAACC,EAAL,EArBwB;EAsBjDqB,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