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

NodeSelection

A node selection is a selection that points at a single node. All nodes marked selectable can be the target of a node selection. In such a selection, from and to point directly before and after the selected node, anchor equals from, and head equals to..

class NodeSelection extends Selection {
constructor($pos: ResolvedPos);
node: Node;
 
content(): Slice;
eq(other: Selection): boolean;
getBookmark(): NodeBookmark;
map(doc: Node, mapping: Mappable): Selection;
toJSON(): any;
 
static create(doc: Node, from: number): NodeSelection;
static isSelectable(node: Node): boolean;
}

§Extends

§
Selection
[src]

§Constructors

§
new NodeSelection($pos: ResolvedPos)
[src]

Create a node selection. Does not verify the validity of its argument.

§Properties

§
node: Node
[src]

The selected node.

§Methods

§
content(): Slice
[src]
§
eq(other: Selection): boolean
[src]
§
getBookmark(): NodeBookmark
[src]
§
map(doc: Node, mapping: Mappable): Selection
[src]
§
toJSON(): any
[src]

§Static Methods

§
create(doc: Node, from: number): NodeSelection
[src]

Create a node selection from non-resolved positions.

§
isSelectable(node: Node): boolean
[src]

Determines whether the given node may be selected as a node selection.