Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: options input type for more clarity #296

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/saveMindfulSession.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Call the method:

```javascript
AppleHealthKit.saveMindfulSession(
(options: HealthInputOptions),
(options: MindfulSessionOptions),
(err: Object, results: number) => {
if (err)
return {
Expand Down
40 changes: 22 additions & 18 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ declare module 'react-native-health' {
}

export interface HKErrorResponse {
message?: string;
message?: string
}

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

saveMindfulSession(
options: HealthValueOptions,
options: MindfulSessionOptions,
callback: (error: string, result: HealthValue) => void,
): void

Expand Down Expand Up @@ -478,10 +478,10 @@ declare module 'react-native-health' {
}

export interface HeartbeatSeriesSampleValue extends BaseValue {
heartbeatSeries: ({
heartbeatSeries: {
timeSinceSeriesStart: number
precededByGap: boolean
})[]
}[]
}

export interface HealthUnitOptions {
Expand Down Expand Up @@ -526,15 +526,13 @@ declare module 'react-native-health' {
end: string
}



export interface ElectrocardiogramSampleValue extends BaseValue {
classification: ElectrocardiogramClassification,
averageHeartRate: number,
samplingFrequency: number,
device: string,
algorithmVersion: number,
voltageMeasurements: (number[])[]
classification: ElectrocardiogramClassification
averageHeartRate: number
samplingFrequency: number
device: string
algorithmVersion: number
voltageMeasurements: number[][]
}

export interface HealthValueOptions extends HealthUnitOptions {
Expand Down Expand Up @@ -578,14 +576,20 @@ declare module 'react-native-health' {
LabResultRecord = 'LabResultRecord',
MedicationRecord = 'MedicationRecord',
ProcedureRecord = 'ProcedureRecord',
VitalSignRecord = 'VitalSignRecord'
VitalSignRecord = 'VitalSignRecord',
}

export interface HealthClinicalRecord extends BaseValue {
sourceName: string,
sourceId: string,
displayName: string,
fhirData: any,
sourceName: string
sourceId: string
displayName: string
fhirData: any
}

export interface MindfulSessionOptions {
startDate: string
endDate: string
value?: number
}

/* Health Constants */
Expand Down Expand Up @@ -760,7 +764,7 @@ declare module 'react-native-health' {
WalkingHeartRateAverage = 'WalkingHeartRateAverage',
Weight = 'Weight',
Workout = 'Workout',
WorkoutRoute = 'WorkoutRoute'
WorkoutRoute = 'WorkoutRoute',
}

export enum HealthUnit {
Expand Down