Skip to content

Add InputEvent, StaticRange, AbstractRange #695

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 7 commits into from
May 30, 2022
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions api-reports/2_12.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ AbortSignal[JT] def dispatchEvent(evt: Event): Boolean
AbortSignal[JT] var onabort: js.Function0[Any]
AbortSignal[JT] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
AbortSignal[JT] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
AbstractRange[JC] def collapsed: Boolean
AbstractRange[JC] def endContainer: Node
AbstractRange[JC] def endOffset: Int
AbstractRange[JC] def startContainer: Node
AbstractRange[JC] def startOffset: Int
AbstractWorker[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
AbstractWorker[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
AbstractWorker[JT] def dispatchEvent(evt: Event): Boolean
Expand Down Expand Up @@ -14184,6 +14189,82 @@ ImageCapture[JC] val track: MediaStreamTrack
ImageData[JC] def data: js.Array[Int]
ImageData[JC] def height: Int
ImageData[JC] def width: Int
InputEvent[JC] def bubbles: Boolean
InputEvent[JC] def cancelBubble: Boolean
InputEvent[JC] def cancelable: Boolean
InputEvent[JC] def currentTarget: EventTarget
InputEvent[JC] def data: String
InputEvent[JC] def dataTransfer: DataTransfer
InputEvent[JC] def defaultPrevented: Boolean
InputEvent[JC] def detail: Int
InputEvent[JC] def eventPhase: Int
InputEvent[JC] def getTargetRanges(): js.Array[StaticRange]
InputEvent[JC] def inputType: InputType
InputEvent[JC] def isComposing: Boolean
InputEvent[JC] def isTrusted: Boolean
InputEvent[JC] def preventDefault(): Unit
InputEvent[JC] def stopImmediatePropagation(): Unit
InputEvent[JC] def stopPropagation(): Unit
InputEvent[JC] def target: EventTarget
InputEvent[JC] def timeStamp: Double
InputEvent[JC] def `type`: String
InputEvent[JC] def view: Window
InputEventInit[JT] var bubbles: js.UndefOr[Boolean]
InputEventInit[JT] var cancelable: js.UndefOr[Boolean]
InputEventInit[JT] var composed: js.UndefOr[Boolean]
InputEventInit[JT] var data: js.UndefOr[String]
InputEventInit[JT] var detail: js.UndefOr[Int]
InputEventInit[JT] var inputType: js.UndefOr[InputType]
InputEventInit[JT] var isComposing: js.UndefOr[Boolean]
InputEventInit[JT] var scoped: js.UndefOr[Boolean]
InputEventInit[JT] var view: js.UndefOr[Window]
InputType[JT]
InputType[SO] val deleteByCut: InputType
InputType[SO] val deleteByDrag: InputType
InputType[SO] val deleteContent: InputType
InputType[SO] val deleteContentBackward: InputType
InputType[SO] val deleteContentForward: InputType
InputType[SO] val deleteEntireSoftLine: InputType
InputType[SO] val deleteHardLineBackward: InputType
InputType[SO] val deleteHardLineForward: InputType
InputType[SO] val deleteSoftLineBackward: InputType
InputType[SO] val deleteSoftLineForward: InputType
InputType[SO] val deleteWordBackward: InputType
InputType[SO] val deleteWordForward: InputType
InputType[SO] val formatBackColor: InputType
InputType[SO] val formatBold: InputType
InputType[SO] val formatFontColor: InputType
InputType[SO] val formatFontName: InputType
InputType[SO] val formatIndent: InputType
InputType[SO] val formatItalic: InputType
InputType[SO] val formatJustifyCenter: InputType
InputType[SO] val formatJustifyFull: InputType
InputType[SO] val formatJustifyLeft: InputType
InputType[SO] val formatJustifyRight: InputType
InputType[SO] val formatOutdent: InputType
InputType[SO] val formatRemove: InputType
InputType[SO] val formatSetBlockTextDirection: InputType
InputType[SO] val formatSetInlineTextDirection: InputType
InputType[SO] val formatStrikeThrough: InputType
InputType[SO] val formatSubscript: InputType
InputType[SO] val formatSuperscript: InputType
InputType[SO] val formatUnderline: InputType
InputType[SO] val historyRedo: InputType
InputType[SO] val historyUndo: InputType
InputType[SO] val insertCompositionText: InputType
InputType[SO] val insertFromDrop: InputType
InputType[SO] val insertFromPaste: InputType
InputType[SO] val insertFromPasteAsQuotation: InputType
InputType[SO] val insertFromYank: InputType
InputType[SO] val insertHorizontalRule: InputType
InputType[SO] val insertLineBreak: InputType
InputType[SO] val insertLink: InputType
InputType[SO] val insertOrderedList: InputType
InputType[SO] val insertParagraph: InputType
InputType[SO] val insertReplacementText: InputType
InputType[SO] val insertText: InputType
InputType[SO] val insertTranspose: InputType
InputType[SO] val insertUnorderedList: InputType
JsonWebKey[JT] var alg: js.Array[String]
JsonWebKey[JT] var crv: String
JsonWebKey[JT] var d: String
Expand Down Expand Up @@ -24124,6 +24205,15 @@ SourceBufferList[JT] var onaddsourcebuffer: js.Function1[Event, Any]
SourceBufferList[JT] var onremovesourcebuffer: js.Function1[Event, Any]
SourceBufferList[JT] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
SourceBufferList[JT] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
StaticRange[JC] def collapsed: Boolean
StaticRange[JC] def endContainer: Node
StaticRange[JC] def endOffset: Int
StaticRange[JC] def startContainer: Node
StaticRange[JC] def startOffset: Int
StaticRangeInit[JT] val endContainer: Node
StaticRangeInit[JT] val endOffset: Int
StaticRangeInit[JT] val startContainer: Node
StaticRangeInit[JT] val startOffset: Int
StereoPannerNode[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
StereoPannerNode[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
StereoPannerNode[JT] var channelCount: Int
Expand Down
90 changes: 90 additions & 0 deletions api-reports/2_13.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ AbortSignal[JT] def dispatchEvent(evt: Event): Boolean
AbortSignal[JT] var onabort: js.Function0[Any]
AbortSignal[JT] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
AbortSignal[JT] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
AbstractRange[JC] def collapsed: Boolean
AbstractRange[JC] def endContainer: Node
AbstractRange[JC] def endOffset: Int
AbstractRange[JC] def startContainer: Node
AbstractRange[JC] def startOffset: Int
AbstractWorker[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
AbstractWorker[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
AbstractWorker[JT] def dispatchEvent(evt: Event): Boolean
Expand Down Expand Up @@ -14184,6 +14189,82 @@ ImageCapture[JC] val track: MediaStreamTrack
ImageData[JC] def data: js.Array[Int]
ImageData[JC] def height: Int
ImageData[JC] def width: Int
InputEvent[JC] def bubbles: Boolean
InputEvent[JC] def cancelBubble: Boolean
InputEvent[JC] def cancelable: Boolean
InputEvent[JC] def currentTarget: EventTarget
InputEvent[JC] def data: String
InputEvent[JC] def dataTransfer: DataTransfer
InputEvent[JC] def defaultPrevented: Boolean
InputEvent[JC] def detail: Int
InputEvent[JC] def eventPhase: Int
InputEvent[JC] def getTargetRanges(): js.Array[StaticRange]
InputEvent[JC] def inputType: InputType
InputEvent[JC] def isComposing: Boolean
InputEvent[JC] def isTrusted: Boolean
InputEvent[JC] def preventDefault(): Unit
InputEvent[JC] def stopImmediatePropagation(): Unit
InputEvent[JC] def stopPropagation(): Unit
InputEvent[JC] def target: EventTarget
InputEvent[JC] def timeStamp: Double
InputEvent[JC] def `type`: String
InputEvent[JC] def view: Window
InputEventInit[JT] var bubbles: js.UndefOr[Boolean]
InputEventInit[JT] var cancelable: js.UndefOr[Boolean]
InputEventInit[JT] var composed: js.UndefOr[Boolean]
InputEventInit[JT] var data: js.UndefOr[String]
InputEventInit[JT] var detail: js.UndefOr[Int]
InputEventInit[JT] var inputType: js.UndefOr[InputType]
InputEventInit[JT] var isComposing: js.UndefOr[Boolean]
InputEventInit[JT] var scoped: js.UndefOr[Boolean]
InputEventInit[JT] var view: js.UndefOr[Window]
InputType[JT]
InputType[SO] val deleteByCut: InputType
InputType[SO] val deleteByDrag: InputType
InputType[SO] val deleteContent: InputType
InputType[SO] val deleteContentBackward: InputType
InputType[SO] val deleteContentForward: InputType
InputType[SO] val deleteEntireSoftLine: InputType
InputType[SO] val deleteHardLineBackward: InputType
InputType[SO] val deleteHardLineForward: InputType
InputType[SO] val deleteSoftLineBackward: InputType
InputType[SO] val deleteSoftLineForward: InputType
InputType[SO] val deleteWordBackward: InputType
InputType[SO] val deleteWordForward: InputType
InputType[SO] val formatBackColor: InputType
InputType[SO] val formatBold: InputType
InputType[SO] val formatFontColor: InputType
InputType[SO] val formatFontName: InputType
InputType[SO] val formatIndent: InputType
InputType[SO] val formatItalic: InputType
InputType[SO] val formatJustifyCenter: InputType
InputType[SO] val formatJustifyFull: InputType
InputType[SO] val formatJustifyLeft: InputType
InputType[SO] val formatJustifyRight: InputType
InputType[SO] val formatOutdent: InputType
InputType[SO] val formatRemove: InputType
InputType[SO] val formatSetBlockTextDirection: InputType
InputType[SO] val formatSetInlineTextDirection: InputType
InputType[SO] val formatStrikeThrough: InputType
InputType[SO] val formatSubscript: InputType
InputType[SO] val formatSuperscript: InputType
InputType[SO] val formatUnderline: InputType
InputType[SO] val historyRedo: InputType
InputType[SO] val historyUndo: InputType
InputType[SO] val insertCompositionText: InputType
InputType[SO] val insertFromDrop: InputType
InputType[SO] val insertFromPaste: InputType
InputType[SO] val insertFromPasteAsQuotation: InputType
InputType[SO] val insertFromYank: InputType
InputType[SO] val insertHorizontalRule: InputType
InputType[SO] val insertLineBreak: InputType
InputType[SO] val insertLink: InputType
InputType[SO] val insertOrderedList: InputType
InputType[SO] val insertParagraph: InputType
InputType[SO] val insertReplacementText: InputType
InputType[SO] val insertText: InputType
InputType[SO] val insertTranspose: InputType
InputType[SO] val insertUnorderedList: InputType
JsonWebKey[JT] var alg: js.Array[String]
JsonWebKey[JT] var crv: String
JsonWebKey[JT] var d: String
Expand Down Expand Up @@ -24124,6 +24205,15 @@ SourceBufferList[JT] var onaddsourcebuffer: js.Function1[Event, Any]
SourceBufferList[JT] var onremovesourcebuffer: js.Function1[Event, Any]
SourceBufferList[JT] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
SourceBufferList[JT] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
StaticRange[JC] def collapsed: Boolean
StaticRange[JC] def endContainer: Node
StaticRange[JC] def endOffset: Int
StaticRange[JC] def startContainer: Node
StaticRange[JC] def startOffset: Int
StaticRangeInit[JT] val endContainer: Node
StaticRangeInit[JT] val endOffset: Int
StaticRangeInit[JT] val startContainer: Node
StaticRangeInit[JT] val startOffset: Int
StereoPannerNode[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
StereoPannerNode[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
StereoPannerNode[JT] var channelCount: Int
Expand Down
55 changes: 55 additions & 0 deletions dom/src/main/scala-2/org/scalajs/dom/InputType.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package org.scalajs.dom

import scala.scalajs.js

@js.native
sealed trait InputType extends js.Any

object InputType {
val insertText: InputType = "insertText".asInstanceOf[InputType]
val insertReplacementText: InputType = "insertReplacementText".asInstanceOf[InputType]
val insertLineBreak: InputType = "insertLineBreak".asInstanceOf[InputType]
val insertParagraph: InputType = "insertParagraph".asInstanceOf[InputType]
val insertOrderedList: InputType = "insertOrderedList".asInstanceOf[InputType]
val insertUnorderedList: InputType = "insertUnorderedList".asInstanceOf[InputType]
val insertHorizontalRule: InputType = "insertHorizontalRule".asInstanceOf[InputType]
val insertFromYank: InputType = "insertFromYank".asInstanceOf[InputType]
val insertFromDrop: InputType = "insertFromDrop".asInstanceOf[InputType]
val insertFromPaste: InputType = "insertFromPaste".asInstanceOf[InputType]
val insertFromPasteAsQuotation: InputType = "insertFromPasteAsQuotation".asInstanceOf[InputType]
val insertTranspose: InputType = "insertTranspose".asInstanceOf[InputType]
val insertCompositionText: InputType = "insertCompositionText".asInstanceOf[InputType]
val insertLink: InputType = "insertLink".asInstanceOf[InputType]
val deleteWordBackward: InputType = "deleteWordBackward".asInstanceOf[InputType]
val deleteWordForward: InputType = "deleteWordForward".asInstanceOf[InputType]
val deleteSoftLineBackward: InputType = "deleteSoftLineBackward".asInstanceOf[InputType]
val deleteSoftLineForward: InputType = "deleteSoftLineForward".asInstanceOf[InputType]
val deleteEntireSoftLine: InputType = "deleteEntireSoftLine".asInstanceOf[InputType]
val deleteHardLineBackward: InputType = "deleteHardLineBackward".asInstanceOf[InputType]
val deleteHardLineForward: InputType = "deleteHardLineForward".asInstanceOf[InputType]
val deleteByDrag: InputType = "deleteByDrag".asInstanceOf[InputType]
val deleteByCut: InputType = "deleteByCut".asInstanceOf[InputType]
val deleteContent: InputType = "deleteContent".asInstanceOf[InputType]
val deleteContentBackward: InputType = "deleteContentBackward".asInstanceOf[InputType]
val deleteContentForward: InputType = "deleteContentForward".asInstanceOf[InputType]
val historyUndo: InputType = "historyUndo".asInstanceOf[InputType]
val historyRedo: InputType = "historyRedo".asInstanceOf[InputType]
val formatBold: InputType = "formatBold".asInstanceOf[InputType]
val formatItalic: InputType = "formatItalic".asInstanceOf[InputType]
val formatUnderline: InputType = "formatUnderline".asInstanceOf[InputType]
val formatStrikeThrough: InputType = "formatStrikeThrough".asInstanceOf[InputType]
val formatSuperscript: InputType = "formatSuperscript".asInstanceOf[InputType]
val formatSubscript: InputType = "formatSubscript".asInstanceOf[InputType]
val formatJustifyFull: InputType = "formatJustifyFull".asInstanceOf[InputType]
val formatJustifyCenter: InputType = "formatJustifyCenter".asInstanceOf[InputType]
val formatJustifyRight: InputType = "formatJustifyRight".asInstanceOf[InputType]
val formatJustifyLeft: InputType = "formatJustifyLeft".asInstanceOf[InputType]
val formatIndent: InputType = "formatIndent".asInstanceOf[InputType]
val formatOutdent: InputType = "formatOutdent".asInstanceOf[InputType]
val formatRemove: InputType = "formatRemove".asInstanceOf[InputType]
val formatSetBlockTextDirection: InputType = "formatSetBlockTextDirection".asInstanceOf[InputType]
val formatSetInlineTextDirection: InputType = "formatSetInlineTextDirection".asInstanceOf[InputType]
val formatBackColor: InputType = "formatBackColor".asInstanceOf[InputType]
val formatFontColor: InputType = "formatFontColor".asInstanceOf[InputType]
val formatFontName: InputType = "formatFontName".asInstanceOf[InputType]
}
54 changes: 54 additions & 0 deletions dom/src/main/scala-3/org/scalajs/dom/InputType.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package org.scalajs.dom

import scala.scalajs.js

opaque type InputType <: String = String

object InputType {
val insertText: InputType = "insertText"
val insertReplacementText: InputType = "insertReplacementText"
val insertLineBreak: InputType = "insertLineBreak"
val insertParagraph: InputType = "insertParagraph"
val insertOrderedList: InputType = "insertOrderedList"
val insertUnorderedList: InputType = "insertUnorderedList"
val insertHorizontalRule: InputType = "insertHorizontalRule"
val insertFromYank: InputType = "insertFromYank"
val insertFromDrop: InputType = "insertFromDrop"
val insertFromPaste: InputType = "insertFromPaste"
val insertFromPasteAsQuotation: InputType = "insertFromPasteAsQuotation"
val insertTranspose: InputType = "insertTranspose"
val insertCompositionText: InputType = "insertCompositionText"
val insertLink: InputType = "insertLink"
val deleteWordBackward: InputType = "deleteWordBackward"
val deleteWordForward: InputType = "deleteWordForward"
val deleteSoftLineBackward: InputType = "deleteSoftLineBackward"
val deleteSoftLineForward: InputType = "deleteSoftLineForward"
val deleteEntireSoftLine: InputType = "deleteEntireSoftLine"
val deleteHardLineBackward: InputType = "deleteHardLineBackward"
val deleteHardLineForward: InputType = "deleteHardLineForward"
val deleteByDrag: InputType = "deleteByDrag"
val deleteByCut: InputType = "deleteByCut"
val deleteContent: InputType = "deleteContent"
val deleteContentBackward: InputType = "deleteContentBackward"
val deleteContentForward: InputType = "deleteContentForward"
val historyUndo: InputType = "historyUndo"
val historyRedo: InputType = "historyRedo"
val formatBold: InputType = "formatBold"
val formatItalic: InputType = "formatItalic"
val formatUnderline: InputType = "formatUnderline"
val formatStrikeThrough: InputType = "formatStrikeThrough"
val formatSuperscript: InputType = "formatSuperscript"
val formatSubscript: InputType = "formatSubscript"
val formatJustifyFull: InputType = "formatJustifyFull"
val formatJustifyCenter: InputType = "formatJustifyCenter"
val formatJustifyRight: InputType = "formatJustifyRight"
val formatJustifyLeft: InputType = "formatJustifyLeft"
val formatIndent: InputType = "formatIndent"
val formatOutdent: InputType = "formatOutdent"
val formatRemove: InputType = "formatRemove"
val formatSetBlockTextDirection: InputType = "formatSetBlockTextDirection"
val formatSetInlineTextDirection: InputType = "formatSetInlineTextDirection"
val formatBackColor: InputType = "formatBackColor"
val formatFontColor: InputType = "formatFontColor"
val formatFontName: InputType = "formatFontName"
}
45 changes: 45 additions & 0 deletions dom/src/main/scala/org/scalajs/dom/AbstractRange.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/** 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._

/** The AbstractRange abstract interface is the base class upon which all DOM range types are defined. A range is an
* object that indicates the start and end points of a section of content within the document.
*/
@js.native
@JSGlobal
abstract class AbstractRange extends js.Object {

/** The Range.startOffset read-only property returns a number representing where in the startContainer the Range
* starts.
*/
def startOffset: Int = js.native

/** The Range.collapsed read-only property returns a Boolean flag indicating whether the start and end points of the
* Range are at the same position. It returns true if the start and end boundary points of the Range are the same
* point in the DOM, false if not.
*/
def collapsed: Boolean = js.native

/** The Range.endOffset read-only property returns a number representing where in the Range.endContainer the Range
* ends.
*/
def endOffset: Int = js.native

/** The Range.startContainer read-only property returns the Node within which the Range starts. To change the start
* position of a node, use one of the Range.setStart() methods.
*/
def startContainer: Node = js.native

/** The Range.endContainer read-only property returns the Node within which the Range ends. To change the end position
* of a node, use the Range.setEnd() method or a similar one.
*/
def endContainer: Node = js.native

}
Loading