Skip to content

Commit 9d7970e

Browse files
committed
Fix PushSubscription.toJSON was the wrong return type (scala-js#346)
Update PushSubscription to better reflect w3 standards: -Change the return type of method toJSON -Add missing properties (expirationTime, options)
1 parent f97fd58 commit 9d7970e

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

src/main/scala/org/scalajs/dom/experimental/push/PushManager.scala

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import scala.scalajs.js.typedarray.{ArrayBuffer, Uint8Array}
1414
*
1515
* MDN
1616
*
17-
* The Push API is currently specified here: [[http://www.w3.org/TR/2015/WD-push-api-20151215/]]
17+
* The Push API is currently specified here: [[https://www.w3.org/TR/2018/WD-push-api-20181026/]]
1818
*/
1919
@js.native
2020
trait PushManager extends js.Object {
@@ -79,6 +79,23 @@ trait PushSubscription extends js.Object {
7979
*/
8080
val endpoint: String = js.native
8181

82+
/**
83+
* The expirationTime read-only property of the PushSubscription interface returns a
84+
* DOMHighResTimeStamp of the subscription expiration time associated with the push
85+
* subscription, if there is one, or null otherwise.
86+
*
87+
* MDN
88+
*/
89+
val expirationTime: Double = js.native
90+
91+
/**
92+
* The options read-only property of the PushSubscription interface is an object containing
93+
* containing the options used to create the subscription.
94+
*
95+
* MDN
96+
*/
97+
val options: PushSubscriptionOptions = js.native
98+
8299
/**
83100
* The getKey method retrieves keying material that can be used for encrypting and authenticating messages.
84101
*/
@@ -98,7 +115,7 @@ trait PushSubscription extends js.Object {
98115
*
99116
* MDN
100117
*/
101-
def toJSON(): String = js.native
118+
def toJSON(): js.Dictionary[js.Any] = js.native
102119
}
103120

104121
/**

0 commit comments

Comments
 (0)