'use strict' import { NativeModules } from 'react-native' const healthPlatform = NativeModules.HealthPlatformPackage type Activity = { steps: number minutes: number distance: number } class HealthPlatform { constructor() {} async isEnabled(): Promise { const isEnabled = await healthPlatform.isEnabled() return isEnabled } async authorize(): Promise { const isAuthorized = await healthPlatform.authorize() return isAuthorized } async getActivities(startDate: Date, endDate: Date): Promise<[Activity]> { const activities = await healthPlatform.getActivities(startDate, endDate) return activities } } export default new HealthPlatform()