File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
src/main/scala/org/scalajs/dom/experimental Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ package org .scalajs .dom .experimental
2+
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+ class VibrationNavigator extends js.Any {
16+ /** Vibrate the device for the specified number of milliseconds. */
17+ def vibrate (duration : Double ): Boolean = js.native
18+
19+ /**
20+ * Vibrate the device in the given pattern.
21+ *
22+ * @param pattern the pattern to vibrate. The first number is the initial
23+ * duration, the subsequent a delay of silence, and so on.
24+ */
25+ def vibrate (pattern : js.Array [Double ]): Boolean = js.native
26+ }
27+ }
You can’t perform that action at this time.
0 commit comments