awesome-cordova-plugins/src/@ionic-native/plugins/extended-device-information/index.ts

59 lines
1.3 KiB
TypeScript
Raw Normal View History

import { Injectable } from '@angular/core';
2017-12-28 20:28:44 +08:00
import { CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name Extended Device Information
* @description
2018-08-17 04:43:50 +08:00
* Retrieves additional device information from the Device Hardware
* - memory
* - cpumhz
* - totalstorage
* - freestorage
*
* @usage
* ```typescript
* import { ExtendedDeviceInformation } from '@ionic-native/extended-device-information';
*
*
* constructor(private extendedDeviceInformation: ExtendedDeviceInformation) { }
*
* ...
*
* console.log('The Memory is: ' + this.extendedDeviceInformation.memory);
* ```
*/
@Plugin({
pluginName: 'ExtendedDeviceInformation',
plugin: 'cordova-plugin-extended-device-information',
pluginRef: 'extended-device-information',
2018-08-17 04:43:50 +08:00
repo:
'https://github.com/danielehrhardt/cordova-plugin-extended-device-information',
platforms: ['Android']
})
@Injectable()
export class ExtendedDeviceInformation extends IonicNativePlugin {
2017-09-28 05:44:06 +08:00
/**
* Get the device's memory size
*/
2017-12-28 20:28:44 +08:00
@CordovaProperty()
memory: number;
2017-09-28 05:44:06 +08:00
/**
* Get the device's CPU mhz
*/
2017-12-28 20:28:44 +08:00
@CordovaProperty()
cpumhz: string;
2017-09-28 05:44:06 +08:00
/**
* Get the total storage
*/
2017-12-28 20:28:44 +08:00
@CordovaProperty()
totalstorage: string;
2018-08-17 04:43:50 +08:00
/**
* Get the total storage
*/
@CordovaProperty()
2018-08-17 04:43:50 +08:00
freestorage: number;
}