Skip to main content

Module: lexical-selection/src

Functions

$addNodeStyle

$addNodeStyle(node): void

Parameters

NameType
nodeTextNode

Returns

void

Defined in

lexical-selection/src/index.ts:333


$cloneContents

$cloneContents(selection): Object

Parameters

NameType
selectionRangeSelection | NodeSelection | GridSelection

Returns

Object

NameType
nodeMap[NodeKey, LexicalNode][]
rangeNodeKey[]

Defined in

lexical-selection/src/index.ts:147


$cloneWithProperties

$cloneWithProperties<T>(node): T

Type parameters

NameType
Textends LexicalNode<T>

Parameters

NameType
nodeT

Returns

T

Defined in

lexical-selection/src/index.ts:39


$getSelectionStyleValueForProperty

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

Parameters

NameTypeDefault value
selectionRangeSelectionundefined
stylePropertystringundefined
defaultValuestring''

Returns

string

Defined in

lexical-selection/src/index.ts:452


$isAtNodeEnd

$isAtNodeEnd(point): boolean

Parameters

NameType
pointPoint

Returns

boolean

Defined in

lexical-selection/src/index.ts:763


$isParentElementRTL

$isParentElementRTL(selection): boolean

Parameters

NameType
selectionRangeSelection

Returns

boolean

Defined in

lexical-selection/src/index.ts:520


$moveCaretSelection

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

Parameters

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

Returns

void

Defined in

lexical-selection/src/index.ts:511


$moveCharacter

$moveCharacter(selection, isHoldingShift, isBackward): void

Parameters

NameType
selectionRangeSelection
isHoldingShiftboolean
isBackwardboolean

Returns

void

Defined in

lexical-selection/src/index.ts:529


$patchStyleText

$patchStyleText(selection, patch): void

Parameters

NameType
selectionRangeSelection | GridSelection
patchRecord<string, string>

Returns

void

Defined in

lexical-selection/src/index.ts:347


$selectAll

$selectAll(selection): void

Parameters

NameType
selectionRangeSelection

Returns

void

Defined in

lexical-selection/src/index.ts:543


$shouldOverrideDefaultCharacterSelection

$shouldOverrideDefaultCharacterSelection(selection, isBackward): boolean

Parameters

NameType
selectionRangeSelection
isBackwardboolean

Returns

boolean

Defined in

lexical-selection/src/index.ts:771


$sliceSelectedTextNodeContent

$sliceSelectedTextNodeContent(selection, textNode): LexicalNode

Parameters

NameType
selectionRangeSelection | NodeSelection | GridSelection
textNodeTextNode

Returns

LexicalNode

Defined in

lexical-selection/src/index.ts:1032


$wrapLeafNodesInElements

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

Parameters

NameType
selectionRangeSelection
createElement() => ElementNode
wrappingElement?ElementNode

Returns

void

Defined in

lexical-selection/src/index.ts:589


createDOMRange

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

Parameters

NameType
editorLexicalEditor
anchorNodeLexicalNode
_anchorOffsetnumber
focusNodeLexicalNode
_focusOffsetnumber

Returns

Range | null

Defined in

lexical-selection/src/index.ts:804


createRectsFromDOMRange

createRectsFromDOMRange(editor, range): ClientRect[]

Parameters

NameType
editorLexicalEditor
rangeRange

Returns

ClientRect[]

Defined in

lexical-selection/src/index.ts:875


getStyleObjectFromCSS

getStyleObjectFromCSS(css): Record<string, string> | null

Parameters

NameType
cssstring

Returns

Record<string, string> | null

Defined in

lexical-selection/src/index.ts:301


trimTextContentFromAnchor

trimTextContentFromAnchor(editor, anchor, delCount): void

Parameters

NameType
editorLexicalEditor
anchorPoint
delCountnumber

Returns

void

Defined in

lexical-selection/src/index.ts:920