diff --git a/dist/plugins/device.d.ts b/dist/plugins/device.d.ts index 4055a41db..ce5120b39 100644 --- a/dist/plugins/device.d.ts +++ b/dist/plugins/device.d.ts @@ -1,17 +1,37 @@ +export interface Device { + /** Get the version of Cordova running on the device. */ + cordova: string; + /** + * 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. + */ + model: string; + /** Get the device's operating system name. */ + platform: string; + /** Get the device's Universally Unique Identifier (UUID). */ + uuid: string; + /** Get the operating system version. */ + version: string; + /** Get the device's manufacturer. */ + manufacturer: string; + /** Whether the device is running on a simulator. */ + isVirtual: boolean; + /** Get the device hardware serial number. */ + serial: string; +} /** * Access information about the underlying device and platform. * * @usage * ```js * let info = Device.getDevice(); - * // Device sits below * ``` */ export declare class Device { /** * Returns the whole device object. - * @see https://github.com/apache/cordova-plugin-device + * * @returns {Object} The device object. */ - static getDevice(): any; + static getDevice(): Device; } diff --git a/dist/plugins/device.js b/dist/plugins/device.js index 5c2b09762..7a5f92009 100644 --- a/dist/plugins/device.js +++ b/dist/plugins/device.js @@ -11,7 +11,6 @@ var plugin_1 = require('./plugin'); * @usage * ```js * let info = Device.getDevice(); - * // Device sits below * ``` */ var Device = (function () { @@ -19,7 +18,7 @@ var Device = (function () { } /** * Returns the whole device object. - * @see https://github.com/apache/cordova-plugin-device + * * @returns {Object} The device object. */ Device.getDevice = function () { diff --git a/dist/plugins/device.js.map b/dist/plugins/device.js.map index 1594efb31..f0593c76f 100644 --- a/dist/plugins/device.js.map +++ b/dist/plugins/device.js.map @@ -1 +1 @@ -{"version":3,"file":"device.js","sourceRoot":"","sources":["../../src/plugins/device.ts"],"names":["Device","Device.constructor","Device.getDevice"],"mappings":";;;;;;AAAA,uBAAqC,UAAU,CAAC,CAAA;AAKhD;;;;;;;;GAQG;AACH;IAAAA;IAgBAC,CAACA;IATDD;;;;OAIGA;IAEMA,gBAASA,GADhBA;QAEEE,MAAMA,CAACA,MAAMA,CAACA,MAAMA,CAACA;IACvBA,CAACA;IAHDF;QAACA,uBAAcA;OACRA,mBAASA,QAEfA;IAfHA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,QAAQA;YACdA,MAAMA,EAAEA,uBAAuBA;YAC/BA,SAASA,EAAEA,QAAQA;SACpBA,CAACA;eAYDA;IAADA,aAACA;AAADA,CAACA,AAhBD,IAgBC;AAXY,cAAM,SAWlB,CAAA"} \ No newline at end of file +{"version":3,"file":"device.js","sourceRoot":"","sources":["../../src/plugins/device.ts"],"names":["Device","Device.constructor","Device.getDevice"],"mappings":";;;;;;AAAA,uBAAqC,UAAU,CAAC,CAAA;AA4BhD;;;;;;;GAOG;AACH;IAAAA;IAgBAC,CAACA;IATDD;;;;OAIGA;IAEMA,gBAASA,GADhBA;QAEEE,MAAMA,CAACA,MAAMA,CAACA,MAAMA,CAACA;IACvBA,CAACA;IAHDF;QAACA,uBAAcA;OACRA,mBAASA,QAEfA;IAfHA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,QAAQA;YACdA,MAAMA,EAAEA,uBAAuBA;YAC/BA,SAASA,EAAEA,QAAQA;SACpBA,CAACA;eAYDA;IAADA,aAACA;AAADA,CAACA,AAhBD,IAgBC;AAXY,cAAM,SAWlB,CAAA"} \ No newline at end of file diff --git a/src/plugins/device.ts b/src/plugins/device.ts index 48dfdb6a3..1a9d1190a 100644 --- a/src/plugins/device.ts +++ b/src/plugins/device.ts @@ -1,7 +1,30 @@ import {Plugin, RequiresPlugin} from './plugin'; -declare var window; +declare var window: { + device: Device +}; +export interface Device { + /** Get the version of Cordova running on the device. */ + cordova: string; + /** + * 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. + */ + model: string; + /** Get the device's operating system name. */ + platform: string; + /** Get the device's Universally Unique Identifier (UUID). */ + uuid: string; + /** Get the operating system version. */ + version: string; + /** Get the device's manufacturer. */ + manufacturer: string; + /** Whether the device is running on a simulator. */ + isVirtual: boolean; + /** Get the device hardware serial number. */ + serial: string; +} /** * Access information about the underlying device and platform. @@ -9,7 +32,6 @@ declare var window; * @usage * ```js * let info = Device.getDevice(); - * // Device sits below * ``` */ @Plugin({ @@ -21,7 +43,7 @@ export class Device { /** * Returns the whole device object. - * @see https://github.com/apache/cordova-plugin-device + * * @returns {Object} The device object. */ @RequiresPlugin