mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-21 00:23:00 +08:00
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 { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface HealthKitOptions {
|
||||
/**
|
||||
* HKWorkoutActivityType constant
|
||||
* Read more here: https://developer.apple.com/library/ios/documentation/HealthKit/Reference/HKWorkout_Class/#//apple_ref/c/tdef/HKWorkoutActivityType
|
||||
*/
|
||||
* HKWorkoutActivityType constant
|
||||
* Read more here: https://developer.apple.com/library/ios/documentation/HealthKit/Reference/HKWorkout_Class/#//apple_ref/c/tdef/HKWorkoutActivityType
|
||||
*/
|
||||
activityType?: string;
|
||||
|
||||
/**
|
||||
* 'hour', 'week', 'year' or 'day', default 'day'
|
||||
*/
|
||||
* 'hour', 'week', 'year' or 'day', default 'day'
|
||||
*/
|
||||
aggregation?: string;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
amount?: number;
|
||||
|
||||
/**
|
||||
* specifies if the data returned by querySampleType() should be sorted by
|
||||
* end date in ascending order, default is false
|
||||
*/
|
||||
* specifies if the data returned by querySampleType() should be sorted by
|
||||
* end date in ascending order, default is false
|
||||
*/
|
||||
ascending?: boolean;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
correlationType?: string;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
date?: any;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
distance?: number;
|
||||
|
||||
/**
|
||||
* probably useful with the former param
|
||||
*/
|
||||
* probably useful with the former param
|
||||
*/
|
||||
distanceUnit?: string;
|
||||
|
||||
/**
|
||||
* in seconds, optional, use either this or endDate
|
||||
*/
|
||||
* in seconds, optional, use either this or endDate
|
||||
*/
|
||||
duration?: number;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
endDate?: any;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
energy?: number;
|
||||
|
||||
/**
|
||||
* J|cal|kcal
|
||||
*/
|
||||
* J|cal|kcal
|
||||
*/
|
||||
energyUnit?: string;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
extraData?: any;
|
||||
|
||||
/**
|
||||
* limits the maximum number of records returned by querySampleType()
|
||||
*/
|
||||
* limits the maximum number of records returned by querySampleType()
|
||||
*/
|
||||
limit?: number;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
metadata?: any;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
quantityType?: string;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
type?: string;
|
||||
|
||||
readTypes?: any;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
requestWritePermission?: boolean;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
samples?: any;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
sampleType?: string;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
startDate?: any;
|
||||
|
||||
/**
|
||||
* m|cm|mm|in|ft
|
||||
*/
|
||||
* m|cm|mm|in|ft
|
||||
*/
|
||||
unit?: string;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
requestReadPermission?: boolean;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
writeTypes?: any;
|
||||
}
|
||||
|
||||
@ -153,168 +107,207 @@ export interface HealthKitOptions {
|
||||
})
|
||||
@Injectable()
|
||||
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)
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
* Pass in a type and get back on of undetermined | denied | authorized
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
available(): Promise<any> { return; }
|
||||
checkAuthStatus(options: HealthKitOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pass in a type and get back on of undetermined | denied | authorized
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
* Ask some or all permissions up front
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
checkAuthStatus(options: HealthKitOptions): Promise<any> { return; }
|
||||
requestAuthorization(options: HealthKitOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ask some or all permissions up front
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
* Formatted as yyyy-MM-dd
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
requestAuthorization(options: HealthKitOptions): Promise<any> { return; }
|
||||
readDateOfBirth(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Formatted as yyyy-MM-dd
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
* Output = male|female|other|unknown
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
readDateOfBirth(): Promise<any> { return; }
|
||||
readGender(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Output = male|female|other|unknown
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
* Output = A+|A-|B+|B-|AB+|AB-|O+|O-|unknown
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
readGender(): Promise<any> { return; }
|
||||
readBloodType(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Output = A+|A-|B+|B-|AB+|AB-|O+|O-|unknown
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
* Output = I|II|III|IV|V|VI|unknown
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
readBloodType(): Promise<any> { return; }
|
||||
readFitzpatrickSkinType(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Output = I|II|III|IV|V|VI|unknown
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
* Pass in unit (g=gram, kg=kilogram, oz=ounce, lb=pound, st=stone) and amount
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@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
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
* Pass in unit (g=gram, kg=kilogram, oz=ounce, lb=pound, st=stone)
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@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)
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
* Pass in unit (mm=millimeter, cm=centimeter, m=meter, in=inch, ft=foot) and amount
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@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
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
* Pass in unit (mm=millimeter, cm=centimeter, m=meter, in=inch, ft=foot)
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@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)
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
* no params yet, so this will return all workouts ever of any type
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@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()
|
||||
findWorkouts(): Promise<any> { return; }
|
||||
saveWorkout(options: HealthKitOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
saveWorkout(options: HealthKitOptions): Promise<any> { return; }
|
||||
querySampleType(options: HealthKitOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
querySampleType(options: HealthKitOptions): Promise<any> { return; }
|
||||
querySampleTypeAggregated(options: HealthKitOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
querySampleTypeAggregated(options: HealthKitOptions): Promise<any> { return; }
|
||||
deleteSamples(options: HealthKitOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
deleteSamples(options: HealthKitOptions): Promise<any> { return; }
|
||||
monitorSampleType(options: HealthKitOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
monitorSampleType(options: HealthKitOptions): Promise<any> { return; }
|
||||
sumQuantityType(options: HealthKitOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
sumQuantityType(options: HealthKitOptions): Promise<any> { return; }
|
||||
saveQuantitySample(options: HealthKitOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
saveQuantitySample(options: HealthKitOptions): Promise<any> { return; }
|
||||
saveCorrelation(options: HealthKitOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
saveCorrelation(options: HealthKitOptions): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
queryCorrelationType(options: HealthKitOptions): Promise<any> { return; }
|
||||
|
||||
|
||||
queryCorrelationType(options: HealthKitOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user