Skip to content

Commit c952e9a

Browse files
committed
Add EventSourceInit
1 parent 8d9ae46 commit c952e9a

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

api-reports/2_12.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1856,6 +1856,7 @@ EventSource[JC] def withCredentials: Boolean
18561856
EventSource[JO] val CLOSED: Int
18571857
EventSource[JO] val CONNECTING: Int
18581858
EventSource[JO] val OPEN: Int
1859+
EventSourceInit[JT] var withCredentials: js.UndefOr[Boolean]
18591860
EventTarget[JC] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
18601861
EventTarget[JC] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
18611862
EventTarget[JC] def dispatchEvent(evt: Event): Boolean

api-reports/2_13.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1856,6 +1856,7 @@ EventSource[JC] def withCredentials: Boolean
18561856
EventSource[JO] val CLOSED: Int
18571857
EventSource[JO] val CONNECTING: Int
18581858
EventSource[JO] val OPEN: Int
1859+
EventSourceInit[JT] var withCredentials: js.UndefOr[Boolean]
18591860
EventTarget[JC] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
18601861
EventTarget[JC] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
18611862
EventTarget[JC] def dispatchEvent(evt: Event): Boolean

dom/src/main/scala/org/scalajs/dom/EventSource.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import scala.scalajs.js.annotation._
1818
*/
1919
@js.native
2020
@JSGlobal
21-
class EventSource(URL: String, settings: js.Dynamic = null) extends EventTarget {
21+
class EventSource(url: String, configuration: EventSourceInit = js.native) extends EventTarget {
2222

2323
/** The url attribute must return the absolute URL that resulted from resolving the value that was passed to the
2424
* constructor. W3C 2012
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/** All documentation for facades is thanks to Mozilla Contributors at https://developer.mozilla.org/en-US/docs/Web/API
2+
* and available under the Creative Commons Attribution-ShareAlike v2.5 or later.
3+
* http://creativecommons.org/licenses/by-sa/2.5/
4+
*
5+
* Everything else is under the MIT License http://opensource.org/licenses/MIT
6+
*/
7+
package org.scalajs.dom
8+
9+
import scala.scalajs.js
10+
11+
/** Provides options to configure the new connection. */
12+
trait EventSourceInit extends js.Object {
13+
14+
/** defaulting to false, indicating if CORS should be set to include credentials */
15+
var withCredentials: js.UndefOr[Boolean] = js.undefined
16+
}

0 commit comments

Comments
 (0)