Skip to content

Restructure Java-style #586

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .scalafix.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ rules = [
]

RemoveUnused {
imports = false
imports = true
privates = true
locals = true
}
Expand Down
16 changes: 0 additions & 16 deletions src/main/scala/org/scalajs/dom/AbortController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,3 @@ class AbortController() extends js.Object {
*/
def abort(): Unit = js.native
}

/** The AbortSignal interface represents a signal object that allows you to communicate with a DOM request (such as a
* Fetch) and abort it if required via an AbortController object.
*/
@js.native
trait AbortSignal extends EventTarget {

/** A Boolean that indicates whether the request(s) the signal is communicating with is/are aborted (true) or not
* (false).
*/
def aborted: Boolean = js.native

/** Invoked when an abort event fires, i.e. when the DOM request(s) the signal is communicating with is/are aborted.
*/
var onabort: js.Function0[Any] = js.native
}
19 changes: 19 additions & 0 deletions src/main/scala/org/scalajs/dom/AbortSignal.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.scalajs.dom

import scala.scalajs.js

/** The AbortSignal interface represents a signal object that allows you to communicate with a DOM request (such as a
* Fetch) and abort it if required via an AbortController object.
*/
@js.native
trait AbortSignal extends EventTarget {

/** A Boolean that indicates whether the request(s) the signal is communicating with is/are aborted (true) or not
* (false).
*/
def aborted: Boolean = js.native

/** Invoked when an abort event fires, i.e. when the DOM request(s) the signal is communicating with is/are aborted.
*/
var onabort: js.Function0[Any] = js.native
}
15 changes: 15 additions & 0 deletions src/main/scala/org/scalajs/dom/AbstractWorker.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.scalajs.dom

import scala.scalajs.js

/** The AbstractWorker interface abstracts properties and methods common to all kind of workers, being Worker or
* SharedWorker.
*/
@js.native
trait AbstractWorker extends EventTarget {

/** The AbstractWorker.onerror property represents an EventHandler, that is a function to be called when the error
* event occurs and bubbles through the Worker.
*/
var onerror: js.Function1[ErrorEvent, _] = js.native
}
91 changes: 91 additions & 0 deletions src/main/scala/org/scalajs/dom/AnalyserNode.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/** 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

/** The AnalyserNode interface represents a node able to provide real-time frequency and time-domain analysis
* information. It is an AudioNode that passes the audio stream unchanged from the input to the output, but allows you
* to take the generated data,process it, and create audio visualizations.
*
* An AnalyzerNode has exactly one input and one output. The node works even if the output is not connected.
*
* - Number of inputs: 1
* - Number of outputs: 1 (but may be left unconnected)
* - Channel count mode: "explicit"
* - Channel count: 1
* - Channel interpretation: "speakers"
*/
@js.native
trait AnalyserNode extends AudioNode {

/** Is an unsigned long value representing the size of the FFT (Fast Fourier Transform) to be used to determine the
* frequency domain.
*/
var fftSize: Int = js.native

/** Is an unsigned long value half that of the FFT size. This generally equates to the number of data values you will
* have to play with for the visualization.
*/
val frequencyBinCount: Int = js.native

/** Is a double value representing the minimum power value in the scaling range for the FFT analysis data, for
* conversion to unsigned byte values — basically, this specifies the minimum value for the range of results when
* using getByteFrequencyData().
*/
var minDecibels: Double = js.native

/** Is a double value representing the maximum power value in the scaling range for the FFT analysis data, for
* conversion to unsigned byte values — basically, this specifies the maximum value for the range of results when
* using getByteFrequencyData().
*/
var maxDecibels: Double = js.native

/** Is a double value representing the averaging constant with the last analysis frame — basically, it makes the
* transition between values over time smoother.
*/
var smoothingTimeConstant: Double = js.native

/** Copies the current frequency data into a Float32Array array passed into it.
*
* If the array has fewer elements than the AnalyserNode.frequencyBinCount, excess elements are dropped. If it has
* more elements than needed, excess elements are ignored.
*
* @param array
* The Float32Array that the frequency domain data will be copied to.
*/
def getFloatFrequencyData(array: js.typedarray.Float32Array): Unit = js.native

/** Copies the current frequency data into a Uint8Array (unsigned byte array) passed into it.
*
* If the array has fewer elements than the AnalyserNode.frequencyBinCount, excess elements are dropped. If it has
* more elements than needed, excess elements are ignored.
*
* @param array
* The Uint8Array that the frequency domain data will be copied to.
*/
def getByteFrequencyData(array: js.typedarray.Uint8Array): Unit = js.native

/** Copies the current waveform, or time-domain, data into a Float32Array array passed into it.
*
* If the array has fewer elements than the AnalyserNode.fftSize, excess elements are dropped. If it has more
* elements than needed, excess elements are ignored.
*
* @param array
* The Float32Array that the time domain data will be copied to.
*/
def getFloatTimeDomainData(array: js.typedarray.Float32Array): Unit = js.native

/** Copies the current waveform, or time-domain, data into a Uint8Array (unsigned byte array) passed into it.
*
* If the array has fewer elements than the AnalyserNode.fftSize, excess elements are dropped. If it has more
* elements than needed, excess elements are ignored.
*
* @param array
* The Uint8Array that the time domain data will be copied to.
*/
def getByteTimeDomainData(array: js.typedarray.Uint8Array): Unit = js.native
}
26 changes: 26 additions & 0 deletions src/main/scala/org/scalajs/dom/AnimationEvent.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/** All documentation for facades 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

/** The AnimationEvent interface represents events providing information related to animations. */
@js.native
trait AnimationEvent extends Event {

/** The AnimationEvent.animationName read-only property is a DOMString containing the value of the animation-name CSS
* property associated with the transition.
*/
def animationName: String = js.native

/** The AnimationEvent.elapsedTime read-only property is a float giving the amount of time the animation has been
* running, in seconds, when this event fired, excluding any time the animation was paused. For an "animationstart"
* event, elapsedTime is 0.0 unless there was a negative value for animation-delay, in which case the event will be
* fired with elapsedTime containing  (-1 * delay).
*/
def elapsedTime: Double = js.native
}
42 changes: 42 additions & 0 deletions src/main/scala/org/scalajs/dom/ApplicationCache.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/** All documentation for facades 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 ApplicationCache extends EventTarget {
def status: Int = js.native

var ondownloading: js.Function1[Event, _] = js.native
var onprogress: js.Function1[ProgressEvent, _] = js.native
var onupdateready: js.Function1[Event, _] = js.native
var oncached: js.Function1[Event, _] = js.native
var onobsolete: js.Function1[Event, _] = js.native
var onerror: js.Function1[ErrorEvent, _] = js.native
var onchecking: js.Function1[Event, _] = js.native
var onnoupdate: js.Function1[Event, _] = js.native

def swapCache(): Unit = js.native

def abort(): Unit = js.native

def update(): Unit = js.native
}

@js.native
@JSGlobal
object ApplicationCache extends js.Object {
/* ??? ConstructorMember(FunSignature(List(),List(),Some(TypeRef(TypeName(ApplicationCache),List())))) */
val CHECKING: Int = js.native
val UNCACHED: Int = js.native
val UPDATEREADY: Int = js.native
val DOWNLOADING: Int = js.native
val IDLE: Int = js.native
val OBSOLETE: Int = js.native
}
41 changes: 41 additions & 0 deletions src/main/scala/org/scalajs/dom/Attr.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/** All documentation for facades 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._

/** This type represents a DOM element's attribute as an object. In most DOM methods, you will probably directly
* retrieve the attribute as a string (e.g., Element.getAttribute(), but certain functions (e.g.,
* Element.getAttributeNode()) or means of iterating give Attr types.
*/
@js.native
@JSGlobal
class Attr extends Node {

/** This property now always returns true. */
def specified: Boolean = js.native

/** The element holding the attribute.
*
* Note: DOM Level 4 removed this property. The assumption was that since you get an Attr object from an Element, you
* should already know the associated element.
*
* As that doesn't hold true in cases like Attr objects being returned by Document.evaluate, the DOM Living Standard
* reintroduced the property.
*/
def ownerElement: Element = js.native

/** The attribute's value. */
var value: String = js.native

/** The attribute's name. */
def name: String = js.native

/** A DOMString representing the namespace prefix of the attribute, or null if no prefix is specified. */
def prefix: String = js.native
}
Loading