Range

open external class Range (source)

Platform and version requirements: JS

Exposes the JavaScript Range to Kotlin

Constructors

<init>

Range()

Exposes the JavaScript Range to Kotlin

Properties

collapsed

open val collapsed: Boolean

commonAncestorContainer

open val commonAncestorContainer: Node

endContainer

open val endContainer: Node

endOffset

open val endOffset: Int

startContainer

open val startContainer: Node

startOffset

open val startOffset: Int

Functions

cloneContents

fun cloneContents(): DocumentFragment

cloneRange

fun cloneRange(): Range

collapse

fun collapse(toStart: Boolean = definedExternally)

compareBoundaryPoints

fun compareBoundaryPoints(
    how: Short,
    sourceRange: Range
): Short

comparePoint

fun comparePoint(node: Node, offset: Int): Short

createContextualFragment

fun createContextualFragment(
    fragment: String
): DocumentFragment

deleteContents

fun deleteContents()

detach

fun detach()

extractContents

fun extractContents(): DocumentFragment

getBoundingClientRect

fun getBoundingClientRect(): DOMRect

getClientRects

fun getClientRects(): Array<DOMRect>

insertNode

fun insertNode(node: Node)

intersectsNode

fun intersectsNode(node: Node): Boolean

isPointInRange

fun isPointInRange(node: Node, offset: Int): Boolean

selectNode

fun selectNode(node: Node)

selectNodeContents

fun selectNodeContents(node: Node)

setEnd

fun setEnd(node: Node, offset: Int)

setEndAfter

fun setEndAfter(node: Node)

setEndBefore

fun setEndBefore(node: Node)

setStart

fun setStart(node: Node, offset: Int)

setStartAfter

fun setStartAfter(node: Node)

setStartBefore

fun setStartBefore(node: Node)

surroundContents

fun surroundContents(newParent: Node)

Inherited Functions

equals

open operator fun equals(other: Any?): Boolean

Indicates whether some other object is "equal to" this one. Implementations must fulfil the following requirements:

hashCode

open fun hashCode(): Int

Returns a hash code value for the object. The general contract of hashCode is:

toString

open fun toString(): String

Returns a string representation of the object.

Companion Object Properties

END_TO_END

val END_TO_END: Short

END_TO_START

val END_TO_START: Short

START_TO_END

val START_TO_END: Short

START_TO_START

val START_TO_START: Short