Files
awesome-cordova-plugins/src/@ionic-native/plugins/device/index.ts
T

68 lines
1.6 KiB
TypeScript
Raw Normal View History

import { Injectable } from '@angular/core';
import { CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core';
2016-07-08 00:51:45 +02:00
2017-05-14 00:55:16 -04:00
declare const window: any;
2015-11-29 17:20:11 -06:00
2016-01-25 16:20:36 -06:00
/**
* @name Device
* @description
2016-01-25 16:20:36 -06:00
* Access information about the underlying device and platform.
*
* @usage
2016-07-20 17:17:09 +02:00
* ```typescript
* import { Device } from '@ionic-native/device';
*
* constructor(private device: Device) { }
*
* ...
*
* console.log('Device UUID is: ' + this.device.uuid);
2016-01-25 16:20:36 -06:00
* ```
*/
2015-11-29 17:20:11 -06:00
@Plugin({
pluginName: 'Device',
2015-11-29 17:20:11 -06:00
plugin: 'cordova-plugin-device',
pluginRef: 'device',
2017-03-28 08:24:04 -04:00
repo: 'https://github.com/apache/cordova-plugin-device',
2017-05-28 00:00:18 -08:00
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'macOS', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone']
2015-11-29 17:20:11 -06:00
})
@Injectable()
export class Device extends IonicNativePlugin {
2016-01-25 16:20:36 -06:00
2016-12-06 07:33:08 -05:00
/** Get the version of Cordova running on the device. */
@CordovaProperty
cordova: string;
2016-12-06 07:33:08 -05:00
2016-04-29 23:56:49 -04:00
/**
2016-12-06 07:33:08 -05:00
* The device.model returns the name of the device's model or product. The value is set
* by the device manufacturer and may be different across versions of the same product.
2016-04-29 23:56:49 -04:00
*/
2016-03-04 13:56:22 -06:00
@CordovaProperty
model: string;
2016-12-06 07:33:08 -05:00
/** Get the device's operating system name. */
@CordovaProperty
platform: string;
2016-12-06 07:33:08 -05:00
/** Get the device's Universally Unique Identifier (UUID). */
@CordovaProperty
uuid: string;
2016-12-06 07:33:08 -05:00
/** Get the operating system version. */
@CordovaProperty
version: string;
2016-12-06 07:33:08 -05:00
/** Get the device's manufacturer. */
@CordovaProperty
manufacturer: string;
2016-12-06 07:33:08 -05:00
/** Whether the device is running on a simulator. */
@CordovaProperty
isVirtual: boolean;
2016-12-06 07:33:08 -05:00
/** Get the device hardware serial number. */
@CordovaProperty
serial: string;
2016-07-20 17:17:09 +02:00
2015-11-29 17:20:11 -06:00
}