Module: @lexical/selection
Functions
$addNodeStyle
▸ $addNodeStyle(node
): void
Parameters
Name | Type |
---|---|
node | TextNode |
Returns
void
Defined in
lexical-selection/src/lexical-node.ts:298
$cloneContents
▸ $cloneContents(selection
): ICloneSelectionContent
Parameters
Name | Type |
---|---|
selection | RangeSelection | NodeSelection | GridSelection |
Returns
ICloneSelectionContent
Defined in
lexical-selection/src/lexical-node.ts:255
$cloneWithProperties
▸ $cloneWithProperties<T
>(node
): T
Type parameters
Name | Type |
---|---|
T | extends LexicalNode <T > |
Parameters
Name | Type |
---|---|
node | T |
Returns
T
Defined in
lexical-selection/src/lexical-node.ts:64
$getSelectionStyleValueForProperty
▸ $getSelectionStyleValueForProperty(selection
, styleProperty
, defaultValue?
): string
Parameters
Name | Type | Default value |
---|---|---|
selection | RangeSelection | undefined |
styleProperty | string | undefined |
defaultValue | string | '' |
Returns
string
Defined in
lexical-selection/src/range-selection.ts:577
$isAtNodeEnd
▸ $isAtNodeEnd(point
): boolean
Parameters
Name | Type |
---|---|
point | Point |
Returns
boolean
Defined in
lexical-selection/src/lexical-node.ts:126
$isParentElementRTL
▸ $isParentElementRTL(selection
): boolean
Parameters
Name | Type |
---|---|
selection | RangeSelection |
Returns
boolean
Defined in
lexical-selection/src/range-selection.ts:327
$moveCaretSelection
▸ $moveCaretSelection(selection
, isHoldingShift
, isBackward
, granularity
): void
Parameters
Name | Type |
---|---|
selection | RangeSelection |
isHoldingShift | boolean |
isBackward | boolean |
granularity | "character" | "word" | "lineboundary" |
Returns
void
Defined in
lexical-selection/src/range-selection.ts:318
$moveCharacter
▸ $moveCharacter(selection
, isHoldingShift
, isBackward
): void
Parameters
Name | Type |
---|---|
selection | RangeSelection |
isHoldingShift | boolean |
isBackward | boolean |
Returns
void
Defined in
lexical-selection/src/range-selection.ts:336
$patchStyleText
▸ $patchStyleText(selection
, patch
): void
Parameters
Name | Type |
---|---|
selection | RangeSelection | GridSelection |
patch | Record <string , string > |
Returns
void
Defined in
lexical-selection/src/lexical-node.ts:312
$selectAll
▸ $selectAll(selection
): void
Parameters
Name | Type |
---|---|
selection | RangeSelection |
Returns
void
Defined in
lexical-selection/src/range-selection.ts:350
$shouldOverrideDefaultCharacterSelection
▸ $shouldOverrideDefaultCharacterSelection(selection
, isBackward
): boolean
Parameters
Name | Type |
---|---|
selection | RangeSelection |
isBackward | boolean |
Returns
boolean
Defined in
lexical-selection/src/range-selection.ts:309
$sliceSelectedTextNodeContent
▸ $sliceSelectedTextNodeContent(selection
, textNode
): LexicalNode
Parameters
Name | Type |
---|---|
selection | RangeSelection | NodeSelection | GridSelection |
textNode | TextNode |
Returns
Defined in
lexical-selection/src/lexical-node.ts:82
$wrapNodes
▸ $wrapNodes(selection
, createElement
, wrappingElement?
): void
Attempts to wrap all nodes in the Selection in ElementNodes returned from createElement. If wrappingElement is provided, all of the wrapped leaves are appended to the wrappingElement. It attempts to append the resulting sub-tree to the nearest safe insertion target.
Parameters
Name | Type | Default value |
---|---|---|
selection | RangeSelection | undefined |
createElement | () => ElementNode | undefined |
wrappingElement | null | ElementNode | null |
Returns
void
Defined in
lexical-selection/src/range-selection.ts:65
$wrapNodesImpl
▸ $wrapNodesImpl(selection
, nodes
, nodesLength
, createElement
, wrappingElement?
): void
Parameters
Name | Type | Default value |
---|---|---|
selection | RangeSelection | undefined |
nodes | LexicalNode [] | undefined |
nodesLength | number | undefined |
createElement | () => ElementNode | undefined |
wrappingElement | null | ElementNode | null |
Returns
void
Defined in
lexical-selection/src/range-selection.ts:142
createDOMRange
▸ createDOMRange(editor
, anchorNode
, _anchorOffset
, focusNode
, _focusOffset
): Range
| null
Parameters
Name | Type |
---|---|
editor | LexicalEditor |
anchorNode | LexicalNode |
_anchorOffset | number |
focusNode | LexicalNode |
_focusOffset | number |
Returns
Range
| null
Defined in
lexical-selection/src/utils.ts:38
createRectsFromDOMRange
▸ createRectsFromDOMRange(editor
, range
): ClientRect
[]
Parameters
Name | Type |
---|---|
editor | LexicalEditor |
range | Range |
Returns
ClientRect
[]
Defined in
lexical-selection/src/utils.ts:109
getStyleObjectFromCSS
▸ getStyleObjectFromCSS(css
): Record
<string
, string
>
Parameters
Name | Type |
---|---|
css | string |
Returns
Record
<string
, string
>
Defined in
lexical-selection/src/utils.ts:168
trimTextContentFromAnchor
▸ trimTextContentFromAnchor(editor
, anchor
, delCount
): void
Parameters
Name | Type |
---|---|
editor | LexicalEditor |
anchor | Point |
delCount | number |
Returns
void
Defined in
lexical-selection/src/lexical-node.ts:134