Class: ElementNode
lexical.ElementNode
Hierarchy
-
↳
ElementNode
↳↳
LinkNode
↳↳
OverflowNode
↳↳
QuoteNode
↳↳
HeadingNode
↳↳
EXPERIMENTAL_DecoratorElementNode
↳↳
CodeNode
↳↳
ListItemNode
↳↳
ListNode
↳↳
MarkNode
↳↳
TableNode
↳↳
TableRowNode
Constructors
constructor
• new ElementNode(key?
): ElementNode
Parameters
Name | Type |
---|---|
key? | string |
Returns
Overrides
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:76
Properties
constructor
• constructor: KlassConstructor
<typeof ElementNode
>
Overrides
LexicalNode.constructor
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:62
Methods
append
▸ append(...nodesToAppend
): this
Parameters
Name | Type |
---|---|
...nodesToAppend | LexicalNode [] |
Returns
this
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:348
canBeEmpty
▸ canBeEmpty(): boolean
Returns
boolean
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:534
canIndent
▸ canIndent(): boolean
Returns
boolean
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:514
canInsertAfter
▸ canInsertAfter(node
): boolean
Parameters
Name | Type |
---|---|
node | LexicalNode |
Returns
boolean
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:531
canInsertTextAfter
▸ canInsertTextAfter(): boolean
Returns
boolean
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:540
canInsertTextBefore
▸ canInsertTextBefore(): boolean
Returns
boolean
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:537
canMergeWith
▸ canMergeWith(node
): boolean
Parameters
Name | Type |
---|---|
node | ElementNode |
Returns
boolean
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:553
canReplaceWith
▸ canReplaceWith(replacement
): boolean
Parameters
Name | Type |
---|---|
replacement | LexicalNode |
Returns
boolean
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:528
clear
▸ clear(): this
Returns
this
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:342
collapseAtStart
▸ collapseAtStart(selection
): boolean
Parameters
Name | Type |
---|---|
selection | RangeSelection |
Returns
boolean
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:522
excludeFromCopy
▸ excludeFromCopy(destination?
): boolean
Parameters
Name | Type |
---|---|
destination? | "clone" | "html" |
Returns
boolean
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:525
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
packages/lexical/src/nodes/LexicalElementNode.ts:497
extractWithChild
▸ extractWithChild(child
, selection
, destination
): boolean
Parameters
Name | Type |
---|---|
child | LexicalNode |
selection | null | BaseSelection |
destination | "clone" | "html" |
Returns
boolean
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:556
getAllTextNodes
▸ getAllTextNodes(): TextNode
[]
Returns
TextNode
[]
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:133
getChildAtIndex
▸ getChildAtIndex<T
>(index
): null
| T
Type parameters
Name | Type |
---|---|
T | extends LexicalNode |
Parameters
Name | Type |
---|---|
index | number |
Returns
null
| T
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:214
getChildren
▸ getChildren<T
>(): T
[]
Type parameters
Name | Type |
---|---|
T | extends LexicalNode |
Returns
T
[]
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:98
getChildrenKeys
▸ getChildrenKeys(): string
[]
Returns
string
[]
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:107
getChildrenSize
▸ getChildrenSize(): number
Returns
number
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:116
getDescendantByIndex
▸ getDescendantByIndex<T
>(index
): null
| T
Type parameters
Name | Type |
---|---|
T | extends LexicalNode |
Parameters
Name | Type |
---|---|
index | number |
Returns
null
| T
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:170
getDirection
▸ getDirection(): null
| "ltr"
| "rtl"
Returns
null
| "ltr"
| "rtl"
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:275
getFirstChild
▸ getFirstChild<T
>(): null
| T
Type parameters
Name | Type |
---|---|
T | extends LexicalNode |
Returns
null
| T
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:190
getFirstChildOrThrow
▸ getFirstChildOrThrow<T
>(): T
Type parameters
Name | Type |
---|---|
T | extends LexicalNode |
Returns
T
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:195
getFirstDescendant
▸ getFirstDescendant<T
>(): null
| T
Type parameters
Name | Type |
---|---|
T | extends LexicalNode |
Returns
null
| T
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:148
getFormat
▸ getFormat(): number
Returns
number
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:86
getFormatType
▸ getFormatType(): ElementFormatType
Returns
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:90
getIndent
▸ getIndent(): number
Returns
number
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:94
getLastChild
▸ getLastChild<T
>(): null
| T
Type parameters
Name | Type |
---|---|
T | extends LexicalNode |
Returns
null
| T
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:202
getLastChildOrThrow
▸ getLastChildOrThrow<T
>(): T
Type parameters
Name | Type |
---|---|
T | extends LexicalNode |
Returns
T
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:207
getLastDescendant
▸ getLastDescendant<T
>(): null
| T
Type parameters
Name | Type |
---|---|
T | extends LexicalNode |
Returns
null
| T
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:159
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
packages/lexical/src/nodes/LexicalElementNode.ts:241
getTextContentSize
▸ getTextContentSize(): number
Returns the length of the string produced by calling getTextContent on this node.
Returns
number
Overrides
LexicalNode.getTextContentSize
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:258
hasFormat
▸ hasFormat(type
): boolean
Parameters
Name | Type |
---|---|
type | ElementFormatType |
Returns
boolean
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:279
insertNewAfter
▸ insertNewAfter(selection
, restoreSelection?
): null
| LexicalNode
Parameters
Name | Type |
---|---|
selection | RangeSelection |
restoreSelection? | boolean |
Returns
null
| LexicalNode
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:508
isDirty
▸ isDirty(): boolean
Returns true if this node has been marked dirty during this update cycle.
Returns
boolean
Overrides
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:123
isEmpty
▸ isEmpty(): boolean
Returns
boolean
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:120
isInline
▸ isInline(): boolean
Returns
boolean
Overrides
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:543
isLastChild
▸ isLastChild(): boolean
Returns
boolean
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:128
isShadowRoot
▸ isShadowRoot(): boolean
Returns
boolean
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:550
select
▸ select(_anchorOffset?
, _focusOffset?
): RangeSelection
Parameters
Name | Type |
---|---|
_anchorOffset? | number |
_focusOffset? | number |
Returns
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:289
selectEnd
▸ selectEnd(): RangeSelection
Returns
Overrides
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:338
selectStart
▸ selectStart(): RangeSelection
Returns
Overrides
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:334
setDirection
▸ setDirection(direction
): this
Parameters
Name | Type |
---|---|
direction | null | "ltr" | "rtl" |
Returns
this
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:351
setFormat
▸ setFormat(type
): this
Parameters
Name | Type |
---|---|
type | ElementFormatType |
Returns
this
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:356
setIndent
▸ setIndent(indentLevel
): this
Parameters
Name | Type |
---|---|
indentLevel | number |
Returns
this
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:361
splice
▸ splice(start
, deleteCount
, nodesToInsert
): this
Parameters
Name | Type |
---|---|
start | number |
deleteCount | number |
nodesToInsert | LexicalNode [] |
Returns
this