fix(health-kit): add missing checkAuthStatus param (#2544)
* Fix checkAuthStatus * Update index.ts * Update index.ts
This commit is contained in:
parent
f62a123a34
commit
956e644fa4
@ -1,127 +1,81 @@
|
|||||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||||
|
|
||||||
export interface HealthKitOptions {
|
export interface HealthKitOptions {
|
||||||
/**
|
/**
|
||||||
* HKWorkoutActivityType constant
|
* HKWorkoutActivityType constant
|
||||||
* Read more here: https://developer.apple.com/library/ios/documentation/HealthKit/Reference/HKWorkout_Class/#//apple_ref/c/tdef/HKWorkoutActivityType
|
* Read more here: https://developer.apple.com/library/ios/documentation/HealthKit/Reference/HKWorkout_Class/#//apple_ref/c/tdef/HKWorkoutActivityType
|
||||||
*/
|
*/
|
||||||
activityType?: string;
|
activityType?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 'hour', 'week', 'year' or 'day', default 'day'
|
* 'hour', 'week', 'year' or 'day', default 'day'
|
||||||
*/
|
*/
|
||||||
aggregation?: string;
|
aggregation?: string;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
amount?: number;
|
amount?: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* specifies if the data returned by querySampleType() should be sorted by
|
* specifies if the data returned by querySampleType() should be sorted by
|
||||||
* end date in ascending order, default is false
|
* end date in ascending order, default is false
|
||||||
*/
|
*/
|
||||||
ascending?: boolean;
|
ascending?: boolean;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
correlationType?: string;
|
correlationType?: string;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
date?: any;
|
date?: any;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
distance?: number;
|
distance?: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* probably useful with the former param
|
* probably useful with the former param
|
||||||
*/
|
*/
|
||||||
distanceUnit?: string;
|
distanceUnit?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* in seconds, optional, use either this or endDate
|
* in seconds, optional, use either this or endDate
|
||||||
*/
|
*/
|
||||||
duration?: number;
|
duration?: number;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
endDate?: any;
|
endDate?: any;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
energy?: number;
|
energy?: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* J|cal|kcal
|
* J|cal|kcal
|
||||||
*/
|
*/
|
||||||
energyUnit?: string;
|
energyUnit?: string;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
extraData?: any;
|
extraData?: any;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* limits the maximum number of records returned by querySampleType()
|
* limits the maximum number of records returned by querySampleType()
|
||||||
*/
|
*/
|
||||||
limit?: number;
|
limit?: number;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
metadata?: any;
|
metadata?: any;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
quantityType?: string;
|
quantityType?: string;
|
||||||
|
|
||||||
/**
|
type?: string;
|
||||||
*
|
|
||||||
*/
|
|
||||||
readTypes?: any;
|
readTypes?: any;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
requestWritePermission?: boolean;
|
requestWritePermission?: boolean;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
samples?: any;
|
samples?: any;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
sampleType?: string;
|
sampleType?: string;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
startDate?: any;
|
startDate?: any;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* m|cm|mm|in|ft
|
* m|cm|mm|in|ft
|
||||||
*/
|
*/
|
||||||
unit?: string;
|
unit?: string;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
requestReadPermission?: boolean;
|
requestReadPermission?: boolean;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
writeTypes?: any;
|
writeTypes?: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,168 +107,207 @@ export interface HealthKitOptions {
|
|||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class HealthKit extends IonicNativePlugin {
|
export class HealthKit extends IonicNativePlugin {
|
||||||
|
/**
|
||||||
|
* Check if HealthKit is supported (iOS8+, not on iPad)
|
||||||
|
* @returns {Promise<any>}
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
available(): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if HealthKit is supported (iOS8+, not on iPad)
|
* Pass in a type and get back on of undetermined | denied | authorized
|
||||||
* @returns {Promise<any>}
|
* @param options {HealthKitOptions}
|
||||||
*/
|
* @returns {Promise<any>}
|
||||||
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
available(): Promise<any> { return; }
|
checkAuthStatus(options: HealthKitOptions): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pass in a type and get back on of undetermined | denied | authorized
|
* Ask some or all permissions up front
|
||||||
* @param options {HealthKitOptions}
|
* @param options {HealthKitOptions}
|
||||||
* @returns {Promise<any>}
|
* @returns {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
checkAuthStatus(options: HealthKitOptions): Promise<any> { return; }
|
requestAuthorization(options: HealthKitOptions): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ask some or all permissions up front
|
* Formatted as yyyy-MM-dd
|
||||||
* @param options {HealthKitOptions}
|
* @returns {Promise<any>}
|
||||||
* @returns {Promise<any>}
|
*/
|
||||||
*/
|
|
||||||
@Cordova()
|
@Cordova()
|
||||||
requestAuthorization(options: HealthKitOptions): Promise<any> { return; }
|
readDateOfBirth(): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Formatted as yyyy-MM-dd
|
* Output = male|female|other|unknown
|
||||||
* @returns {Promise<any>}
|
* @returns {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
readDateOfBirth(): Promise<any> { return; }
|
readGender(): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output = male|female|other|unknown
|
* Output = A+|A-|B+|B-|AB+|AB-|O+|O-|unknown
|
||||||
* @returns {Promise<any>}
|
* @returns {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
readGender(): Promise<any> { return; }
|
readBloodType(): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output = A+|A-|B+|B-|AB+|AB-|O+|O-|unknown
|
* Output = I|II|III|IV|V|VI|unknown
|
||||||
* @returns {Promise<any>}
|
* @returns {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
readBloodType(): Promise<any> { return; }
|
readFitzpatrickSkinType(): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output = I|II|III|IV|V|VI|unknown
|
* Pass in unit (g=gram, kg=kilogram, oz=ounce, lb=pound, st=stone) and amount
|
||||||
* @returns {Promise<any>}
|
* @param options {HealthKitOptions}
|
||||||
*/
|
* @returns {Promise<any>}
|
||||||
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
readFitzpatrickSkinType(): Promise<any> { return; }
|
saveWeight(options: HealthKitOptions): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pass in unit (g=gram, kg=kilogram, oz=ounce, lb=pound, st=stone) and amount
|
* Pass in unit (g=gram, kg=kilogram, oz=ounce, lb=pound, st=stone)
|
||||||
* @param options {HealthKitOptions}
|
* @param options {HealthKitOptions}
|
||||||
* @returns {Promise<any>}
|
* @returns {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
saveWeight(options: HealthKitOptions): Promise<any> { return; }
|
readWeight(options: HealthKitOptions): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pass in unit (g=gram, kg=kilogram, oz=ounce, lb=pound, st=stone)
|
* Pass in unit (mm=millimeter, cm=centimeter, m=meter, in=inch, ft=foot) and amount
|
||||||
* @param options {HealthKitOptions}
|
* @param options {HealthKitOptions}
|
||||||
* @returns {Promise<any>}
|
* @returns {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
readWeight(options: HealthKitOptions): Promise<any> { return; }
|
saveHeight(options: HealthKitOptions): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pass in unit (mm=millimeter, cm=centimeter, m=meter, in=inch, ft=foot) and amount
|
* Pass in unit (mm=millimeter, cm=centimeter, m=meter, in=inch, ft=foot)
|
||||||
* @param options {HealthKitOptions}
|
* @param options {HealthKitOptions}
|
||||||
* @returns {Promise<any>}
|
* @returns {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
saveHeight(options: HealthKitOptions): Promise<any> { return; }
|
readHeight(options: HealthKitOptions): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pass in unit (mm=millimeter, cm=centimeter, m=meter, in=inch, ft=foot)
|
* no params yet, so this will return all workouts ever of any type
|
||||||
* @param options {HealthKitOptions}
|
* @returns {Promise<any>}
|
||||||
* @returns {Promise<any>}
|
*/
|
||||||
*/
|
|
||||||
@Cordova()
|
@Cordova()
|
||||||
readHeight(options: HealthKitOptions): Promise<any> { return; }
|
findWorkouts(): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* no params yet, so this will return all workouts ever of any type
|
*
|
||||||
* @returns {Promise<any>}
|
* @param options {HealthKitOptions}
|
||||||
*/
|
* @returns {Promise<any>}
|
||||||
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
findWorkouts(): Promise<any> { return; }
|
saveWorkout(options: HealthKitOptions): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param options {HealthKitOptions}
|
* @param options {HealthKitOptions}
|
||||||
* @returns {Promise<any>}
|
* @returns {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
saveWorkout(options: HealthKitOptions): Promise<any> { return; }
|
querySampleType(options: HealthKitOptions): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param options {HealthKitOptions}
|
* @param options {HealthKitOptions}
|
||||||
* @returns {Promise<any>}
|
* @returns {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
querySampleType(options: HealthKitOptions): Promise<any> { return; }
|
querySampleTypeAggregated(options: HealthKitOptions): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param options {HealthKitOptions}
|
* @param options {HealthKitOptions}
|
||||||
* @returns {Promise<any>}
|
* @returns {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
querySampleTypeAggregated(options: HealthKitOptions): Promise<any> { return; }
|
deleteSamples(options: HealthKitOptions): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param options {HealthKitOptions}
|
* @param options {HealthKitOptions}
|
||||||
* @returns {Promise<any>}
|
* @returns {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
deleteSamples(options: HealthKitOptions): Promise<any> { return; }
|
monitorSampleType(options: HealthKitOptions): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param options {HealthKitOptions}
|
* @param options {HealthKitOptions}
|
||||||
* @returns {Promise<any>}
|
* @returns {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
monitorSampleType(options: HealthKitOptions): Promise<any> { return; }
|
sumQuantityType(options: HealthKitOptions): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param options {HealthKitOptions}
|
* @param options {HealthKitOptions}
|
||||||
* @returns {Promise<any>}
|
* @returns {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
sumQuantityType(options: HealthKitOptions): Promise<any> { return; }
|
saveQuantitySample(options: HealthKitOptions): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param options {HealthKitOptions}
|
* @param options {HealthKitOptions}
|
||||||
* @returns {Promise<any>}
|
* @returns {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
saveQuantitySample(options: HealthKitOptions): Promise<any> { return; }
|
saveCorrelation(options: HealthKitOptions): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param options {HealthKitOptions}
|
* @param options {HealthKitOptions}
|
||||||
* @returns {Promise<any>}
|
* @returns {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
saveCorrelation(options: HealthKitOptions): Promise<any> { return; }
|
queryCorrelationType(options: HealthKitOptions): Promise<any> {
|
||||||
|
return;
|
||||||
/**
|
}
|
||||||
*
|
|
||||||
* @param options {HealthKitOptions}
|
|
||||||
* @returns {Promise<any>}
|
|
||||||
*/
|
|
||||||
@Cordova()
|
|
||||||
queryCorrelationType(options: HealthKitOptions): Promise<any> { return; }
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user