mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-31 18:49:43 +08:00
feat(uptime): add deep sleep parameter (#2456)
* docs(uptime): add cordova installation * feat(uptime): add deep sleep parameter * Update index.ts
This commit is contained in:
parent
300db62731
commit
91d22c5211
@ -4,17 +4,18 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
|||||||
/**
|
/**
|
||||||
* @name Uptime
|
* @name Uptime
|
||||||
* @description
|
* @description
|
||||||
* This plugin return the device uptime, without sleep time.
|
* This plugin provides the time spent in milliseconds since boot (uptime).
|
||||||
*
|
*
|
||||||
* @usage
|
* @usage
|
||||||
* ```typescript
|
* ```typescript
|
||||||
|
* ionic cordova plugin add cordova-plugin-uptime
|
||||||
* import { Uptime } from '@ionic-native/uptime';
|
* import { Uptime } from '@ionic-native/uptime';
|
||||||
*
|
*
|
||||||
* constructor(private uptime: Uptime) { }
|
* constructor(private uptime: Uptime) { }
|
||||||
*
|
*
|
||||||
* ...
|
* ...
|
||||||
*
|
*
|
||||||
* this.uptime.getUptime()
|
* this.uptime.getUptime(includeDeepSleep)
|
||||||
* .then(uptime => console.log(uptime))
|
* .then(uptime => console.log(uptime))
|
||||||
* .catch(error => console.log(error));
|
* .catch(error => console.log(error));
|
||||||
*
|
*
|
||||||
@ -31,10 +32,11 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
|||||||
export class Uptime extends IonicNativePlugin {
|
export class Uptime extends IonicNativePlugin {
|
||||||
/**
|
/**
|
||||||
* This function return system uptime
|
* This function return system uptime
|
||||||
|
* @param {boolean} includeDeepSleep Set to true to include system deep sleep
|
||||||
* @return {Promise<string>} Returns a promise that return the uptime in milliseconds
|
* @return {Promise<string>} Returns a promise that return the uptime in milliseconds
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
getUptime(): Promise<string> {
|
getUptime(includeDeepSleep: boolean): Promise<string> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user