Skip to content

Commit

Permalink
Make sure BlobEvent is class.
Browse files Browse the repository at this point in the history
  • Loading branch information
yilinwei committed Oct 8, 2023
1 parent 081534d commit fca6713
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
13 changes: 11 additions & 2 deletions dom/src/main/scala/org/scalajs/dom/BlobEvent.scala
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
package org.scalajs.dom

import scala.scalajs.js
import scala.scalajs.js.annotation._

/** The AnimationEvent interface represents events providing information related to animations. */
@JSGlobal
@js.native
trait BlobEvent extends Event {
class BlobEvent(typeArg: String, init: js.UndefOr[BlobEventInit]) extends Event(typeArg, init) {

def data: Blob = js.native
def this(typeArg: String) = {
this(typeArg, js.undefined)
}

def this() = {
this("dataavailable", js.undefined)
}

val data: Blob = js.native
}
8 changes: 8 additions & 0 deletions dom/src/main/scala/org/scalajs/dom/BlobEventInit.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package org.scalajs.dom

import scala.scalajs.js

@js.native
trait BlobEventInit extends EventInit {
var data: js.UndefOr[Blob]
}

0 comments on commit fca6713

Please sign in to comment.