Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Range

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

interface Range extends AbstractRange {
readonly commonAncestorContainer: Node;
readonly END_TO_END: number;
readonly END_TO_START: number;
readonly START_TO_END: number;
readonly START_TO_START: number;
cloneContents(): DocumentFragment;
cloneRange(): Range;
collapse(toStart?: boolean): void;
compareBoundaryPoints(how: number, sourceRange: Range): number;
comparePoint(node: Node, offset: number): number;
createContextualFragment(fragment: string): DocumentFragment;
deleteContents(): void;
detach(): void;
extractContents(): DocumentFragment;
getBoundingClientRect(): DOMRect;
getClientRects(): DOMRectList;
insertNode(node: Node): void;
intersectsNode(node: Node): boolean;
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;
}
var Range: {
prototype: Range;
readonly END_TO_END: number;
readonly END_TO_START: number;
readonly START_TO_END: number;
readonly START_TO_START: number;
new (): Range;
toString(): string;
}
;

§Extends

§Properties

§
readonly commonAncestorContainer: Node
[src]

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
[src]
§
readonly END_TO_START: number
[src]
§
readonly START_TO_END: number
[src]
§
readonly START_TO_START: number
[src]

§Methods

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

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
[src]
§
deleteContents(): void
[src]
§
detach(): void
[src]
§
extractContents(): DocumentFragment
[src]
§
getBoundingClientRect(): DOMRect
[src]
§
getClientRects(): DOMRectList
[src]
§
insertNode(node: Node): void
[src]
§
intersectsNode(node: Node): boolean
[src]

Returns whether range intersects node.

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