Skip to content

Commit

Permalink
docs(background-geolocation): add return types and platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
ihadeed committed Mar 2, 2017
1 parent fc87992 commit 07c867d
Showing 1 changed file with 39 additions and 27 deletions.
66 changes: 39 additions & 27 deletions src/plugins/background-geolocation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,18 +389,21 @@ export class BackgroundGeolocation {

/**
* Inform the native plugin that you're finished, the background-task may be completed
* NOTE: IOS, WP only
* @returns {Promise<any>}
*/
@Cordova()
static finish(): Promise<any> { }
@Cordova({
platforms: ['iOS', 'Windows Phone']
})
static finish(): Promise<any> { return; }

/**
* Force the plugin to enter "moving" or "stationary" state
* NOTE: IOS, WP only
* @returns {Promise<any>}
*/
@Cordova()
static changePace(isMoving: boolean) { }
@Cordova({
platforms: ['iOS', 'Windows Phone']
})
static changePace(isMoving: boolean): Promise<any> { return; }

/**
* Setup configuration
Expand All @@ -413,27 +416,30 @@ export class BackgroundGeolocation {

/**
* Returns current stationaryLocation if available. null if not
* NOTE: IOS, WP only
* @returns {Promise<Location>}
*/
@Cordova()
@Cordova({
platforms: ['iOS', 'Windows Phone']
})
static getStationaryLocation(): Promise<BackgroundGeolocationResponse> { return; }

/**
* Add a stationary-region listener. Whenever the devices enters "stationary-mode",
* your #success callback will be executed with #location param containing #radius of region
* NOTE: IOS, WP only
* @returns {Promise<any>}
*/
@Cordova()
@Cordova({
platforms: ['iOS', 'Windows Phone']
})
static onStationary(): Promise<any> { return; }

/**
* Check if location is enabled on the device
* @returns {Promise<number>} Returns a promise with int argument that takes values 0, 1 (true).
* NOTE: ANDROID only
*/
@Cordova()
@Cordova({
platforms: ['Android']
})
static isLocationEnabled(): Promise<number> { return; }

/**
Expand All @@ -452,18 +458,21 @@ export class BackgroundGeolocation {
* Method can be used to detect user changes in location services settings.
* If user enable or disable location services then success callback will be executed.
* In case or error (SettingNotFoundException) fail callback will be executed.
* NOTE: ANDROID only
* @returns {Promise<boolean>}
*/
@Cordova()
@Cordova({
platforms: ['Android']
})
static watchLocationMode(): Promise<boolean> { return; }

/**
* Stop watching for location mode changes.
* NOTE: ANDROID only
* @returns {Promise<any>}
*/
@Cordova()
static stopWatchingLocationMode() { }
@Cordova({
platforms: ['Android']
})
static stopWatchingLocationMode(): Promise<any> { return; }

/**
* Method will return all stored locations.
Expand All @@ -472,10 +481,11 @@ export class BackgroundGeolocation {
* by the system
* or
* - option.debug is true
* NOTE: ANDROID only
* @returns {Promise<any>}
*/
@Cordova()
@Cordova({
platforms: ['Android']
})
static getLocations(): Promise<any> { return; }

/**

Expand All @@ -487,18 +497,20 @@ export class BackgroundGeolocation {

/**
* Delete stored location by given locationId.
* NOTE: ANDROID only
* @returns {Promise<any>}
*/
@Cordova()
@Cordova({
platforms: ['Android']
})
static deleteLocation(locationId: number): Promise<any> { return; }

/**
* Delete all stored locations.
* NOTE: ANDROID only
* @returns {Promise<any>}
*/
@Cordova()
@Cordova({
platforms: ['Android']
})
static deleteAllLocations(): Promise<any> { return; }

/**
Expand All @@ -510,13 +522,13 @@ export class BackgroundGeolocation {
*
* BackgroundGeolocation.Mode.FOREGROUND
* BackgroundGeolocation.Mode.BACKGROUND

*
* NOTE: iOS only
*
**
* @param {number} See above.

* @returns {Promise<any>}
*/
@Cordova()
@Cordova({
platforms: ['iOS']
})
static switchMode(modeId: number): Promise<any> { return; }

/**

Expand Down

0 comments on commit 07c867d

Please sign in to comment.