cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [05/15] cordova-plugin-vibration git commit: CB-12369: Add plugin typings from DefinitelyTyped
Date Thu, 27 Apr 2017 20:13:03 GMT
CB-12369: Add plugin typings from DefinitelyTyped

 This closes #51


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

Branch: refs/heads/2.1.x
Commit: a109a8240bb70c0657d0a75b546980ce79b3b8df
Parents: 66f5e71
Author: Nikita Matrosov <v-nimatr@microsoft.com>
Authored: Thu Jan 19 16:12:32 2017 +0300
Committer: Vladimir Kotikov <kotikov.vladimir@gmail.com>
Committed: Fri Jan 20 11:47:34 2017 +0300

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


http://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration/blob/a109a824/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 4e671e7..06333c3 100644
--- a/package.json
+++ b/package.json
@@ -2,6 +2,7 @@
   "name": "cordova-plugin-vibration",
   "version": "2.1.4-dev",
   "description": "Cordova Vibration Plugin",
+  "types": "./types/index.d.ts",
   "cordova": {
     "id": "cordova-plugin-vibration",
     "platforms": [

http://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration/blob/a109a824/types/index.d.ts
----------------------------------------------------------------------
diff --git a/types/index.d.ts b/types/index.d.ts
new file mode 100644
index 0000000..647c167
--- /dev/null
+++ b/types/index.d.ts
@@ -0,0 +1,45 @@
+// Type definitions for Apache Cordova Vibration plugin
+// Project: https://github.com/apache/cordova-plugin-vibration
+// Definitions by: Microsoft Open Technologies Inc <http://msopentech.com>, Louis Lagrange
<https://github.com/Minishlink/>
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+//
+// Copyright (c) Microsoft Open Technologies Inc
+// Licensed under the MIT license.
+
+interface Navigator {
+	/**
+	 * Vibrates the device for the specified amount of time.
+	 * @param time Milliseconds to vibrate the device. 0 cancels the vibration. Ignored on iOS.
+	 */
+    vibrate(time: number): void;
+
+    /**
+	 * Vibrates the device with a given pattern.
+	 * @param time Sequence of durations (in milliseconds) for which to turn on or off the vibrator.
Ignored on iOS.
+	 */
+    vibrate(time: number[]): void;
+}
+
+interface Notification {
+	/**
+	 * Vibrates the device for the specified amount of time.
+	 * @param time Milliseconds to vibrate the device. Ignored on iOS.
+     * @deprecated
+	 */
+    vibrate(time: number): void;
+    /**
+     * Vibrates the device with a given pattern.
+     * @param number[] pattern Pattern with which to vibrate the device.
+     *                         The first value - number of milliseconds to wait before turning
the vibrator on.
+     *                         The next value - the number of milliseconds for which to keep
the vibrator on before turning it off.
+     * @param number  repeat   Optional index into the pattern array at which to start repeating
(will repeat until canceled),
+     *                         or -1 for no repetition (default).
+     * @deprecated
+     */
+    vibrateWithPattern(pattern: number[], repeat: number): void;
+    /**
+     * Immediately cancels any currently running vibration.
+     * @deprecated
+     */
+    cancelVibration(): void;
+}
\ 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


Mime
View raw message