@@ -3,70 +3,70 @@ package org.scalajs.dom
3
3
import scala .scalajs .js
4
4
import scala .scalajs .js .annotation ._
5
5
6
- @ js.native
7
6
trait NotificationOptions extends js.Object {
8
7
9
8
/** The body property of the Notification interface indicates the body string of the notification. */
10
- val body : String = js.native
9
+ var body : js. UndefOr [ String ] = js.undefined
11
10
12
11
/** The dir property of the Notification interface indicates the text direction of the notification. */
13
- val dir : String = js.native
12
+ var dir : js. UndefOr [ String ] = js.undefined
14
13
15
14
/** The icon property of the Notification interface contains the URL of an icon to be displayed as part of the
16
15
* notification.
17
16
*/
18
- val icon : String = js.native
17
+ var icon : js. UndefOr [ String ] = js.undefined
19
18
20
19
/** The lang property of the Notification interface indicates the text direction of the notification. */
21
- val lang : String = js.native
20
+ var lang : js. UndefOr [ String ] = js.undefined
22
21
23
22
/** The noscreen property of the Notification interface specifies whether the notification firing should enable the
24
23
* device's screen or not.
25
24
*/
26
- val noscreen : Boolean = js.native
25
+ var noscreen : js. UndefOr [ Boolean ] = js.undefined
27
26
28
27
/** The renotify property of the Notification interface specifies whether the user should be notified after a new
29
28
* notification replaces an old one.
30
29
*/
31
- val renotify : Boolean = js.native
30
+ var renotify : js. UndefOr [ Boolean ] = js.undefined
32
31
33
32
/** The silent property of the Notification interface specifies whether the notification should be silent, i.e. no
34
33
* sounds or vibrations should be issued, regardless of the device settings.
35
34
*/
36
- val silent : Boolean = js.native
35
+ var silent : js. UndefOr [ Boolean ] = js.undefined
37
36
38
37
/** The sound property of the Notification interface specifies the URL of an audio file to be played when the
39
38
* notification fires.
40
39
*/
41
- val sound : String = js.native
40
+ var sound : js. UndefOr [ String ] = js.undefined
42
41
43
42
/** The sticky property of the Notification interface specifies whether the notification should be 'sticky', i.e. not
44
43
* easily clearable by the user.
45
44
*/
46
- val sticky : Boolean = js.native
45
+ var sticky : js. UndefOr [ Boolean ] = js.undefined
47
46
48
47
/** The tag property of the Notification interface signifies an identifying tag for the notification.
49
48
*
50
49
* The idea of notification tags is that more than one notification can share the same tag, linking them together.
51
50
* One notification can then be programmatically replaced with another to avoid the users' screen being filled up
52
51
* with a huge number of similar notifications.
53
52
*/
54
- val tag : String = js.native
53
+ var tag : js. UndefOr [ String ] = js.undefined
55
54
56
55
/** The onclick property of the Notification interface specifies an event listener to receive click events. These
57
56
* events occur when the user clicks on a displayed Notification.
58
57
*/
59
- val onclick : js.Function0 [Any ] = js.native
58
+ var onclick : js.UndefOr [js. Function0 [Any ]] = js.undefined
60
59
61
60
/** The onerror property of the Notification interface specifies an event listener to receive error events. These
62
61
* events occur when something goes wrong with a Notification (in many cases an error preventing the notification
63
62
* from being displayed.)
64
63
*/
65
- val onerror : js.Function0 [Any ] = js.native
64
+ var onerror : js.UndefOr [js. Function0 [Any ]] = js.undefined
66
65
67
- val vibrate : js.Array [Double ] = js.native
66
+ var vibrate : js.UndefOr [js. Array [Double ]] = js.undefined
68
67
}
69
68
69
+ @ deprecated(" all members of NotificationOptions are deprecated" , " 2.0.0" )
70
70
object NotificationOptions {
71
71
72
72
/** Construct a new NotificationOptions
@@ -97,6 +97,7 @@ object NotificationOptions {
97
97
* @return
98
98
* a new NotificationOptions
99
99
*/
100
+ @ deprecated(" use `new NotificationOptions { ... }` instead" , " 2.0.0" )
100
101
@ inline
101
102
def apply (
102
103
body : js.UndefOr [String ] = js.undefined, dir : js.UndefOr [String ] = js.undefined,
@@ -107,21 +108,34 @@ object NotificationOptions {
107
108
onclick : js.UndefOr [js.Function0 [Any ]] = js.undefined, onerror : js.UndefOr [js.Function0 [Any ]] = js.undefined,
108
109
vibrate : js.UndefOr [js.Array [Double ]] = js.undefined
109
110
): NotificationOptions = {
110
- val result = js.Dynamic .literal()
111
- body.foreach(result.body = _)
112
- dir.foreach(result.dir = _)
113
- icon.foreach(result.icon = _)
114
- lang.foreach(result.lang = _)
115
- noscreen.foreach(result.noscreen = _)
116
- renotify.foreach(result.renotify = _)
117
- silent.foreach(result.silent = _)
118
- sound.foreach(result.sound = _)
119
- sticky.foreach(result.sticky = _)
120
- tag.foreach(result.tag = _)
121
- onclick.foreach(result.onclick = _)
122
- onerror.foreach(result.onerror = _)
123
- vibrate.foreach(result.vibrate = _)
124
- result.asInstanceOf [NotificationOptions ]
111
+ val body0 = body
112
+ val dir0 = dir
113
+ val icon0 = icon
114
+ val lang0 = lang
115
+ val noscreen0 = noscreen
116
+ val renotify0 = renotify
117
+ val silent0 = silent
118
+ val sound0 = sound
119
+ val sticky0 = sticky
120
+ val tag0 = tag
121
+ val onclick0 = onclick
122
+ val onerror0 = onerror
123
+ val vibrate0 = vibrate
124
+ new NotificationOptions {
125
+ this .body = body0
126
+ this .dir = dir0
127
+ this .icon = icon0
128
+ this .lang = lang0
129
+ this .noscreen = noscreen0
130
+ this .renotify = renotify0
131
+ this .silent = silent0
132
+ this .sound = sound0
133
+ this .sticky = sticky0
134
+ this .tag = tag0
135
+ this .onclick = onclick0
136
+ this .onerror = onerror0
137
+ this .vibrate = vibrate0
138
+ }
125
139
}
126
140
}
127
141
0 commit comments