Class: LexicalNode
lexical.LexicalNode
Hierarchy
LexicalNode
↳
TextNode
Indexable
▪ [x: string
]: any
Constructors
constructor
• new LexicalNode(key?
)
Parameters
Name | Type |
---|---|
key? | string |
Defined in
lexical/src/LexicalNode.ts:199
Methods
createDOM
▸ createDOM(_config
, _editor
): HTMLElement
Parameters
Name | Type |
---|---|
_config | EditorConfig |
_editor | LexicalEditor |
Returns
HTMLElement
Defined in
lexical/src/LexicalNode.ts:608
exportDOM
▸ exportDOM(editor
): DOMExportOutput
Parameters
Name | Type |
---|---|
editor | LexicalEditor |
Returns
Defined in
lexical/src/LexicalNode.ts:620
exportJSON
▸ exportJSON(): SerializedLexicalNode
Returns
Defined in
lexical/src/LexicalNode.ts:625
getCommonAncestor
▸ getCommonAncestor<T
>(node
): null
| T
Type parameters
Name | Type |
---|---|
T | extends ElementNode <T > = ElementNode |
Parameters
Name | Type |
---|---|
node | LexicalNode |
Returns
null
| T
Defined in
lexical/src/LexicalNode.ts:392
getIndexWithinParent
▸ getIndexWithinParent(): number
Returns
number
Defined in
lexical/src/LexicalNode.ts:269
getKey
▸ getKey(): string
Returns
string
Defined in
lexical/src/LexicalNode.ts:264
getLatest
▸ getLatest(): LexicalNode
Returns
Defined in
lexical/src/LexicalNode.ts:538
getNextSibling
▸ getNextSibling<T
>(): null
| T
Type parameters
Name | Type |
---|---|
T | extends LexicalNode <T > |
Returns
null
| T
Defined in
lexical/src/LexicalNode.ts:366
getNextSiblings
▸ getNextSiblings<T
>(): T
[]
Type parameters
Name | Type |
---|---|
T | extends LexicalNode <T > |
Returns
T
[]
Defined in
lexical/src/LexicalNode.ts:380
getNodesBetween
▸ getNodesBetween(targetNode
): LexicalNode
[]
Parameters
Name | Type |
---|---|
targetNode | LexicalNode |
Returns
Defined in
lexical/src/LexicalNode.ts:471
getParent
▸ getParent<T
>(): null
| T
Type parameters
Name | Type |
---|---|
T | extends ElementNode <T > |
Returns
null
| T
Defined in
lexical/src/LexicalNode.ts:278
getParentKeys
▸ getParentKeys(): string
[]
Returns
string
[]
Defined in
lexical/src/LexicalNode.ts:331
getParentOrThrow
▸ getParentOrThrow<T
>(): T
Type parameters
Name | Type |
---|---|
T | extends ElementNode <T > |
Returns
T
Defined in
lexical/src/LexicalNode.ts:286
getParents
▸ getParents(): ElementNode
[]
Returns
Defined in
lexical/src/LexicalNode.ts:321
getPreviousSibling
▸ getPreviousSibling<T
>(): null
| T
Type parameters
Name | Type |
---|---|
T | extends LexicalNode <T > |
Returns
null
| T
Defined in
lexical/src/LexicalNode.ts:341
getPreviousSiblings
▸ getPreviousSiblings<T
>(): T
[]
Type parameters
Name | Type |
---|---|
T | extends LexicalNode <T > |
Returns
T
[]
Defined in
lexical/src/LexicalNode.ts:354
getTextContent
▸ getTextContent(_includeInert?
, _includeDirectionless?
): string
Parameters
Name | Type |
---|---|
_includeInert? | boolean |
_includeDirectionless? | false |
Returns
string
Defined in
lexical/src/LexicalNode.ts:592
getTextContentSize
▸ getTextContentSize(includeInert?
, includeDirectionless?
): number
Parameters
Name | Type |
---|---|
includeInert? | boolean |
includeDirectionless? | false |
Returns
number
Defined in
lexical/src/LexicalNode.ts:599
getTopLevelElement
▸ getTopLevelElement(): null
| LexicalNode
| ElementNode
Returns
null
| LexicalNode
| ElementNode
Defined in
lexical/src/LexicalNode.ts:294
getTopLevelElementOrThrow
▸ getTopLevelElementOrThrow(): LexicalNode
| ElementNode
Returns
Defined in
lexical/src/LexicalNode.ts:309
getType
▸ getType(): string
Returns
string
Defined in
lexical/src/LexicalNode.ts:218
getWritable
▸ getWritable(): LexicalNode
Returns
Defined in
lexical/src/LexicalNode.ts:549
insertAfter
▸ insertAfter(nodeToInsert
): LexicalNode
Parameters
Name | Type |
---|---|
nodeToInsert | LexicalNode |
Returns
Defined in
lexical/src/LexicalNode.ts:678
insertBefore
▸ insertBefore(nodeToInsert
): LexicalNode
Parameters
Name | Type |
---|---|
nodeToInsert | LexicalNode |
Returns
Defined in
lexical/src/LexicalNode.ts:730
is
▸ is(object
): boolean
Parameters
Name | Type |
---|---|
object | undefined | null | LexicalNode |
Returns
boolean
Defined in
lexical/src/LexicalNode.ts:418
isAttached
▸ isAttached(): boolean
Returns
boolean
Defined in
lexical/src/LexicalNode.ts:222
isBefore
▸ isBefore(targetNode
): boolean
Parameters
Name | Type |
---|---|
targetNode | LexicalNode |
Returns
boolean
Defined in
lexical/src/LexicalNode.ts:425
isDirty
▸ isDirty(): boolean
Returns
boolean
Defined in
lexical/src/LexicalNode.ts:532
isParentOf
▸ isParentOf(targetNode
): boolean
Parameters
Name | Type |
---|---|
targetNode | LexicalNode |
Returns
boolean
Defined in
lexical/src/LexicalNode.ts:456
isSelected
▸ isSelected(): boolean
Returns
boolean
Defined in
lexical/src/LexicalNode.ts:239
markDirty
▸ markDirty(): void
Returns
void
Defined in
lexical/src/LexicalNode.ts:788
remove
▸ remove(preserveEmptyParent?
): void
Parameters
Name | Type |
---|---|
preserveEmptyParent? | boolean |
Returns
void
Defined in
lexical/src/LexicalNode.ts:639
replace
▸ replace<N
>(replaceWith
): N
Type parameters
Name | Type |
---|---|
N | extends LexicalNode <N > |
Parameters
Name | Type |
---|---|
replaceWith | N |
Returns
N
Defined in
lexical/src/LexicalNode.ts:644
selectNext
▸ selectNext(anchorOffset?
, focusOffset?
): RangeSelection
Parameters
Name | Type |
---|---|
anchorOffset? | number |
focusOffset? | number |
Returns
Defined in
lexical/src/LexicalNode.ts:772
selectPrevious
▸ selectPrevious(anchorOffset?
, focusOffset?
): RangeSelection
Parameters
Name | Type |
---|---|
anchorOffset? | number |
focusOffset? | number |
Returns
Defined in
lexical/src/LexicalNode.ts:756
updateDOM
▸ updateDOM(_prevNode
, _dom
, _config
): boolean
Parameters
Name | Type |
---|---|
_prevNode | unknown |
_dom | HTMLElement |
_config | EditorConfig |
Returns
boolean
Defined in
lexical/src/LexicalNode.ts:612
clone
▸ Static
clone(_data
): LexicalNode
Parameters
Name | Type |
---|---|
_data | unknown |
Returns
Defined in
lexical/src/LexicalNode.ts:191
getType
▸ Static
getType(): string
Returns
string
Defined in
lexical/src/LexicalNode.ts:183
importJSON
▸ Static
importJSON(_serializedNode
): LexicalNode
Parameters
Name | Type |
---|---|
_serializedNode | SerializedLexicalNode |
Returns
Defined in
lexical/src/LexicalNode.ts:629