Skip to main content

Module: @lexical/selection

Functions

$addNodeStyle

$addNodeStyle(node): void

Parameters

NameType
nodeTextNode

Returns

void

Defined in

lexical-selection/src/lexical-node.ts:249


$cloneWithProperties

$cloneWithProperties<T>(node): T

Type parameters

NameType
Textends LexicalNode<T>

Parameters

NameType
nodeT

Returns

T

Defined in

lexical-selection/src/lexical-node.ts:61


$getSelectionStyleValueForProperty

$getSelectionStyleValueForProperty(selection, styleProperty, defaultValue?): string

Parameters

NameTypeDefault value
selectionRangeSelectionundefined
stylePropertystringundefined
defaultValuestring''

Returns

string

Defined in

lexical-selection/src/range-selection.ts:468


$isAtNodeEnd

$isAtNodeEnd(point): boolean

Parameters

NameType
pointPoint

Returns

boolean

Defined in

lexical-selection/src/lexical-node.ts:125


$isParentElementRTL

$isParentElementRTL(selection): boolean

Parameters

NameType
selectionRangeSelection

Returns

boolean

Defined in

lexical-selection/src/range-selection.ts:399


$moveCaretSelection

$moveCaretSelection(selection, isHoldingShift, isBackward, granularity): void

Parameters

NameType
selectionRangeSelection
isHoldingShiftboolean
isBackwardboolean
granularity"character" | "word" | "lineboundary"

Returns

void

Defined in

lexical-selection/src/range-selection.ts:390


$moveCharacter

$moveCharacter(selection, isHoldingShift, isBackward): void

Parameters

NameType
selectionRangeSelection
isHoldingShiftboolean
isBackwardboolean

Returns

void

Defined in

lexical-selection/src/range-selection.ts:408


$patchStyleText

$patchStyleText(selection, patch): void

Parameters

NameType
selectionRangeSelection
patchRecord<string, null | string>

Returns

void

Defined in

lexical-selection/src/lexical-node.ts:278


$selectAll

$selectAll(selection): void

Parameters

NameType
selectionRangeSelection

Returns

void

Defined in

lexical-selection/src/range-selection.ts:422


$setBlocksType

$setBlocksType(selection, createElement): void

Converts all nodes in the selection that are of one block type to another specified by parameter

Parameters

NameType
selectionRangeSelection | GridSelection
createElement() => ElementNode

Returns

void

Defined in

lexical-selection/src/range-selection.ts:43


$shouldOverrideDefaultCharacterSelection

$shouldOverrideDefaultCharacterSelection(selection, isBackward): boolean

Parameters

NameType
selectionRangeSelection
isBackwardboolean

Returns

boolean

Defined in

lexical-selection/src/range-selection.ts:376


$sliceSelectedTextNodeContent

$sliceSelectedTextNodeContent(selection, textNode): LexicalNode

Parameters

NameType
selectionRangeSelection | NodeSelection | GridSelection
textNodeTextNode

Returns

LexicalNode

Defined in

lexical-selection/src/lexical-node.ts:81


$wrapNodes

$wrapNodes(selection, createElement, wrappingElement?): void

Deprecated

Parameters

NameTypeDefault value
selectionRangeSelection | GridSelectionundefined
createElement() => ElementNodeundefined
wrappingElementnull | ElementNodenull

Returns

void

Defined in

lexical-selection/src/range-selection.ts:122


createDOMRange

createDOMRange(editor, anchorNode, _anchorOffset, focusNode, _focusOffset): Range | null

Parameters

NameType
editorLexicalEditor
anchorNodeLexicalNode
_anchorOffsetnumber
focusNodeLexicalNode
_focusOffsetnumber

Returns

Range | null

Defined in

lexical-selection/src/utils.ts:38


createRectsFromDOMRange

createRectsFromDOMRange(editor, range): ClientRect[]

Parameters

NameType
editorLexicalEditor
rangeRange

Returns

ClientRect[]

Defined in

lexical-selection/src/utils.ts:109


getStyleObjectFromCSS

getStyleObjectFromCSS(css): Record<string, string>

Parameters

NameType
cssstring

Returns

Record<string, string>

Defined in

lexical-selection/src/utils.ts:168


trimTextContentFromAnchor

trimTextContentFromAnchor(editor, anchor, delCount): void

Parameters

NameType
editorLexicalEditor
anchorPoint
delCountnumber

Returns

void

Defined in

lexical-selection/src/lexical-node.ts:133