Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/evt/lib/types/index.ts>dom.Range

💧EventEmitter's typesafe replacement
Go to Latest
interface dom.Range
implements AbstractRange
import { type dom } from "https://deno.land/x/evt@v2.4.10/lib/types/index.ts";
const { Range } = dom;

A fragment of a document that can contain nodes and parts of text nodes.

Properties

readonly
commonAncestorContainer: Node

Returns the node, furthest away from the document, that is an ancestor of both range's start node and end node.

readonly
END_TO_END: number
readonly
END_TO_START: number
readonly
START_TO_END: number
readonly
START_TO_START: number

Methods

cloneContents(): DocumentFragment
cloneRange(): Range
collapse(toStart?: boolean): void
compareBoundaryPoints(how: number, sourceRange: Range): number
comparePoint(node: Node, offset: number): number

Returns −1 if the point is before the range, 0 if the point is in the range, and 1 if the point is after the range.

createContextualFragment(fragment: string): DocumentFragment
deleteContents(): void
detach(): void
extractContents(): DocumentFragment
getBoundingClientRect(): DOMRect
getClientRects(): DOMRectList
insertNode(node: Node): void
intersectsNode(node: Node): boolean

Returns whether range intersects node.

isPointInRange(node: Node, offset: number): boolean
selectNode(node: Node): void
selectNodeContents(node: Node): void
setEnd(node: Node, offset: number): void
setEndAfter(node: Node): void
setEndBefore(node: Node): void
setStart(node: Node, offset: number): void
setStartAfter(node: Node): void
setStartBefore(node: Node): void
surroundContents(newParent: Node): void
toString(): string