Skip to content

Commit 7db857d

Browse files
committed
Add explicit types for constants
1 parent bf47657 commit 7db857d

10 files changed

+27
-27
lines changed

src/main/scala-3/org/scalajs/dom/FrameType.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ object FrameType {
1414
val auxiliary: FrameType = "auxiliary"
1515

1616
/** The window client's global object's browsing context is a top-level browsing context. */
17-
val `top-level` = "top-level"
17+
val `top-level`: FrameType = "top-level"
1818

1919
/** The window client's global object's browsing context is a nested browsing context. */
2020
val nested: FrameType = "nested"

src/main/scala-3/org/scalajs/dom/MIMEType.scala

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import scala.scalajs.js
55
opaque type MIMEType = String
66

77
object MIMEType {
8-
val `text/html` = "text/html"
9-
val `text/xml` = "text/xml"
10-
val `application/xml` = "application/xml"
8+
val `text/html`: MIMEType = "text/html"
9+
val `text/xml`: MIMEType = "text/xml"
10+
val `application/xml`: MIMEType = "application/xml"
1111

12-
val `application/xhtml+xml` =
12+
val `application/xhtml+xml`: MIMEType =
1313
"application/xhtml+xml"
14-
val `image/svg+xml` = "image/svg+xml"
14+
val `image/svg+xml`: MIMEType = "image/svg+xml"
1515
}

src/main/scala-3/org/scalajs/dom/PermissionName.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ object PermissionName {
1010
val notifications: PermissionName = "notifications"
1111
val push: PermissionName = "push"
1212

13-
val `persistent-storage` =
13+
val `persistent-storage`: PermissionName =
1414
"persistent-storage"
1515
}

src/main/scala-3/org/scalajs/dom/RTCBundlePolicy.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ object RTCBundlePolicy {
1616
/** Gather ICE candidates for each track. If the remote endpoint is not BUNDLE-aware, negotiate all media tracks on
1717
* separate transports.
1818
*/
19-
val `max-compat` = "max-compat"
19+
val `max-compat`: RTCBundlePolicy = "max-compat"
2020

2121
/** Gather ICE candidates for only one track. If the remote endpoint is not BUNDLE-aware, negotiate only one media
2222
* track.
2323
*/
24-
val `max-bundle` = "max-bundle"
24+
val `max-bundle`: RTCBundlePolicy = "max-bundle"
2525
}

src/main/scala-3/org/scalajs/dom/RTCSignalingState.scala

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@ object RTCSignalingState {
1313
val stable: RTCSignalingState = "stable"
1414

1515
/** A local description, of type "offer", has been successfully applied. */
16-
val `have-local-offer` = "have-local-offer"
16+
val `have-local-offer`: RTCSignalingState = "have-local-offer"
1717

1818
/** A remote description, of type "offer", has been successfully applied. */
19-
val `have-remote-offer` = "have-remote-offer"
19+
val `have-remote-offer`: RTCSignalingState = "have-remote-offer"
2020

2121
/** A remote description of type "offer" has been successfully applied and a local description of type "pranswer" has
2222
* been successfully applied.
2323
*/
24-
val `have-local-pranswer` =
24+
val `have-local-pranswer`: RTCSignalingState =
2525
"have-local-pranswer"
2626

2727
/** A local description of type "offer" has been successfully applied and a remote description of type "pranswer" has
2828
* been successfully applied.
2929
*/
30-
val `have-remote-pranswer` =
30+
val `have-remote-pranswer`: RTCSignalingState =
3131
"have-remote-pranswer"
3232

3333
/** The connection is closed. */

src/main/scala-3/org/scalajs/dom/RTCStatsType.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ opaque type RTCStatsType = String
99
object RTCStatsType {
1010

1111
/** Inbound RTP. */
12-
val `inbound-rtp` = "inbound-rtp"
12+
val `inbound-rtp`: RTCStatsType = "inbound-rtp"
1313

1414
/** Outbound RTP. */
15-
val `outbound-rtp` = "outbound-rtp"
15+
val `outbound-rtp`: RTCStatsType = "outbound-rtp"
1616
}

src/main/scala-3/org/scalajs/dom/ReferrerPolicy.scala

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ opaque type ReferrerPolicy = String
66

77
object ReferrerPolicy {
88
val empty: ReferrerPolicy = ""
9-
val `no-referrer` = "no-referrer"
9+
val `no-referrer`: ReferrerPolicy = "no-referrer"
1010

11-
val `no-referrer-when-downgrade` =
11+
val `no-referrer-when-downgrade`: ReferrerPolicy =
1212
"no-referrer-when-downgrade"
13-
val `origin-only` = "origin-only"
13+
val `origin-only`: ReferrerPolicy = "origin-only"
1414

15-
val `origin-when-cross-origin` =
15+
val `origin-when-cross-origin`: ReferrerPolicy =
1616
"origin-when-cross-origin"
17-
val `unsafe-url` = "unsafe-url"
17+
val `unsafe-url`: ReferrerPolicy = "unsafe-url"
1818
}

src/main/scala-3/org/scalajs/dom/RequestCache.scala

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ opaque type RequestCache = String
77

88
object RequestCache {
99
val default: RequestCache = "default"
10-
val `no-store` = "no-store"
10+
val `no-store`: RequestCache = "no-store"
1111
val reload: RequestCache = "reload"
12-
val `no-cache` = "no-cache"
13-
val `force-cache` = "force-cache"
14-
val `only-if-cached` = "only-if-cached"
12+
val `no-cache`: RequestCache = "no-cache"
13+
val `force-cache`: RequestCache = "force-cache"
14+
val `only-if-cached`: RequestCache = "only-if-cached"
1515
}

src/main/scala-3/org/scalajs/dom/RequestCredentials.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ opaque type RequestCredentials = String
77

88
object RequestCredentials {
99
val omit: RequestCredentials = "omit"
10-
val `same-origin` = "same-origin"
10+
val `same-origin`: RequestCredentials = "same-origin"
1111
val include: RequestCredentials = "include"
1212
}

src/main/scala-3/org/scalajs/dom/RequestMode.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ opaque type RequestMode = String
77

88
object RequestMode {
99
val navigate: RequestMode = "navigate"
10-
val `same-origin` = "same-origin"
11-
val `no-cors` = "no-cors"
10+
val `same-origin`: RequestMode = "same-origin"
11+
val `no-cors`: RequestMode = "no-cors"
1212
val cors: RequestMode = "cors"
1313
}

0 commit comments

Comments
 (0)