6.0.2 • Published 1 year ago

@felipeclopes/capacitor-healthkit v6.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@perfood/capacitor-healthkit v2

This is a complete re-write of the original plugin and still work in progress. v2 will have a complete new API and some new features. By far not everything has been implemented yet. You can test the most recent release of v2 by installing @perfood/capacitor-healthkit@next.

Install

npm install @perfood/capacitor-healthkit@next
npx cap sync

API

requestAuthorization(...)

requestAuthorization(options: RequestAuthorizationOptions) => Promise<void>
ParamType
optionsRequestAuthorizationOptions

isAvailable()

isAvailable() => Promise<void>

getAuthorizationStatus(...)

getAuthorizationStatus(options: GetAuthorizationStatusOptions) => Promise<{ status: AuthorizationStatus; }>
ParamType
optionsGetAuthorizationStatusOptions

Returns: Promise<{ status: AuthorizationStatus; }>


getStatisticsCollection(...)

getStatisticsCollection(options: StatisticsCollectionOptions) => Promise<StatisticsCollectionOutput>
ParamType
optionsStatisticsCollectionOptions

Returns: Promise<StatisticsCollectionOutput>


getBodyMassEntries(...)

getBodyMassEntries(options: BodyMassQueryOptions) => Promise<BodyMassQueryOutput>
ParamType
optionsBodyMassQueryOptions

Returns: Promise<BodyMassQueryOutput>


getWorkouts(...)

getWorkouts(options: WorkoutsQueryOptions) => Promise<WorkoutsQueryOutput>
ParamType
optionsWorkoutsQueryOptions

Returns: Promise<WorkoutsQueryOutput>


Interfaces

RequestAuthorizationOptions

PropType
allstring[]
readstring[]
writestring[]

GetAuthorizationStatusOptions

PropType
sampleTypestring

StatisticsCollectionOutput

PropType
data{ startDate: string; endDate: string; value: number; }[]

StatisticsCollectionOptions

PropType
startDatestring
endDatestring
anchorDatestring
intervalStatisticsCollectionQueryInterval
quantityTypeSampleNameQuantityType

StatisticsCollectionQueryInterval

PropType
unit'second' | 'minute' | 'hour' | 'day' | 'month' | 'year'
valuenumber

BodyMassQueryOutput

PropType
data{ date: string; value: number; unit: string; uuid: string; sourceName: string; sourceBundleId: string; }[]

BodyMassQueryOptions

PropType
startDatestring
endDatestring
limitnumber

WorkoutsQueryOutput

PropType
data{ uuid: string; startDate: string; endDate: string; duration: number; device?: HealthKitDevice; source: string; sourceBundleId: string; workoutActivityType: string; workoutActivityTypeId: number; totalEnergyBurned?: number; totalDistance?: number; totalFlightsClimbed?: number; totalSwimmingStrokeCount?: number; }[]

HealthKitDevice

PropType
namestring
modelstring
manufacturerstring
hardwareVersionstring
softwareVersionstring
firmwareVersionstring
localIdentifierstring
udiDeviceIdentifierstring

WorkoutsQueryOptions

PropType
startDatestring
endDatestring
limitnumber

Type Aliases

AuthorizationStatus

'notDetermined' | 'sharingDenied' | 'sharingAuthorized'

QuantityType

'stepCount'

6.0.2

1 year ago

6.0.1

1 year ago

6.0.0

1 year ago