From 806766e33e47edd19d3228119a3a1b1024b20be5 Mon Sep 17 00:00:00 2001 From: Daniel Ehrhardt Date: Wed, 27 Sep 2017 23:36:00 +0200 Subject: [PATCH] feat(extended-device-information): add Extended Device Info plugin (#1980) * Added Cordova Device Information Wrapper * Updated Usage Description * Removed unsued line * Added Total Storage --- .../extended-device-information/index.ts | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/@ionic-native/plugins/extended-device-information/index.ts diff --git a/src/@ionic-native/plugins/extended-device-information/index.ts b/src/@ionic-native/plugins/extended-device-information/index.ts new file mode 100644 index 00000000..b41248d9 --- /dev/null +++ b/src/@ionic-native/plugins/extended-device-information/index.ts @@ -0,0 +1,42 @@ +import { Injectable } from '@angular/core'; +import { CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core'; + +/** + * @name Extended Device Information + * @description + * + * @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', + repo: 'https://github.com/danielehrhardt/cordova-plugin-extended-device-information', + platforms: ['Android'] +}) +@Injectable() +export class ExtendedDeviceInformation extends IonicNativePlugin { + + /** Get the device's memory size. */ + @CordovaProperty + memory: number; + + /** Get the device's CPU mhz. */ + @CordovaProperty + cpumhz: string; + + /** Get the device's CPU mhz. */ + @CordovaProperty + totalstorage: string; + +}