awesome-cordova-plugins/src/plugins/device.ts

32 lines
555 B
TypeScript
Raw Normal View History

2015-11-30 07:20:11 +08:00
import {Plugin, RequiresPlugin} from './plugin';
declare var window;
/**
* 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 {
/**
* 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;
}
}