Skip to main content

Class: GridSelection

@lexical/table.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-table/src/LexicalGridSelection.ts:40

Properties

_cachedNodes

_cachedNodes: null | LexicalNode[]

Inherited from

INTERNAL_PointSelection._cachedNodes

Defined in

lexical/src/LexicalSelection.ts:284


anchor

anchor: PointType

Inherited from

INTERNAL_PointSelection.anchor

Defined in

lexical/src/LexicalSelection.ts:281


dirty

dirty: boolean

Inherited from

INTERNAL_PointSelection.dirty

Defined in

lexical/src/LexicalSelection.ts:283


focus

focus: PointType

Inherited from

INTERNAL_PointSelection.focus

Defined in

lexical/src/LexicalSelection.ts:282


gridKey

gridKey: string

Defined in

lexical-table/src/LexicalGridSelection.ts:38

Methods

clone

clone(): GridSelection

Returns

GridSelection

Overrides

INTERNAL_PointSelection.clone

Defined in

lexical-table/src/LexicalGridSelection.ts:72


extract

extract(): LexicalNode[]

Returns

LexicalNode[]

Overrides

INTERNAL_PointSelection.extract

Defined in

lexical-table/src/LexicalGridSelection.ts:80


getCachedNodes

getCachedNodes(): null | LexicalNode[]

Returns

null | LexicalNode[]

Overrides

INTERNAL_PointSelection.getCachedNodes

Defined in

lexical-table/src/LexicalGridSelection.ts:45


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


getNodes

getNodes(): LexicalNode[]

Returns

LexicalNode[]

Overrides

INTERNAL_PointSelection.getNodes

Defined in

lexical-table/src/LexicalGridSelection.ts:154


getShape

getShape(): GridSelectionShape

Returns

GridSelectionShape

Defined in

lexical-table/src/LexicalGridSelection.ts:105


getTextContent

getTextContent(): string

Returns

string

Overrides

INTERNAL_PointSelection.getTextContent

Defined in

lexical-table/src/LexicalGridSelection.ts:312


insertNodes

insertNodes(nodes): void

Parameters

NameType
nodesLexicalNode[]

Returns

void

Overrides

INTERNAL_PointSelection.insertNodes

Defined in

lexical-table/src/LexicalGridSelection.ts:92


insertRawText

insertRawText(text): void

Parameters

NameType
textstring

Returns

void

Overrides

INTERNAL_PointSelection.insertRawText

Defined in

lexical-table/src/LexicalGridSelection.ts:84


insertText

insertText(): void

Returns

void

Overrides

INTERNAL_PointSelection.insertText

Defined in

lexical-table/src/LexicalGridSelection.ts:88


is

is(selection): boolean

Parameters

NameType
selectionnull | BaseSelection

Returns

boolean

Overrides

INTERNAL_PointSelection.is

Defined in

lexical-table/src/LexicalGridSelection.ts:53


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


isCollapsed

isCollapsed(): boolean

Returns

boolean

Overrides

INTERNAL_PointSelection.isCollapsed

Defined in

lexical-table/src/LexicalGridSelection.ts:76


set

set(gridKey, anchorCellKey, focusCellKey): void

Parameters

NameType
gridKeystring
anchorCellKeystring
focusCellKeystring

Returns

void

Defined in

lexical-table/src/LexicalGridSelection.ts:64


setCachedNodes

setCachedNodes(nodes): void

Parameters

NameType
nodesnull | LexicalNode[]

Returns

void

Overrides

INTERNAL_PointSelection.setCachedNodes

Defined in

lexical-table/src/LexicalGridSelection.ts:49