Skip to content

Commit 5a5f911

Browse files
committed
Improve doc comments, fix function signature getAsString, api reports
1 parent 4247132 commit 5a5f911

File tree

5 files changed

+73
-13
lines changed

5 files changed

+73
-13
lines changed

api-reports/2_12.txt

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,13 +1526,24 @@ DOMTokenList[JC] def remove(token: String): Unit
15261526
DOMTokenList[JC] def toggle(token: String): Boolean
15271527
DOMTokenList[JC] def toggle(token: String, force: Boolean): Boolean
15281528
DataTransfer[JT] def clearData(format: String?): Unit
1529-
DataTransfer[JT] var dropEffect: String
1530-
DataTransfer[JT] var effectAllowed: String
1529+
DataTransfer[JT] var dropEffect: DropEffectValue
1530+
DataTransfer[JT] var effectAllowed: EffectAllowedValue
15311531
DataTransfer[JT] def files: FileList
15321532
DataTransfer[JT] def getData(format: String): String
1533+
DataTransfer[JT] def items: DataTransferItemList
15331534
DataTransfer[JT] def setData(format: String, data: String): Unit
15341535
DataTransfer[JT] def setDragImage(image: Element, x: Double, y: Double): Unit
1535-
DataTransfer[JT] def types: js.Array[String]
1536+
DataTransfer[JT] def types: FrozenArray[String]
1537+
DataTransferItem[JT] def getAsFile(): js.UndefOr[File]
1538+
DataTransferItem[JT] def getAsString(callback: Function1[String, Unit]): Unit
1539+
DataTransferItem[JT] def kind: DragDataItemKind
1540+
DataTransferItem[JT] def `type`: String
1541+
DataTransferItemList[JC] def add(data: File): Unit
1542+
DataTransferItemList[JC] def add(data: String, `type`: String): Unit
1543+
DataTransferItemList[JC] @js.annotation.JSBracketAccess def apply(index: Int): DataTransferItem
1544+
DataTransferItemList[JC] def clear(): Unit
1545+
DataTransferItemList[JC] def length: Int
1546+
DataTransferItemList[JC] def remove(index: Int): Unit
15361547
DedicatedWorkerGlobalScope[JO] def self: DedicatedWorkerGlobalScope
15371548
DedicatedWorkerGlobalScope[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
15381549
DedicatedWorkerGlobalScope[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
@@ -1854,6 +1865,9 @@ DocumentType[JC] def removeEventListener[T <: Event](`type`: String, listener: j
18541865
DocumentType[JC] def replaceChild(newChild: Node, oldChild: Node): Node
18551866
DocumentType[JC] def systemId: String
18561867
DocumentType[JC] var textContent: String
1868+
DragDataItemKind[JT]
1869+
DragDataItemKind[SO] val file: DragDataItemKind
1870+
DragDataItemKind[SO] val string: DragDataItemKind
18571871
DragEffect[SO] final val All = "all"
18581872
DragEffect[SO] final val Copy = "copy"
18591873
DragEffect[SO] final val CopyLink = "copyLink"
@@ -1895,6 +1909,11 @@ DragEvent[JT] def target: EventTarget
18951909
DragEvent[JT] def timeStamp: Double
18961910
DragEvent[JT] def `type`: String
18971911
DragEvent[JT] def view: Window
1912+
DropEffectValue[JT]
1913+
DropEffectValue[SO] val copy: DropEffectValue
1914+
DropEffectValue[SO] val link: DropEffectValue
1915+
DropEffectValue[SO] val move: DropEffectValue
1916+
DropEffectValue[SO] val none: DropEffectValue
18981917
DynamicsCompressorNode[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
18991918
DynamicsCompressorNode[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
19001919
DynamicsCompressorNode[JT] val attack: AudioParam
@@ -1940,6 +1959,16 @@ EcdsaParams[JT] val name: String
19401959
EcdsaParams[SO] def apply(name: String, hash: HashAlgorithmIdentifier): EcdsaParams (@deprecated in 2.0.0)
19411960
EcdsaParams[SO] val hash = hash0
19421961
EcdsaParams[SO] val name = name0
1962+
EffectAllowedValue[JT]
1963+
EffectAllowedValue[SO] val all: EffectAllowedValue
1964+
EffectAllowedValue[SO] val copy: EffectAllowedValue
1965+
EffectAllowedValue[SO] val copyLink: EffectAllowedValue
1966+
EffectAllowedValue[SO] val copyMove: EffectAllowedValue
1967+
EffectAllowedValue[SO] val link: EffectAllowedValue
1968+
EffectAllowedValue[SO] val linkMove: EffectAllowedValue
1969+
EffectAllowedValue[SO] val move: EffectAllowedValue
1970+
EffectAllowedValue[SO] val none: EffectAllowedValue
1971+
EffectAllowedValue[SO] val uninitialized: EffectAllowedValue
19431972
Element[JC] var accessKey: String
19441973
Element[JC] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
19451974
Element[JC] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit

api-reports/2_13.txt

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,13 +1526,24 @@ DOMTokenList[JC] def remove(token: String): Unit
15261526
DOMTokenList[JC] def toggle(token: String): Boolean
15271527
DOMTokenList[JC] def toggle(token: String, force: Boolean): Boolean
15281528
DataTransfer[JT] def clearData(format: String?): Unit
1529-
DataTransfer[JT] var dropEffect: String
1530-
DataTransfer[JT] var effectAllowed: String
1529+
DataTransfer[JT] var dropEffect: DropEffectValue
1530+
DataTransfer[JT] var effectAllowed: EffectAllowedValue
15311531
DataTransfer[JT] def files: FileList
15321532
DataTransfer[JT] def getData(format: String): String
1533+
DataTransfer[JT] def items: DataTransferItemList
15331534
DataTransfer[JT] def setData(format: String, data: String): Unit
15341535
DataTransfer[JT] def setDragImage(image: Element, x: Double, y: Double): Unit
1535-
DataTransfer[JT] def types: js.Array[String]
1536+
DataTransfer[JT] def types: FrozenArray[String]
1537+
DataTransferItem[JT] def getAsFile(): js.UndefOr[File]
1538+
DataTransferItem[JT] def getAsString(callback: Function1[String, Unit]): Unit
1539+
DataTransferItem[JT] def kind: DragDataItemKind
1540+
DataTransferItem[JT] def `type`: String
1541+
DataTransferItemList[JC] def add(data: File): Unit
1542+
DataTransferItemList[JC] def add(data: String, `type`: String): Unit
1543+
DataTransferItemList[JC] @js.annotation.JSBracketAccess def apply(index: Int): DataTransferItem
1544+
DataTransferItemList[JC] def clear(): Unit
1545+
DataTransferItemList[JC] def length: Int
1546+
DataTransferItemList[JC] def remove(index: Int): Unit
15361547
DedicatedWorkerGlobalScope[JO] def self: DedicatedWorkerGlobalScope
15371548
DedicatedWorkerGlobalScope[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
15381549
DedicatedWorkerGlobalScope[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
@@ -1854,6 +1865,9 @@ DocumentType[JC] def removeEventListener[T <: Event](`type`: String, listener: j
18541865
DocumentType[JC] def replaceChild(newChild: Node, oldChild: Node): Node
18551866
DocumentType[JC] def systemId: String
18561867
DocumentType[JC] var textContent: String
1868+
DragDataItemKind[JT]
1869+
DragDataItemKind[SO] val file: DragDataItemKind
1870+
DragDataItemKind[SO] val string: DragDataItemKind
18571871
DragEffect[SO] final val All = "all"
18581872
DragEffect[SO] final val Copy = "copy"
18591873
DragEffect[SO] final val CopyLink = "copyLink"
@@ -1895,6 +1909,11 @@ DragEvent[JT] def target: EventTarget
18951909
DragEvent[JT] def timeStamp: Double
18961910
DragEvent[JT] def `type`: String
18971911
DragEvent[JT] def view: Window
1912+
DropEffectValue[JT]
1913+
DropEffectValue[SO] val copy: DropEffectValue
1914+
DropEffectValue[SO] val link: DropEffectValue
1915+
DropEffectValue[SO] val move: DropEffectValue
1916+
DropEffectValue[SO] val none: DropEffectValue
18981917
DynamicsCompressorNode[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
18991918
DynamicsCompressorNode[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
19001919
DynamicsCompressorNode[JT] val attack: AudioParam
@@ -1940,6 +1959,16 @@ EcdsaParams[JT] val name: String
19401959
EcdsaParams[SO] def apply(name: String, hash: HashAlgorithmIdentifier): EcdsaParams (@deprecated in 2.0.0)
19411960
EcdsaParams[SO] val hash = hash0
19421961
EcdsaParams[SO] val name = name0
1962+
EffectAllowedValue[JT]
1963+
EffectAllowedValue[SO] val all: EffectAllowedValue
1964+
EffectAllowedValue[SO] val copy: EffectAllowedValue
1965+
EffectAllowedValue[SO] val copyLink: EffectAllowedValue
1966+
EffectAllowedValue[SO] val copyMove: EffectAllowedValue
1967+
EffectAllowedValue[SO] val link: EffectAllowedValue
1968+
EffectAllowedValue[SO] val linkMove: EffectAllowedValue
1969+
EffectAllowedValue[SO] val move: EffectAllowedValue
1970+
EffectAllowedValue[SO] val none: EffectAllowedValue
1971+
EffectAllowedValue[SO] val uninitialized: EffectAllowedValue
19431972
Element[JC] var accessKey: String
19441973
Element[JC] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
19451974
Element[JC] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ trait DataTransfer extends js.Object {
2222
*/
2323
var effectAllowed: EffectAllowedValue = js.native
2424

25-
/** The actual effect that will be used, and should always be one of the possible values of effectAllowed. */
25+
/** The actual effect that will be used. */
2626
var dropEffect: DropEffectValue = js.native
2727

2828
/** Remove the data associated with a given type. The type argument is optional. If the type is empty or not

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ trait DataTransferItem extends js.Object {
1919
def `type`: String = js.native
2020

2121
/** Invokes the callback with the string data as the argument, if the drag data item kind is text. */
22-
def getAsString(callback: () => String) = js.native
22+
def getAsString(callback: Function1[String, Unit]): Unit = js.native
2323

2424
/** Returns a File object, if the drag data item kind is File. */
2525
def getAsFile(): js.UndefOr[File] = js.native

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@
77
package org.scalajs.dom
88

99
import scala.scalajs.js
10+
import scala.scalajs.js.annotation.JSGlobal
1011

12+
/** A list of [[DataTransferItem]] objects representing items being dragged. During a drag operation, each DragEvent has
13+
* a dataTransfer property and that property is a DataTransferItemList.
14+
*/
1115
@js.native
12-
trait DataTransferItemList extends js.Object {
16+
@JSGlobal
17+
class DataTransferItemList extends js.Object {
1318

1419
/** Returns the number of items in the drag data store. */
1520
def length: Int = js.native
@@ -30,10 +35,7 @@ trait DataTransferItemList extends js.Object {
3035
/** Removes all the entries in the drag data store. */
3136
def clear(): Unit = js.native
3237

33-
}
34-
35-
@js.native
36-
object DataTransferItemList extends DataTransferItemList {
38+
@js.annotation.JSBracketAccess
3739
/** Returns the DataTransferItem object representing the indexth entry in the drag data store. */
3840
def apply(index: Int): DataTransferItem = js.native
3941
}

0 commit comments

Comments
 (0)