2015-11-30 07:20:11 +08:00
|
|
|
import {Plugin, RequiresPlugin} from './plugin';
|
|
|
|
|
|
|
|
declare var window;
|
|
|
|
|
2016-01-26 06:20:36 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Access information about the underlying device and platform.
|
|
|
|
*
|
|
|
|
* @usage
|
|
|
|
* ```js
|
|
|
|
* let info = Device.getDevice();
|
|
|
|
* // Device sits below
|
|
|
|
* ```
|
|
|
|
*/
|
2015-11-30 07:20:11 +08:00
|
|
|
@Plugin({
|
|
|
|
name: 'Device',
|
|
|
|
plugin: 'cordova-plugin-device',
|
|
|
|
pluginRef: 'device'
|
|
|
|
})
|
|
|
|
export class Device {
|
2016-01-26 06:20:36 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the whole device object.
|
|
|
|
* @see https://github.com/apache/cordova-plugin-device
|
|
|
|
* @returns {Object} The device object.
|
|
|
|
*/
|
2015-11-30 07:20:11 +08:00
|
|
|
@RequiresPlugin
|
|
|
|
static getDevice() {
|
|
|
|
return window.device;
|
|
|
|
}
|
|
|
|
}
|