You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2017/01/20 08:39:08 UTC

cordova-plugin-device git commit: CB-12369: Add plugin typings from DefinitelyTyped

Repository: cordova-plugin-device
Updated Branches:
  refs/heads/master 99474e0e5 -> cf56c90f4


CB-12369: Add plugin typings from DefinitelyTyped

 This closes #60


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/commit/cf56c90f
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/tree/cf56c90f
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/diff/cf56c90f

Branch: refs/heads/master
Commit: cf56c90f4f0b3488ce66519edfc055bd93ee967d
Parents: 99474e0
Author: Nikita Matrosov <v-...@microsoft.com>
Authored: Thu Jan 19 15:52:51 2017 +0300
Committer: Vladimir Kotikov <ko...@gmail.com>
Committed: Fri Jan 20 11:06:02 2017 +0300

----------------------------------------------------------------------
 package.json     |  1 +
 types/index.d.ts | 36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/blob/cf56c90f/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 9435f38..46166be 100644
--- a/package.json
+++ b/package.json
@@ -2,6 +2,7 @@
   "name": "cordova-plugin-device",
   "version": "1.1.5-dev",
   "description": "Cordova Device Plugin",
+  "types": "./types/index.d.ts",
   "cordova": {
     "id": "cordova-plugin-device",
     "platforms": [

http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/blob/cf56c90f/types/index.d.ts
----------------------------------------------------------------------
diff --git a/types/index.d.ts b/types/index.d.ts
new file mode 100644
index 0000000..d4450b4
--- /dev/null
+++ b/types/index.d.ts
@@ -0,0 +1,36 @@
+// Type definitions for Apache Cordova Device plugin
+// Project: https://github.com/apache/cordova-plugin-device
+// Definitions by: Microsoft Open Technologies Inc <http://msopentech.com>
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// 
+// Copyright (c) Microsoft Open Technologies Inc
+// Licensed under the MIT license 
+
+/**
+ * This plugin defines a global device object, which describes the device's hardware and software.
+ * Although the object is in the global scope, it is not available until after the deviceready event.
+ */
+interface Device {
+    /** Get the version of Cordova running on the device. */
+    cordova: string;
+    /** Indicates that Cordova initialize successfully. */
+    available: boolean;
+    /**
+     * 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;}
+
+declare var device: Device;
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org