Skip to content

Commit 6b9243e

Browse files
authored
Merge pull request #586 from scala-js/issue/476
Restructure Java-style
2 parents 11fdc77 + 98d8be7 commit 6b9243e

File tree

677 files changed

+22174
-17510
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

677 files changed

+22174
-17510
lines changed

.scalafix.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ rules = [
77
]
88

99
RemoveUnused {
10-
imports = false
10+
imports = true
1111
privates = true
1212
locals = true
1313
}

src/main/scala/org/scalajs/dom/AbortController.scala

-16
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,3 @@ class AbortController() extends js.Object {
1818
*/
1919
def abort(): Unit = js.native
2020
}
21-
22-
/** The AbortSignal interface represents a signal object that allows you to communicate with a DOM request (such as a
23-
* Fetch) and abort it if required via an AbortController object.
24-
*/
25-
@js.native
26-
trait AbortSignal extends EventTarget {
27-
28-
/** A Boolean that indicates whether the request(s) the signal is communicating with is/are aborted (true) or not
29-
* (false).
30-
*/
31-
def aborted: Boolean = js.native
32-
33-
/** Invoked when an abort event fires, i.e. when the DOM request(s) the signal is communicating with is/are aborted.
34-
*/
35-
var onabort: js.Function0[Any] = js.native
36-
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package org.scalajs.dom
2+
3+
import scala.scalajs.js
4+
5+
/** The AbortSignal interface represents a signal object that allows you to communicate with a DOM request (such as a
6+
* Fetch) and abort it if required via an AbortController object.
7+
*/
8+
@js.native
9+
trait AbortSignal extends EventTarget {
10+
11+
/** A Boolean that indicates whether the request(s) the signal is communicating with is/are aborted (true) or not
12+
* (false).
13+
*/
14+
def aborted: Boolean = js.native
15+
16+
/** Invoked when an abort event fires, i.e. when the DOM request(s) the signal is communicating with is/are aborted.
17+
*/
18+
var onabort: js.Function0[Any] = js.native
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package org.scalajs.dom
2+
3+
import scala.scalajs.js
4+
5+
/** The AbstractWorker interface abstracts properties and methods common to all kind of workers, being Worker or
6+
* SharedWorker.
7+
*/
8+
@js.native
9+
trait AbstractWorker extends EventTarget {
10+
11+
/** The AbstractWorker.onerror property represents an EventHandler, that is a function to be called when the error
12+
* event occurs and bubbles through the Worker.
13+
*/
14+
var onerror: js.Function1[ErrorEvent, _] = js.native
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/** Documentation is thanks to Mozilla Contributors at https://developer.mozilla.org/en-US/docs/Web/API and available
2+
* under the Creative Commons Attribution-ShareAlike v2.5 or later. http://creativecommons.org/licenses/by-sa/2.5/
3+
*
4+
* Everything else is under the MIT License http://opensource.org/licenses/MIT
5+
*/
6+
package org.scalajs.dom
7+
8+
import scala.scalajs.js
9+
10+
/** The AnalyserNode interface represents a node able to provide real-time frequency and time-domain analysis
11+
* information. It is an AudioNode that passes the audio stream unchanged from the input to the output, but allows you
12+
* to take the generated data,process it, and create audio visualizations.
13+
*
14+
* An AnalyzerNode has exactly one input and one output. The node works even if the output is not connected.
15+
*
16+
* - Number of inputs: 1
17+
* - Number of outputs: 1 (but may be left unconnected)
18+
* - Channel count mode: "explicit"
19+
* - Channel count: 1
20+
* - Channel interpretation: "speakers"
21+
*/
22+
@js.native
23+
trait AnalyserNode extends AudioNode {
24+
25+
/** Is an unsigned long value representing the size of the FFT (Fast Fourier Transform) to be used to determine the
26+
* frequency domain.
27+
*/
28+
var fftSize: Int = js.native
29+
30+
/** Is an unsigned long value half that of the FFT size. This generally equates to the number of data values you will
31+
* have to play with for the visualization.
32+
*/
33+
val frequencyBinCount: Int = js.native
34+
35+
/** Is a double value representing the minimum power value in the scaling range for the FFT analysis data, for
36+
* conversion to unsigned byte values — basically, this specifies the minimum value for the range of results when
37+
* using getByteFrequencyData().
38+
*/
39+
var minDecibels: Double = js.native
40+
41+
/** Is a double value representing the maximum power value in the scaling range for the FFT analysis data, for
42+
* conversion to unsigned byte values — basically, this specifies the maximum value for the range of results when
43+
* using getByteFrequencyData().
44+
*/
45+
var maxDecibels: Double = js.native
46+
47+
/** Is a double value representing the averaging constant with the last analysis frame — basically, it makes the
48+
* transition between values over time smoother.
49+
*/
50+
var smoothingTimeConstant: Double = js.native
51+
52+
/** Copies the current frequency data into a Float32Array array passed into it.
53+
*
54+
* If the array has fewer elements than the AnalyserNode.frequencyBinCount, excess elements are dropped. If it has
55+
* more elements than needed, excess elements are ignored.
56+
*
57+
* @param array
58+
* The Float32Array that the frequency domain data will be copied to.
59+
*/
60+
def getFloatFrequencyData(array: js.typedarray.Float32Array): Unit = js.native
61+
62+
/** Copies the current frequency data into a Uint8Array (unsigned byte array) passed into it.
63+
*
64+
* If the array has fewer elements than the AnalyserNode.frequencyBinCount, excess elements are dropped. If it has
65+
* more elements than needed, excess elements are ignored.
66+
*
67+
* @param array
68+
* The Uint8Array that the frequency domain data will be copied to.
69+
*/
70+
def getByteFrequencyData(array: js.typedarray.Uint8Array): Unit = js.native
71+
72+
/** Copies the current waveform, or time-domain, data into a Float32Array array passed into it.
73+
*
74+
* If the array has fewer elements than the AnalyserNode.fftSize, excess elements are dropped. If it has more
75+
* elements than needed, excess elements are ignored.
76+
*
77+
* @param array
78+
* The Float32Array that the time domain data will be copied to.
79+
*/
80+
def getFloatTimeDomainData(array: js.typedarray.Float32Array): Unit = js.native
81+
82+
/** Copies the current waveform, or time-domain, data into a Uint8Array (unsigned byte array) passed into it.
83+
*
84+
* If the array has fewer elements than the AnalyserNode.fftSize, excess elements are dropped. If it has more
85+
* elements than needed, excess elements are ignored.
86+
*
87+
* @param array
88+
* The Uint8Array that the time domain data will be copied to.
89+
*/
90+
def getByteTimeDomainData(array: js.typedarray.Uint8Array): Unit = js.native
91+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/** All documentation for facades is thanks to Mozilla Contributors at https://developer.mozilla.org/en-US/docs/Web/API
2+
* and available under the Creative Commons Attribution-ShareAlike v2.5 or later.
3+
* http://creativecommons.org/licenses/by-sa/2.5/
4+
*
5+
* Everything else is under the MIT License http://opensource.org/licenses/MIT
6+
*/
7+
package org.scalajs.dom
8+
9+
import scala.scalajs.js
10+
11+
/** The AnimationEvent interface represents events providing information related to animations. */
12+
@js.native
13+
trait AnimationEvent extends Event {
14+
15+
/** The AnimationEvent.animationName read-only property is a DOMString containing the value of the animation-name CSS
16+
* property associated with the transition.
17+
*/
18+
def animationName: String = js.native
19+
20+
/** The AnimationEvent.elapsedTime read-only property is a float giving the amount of time the animation has been
21+
* running, in seconds, when this event fired, excluding any time the animation was paused. For an "animationstart"
22+
* event, elapsedTime is 0.0 unless there was a negative value for animation-delay, in which case the event will be
23+
* fired with elapsedTime containing  (-1 * delay).
24+
*/
25+
def elapsedTime: Double = js.native
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/** All documentation for facades is thanks to Mozilla Contributors at https://developer.mozilla.org/en-US/docs/Web/API
2+
* and available under the Creative Commons Attribution-ShareAlike v2.5 or later.
3+
* http://creativecommons.org/licenses/by-sa/2.5/
4+
*
5+
* Everything else is under the MIT License http://opensource.org/licenses/MIT
6+
*/
7+
package org.scalajs.dom
8+
9+
import scala.scalajs.js
10+
import scala.scalajs.js.annotation._
11+
12+
@js.native
13+
trait ApplicationCache extends EventTarget {
14+
def status: Int = js.native
15+
16+
var ondownloading: js.Function1[Event, _] = js.native
17+
var onprogress: js.Function1[ProgressEvent, _] = js.native
18+
var onupdateready: js.Function1[Event, _] = js.native
19+
var oncached: js.Function1[Event, _] = js.native
20+
var onobsolete: js.Function1[Event, _] = js.native
21+
var onerror: js.Function1[ErrorEvent, _] = js.native
22+
var onchecking: js.Function1[Event, _] = js.native
23+
var onnoupdate: js.Function1[Event, _] = js.native
24+
25+
def swapCache(): Unit = js.native
26+
27+
def abort(): Unit = js.native
28+
29+
def update(): Unit = js.native
30+
}
31+
32+
@js.native
33+
@JSGlobal
34+
object ApplicationCache extends js.Object {
35+
/* ??? ConstructorMember(FunSignature(List(),List(),Some(TypeRef(TypeName(ApplicationCache),List())))) */
36+
val CHECKING: Int = js.native
37+
val UNCACHED: Int = js.native
38+
val UPDATEREADY: Int = js.native
39+
val DOWNLOADING: Int = js.native
40+
val IDLE: Int = js.native
41+
val OBSOLETE: Int = js.native
42+
}
+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/** All documentation for facades is thanks to Mozilla Contributors at https://developer.mozilla.org/en-US/docs/Web/API
2+
* and available under the Creative Commons Attribution-ShareAlike v2.5 or later.
3+
* http://creativecommons.org/licenses/by-sa/2.5/
4+
*
5+
* Everything else is under the MIT License http://opensource.org/licenses/MIT
6+
*/
7+
package org.scalajs.dom
8+
9+
import scala.scalajs.js
10+
import scala.scalajs.js.annotation._
11+
12+
/** This type represents a DOM element's attribute as an object. In most DOM methods, you will probably directly
13+
* retrieve the attribute as a string (e.g., Element.getAttribute(), but certain functions (e.g.,
14+
* Element.getAttributeNode()) or means of iterating give Attr types.
15+
*/
16+
@js.native
17+
@JSGlobal
18+
class Attr extends Node {
19+
20+
/** This property now always returns true. */
21+
def specified: Boolean = js.native
22+
23+
/** The element holding the attribute.
24+
*
25+
* Note: DOM Level 4 removed this property. The assumption was that since you get an Attr object from an Element, you
26+
* should already know the associated element.
27+
*
28+
* As that doesn't hold true in cases like Attr objects being returned by Document.evaluate, the DOM Living Standard
29+
* reintroduced the property.
30+
*/
31+
def ownerElement: Element = js.native
32+
33+
/** The attribute's value. */
34+
var value: String = js.native
35+
36+
/** The attribute's name. */
37+
def name: String = js.native
38+
39+
/** A DOMString representing the namespace prefix of the attribute, or null if no prefix is specified. */
40+
def prefix: String = js.native
41+
}

0 commit comments

Comments
 (0)