Skip to content

Commit 928cb9e

Browse files
committed
Forgot to check in new files (:
1 parent 2f3597d commit 928cb9e

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package org.scalajs.dom
2+
3+
import scala.scalajs.js
4+
5+
@js.native
6+
sealed trait WorkerType extends js.Any
7+
8+
object WorkerType {
9+
val classic: WorkerType = "classic".asInstanceOf[WorkerType]
10+
val module: WorkerType = "module".asInstanceOf[WorkerType]
11+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package org.scalajs.dom
2+
3+
import scala.scalajs.js
4+
5+
opaque type WorkerType <: String = String
6+
7+
object WorkerType {
8+
val classic: WorkerType = "classic"
9+
val module: WorkerType = "module"
10+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package org.scalajs.dom
2+
3+
import scala.scalajs.js
4+
5+
/** The Worker interface represents a background task that can be easily created and can send messages back to their
6+
* creators. Creating a worker is as simple as calling the Worker() constructor, specifying a script to be run in the
7+
* worker thread.
8+
*
9+
* Of note is the fact that workers may in turn spawn new workers as long as those workers are hosted within the same
10+
* origin as the parent page. In addition, workers may use XMLHttpRequest for network I/O, with the exception that the
11+
* responseXML and channel attributes on XMLHttpRequest always return null.
12+
*/
13+
@js.native
14+
trait WorkerOptions extends js.Any {
15+
var credentials: js.UndefOr[RequestCredentials] = js.native
16+
var name: js.UndefOr[String] = js.native
17+
var `type`: js.UndefOr[WorkerType] = js.native
18+
}

0 commit comments

Comments
 (0)