refactor(health): fix return types and prefix interfaces

This commit is contained in:
Ibby 2017-03-04 08:20:35 -05:00
parent b8c8a1aa8d
commit b851de9cc8

View File

@ -1,6 +1,6 @@
import {Plugin, Cordova} from './plugin'; import {Plugin, Cordova} from './plugin';
export interface QueryOptions { export interface HealthQueryOptions {
/** /**
* Start date from which to get data * Start date from which to get data
*/ */
@ -33,7 +33,7 @@ export interface QueryOptions {
filtered?: boolean; filtered?: boolean;
} }
export interface QueryOptionsAggregated { export interface HealthQueryOptionsAggregated {
/** /**
* Start date from which to get data * Start date from which to get data
*/ */
@ -56,7 +56,7 @@ export interface QueryOptionsAggregated {
bucket: string; bucket: string;
} }
export interface StoreOptions { export interface HealthStoreOptions {
/** /**
* Start date from which to get data * Start date from which to get data
*/ */
@ -112,13 +112,13 @@ export interface HealthData {
*/ */
unit: string; unit: string;
/* /**
* The source that produced this data. In iOS this is ignored and * The source that produced this data. In iOS this is ignored and
* set automatically to the name of your app. * set automatically to the name of your app.
*/ */
sourceName: string; sourceName: string;
/* /**
* The complete package of the source that produced this data. * The complete package of the source that produced this data.
* In Android, if not specified, it's assigned to the package of the App. In iOS this is ignored and * In Android, if not specified, it's assigned to the package of the App. In iOS this is ignored and
* set automatically to the bunde id of the app. * set automatically to the bunde id of the app.
@ -137,6 +137,11 @@ export interface HealthData {
* *
* ``` * ```
* See description at https://github.com/dariosalvi78/cordova-plugin-health for a full list of Datatypes and see examples. * See description at https://github.com/dariosalvi78/cordova-plugin-health for a full list of Datatypes and see examples.
* @interfaces
* HealthQueryOptions
* HealthQueryOptionsAggregated
* HealthStoreOptions
* HealthData
*/ */
@Plugin({ @Plugin({
@ -242,11 +247,11 @@ export class Health {
* nutrition.vitamin_a is given in micrograms in HealthKit and International Unit in Google Fit. * nutrition.vitamin_a is given in micrograms in HealthKit and International Unit in Google Fit.
* Automatic conversion is not trivial and depends on the actual substance. * Automatic conversion is not trivial and depends on the actual substance.
* *
* @param queryOptions * @param queryOptions {HealthQueryOptions}
* * @return {Promise<HealthData>}
*/ */
@Cordova() @Cordova()
static query(queryOptions: QueryOptions): Promise<any> { static query(queryOptions: HealthQueryOptions): Promise<HealthData> {
return; return;
}; };
@ -269,10 +274,10 @@ export class Health {
* nutrition.vitamin_a is given in micrograms in HealthKit and International Unit in Google Fit. * nutrition.vitamin_a is given in micrograms in HealthKit and International Unit in Google Fit.
* *
* @param queryOptionsAggregated * @param queryOptionsAggregated
* @return {Promise<any>} * @return {Promise<HealthData>}
*/ */
@Cordova() @Cordova()
static queryAggregated(queryOptionsAggregated: QueryOptionsAggregated): Promise<any> { static queryAggregated(queryOptionsAggregated: HealthQueryOptionsAggregated): Promise<HealthData> {
return; return;
}; };
@ -291,7 +296,7 @@ export class Health {
* @return {Promise<any>} * @return {Promise<any>}
*/ */
@Cordova() @Cordova()
static store(storeOptions: StoreOptions): Promise<any> { static store(storeOptions: HealthStoreOptions): Promise<any> {
return; return;
}; };