Class: ElementNode
lexical.ElementNode
Hierarchy
↳
ElementNode
↳↳
LinkNode
↳↳
OverflowNode
↳↳
RootNode
↳↳
CodeNode
↳↳
ListItemNode
↳↳
ListNode
↳↳
MarkNode
Constructors
constructor
• new ElementNode(key?
)
Parameters
Name | Type |
---|---|
key? | string |
Overrides
Defined in
lexical/src/nodes/LexicalElementNode.ts:76
Methods
append
▸ append(...nodesToAppend
): ElementNode
Parameters
Name | Type |
---|---|
...nodesToAppend | LexicalNode [] |
Returns
Defined in
lexical/src/nodes/LexicalElementNode.ts:368
canBeEmpty
▸ canBeEmpty(): boolean
Returns
boolean
Defined in
lexical/src/nodes/LexicalElementNode.ts:558
canExtractContents
▸ canExtractContents(): boolean
Returns
boolean
Defined in
lexical/src/nodes/LexicalElementNode.ts:549
canIndent
▸ canIndent(): boolean
Returns
boolean
Defined in
lexical/src/nodes/LexicalElementNode.ts:534
canInsertAfter
▸ canInsertAfter(node
): boolean
Parameters
Name | Type |
---|---|
node | LexicalNode |
Returns
boolean
Defined in
lexical/src/nodes/LexicalElementNode.ts:555
canInsertTextAfter
▸ canInsertTextAfter(): boolean
Returns
boolean
Defined in
lexical/src/nodes/LexicalElementNode.ts:564
canInsertTextBefore
▸ canInsertTextBefore(): boolean
Returns
boolean
Defined in
lexical/src/nodes/LexicalElementNode.ts:561
canMergeWith
▸ canMergeWith(node
): boolean
Parameters
Name | Type |
---|---|
node | ElementNode |
Returns
boolean
Defined in
lexical/src/nodes/LexicalElementNode.ts:577
canReplaceWith
▸ canReplaceWith(replacement
): boolean
Parameters
Name | Type |
---|---|
replacement | LexicalNode |
Returns
boolean
Defined in
lexical/src/nodes/LexicalElementNode.ts:552
clear
▸ clear(): ElementNode
Returns
Defined in
lexical/src/nodes/LexicalElementNode.ts:362
collapseAtStart
▸ collapseAtStart(selection
): boolean
Parameters
Name | Type |
---|---|
selection | RangeSelection |
Returns
boolean
Defined in
lexical/src/nodes/LexicalElementNode.ts:542
excludeFromCopy
▸ excludeFromCopy(destination?
): boolean
Parameters
Name | Type |
---|---|
destination? | "clone" | "html" |
Returns
boolean
Defined in
lexical/src/nodes/LexicalElementNode.ts:545
exportJSON
▸ exportJSON(): SerializedElementNode
<SerializedLexicalNode
>
Controls how the this node is serialized to JSON. This is important for copy and paste between Lexical editors sharing the same namespace. It's also important if you're serializing to JSON for persistent storage somewhere. See Serialization & Deserialization.
Returns
SerializedElementNode
<SerializedLexicalNode
>
Overrides
Defined in
lexical/src/nodes/LexicalElementNode.ts:517
extractWithChild
▸ extractWithChild(child
, selection
, destination
): boolean
Parameters
Name | Type |
---|---|
child | LexicalNode |
selection | null | RangeSelection | NodeSelection | GridSelection |
destination | "clone" | "html" |
Returns
boolean
Defined in
lexical/src/nodes/LexicalElementNode.ts:580
getAllTextNodes
▸ getAllTextNodes(): TextNode
[]
Returns
TextNode
[]
Defined in
lexical/src/nodes/LexicalElementNode.ts:133
getChildAtIndex
▸ getChildAtIndex<T
>(index
): null
| T
Type parameters
Name | Type |
---|---|
T | extends LexicalNode <T > |
Parameters
Name | Type |
---|---|
index | number |
Returns
null
| T
Defined in
lexical/src/nodes/LexicalElementNode.ts:220
getChildren
▸ getChildren<T
>(): T
[]
Type parameters
Name | Type |
---|---|
T | extends LexicalNode <T > |
Returns
T
[]
Defined in
lexical/src/nodes/LexicalElementNode.ts:98
getChildrenKeys
▸ getChildrenKeys(): string
[]
Returns
string
[]
Defined in
lexical/src/nodes/LexicalElementNode.ts:107
getChildrenSize
▸ getChildrenSize(): number
Returns
number
Defined in
lexical/src/nodes/LexicalElementNode.ts:116
getDescendantByIndex
▸ getDescendantByIndex<T
>(index
): null
| T
Type parameters
Name | Type |
---|---|
T | extends LexicalNode <T > |
Parameters
Name | Type |
---|---|
index | number |
Returns
null
| T
Defined in
lexical/src/nodes/LexicalElementNode.ts:176
getDirection
▸ getDirection(): null
| "ltr"
| "rtl"
Returns
null
| "ltr"
| "rtl"
Defined in
lexical/src/nodes/LexicalElementNode.ts:281
getFirstChild
▸ getFirstChild<T
>(): null
| T
Type parameters
Name | Type |
---|---|
T | extends LexicalNode <T > |
Returns
null
| T
Defined in
lexical/src/nodes/LexicalElementNode.ts:196
getFirstChildOrThrow
▸ getFirstChildOrThrow<T
>(): T
Type parameters
Name | Type |
---|---|
T | extends LexicalNode <T > |
Returns
T
Defined in
lexical/src/nodes/LexicalElementNode.ts:201
getFirstDescendant
▸ getFirstDescendant<T
>(): null
| T
Type parameters
Name | Type |
---|---|
T | extends LexicalNode <T > |
Returns
null
| T
Defined in
lexical/src/nodes/LexicalElementNode.ts:148
getFormat
▸ getFormat(): number
Returns
number
Defined in
lexical/src/nodes/LexicalElementNode.ts:86
getFormatType
▸ getFormatType(): ElementFormatType
Returns
Defined in
lexical/src/nodes/LexicalElementNode.ts:90
getIndent
▸ getIndent(): number
Returns
number
Defined in
lexical/src/nodes/LexicalElementNode.ts:94
getLastChild
▸ getLastChild<T
>(): null
| T
Type parameters
Name | Type |
---|---|
T | extends LexicalNode <T > |
Returns
null
| T
Defined in
lexical/src/nodes/LexicalElementNode.ts:208
getLastChildOrThrow
▸ getLastChildOrThrow<T
>(): T
Type parameters
Name | Type |
---|---|
T | extends LexicalNode <T > |
Returns
T
Defined in
lexical/src/nodes/LexicalElementNode.ts:213
getLastDescendant
▸ getLastDescendant<T
>(): null
| T
Type parameters
Name | Type |
---|---|
T | extends LexicalNode <T > |
Returns
null
| T
Defined in
lexical/src/nodes/LexicalElementNode.ts:162
getTextContent
▸ getTextContent(): string
Returns the text content of the node. Override this for custom nodes that should have a representation in plain text format (for copy + paste, for example)
Returns
string
Overrides
Defined in
lexical/src/nodes/LexicalElementNode.ts:247
getTextContentSize
▸ getTextContentSize(): number
Returns the length of the string produced by calling getTextContent on this node.
Returns
number
Overrides
LexicalNode.getTextContentSize
Defined in
lexical/src/nodes/LexicalElementNode.ts:264
hasFormat
▸ hasFormat(type
): boolean
Parameters
Name | Type |
---|---|
type | ElementFormatType |
Returns
boolean
Defined in
lexical/src/nodes/LexicalElementNode.ts:285
insertNewAfter
▸ insertNewAfter(selection
, restoreSelection?
): null
| LexicalNode
Parameters
Name | Type |
---|---|
selection | RangeSelection |
restoreSelection? | boolean |
Returns
null
| LexicalNode
Defined in
lexical/src/nodes/LexicalElementNode.ts:528
isDirty
▸ isDirty(): boolean
Returns true if this node has been marked dirty during this update cycle.
Returns
boolean
Overrides
Defined in
lexical/src/nodes/LexicalElementNode.ts:123
isEmpty
▸ isEmpty(): boolean
Returns
boolean
Defined in
lexical/src/nodes/LexicalElementNode.ts:120
isInline
▸ isInline(): boolean
Returns
boolean
Defined in
lexical/src/nodes/LexicalElementNode.ts:567
isLastChild
▸ isLastChild(): boolean
Returns
boolean
Defined in
lexical/src/nodes/LexicalElementNode.ts:128
isShadowRoot
▸ isShadowRoot(): boolean
Returns
boolean
Defined in
lexical/src/nodes/LexicalElementNode.ts:574
select
▸ select(_anchorOffset?
, _focusOffset?
): RangeSelection
Parameters
Name | Type |
---|---|
_anchorOffset? | number |
_focusOffset? | number |
Returns
Defined in
lexical/src/nodes/LexicalElementNode.ts:295
selectEnd
▸ selectEnd(): RangeSelection
Returns
Defined in
lexical/src/nodes/LexicalElementNode.ts:351
selectStart
▸ selectStart(): RangeSelection
Returns
Defined in
lexical/src/nodes/LexicalElementNode.ts:340
setDirection
▸ setDirection(direction
): ElementNode
Parameters
Name | Type |
---|---|
direction | null | "ltr" | "rtl" |
Returns
Defined in
lexical/src/nodes/LexicalElementNode.ts:371
setFormat
▸ setFormat(type
): ElementNode
Parameters
Name | Type |
---|---|
type | ElementFormatType |
Returns
Defined in
lexical/src/nodes/LexicalElementNode.ts:376
setIndent
▸ setIndent(indentLevel
): ElementNode
Parameters
Name | Type |
---|---|
indentLevel | number |
Returns
Defined in
lexical/src/nodes/LexicalElementNode.ts:381
splice
▸ splice(start
, deleteCount
, nodesToInsert
): ElementNode
Parameters
Name | Type |
---|---|
start | number |
deleteCount | number |
nodesToInsert | LexicalNode [] |
Returns
Defined in
lexical/src/nodes/LexicalElementNode.ts:386