File tree Expand file tree Collapse file tree 4 files changed +24
-5
lines changed
dom/src/main/scala/org/scalajs/dom Expand file tree Collapse file tree 4 files changed +24
-5
lines changed Original file line number Diff line number Diff line change @@ -25351,6 +25351,12 @@ WorkerNavigator[JT] def onLine: Boolean
2535125351WorkerNavigator[JT] def platform: String
2535225352WorkerNavigator[JT] def sendBeacon(url: String, data: BodyInit?): Boolean (@deprecated in 2.0.0)
2535325353WorkerNavigator[JT] def userAgent: String
25354+ WorkerOptions[JT] var credentials: js.UndefOr[RequestCredentials]
25355+ WorkerOptions[JT] var name: js.UndefOr[String]
25356+ WorkerOptions[JT] var `type`: js.UndefOr[WorkerType]
25357+ WorkerType[JT]
25358+ WorkerType[SO] val classic: WorkerType
25359+ WorkerType[SO] val module: WorkerType
2535425360WriteableState[JT]
2535525361WriteableState[SO] val closed: WriteableState
2535625362WriteableState[SO] val closing: WriteableState
Original file line number Diff line number Diff line change @@ -25351,6 +25351,12 @@ WorkerNavigator[JT] def onLine: Boolean
2535125351WorkerNavigator[JT] def platform: String
2535225352WorkerNavigator[JT] def sendBeacon(url: String, data: BodyInit?): Boolean (@deprecated in 2.0.0)
2535325353WorkerNavigator[JT] def userAgent: String
25354+ WorkerOptions[JT] var credentials: js.UndefOr[RequestCredentials]
25355+ WorkerOptions[JT] var name: js.UndefOr[String]
25356+ WorkerOptions[JT] var `type`: js.UndefOr[WorkerType]
25357+ WorkerType[JT]
25358+ WorkerType[SO] val classic: WorkerType
25359+ WorkerType[SO] val module: WorkerType
2535425360WriteableState[JT]
2535525361WriteableState[SO] val closed: WriteableState
2535625362WriteableState[SO] val closing: WriteableState
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package org.scalajs.dom
22
33import scala .scalajs .js
44import scala .scalajs .js .annotation ._
5+ import scala .scalajs .js .|
56
67/** The SharedWorker interface represents a specific kind of worker that can be accessed from several browsing contexts,
78 * such as several windows, iframes or even workers. They implement an interface different than dedicated workers and
@@ -17,13 +18,14 @@ import scala.scalajs.js.annotation._
1718 * {{{var myWorker = new SharedWorker("aURL", name);}}}
1819 * @param stringUrl
1920 * A DOMString representing the URL of the script the worker will execute. It must obey the same-origin policy.
20- * @param name
21- * An optional argument that specifies an existing SharedWorkerGlobalScope.name — if this is specified then that
22- * SharedWorkerGlobalScope will be used as the scope for this shared worker.
21+ * @param options
22+ * A DOMString specifying an identifying name for the SharedWorkerGlobalScope representing the scope of the worker,
23+ * which is mainly useful for debugging purposes. Or, an object containing option properties that can set when
24+ * creating the object instance.
2325 */
2426@ js.native
2527@ JSGlobal
26- class SharedWorker (stringUrl : String , name : js.UndefOr [String ] = js.native) extends AbstractWorker {
28+ class SharedWorker (scriptURL : String , options : js.UndefOr [String | WorkerOptions ] = js.native) extends AbstractWorker {
2729
2830 /** The port property of the SharedWorker interface returns a [[MessagePort ]] object used to communicate and control
2931 * the shared worker.
Original file line number Diff line number Diff line change @@ -10,10 +10,15 @@ import scala.scalajs.js.annotation._
1010 * Of note is the fact that workers may in turn spawn new workers as long as those workers are hosted within the same
1111 * origin as the parent page. In addition, workers may use XMLHttpRequest for network I/O, with the exception that the
1212 * responseXML and channel attributes on XMLHttpRequest always return null.
13+ *
14+ * @param scriptURL
15+ * A USVString representing the URL of the script the worker will execute. It must obey the same-origin policy.
16+ * @param options
17+ * An object containing option properties that can be set when creating the object instance.
1318 */
1419@ js.native
1520@ JSGlobal
16- class Worker (stringUrl : String ) extends AbstractWorker {
21+ class Worker (scriptURL : String , options : js. UndefOr [ WorkerOptions ] = js.native ) extends AbstractWorker {
1722
1823 /** The Worker.onmessage property represents an EventHandler, that is a function to be called when the message event
1924 * occurs. These events are of type MessageEvent and will be called when the worker calls its own postMessage()
You can’t perform that action at this time.
0 commit comments