Skip to main content

Class: RangeSelection

lexical.RangeSelection

Implements

Constructors

constructor

new RangeSelection(anchor, focus, format, style)

Parameters

NameType
anchorPointType
focusPointType
formatnumber
stylestring

Defined in

lexical/src/LexicalSelection.ts:661

Properties

_cachedNodes

_cachedNodes: null | LexicalNode[]

Defined in

lexical/src/LexicalSelection.ts:659


anchor

anchor: PointType

Defined in

lexical/src/LexicalSelection.ts:654


dirty

dirty: boolean

Implementation of

BaseSelection.dirty

Defined in

lexical/src/LexicalSelection.ts:656


focus

focus: PointType

Defined in

lexical/src/LexicalSelection.ts:655


format

format: number

Defined in

lexical/src/LexicalSelection.ts:657


style

style: string

Defined in

lexical/src/LexicalSelection.ts:658

Methods

applyDOMRange

applyDOMRange(range): void

Parameters

NameType
rangeStaticRange

Returns

void

Defined in

lexical/src/LexicalSelection.ts:825


clone

clone(): RangeSelection

Returns

RangeSelection

Implementation of

BaseSelection.clone

Defined in

lexical/src/LexicalSelection.ts:856


deleteCharacter

deleteCharacter(isBackward): void

Parameters

NameType
isBackwardboolean

Returns

void

Defined in

lexical/src/LexicalSelection.ts:2044


deleteLine

deleteLine(isBackward): void

Parameters

NameType
isBackwardboolean

Returns

void

Defined in

lexical/src/LexicalSelection.ts:2158


deleteWord

deleteWord(isBackward): void

Parameters

NameType
isBackwardboolean

Returns

void

Defined in

lexical/src/LexicalSelection.ts:2175


extract

extract(): LexicalNode[]

Returns

LexicalNode[]

Implementation of

BaseSelection.extract

Defined in

lexical/src/LexicalSelection.ts:1853


formatText

formatText(formatType): void

Parameters

NameType
formatTypeTextFormatType

Returns

void

Defined in

lexical/src/LexicalSelection.ts:1223


getCharacterOffsets

getCharacterOffsets(): [number, number]

Returns

[number, number]

Defined in

lexical/src/LexicalSelection.ts:1849


getNodes

getNodes(): LexicalNode[]

Returns

LexicalNode[]

Implementation of

BaseSelection.getNodes

Defined in

lexical/src/LexicalSelection.ts:699


getTextContent

getTextContent(): string

Returns

string

Implementation of

BaseSelection.getTextContent

Defined in

lexical/src/LexicalSelection.ts:763


hasFormat

hasFormat(type): boolean

Parameters

NameType
typeTextFormatType

Returns

boolean

Defined in

lexical/src/LexicalSelection.ts:878


insertLineBreak

insertLineBreak(selectStart?): void

Parameters

NameType
selectStart?boolean

Returns

void

Defined in

lexical/src/LexicalSelection.ts:1831


insertNodes

insertNodes(nodes, selectStart?): boolean

Parameters

NameType
nodesLexicalNode[]
selectStart?boolean

Returns

boolean

Defined in

lexical/src/LexicalSelection.ts:1347


insertParagraph

insertParagraph(): void

Returns

void

Defined in

lexical/src/LexicalSelection.ts:1721


insertRawText

insertRawText(text): void

Parameters

NameType
textstring

Returns

void

Implementation of

BaseSelection.insertRawText

Defined in

lexical/src/LexicalSelection.ts:883


insertText

insertText(text): void

Parameters

NameType
textstring

Returns

void

Defined in

lexical/src/LexicalSelection.ts:900


is

is(selection): boolean

Parameters

NameType
selectionnull | RangeSelection | NodeSelection | GridSelection

Returns

boolean

Implementation of

BaseSelection.is

Defined in

lexical/src/LexicalSelection.ts:677


isBackward

isBackward(): boolean

Returns

boolean

Defined in

lexical/src/LexicalSelection.ts:691


isCollapsed

isCollapsed(): boolean

Returns

boolean

Defined in

lexical/src/LexicalSelection.ts:695


modify

modify(alter, isBackward, granularity): void

Parameters

NameType
alter"move" | "extend"
isBackwardboolean
granularity"character" | "word" | "lineboundary"

Returns

void

Defined in

lexical/src/LexicalSelection.ts:1902


removeText

removeText(): void

Returns

void

Defined in

lexical/src/LexicalSelection.ts:1219


setStyle

setStyle(style): void

Parameters

NameType
stylestring

Returns

void

Defined in

lexical/src/LexicalSelection.ts:873


setTextNodeRange

setTextNodeRange(anchorNode, anchorOffset, focusNode, focusOffset): void

Parameters

NameType
anchorNodeTextNode
anchorOffsetnumber
focusNodeTextNode
focusOffsetnumber

Returns

void

Defined in

lexical/src/LexicalSelection.ts:751


toggleFormat

toggleFormat(format): void

Parameters

NameType
formatTextFormatType

Returns

void

Defined in

lexical/src/LexicalSelection.ts:868