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
25351
25351
WorkerNavigator[JT] def platform: String
25352
25352
WorkerNavigator[JT] def sendBeacon(url: String, data: BodyInit?): Boolean (@deprecated in 2.0.0)
25353
25353
WorkerNavigator[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
25354
25360
WriteableState[JT]
25355
25361
WriteableState[SO] val closed: WriteableState
25356
25362
WriteableState[SO] val closing: WriteableState
Original file line number Diff line number Diff line change @@ -25351,6 +25351,12 @@ WorkerNavigator[JT] def onLine: Boolean
25351
25351
WorkerNavigator[JT] def platform: String
25352
25352
WorkerNavigator[JT] def sendBeacon(url: String, data: BodyInit?): Boolean (@deprecated in 2.0.0)
25353
25353
WorkerNavigator[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
25354
25360
WriteableState[JT]
25355
25361
WriteableState[SO] val closed: WriteableState
25356
25362
WriteableState[SO] val closing: WriteableState
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package org.scalajs.dom
2
2
3
3
import scala .scalajs .js
4
4
import scala .scalajs .js .annotation ._
5
+ import scala .scalajs .js .|
5
6
6
7
/** The SharedWorker interface represents a specific kind of worker that can be accessed from several browsing contexts,
7
8
* 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._
17
18
* {{{var myWorker = new SharedWorker("aURL", name);}}}
18
19
* @param stringUrl
19
20
* 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.
23
25
*/
24
26
@ js.native
25
27
@ 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 {
27
29
28
30
/** The port property of the SharedWorker interface returns a [[MessagePort ]] object used to communicate and control
29
31
* the shared worker.
Original file line number Diff line number Diff line change @@ -10,10 +10,15 @@ import scala.scalajs.js.annotation._
10
10
* Of note is the fact that workers may in turn spawn new workers as long as those workers are hosted within the same
11
11
* origin as the parent page. In addition, workers may use XMLHttpRequest for network I/O, with the exception that the
12
12
* 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.
13
18
*/
14
19
@ js.native
15
20
@ JSGlobal
16
- class Worker (stringUrl : String ) extends AbstractWorker {
21
+ class Worker (scriptURL : String , options : js. UndefOr [ WorkerOptions ] = js.native ) extends AbstractWorker {
17
22
18
23
/** The Worker.onmessage property represents an EventHandler, that is a function to be called when the message event
19
24
* 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