File tree 2 files changed +17
-28
lines changed
src/main/scala/org/scalajs/dom
2 files changed +17
-28
lines changed Original file line number Diff line number Diff line change 1
1
package org .scalajs .dom .experimental
2
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
- @ 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" , " 2.0.0" )
4
+ object Vibration
Original file line number Diff line number Diff line change @@ -492,7 +492,7 @@ trait WindowTimers extends js.Object {
492
492
class Navigator
493
493
extends NavigatorID with NavigatorOnLine with NavigatorContentUtils
494
494
with NavigatorGeolocation with NavigatorStorageUtils
495
- with NavigatorLanguage {
495
+ with NavigatorLanguage with NavigatorVibration {
496
496
497
497
/**
498
498
* The Clipboard API adds to the Navigator interface the read-only
@@ -5367,6 +5367,20 @@ trait WindowLocalStorage extends js.Object {
5367
5367
@ js.native
5368
5368
trait NavigatorStorageUtils extends js.Object
5369
5369
5370
+ @ js.native
5371
+ trait NavigatorVibration extends js.Object {
5372
+ /** Vibrate the device for the specified number of milliseconds. */
5373
+ def vibrate (duration : Double ): Boolean = js.native
5374
+
5375
+ /**
5376
+ * Vibrate the device in the given pattern.
5377
+ *
5378
+ * @param pattern the pattern to vibrate. The first number is the initial
5379
+ * duration, the subsequent a delay of silence, and so on.
5380
+ */
5381
+ def vibrate (pattern : js.Array [Double ]): Boolean = js.native
5382
+ }
5383
+
5370
5384
/**
5371
5385
* The Location interface represents the location of the object it is linked to.
5372
5386
* 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