Skip to main content

Class: GridSelection

lexical.GridSelection

This class is being used only for internal use case of migration GridSelection outside of core package. DO NOT USE THIS CLASS DIRECTLY.

Hierarchy

Constructors

constructor

new GridSelection(gridKey, anchor, focus)

Parameters

NameType
gridKeystring
anchorPointType
focusPointType

Overrides

INTERNAL_PointSelection.constructor

Defined in

lexical/src/LexicalSelection.ts:534

Properties

_cachedNodes

_cachedNodes: null | LexicalNode[]

Inherited from

INTERNAL_PointSelection._cachedNodes

Defined in

lexical/src/LexicalSelection.ts:285


anchor

anchor: PointType

Inherited from

INTERNAL_PointSelection.anchor

Defined in

lexical/src/LexicalSelection.ts:282


dirty

dirty: boolean

Inherited from

INTERNAL_PointSelection.dirty

Defined in

lexical/src/LexicalSelection.ts:284


focus

focus: PointType

Inherited from

INTERNAL_PointSelection.focus

Defined in

lexical/src/LexicalSelection.ts:283


gridKey

gridKey: string

Defined in

lexical/src/LexicalSelection.ts:532

Methods

clone

clone(): GridSelection

Returns

GridSelection

Overrides

INTERNAL_PointSelection.clone

Defined in

lexical/src/LexicalSelection.ts:566


extract

extract(): LexicalNode[]

Returns

LexicalNode[]

Overrides

INTERNAL_PointSelection.extract

Defined in

lexical/src/LexicalSelection.ts:574


getCachedNodes

getCachedNodes(): null | LexicalNode[]

Returns

null | LexicalNode[]

Overrides

INTERNAL_PointSelection.getCachedNodes

Defined in

lexical/src/LexicalSelection.ts:539


getCharacterOffsets

getCharacterOffsets(): [number, number]

Returns the character-based offsets of the Selection, accounting for non-text Points by using the children size or text content.

Returns

[number, number]

the character offsets for the Selection

Inherited from

INTERNAL_PointSelection.getCharacterOffsets

Defined in

lexical/src/LexicalSelection.ts:345


getNodes

getNodes(): LexicalNode[]

Returns

LexicalNode[]

Overrides

INTERNAL_PointSelection.getNodes

Defined in

lexical/src/LexicalSelection.ts:644


getShape

getShape(): GridSelectionShape

Returns

GridSelectionShape

Defined in

lexical/src/LexicalSelection.ts:595


getTextContent

getTextContent(): string

Returns

string

Overrides

INTERNAL_PointSelection.getTextContent

Defined in

lexical/src/LexicalSelection.ts:802


insertNodes

insertNodes(nodes): void

Parameters

NameType
nodesLexicalNode[]

Returns

void

Overrides

INTERNAL_PointSelection.insertNodes

Defined in

lexical/src/LexicalSelection.ts:586


insertRawText

insertRawText(text): void

Parameters

NameType
textstring

Returns

void

Overrides

INTERNAL_PointSelection.insertRawText

Defined in

lexical/src/LexicalSelection.ts:578


insertText

insertText(): void

Returns

void

Overrides

INTERNAL_PointSelection.insertText

Defined in

lexical/src/LexicalSelection.ts:582


is

is(selection): boolean

Parameters

NameType
selectionnull | BaseSelection

Returns

boolean

Overrides

INTERNAL_PointSelection.is

Defined in

lexical/src/LexicalSelection.ts:547


isBackward

isBackward(): boolean

Returns whether the Selection is "backwards", meaning the focus logically precedes the anchor in the EditorState.

Returns

boolean

true if the Selection is backwards, false otherwise.

Inherited from

INTERNAL_PointSelection.isBackward

Defined in

lexical/src/LexicalSelection.ts:335


isCollapsed

isCollapsed(): boolean

Returns

boolean

Overrides

INTERNAL_PointSelection.isCollapsed

Defined in

lexical/src/LexicalSelection.ts:570


set

set(gridKey, anchorCellKey, focusCellKey): void

Parameters

NameType
gridKeystring
anchorCellKeystring
focusCellKeystring

Returns

void

Defined in

lexical/src/LexicalSelection.ts:558


setCachedNodes

setCachedNodes(nodes): void

Parameters

NameType
nodesnull | LexicalNode[]

Returns

void

Overrides

INTERNAL_PointSelection.setCachedNodes

Defined in

lexical/src/LexicalSelection.ts:543