File tree Expand file tree Collapse file tree 2 files changed +20
-29
lines changed
src/main/scala/org/scalajs/dom Expand file tree Collapse file tree 2 files changed +20
-29
lines changed Original file line number Diff line number Diff line change 11package org .scalajs .dom .experimental
22
3- import scala .language .implicitConversions
4- import scalajs .js
5-
6- /**
7- * Implicit imports for the vibration api.
8- *
9- * http://www.w3.org/TR/2015/REC-vibration-20150210/
10- */
11- object Vibration {
12- implicit def toVibration (n : org.scalajs.dom.Navigator ): VibrationNavigator =
13- n.asInstanceOf [VibrationNavigator ]
14-
15- @ js.native
16- trait VibrationNavigator extends js.Any {
17-
18- /** Vibrate the device for the specified number of milliseconds. */
19- def vibrate (duration : Double ): Boolean = js.native
20-
21- /**
22- * Vibrate the device in the given pattern.
23- *
24- * @param pattern the pattern to vibrate. The first number is the initial
25- * duration, the subsequent a delay of silence, and so on.
26- */
27- def vibrate (pattern : js.Array [Double ]): Boolean = js.native
28- }
29- }
3+ @ deprecated(" the extensions of Vibration are now available by default" ,
4+ " 2.0.0" )
5+ object Vibration
Original file line number Diff line number Diff line change @@ -491,8 +491,8 @@ trait WindowTimers extends js.Object {
491491@ JSGlobal
492492class Navigator
493493 extends NavigatorID with NavigatorOnLine with NavigatorContentUtils
494- with NavigatorGeolocation with NavigatorStorageUtils
495- with NavigatorLanguage {
494+ with NavigatorGeolocation with NavigatorStorageUtils with NavigatorLanguage
495+ with NavigatorVibration {
496496
497497 /**
498498 * The Clipboard API adds to the Navigator interface the read-only
@@ -5367,6 +5367,21 @@ trait WindowLocalStorage extends js.Object {
53675367@ js.native
53685368trait NavigatorStorageUtils extends js.Object
53695369
5370+ @ js.native
5371+ trait NavigatorVibration extends js.Object {
5372+
5373+ /** Vibrate the device for the specified number of milliseconds. */
5374+ def vibrate (duration : Double ): Boolean = js.native
5375+
5376+ /**
5377+ * Vibrate the device in the given pattern.
5378+ *
5379+ * @param pattern the pattern to vibrate. The first number is the initial
5380+ * duration, the subsequent a delay of silence, and so on.
5381+ */
5382+ def vibrate (pattern : js.Array [Double ]): Boolean = js.native
5383+ }
5384+
53705385/**
53715386 * The Location interface represents the location of the object it is linked to.
53725387 * Changes done on it are reflected on the object it relates to. Both the Document and
You can’t perform that action at this time.
0 commit comments