Skip to content

Commit 4e83b8c

Browse files
author
Tamer Moustafa
authored
Add companion object for AlertButton
1 parent f660d4a commit 4e83b8c

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/main/scala/sri/universal/apis/Alert.scala

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,19 @@ trait Alert extends js.Object {
1818
object Alert extends Alert
1919

2020
trait AlertButton extends js.Object {
21-
var text: js.UndefOr[String] = js.undefined
22-
var onPress: js.UndefOr[js.Function] = js.undefined
23-
var style: js.UndefOr[AlertButtonStyle] = js.undefined
21+
val text: js.UndefOr[String] = js.undefined
22+
val onPress: js.UndefOr[js.Function] = js.undefined
23+
val style: js.UndefOr[AlertButtonStyle] = js.undefined
24+
}
25+
26+
object AlertButton {
27+
@inline
28+
def apply(text: OP[String] = NoValue,
29+
onPress: OP[() => _] = NoValue,
30+
style: OP[AlertButtonStyle] = NoValue): AlertButton = {
31+
val p = FunctionObjectMacro()
32+
p.asInstanceOf[AlertButton]
33+
}
2434
}
2535

2636
trait AlertOptions extends js.Object {

0 commit comments

Comments
 (0)