Skip to content

Commit

Permalink
Add customized inputs for HealthKit getters
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaspbordignon committed Sep 30, 2020
1 parent b50c4d4 commit 81442b0
Showing 1 changed file with 38 additions and 33 deletions.
71 changes: 38 additions & 33 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ declare module 'react-native-health' {
}

export interface Constants {
Activities: HealthActivity
Observers: HealthObserver
Permissions: HealthPermission
Units: HealthUnit
Activities: Record<HealthActivity, HealthActivity>
Observers: Record<HealthObserver, HealthObserver>
Permissions: Record<HealthPermission, HealthPermission>
Units: Record<HealthUnit, HealthUnit>
}

export interface AppleHealthKit {
Expand Down Expand Up @@ -82,17 +82,17 @@ declare module 'react-native-health' {
): void

getStepCount(
options: HealthUnitOptions,
options: HealthInputOptions,
callback: (err: string, results: HealthValue) => void,
): void

getSamples(
options: HealthUnitOptions,
options: HealthInputOptions,
callback: (err: string, results: HealthValue) => void,
): void

getDailyStepCountSamples(
options: HealthUnitOptions,
options: HealthInputOptions,
callback: (err: string, results: HealthValue) => void,
): void

Expand All @@ -102,32 +102,32 @@ declare module 'react-native-health' {
): void

getDistanceWalkingRunning(
options: HealthUnitOptions,
options: HealthInputOptions,
callback: (err: string, results: HealthValue) => void,
): void

getDailyDistanceWalkingRunningSamples(
options: HealthUnitOptions,
options: HealthInputOptions,
callback: (err: string, results: HealthValue) => void,
): void

getDistanceCycling(
options: HealthUnitOptions,
options: HealthInputOptions,
callback: (err: string, results: HealthValue) => void,
): void

getDailyDistanceCyclingSamples(
options: HealthUnitOptions,
options: HealthInputOptions,
callback: (err: string, results: HealthValue) => void,
): void

getFlightsClimbed(
options: HealthUnitOptions,
options: HealthInputOptions,
callback: (err: string, results: HealthValue) => void,
): void

getDailyFlightsClimbedSamples(
options: HealthUnitOptions,
options: HealthInputOptions,
callback: (err: string, results: HealthValue) => void,
): void

Expand All @@ -142,67 +142,67 @@ declare module 'react-native-health' {
): void

getHeartRateSamples(
options: HealthUnitOptions,
options: HealthInputOptions,
callback: (err: string, results: HealthValue) => void,
): void

getRestingHeartRate(
options: HealthUnitOptions,
options: HealthInputOptions,
callback: (err: string, results: HealthValue) => void,
): void

getWalkingHeartRateAverage(
options: HealthUnitOptions,
options: HealthInputOptions,
callback: (err: string, results: HealthValue) => void,
): void

getActiveEnergyBurned(
options: HealthUnitOptions,
options: HealthInputOptions,
callback: (err: string, results: HealthValue) => void,
): void

getBasalEnergyBurned(
options: HealthUnitOptions,
options: HealthInputOptions,
callback: (err: string, results: HealthValue) => void,
): void

getAppleExerciseTime(
options: HealthUnitOptions,
options: HealthInputOptions,
callback: (err: string, results: HealthValue) => void,
): void

getVo2MaxSamples(
options: HealthUnitOptions,
options: HealthInputOptions,
callback: (err: string, results: HealthValue) => void,
): void

getBodyTemperatureSamples(
options: HealthUnitOptions,
options: HealthInputOptions,
callback: (err: string, results: HealthValue) => void,
): void

getBloodPressureSamples(
options: HealthUnitOptions,
options: HealthInputOptions,
callback: (err: string, results: HealthValue) => void,
): void

getRespiratoryRateSamples(
options: HealthUnitOptions,
options: HealthInputOptions,
callback: (err: string, results: HealthValue) => void,
): void

getHeartRateVariabilitySamples(
options: HealthUnitOptions,
options: HealthInputOptions,
callback: (err: string, results: HealthValue) => void,
): void

getRestingHeartRateSamples(
options: HealthUnitOptions,
options: HealthInputOptions,
callback: (err: string, results: HealthValue) => void,
): void

getBloodGlucoseSamples(
options: HealthUnitOptions,
options: HealthInputOptions,
callback: (err: string, results: HealthValue) => void,
): void

Expand All @@ -212,7 +212,7 @@ declare module 'react-native-health' {
): void

getSleepSamples(
options: HealthUnitOptions,
options: HealthInputOptions,
callback: (err: string, results: HealthValue) => void,
): void

Expand All @@ -222,7 +222,7 @@ declare module 'react-native-health' {
): void

getMindfulSession(
options: HealthValueOptions,
options: HealthInputOptions,
callback: (err: string, results: HealthValue) => void,
): void

Expand All @@ -232,7 +232,7 @@ declare module 'react-native-health' {
): void

getWorkout(
options: HealthUnitOptions,
options: HealthInputOptions,
callback: (err: string, results: HealthValue) => void,
): void

Expand All @@ -247,12 +247,12 @@ declare module 'react-native-health' {
): void

getLatestBloodAlcoholContent(
options: HealthUnitOptions,
options: HealthInputOptions,
callback: (err: string, results: HealthValue) => void,
): void

getBloodAlcoholContentSamples(
options: HealthUnitOptions,
options: HealthInputOptions,
callback: (err: string, results: HealthValue) => void,
): void

Expand Down Expand Up @@ -283,14 +283,19 @@ declare module 'react-native-health' {
unit: HealthUnit
}

export interface HealthValueOptions extends HealthUnitOptions {
value: number
export interface HealthInputOptions extends HealthUnitOptions {
startDate?: string
endDate?: string
limit?: number
ascending?: boolean
}

export interface HealthValueOptions extends HealthUnitOptions {
value: number
startDate?: string
endDate?: string
}

export interface HealthObserverOptions {
type: HealthObserver
}
Expand Down

0 comments on commit 81442b0

Please sign in to comment.