Skip to content

Commit

Permalink
AudioWorkletNode should not be abstract.
Browse files Browse the repository at this point in the history
  • Loading branch information
yilinwei committed Nov 16, 2023
1 parent ba8f619 commit 3e32f25
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 4 deletions.
14 changes: 14 additions & 0 deletions dom/src/main/scala/org/scalajs/dom/AudioParamMap.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/** Documentation is thanks to Mozilla Contributors at https://developer.mozilla.org/en-US/docs/Web/API and available
* under the Creative Commons Attribution-ShareAlike v2.5 or later. http://creativecommons.org/licenses/by-sa/2.5/
*
* Everything else is under the MIT License http://opensource.org/licenses/MIT
*/

package org.scalajs.dom

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

@JSGlobal
@js.native
class AudioParamMap extends ReadOnlyMapLike[String, AudioParam] { }
2 changes: 1 addition & 1 deletion dom/src/main/scala/org/scalajs/dom/AudioWorkletNode.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import scala.scalajs.js.annotation._

@JSGlobal
@js.native
abstract class AudioWorkletNode(context: BaseAudioContext, name: String, options: AudioWorkletNodeOptions = js.native)
class AudioWorkletNode(context: BaseAudioContext, name: String, options: AudioWorkletNodeOptions = js.native)
extends AudioNode {

val port: MessagePort = js.native
Expand Down
4 changes: 1 addition & 3 deletions dom/src/main/scala/org/scalajs/dom/RTCStatsReport.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@ import scala.scalajs.js

//https://www.w3.org/TR/2015/WD-webrtc-20150210/#idl-def-RTCStatsReport
@js.native
trait RTCStatsReport extends js.Object {
def apply(id: String): RTCStats = js.native
}
trait RTCStatsReport extends ReadOnlyMapLike[String, RTCStats] { }
27 changes: 27 additions & 0 deletions dom/src/main/scala/org/scalajs/dom/ReadOnlyMapLike.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/** Documentation is thanks to Mozilla Contributors at https://developer.mozilla.org/en-US/docs/Web/API and available
* under the Creative Commons Attribution-ShareAlike v2.5 or later. http://creativecommons.org/licenses/by-sa/2.5/
*
* Everything else is under the MIT License http://opensource.org/licenses/MIT
*/

package org.scalajs.dom

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

@js.native
trait ReadOnlyMapLike[K, V] extends js.Object {

@JSBracketAccess
def apply(index: K): V = js.native

/** Returns a boolean indicating whether a value has been associated with the passed key in the Map object or not. */
def has(key: K): Boolean = js.native

def forEach(callbackFn: js.Function2[K, V, Unit]): Unit = js.native

def size: Int = js.native

def keys(): js.Iterator[K] = js.native

}

0 comments on commit 3e32f25

Please sign in to comment.