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:543

Properties

_cachedNodes

_cachedNodes: null | LexicalNode[]

Inherited from

INTERNAL_PointSelection._cachedNodes

Defined in

lexical/src/LexicalSelection.ts:286


anchor

anchor: PointType

Inherited from

INTERNAL_PointSelection.anchor

Defined in

lexical/src/LexicalSelection.ts:283


dirty

dirty: boolean

Inherited from

INTERNAL_PointSelection.dirty

Defined in

lexical/src/LexicalSelection.ts:285


focus

focus: PointType

Inherited from

INTERNAL_PointSelection.focus

Defined in

lexical/src/LexicalSelection.ts:284


gridKey

gridKey: string

Defined in

lexical/src/LexicalSelection.ts:541

Methods

clone

clone(): GridSelection

Returns

GridSelection

Overrides

INTERNAL_PointSelection.clone

Defined in

lexical/src/LexicalSelection.ts:575


extract

extract(): LexicalNode[]

Returns

LexicalNode[]

Overrides

INTERNAL_PointSelection.extract

Defined in

lexical/src/LexicalSelection.ts:583


getCachedNodes

getCachedNodes(): null | LexicalNode[]

Returns

null | LexicalNode[]

Overrides

INTERNAL_PointSelection.getCachedNodes

Defined in

lexical/src/LexicalSelection.ts:548


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:346


getNodes

getNodes(): LexicalNode[]

Returns

LexicalNode[]

Overrides

INTERNAL_PointSelection.getNodes

Defined in

lexical/src/LexicalSelection.ts:657


getShape

getShape(): GridSelectionShape

Returns

GridSelectionShape

Defined in

lexical/src/LexicalSelection.ts:608


getTextContent

getTextContent(): string

Returns

string

Overrides

INTERNAL_PointSelection.getTextContent

Defined in

lexical/src/LexicalSelection.ts:815


insertNodes

insertNodes(nodes): void

Parameters

NameType
nodesLexicalNode[]

Returns

void

Overrides

INTERNAL_PointSelection.insertNodes

Defined in

lexical/src/LexicalSelection.ts:595


insertRawText

insertRawText(text): void

Parameters

NameType
textstring

Returns

void

Overrides

INTERNAL_PointSelection.insertRawText

Defined in

lexical/src/LexicalSelection.ts:587


insertText

insertText(): void

Returns

void

Overrides

INTERNAL_PointSelection.insertText

Defined in

lexical/src/LexicalSelection.ts:591


is

is(selection): boolean

Parameters

NameType
selectionnull | BaseSelection

Returns

boolean

Overrides

INTERNAL_PointSelection.is

Defined in

lexical/src/LexicalSelection.ts:556


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:336


isCollapsed

isCollapsed(): boolean

Returns

boolean

Overrides

INTERNAL_PointSelection.isCollapsed

Defined in

lexical/src/LexicalSelection.ts:579


set

set(gridKey, anchorCellKey, focusCellKey): void

Parameters

NameType
gridKeystring
anchorCellKeystring
focusCellKeystring

Returns

void

Defined in

lexical/src/LexicalSelection.ts:567


setCachedNodes

setCachedNodes(nodes): void

Parameters

NameType
nodesnull | LexicalNode[]

Returns

void

Overrides

INTERNAL_PointSelection.setCachedNodes

Defined in

lexical/src/LexicalSelection.ts:552