Skip to content

Commit 8d2fc3d

Browse files
authored
Merge pull request #556 from scala-js/topic/reformatScalaDoc
Fold single-line ScalaDoc
2 parents 9ce3258 + 624289d commit 8d2fc3d

38 files changed

+1066
-2130
lines changed

.scalafmt.conf

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ maxColumn = 120
77
danglingParentheses.callSite = false
88
danglingParentheses.ctrlSite = false
99
danglingParentheses.defnSite = false
10+
docstrings.oneline = fold
1011
docstrings.style = SpaceAsterisk
1112
literals.hexDigits = Upper
1213
literals.scientific = Upper

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ import scala.scalajs.js.annotation.JSGlobal
1010
@JSGlobal
1111
class AbortController() extends js.Object {
1212

13-
/** Returns a AbortSignal object instance, which can be used to communicate with/abort a DOM request
14-
*/
13+
/** Returns a AbortSignal object instance, which can be used to communicate with/abort a DOM request */
1514
val signal: AbortSignal = js.native
1615

1716
/** Aborts a DOM request before it has completed. This is able to abort fetch requests, consumption of any response

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

+29-58
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ class AudioContext extends EventTarget {
4141
/** Returns the current state of the AudioContext. */
4242
def state: String = js.native
4343

44-
/** Closes the audio context, releasing any system audio resources that it uses.
45-
*/
44+
/** Closes the audio context, releasing any system audio resources that it uses. */
4645
def close(): js.Promise[Unit] = js.native
4746

4847
/** Creates an AnalyserNode, which can be used to expose audio time and frequency data and for example to create data
@@ -106,12 +105,10 @@ class AudioContext extends EventTarget {
106105
*/
107106
def createDelay(maxDelayTime: Int): DelayNode = js.native
108107

109-
/** Creates a DynamicsCompressorNode, which can be used to apply acoustic compression to an audio signal.
110-
*/
108+
/** Creates a DynamicsCompressorNode, which can be used to apply acoustic compression to an audio signal. */
111109
def createDynamicsCompressor(): DynamicsCompressorNode = js.native
112110

113-
/** Creates a GainNode, which can be used to control the overall volume of the audio graph.
114-
*/
111+
/** Creates a GainNode, which can be used to control the overall volume of the audio graph. */
115112
def createGain(): GainNode = js.native
116113

117114
/** Creates a MediaElementAudioSourceNode associated with an HTMLMediaElement. This can be used to play and manipulate
@@ -135,25 +132,21 @@ class AudioContext extends EventTarget {
135132
*/
136133
def createMediaStreamDestination(): MediaStreamAudioDestinationNode = js.native
137134

138-
/** Creates an OscillatorNode, a source representing a periodic waveform. It basically generates a tone.
139-
*/
135+
/** Creates an OscillatorNode, a source representing a periodic waveform. It basically generates a tone. */
140136
def createOscillator(): OscillatorNode = js.native
141137

142-
/** Creates a PannerNode, which is used to spatialise an incoming audio stream in 3D space.
143-
*/
138+
/** Creates a PannerNode, which is used to spatialise an incoming audio stream in 3D space. */
144139
def createPanner(): PannerNode = js.native
145140

146141
/** Creates a PeriodicWave, used to define a periodic waveform that can be used to determine the output of an
147142
* OscillatorNode.
148143
*/
149144
def createPeriodicWave(real: js.typedarray.Float32Array, imag: js.typedarray.Float32Array): PeriodicWave = js.native
150145

151-
/** Creates a StereoPannerNode, which can be used to apply stereo panning to an audio source.
152-
*/
146+
/** Creates a StereoPannerNode, which can be used to apply stereo panning to an audio source. */
153147
def createStereoPanner(): StereoPannerNode = js.native
154148

155-
/** Creates a WaveShaperNode, which is used to implement non-linear distortion effects.
156-
*/
149+
/** Creates a WaveShaperNode, which is used to implement non-linear distortion effects. */
157150
def createWaveShaper(): WaveShaperNode = js.native
158151

159152
/** Asynchronously decodes audio file data contained in an ArrayBuffer. In this case, the ArrayBuffer is usually
@@ -175,8 +168,7 @@ class AudioContext extends EventTarget {
175168
errorCallback: js.Function0[_] = js.native
176169
): js.Promise[AudioBuffer] = js.native
177170

178-
/** Resumes the progression of time in an audio context that has previously been suspended.
179-
*/
171+
/** Resumes the progression of time in an audio context that has previously been suspended. */
180172
def resume(): js.Promise[Unit] = js.native
181173

182174
/** Suspends the progression of time in the audio context, temporarily halting audio hardware access and reducing
@@ -269,12 +261,10 @@ trait AudioNode extends EventTarget {
269261
*/
270262
var channelInterpretation: String = js.native
271263

272-
/** Allows us to connect one output of this node to one input of another node.
273-
*/
264+
/** Allows us to connect one output of this node to one input of another node. */
274265
def connect(audioNode: AudioNode): Unit = js.native
275266

276-
/** Allows us to connect one output of this node to one input of an audio parameter.
277-
*/
267+
/** Allows us to connect one output of this node to one input of an audio parameter. */
278268
def connect(audioParam: AudioParam): Unit = js.native
279269

280270
/** Allows us to disconnect the current node from another one it is already connected to.
@@ -434,8 +424,7 @@ trait AudioBufferSourceNode extends AudioNode {
434424
*/
435425
def stop(when: Double = 0.0): Unit = js.native
436426

437-
/** Is an EventHandler containing the callback associated with the ended event.
438-
*/
427+
/** Is an EventHandler containing the callback associated with the ended event. */
439428
var onended: js.Function1[Event, _] = js.native
440429
}
441430

@@ -458,8 +447,7 @@ trait AudioBufferSourceNode extends AudioNode {
458447
@js.native
459448
trait AudioDestinationNode extends AudioNode {
460449

461-
/** Is an unsigned long defining the maximum amount of channels that the physical device can handle.
462-
*/
450+
/** Is an unsigned long defining the maximum amount of channels that the physical device can handle. */
463451
var maxChannelCount: Int = js.native
464452
}
465453

@@ -472,12 +460,10 @@ trait AudioDestinationNode extends AudioNode {
472460
@js.native
473461
trait AudioListener extends AudioNode {
474462

475-
/** Is a double value representing the amount of pitch shift to use when rendering a doppler effect.
476-
*/
463+
/** Is a double value representing the amount of pitch shift to use when rendering a doppler effect. */
477464
var dopplerFactor: Double = js.native
478465

479-
/** Is a double value representing the speed of sound, in meters per second.
480-
*/
466+
/** Is a double value representing the speed of sound, in meters per second. */
481467
var speedOfSound: Double = js.native
482468

483469
/** Defines the position of the listener.
@@ -552,8 +538,7 @@ trait AudioParam extends AudioNode {
552538
*/
553539
var value: Double = js.native
554540

555-
/** Represents the initial value of the attributes as defined by the specific AudioNode creating the AudioParam.
556-
*/
541+
/** Represents the initial value of the attributes as defined by the specific AudioNode creating the AudioParam. */
557542
val defaultValue: Double = js.native
558543

559544
/** Schedules an instant change to the value of the AudioParam at a precise time, as measured against
@@ -646,20 +631,16 @@ trait BiquadFilterNode extends AudioNode {
646631
*/
647632
val frequency: AudioParam = js.native
648633

649-
/** Is an a-rate AudioParam representing detuning of the frequency in cents.
650-
*/
634+
/** Is an a-rate AudioParam representing detuning of the frequency in cents. */
651635
val detune: AudioParam = js.native
652636

653-
/** Is a k-rate AudioParam, a double representing a Q factor, or quality factor.
654-
*/
637+
/** Is a k-rate AudioParam, a double representing a Q factor, or quality factor. */
655638
val Q: AudioParam = js.native
656639

657-
/** Is a k-rate AudioParam, a double representing the gain used in the current filtering algorithm.
658-
*/
640+
/** Is a k-rate AudioParam, a double representing the gain used in the current filtering algorithm. */
659641
val gain: AudioParam = js.native
660642

661-
/** Is a string value defining the kind of filtering algorithm the node is implementing.
662-
*/
643+
/** Is a string value defining the kind of filtering algorithm the node is implementing. */
663644
var `type`: String = js.native
664645

665646
/** From the current filter parameter settings this method calculates the frequency response for frequencies specified
@@ -778,8 +759,7 @@ trait DelayNode extends AudioNode {
778759
@js.native
779760
trait DynamicsCompressorNode extends AudioNode {
780761

781-
/** Is a k-rate AudioParam representing the decibel value above which the compression will start taking effect.
782-
*/
762+
/** Is a k-rate AudioParam representing the decibel value above which the compression will start taking effect. */
783763
val threshold: AudioParam = js.native
784764

785765
/** Is a k-rate AudioParam containing a decibel value representing the range above the threshold where the curve
@@ -797,12 +777,10 @@ trait DynamicsCompressorNode extends AudioNode {
797777
*/
798778
val reduction: AudioParam = js.native
799779

800-
/** Is a k-rate AudioParam representing the amount of time, in seconds, required to reduce the gain by 10 dB.
801-
*/
780+
/** Is a k-rate AudioParam representing the amount of time, in seconds, required to reduce the gain by 10 dB. */
802781
val attack: AudioParam = js.native
803782

804-
/** Is a k-rate AudioParam representing the amount of time, in seconds, required to increase the gain by 10 dB.
805-
*/
783+
/** Is a k-rate AudioParam representing the amount of time, in seconds, required to increase the gain by 10 dB. */
806784
val release: AudioParam = js.native
807785
}
808786

@@ -909,8 +887,7 @@ trait OscillatorNode extends AudioNode {
909887
*/
910888
var detune: AudioParam = js.native
911889

912-
/** Represents the shape of the oscillator wave generated. Different waves will produce different tones.
913-
*/
890+
/** Represents the shape of the oscillator wave generated. Different waves will produce different tones. */
914891
var `type`: String = js.native // Not sure if this is correct ...
915892

916893
/** This method specifies the exact time to start playing the tone. */
@@ -926,8 +903,7 @@ trait OscillatorNode extends AudioNode {
926903
*/
927904
def setPeriodicWave(wave: PeriodicWave): Unit = js.native
928905

929-
/** Used to set the event handler for the ended event, which fires when the tone has stopped playing.
930-
*/
906+
/** Used to set the event handler for the ended event, which fires when the tone has stopped playing. */
931907
var onended: js.Function1[Event, _] = js.native
932908
}
933909

@@ -949,8 +925,7 @@ trait OscillatorNode extends AudioNode {
949925
@js.native
950926
trait PannerNode extends AudioNode {
951927

952-
/** Is an enumerated value determining which spatialisation algorithm to use to position the audio in 3D space.
953-
*/
928+
/** Is an enumerated value determining which spatialisation algorithm to use to position the audio in 3D space. */
954929
var panningModel: String = js.native
955930

956931
/** Is an enumerated value determining which algorithm to use to reduce the volume of the audio source as it moves
@@ -1097,16 +1072,13 @@ trait WaveShaperNode extends AudioNode {
10971072
@js.native
10981073
trait AudioBuffer extends js.Object {
10991074

1100-
/** Returns a float representing the sample rate, in samples per second, of the PCM data stored in the buffer.
1101-
*/
1075+
/** Returns a float representing the sample rate, in samples per second, of the PCM data stored in the buffer. */
11021076
val sampleRate: Double = js.native
11031077

1104-
/** Returns an integer representing the length, in sample-frames, of the PCM data stored in the buffer.
1105-
*/
1078+
/** Returns an integer representing the length, in sample-frames, of the PCM data stored in the buffer. */
11061079
val length: Int = js.native
11071080

1108-
/** Returns a double representing the duration, in seconds, of the PCM data stored in the buffer.
1109-
*/
1081+
/** Returns a double representing the duration, in seconds, of the PCM data stored in the buffer. */
11101082
val duration: Double = js.native
11111083

11121084
/** Returns an integer representing the number of discrete audio channels described by the PCM data stored in the
@@ -1158,8 +1130,7 @@ trait AudioBuffer extends js.Object {
11581130
@js.native
11591131
trait OfflineAudioCompletionEvent extends Event {
11601132

1161-
/** The buffer containing the result of the processing of an OfflineAudioContext.
1162-
*/
1133+
/** The buffer containing the result of the processing of an OfflineAudioContext. */
11631134
val renderedBuffer: AudioBuffer = js.native
11641135
}
11651136

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

+15-30
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,7 @@ class CSSStyleDeclaration extends js.Object {
240240
var transformStyle: String = js.native
241241
}
242242

243-
/** An object implementing the CSSStyleSheet interface represents a single CSS style sheet.
244-
*/
243+
/** An object implementing the CSSStyleSheet interface represents a single CSS style sheet. */
245244
@js.native
246245
@JSGlobal
247246
class CSSStyleSheet extends StyleSheet {
@@ -257,23 +256,20 @@ class CSSStyleSheet extends StyleSheet {
257256
*/
258257
var ownerRule: CSSRule = js.native
259258

260-
/** Returns a CSSRuleList of the CSS rules in the style sheet.
261-
*/
259+
/** Returns a CSSRuleList of the CSS rules in the style sheet. */
262260
var cssRules: CSSRuleList = js.native
263261
var id: String = js.native
264262

265263
def addImport(bstrURL: String, lIndex: Int = js.native): Int = js.native
266264

267265
def addPageRule(bstrSelector: String, bstrStyle: String, lIndex: Int = js.native): Int = js.native
268266

269-
/** The CSSStyleSheet.insertRule() method inserts a new style rule into the current style sheet.
270-
*/
267+
/** The CSSStyleSheet.insertRule() method inserts a new style rule into the current style sheet. */
271268
def insertRule(rule: String, index: Int = js.native): Int = js.native
272269

273270
def removeRule(lIndex: Int): Unit = js.native
274271

275-
/** Deletes a rule from the style sheet.
276-
*/
272+
/** Deletes a rule from the style sheet. */
277273
def deleteRule(index: Int = js.native): Unit = js.native
278274

279275
def addRule(bstrSelector: String, bstrStyle: String = js.native, lIndex: Int = js.native): Int = js.native
@@ -288,13 +284,11 @@ class CSSStyleSheet extends StyleSheet {
288284
@JSGlobal
289285
class CSSStyleRule extends CSSRule {
290286

291-
/** Gets/sets the textual representation of the selector for this rule, e.g. "h1,h2".
292-
*/
287+
/** Gets/sets the textual representation of the selector for this rule, e.g. "h1,h2". */
293288
var selectorText: String = js.native
294289
var readOnly: Boolean = js.native
295290

296-
/** Returns the CSSStyleDeclaration object for the rule.
297-
*/
291+
/** Returns the CSSStyleDeclaration object for the rule. */
298292
val style: CSSStyleDeclaration = js.native
299293
}
300294

@@ -305,8 +299,7 @@ class CSSStyleRule extends CSSRule {
305299
@JSGlobal
306300
class CSSMediaRule extends CSSRule {
307301

308-
/** Specifies a MediaList representing the intended destination medium for style information.
309-
*/
302+
/** Specifies a MediaList representing the intended destination medium for style information. */
310303
var media: MediaList = js.native
311304
var cssRules: CSSRuleList = js.native
312305

@@ -322,8 +315,7 @@ class CSSMediaRule extends CSSRule {
322315
@JSGlobal
323316
class CSSNamespaceRule extends CSSRule {
324317

325-
/** Returns a DOMString containing the text of the URI of the given namespace.
326-
*/
318+
/** Returns a DOMString containing the text of the URI of the given namespace. */
327319
var namespaceURI: String = js.native
328320

329321
/** Returns a DOMString with the name of the prefix associated to this namespace. If there is no such prefix, returns 
@@ -352,8 +344,7 @@ class CSSRule extends js.Object {
352344
*/
353345
var cssText: String = js.native
354346

355-
/** parentStyleSheet returns the stylesheet object in which the current rule is defined.
356-
*/
347+
/** parentStyleSheet returns the stylesheet object in which the current rule is defined. */
357348
var parentStyleSheet: CSSStyleSheet = js.native
358349

359350
/** Returns the containing rule, otherwise null. E.g. if this rule is a style rule inside an `@media` block, the
@@ -401,18 +392,15 @@ class CSSFontFaceRule extends CSSRule {
401392
class CSSPageRule extends CSSRule {
402393
var pseudoClass: String = js.native
403394

404-
/** Represents the text of the page selector associated with the at-rule.
405-
*/
395+
/** Represents the text of the page selector associated with the at-rule. */
406396
var selectorText: String = js.native
407397
var selector: String = js.native
408398

409-
/** Returns the declaration block associated with the at-rule.
410-
*/
399+
/** Returns the declaration block associated with the at-rule. */
411400
var style: CSSStyleDeclaration = js.native
412401
}
413402

414-
/** A CSSRuleList is an array-like object containing an ordered collection of CSSRule objects.
415-
*/
403+
/** A CSSRuleList is an array-like object containing an ordered collection of CSSRule objects. */
416404
@js.native
417405
@JSGlobal
418406
class CSSRuleList private[this] () extends DOMList[CSSRule] {
@@ -427,12 +415,10 @@ class CSSRuleList private[this] () extends DOMList[CSSRule] {
427415
@JSGlobal
428416
class CSSKeyframesRule extends CSSRule {
429417

430-
/** Represents the name of the animation, used by the animation-name property.
431-
*/
418+
/** Represents the name of the animation, used by the animation-name property. */
432419
var name: String = js.native
433420

434-
/** Returns a CSSRuleList of the CSS rules in the media rule.
435-
*/
421+
/** Returns a CSSRuleList of the CSS rules in the media rule. */
436422
var cssRules: CSSRuleList = js.native
437423

438424
/** Returns a keyframe rule corresponding to the given key. The key is a DOMString containing an index of the keyframe
@@ -465,7 +451,6 @@ class CSSKeyframeRule extends CSSRule {
465451
*/
466452
var keyText: String = js.native
467453

468-
/** Returns a CSSStyleDeclaration of the CSS style associated with the keyfrom.
469-
*/
454+
/** Returns a CSSStyleDeclaration of the CSS style associated with the keyfrom. */
470455
var style: CSSStyleDeclaration = js.native
471456
}

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ package org.scalajs.dom
22

33
import org.scalajs.dom
44

5-
/** Short aliases of all the dom.CSSThing classes
6-
*/
5+
/** Short aliases of all the dom.CSSThing classes */
76
@deprecated("directly use the dom.CSS* types and values instead", "2.0.0")
87
object DeprecatedCSSAliases {
98

0 commit comments

Comments
 (0)