Skip to main content

Class: ElementNode

lexical.ElementNode

Hierarchy

Constructors

constructor

new ElementNode(key?)

Parameters

NameType
key?string

Overrides

LexicalNode.constructor

Defined in

lexical/src/nodes/LexicalElementNode.ts:74

Methods

append

append(...nodesToAppend): ElementNode

Parameters

NameType
...nodesToAppendLexicalNode[]

Returns

ElementNode

Defined in

lexical/src/nodes/LexicalElementNode.ts:349


canBeEmpty

canBeEmpty(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:541


canExtractContents

canExtractContents(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:532


canIndent

canIndent(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:518


canInsertAfter

canInsertAfter(node): boolean

Parameters

NameType
nodeLexicalNode

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:538


canInsertTab

canInsertTab(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:515


canInsertTextAfter

canInsertTextAfter(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:547


canInsertTextBefore

canInsertTextBefore(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:544


canMergeWith

canMergeWith(node): boolean

Parameters

NameType
nodeElementNode

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:560


canReplaceWith

canReplaceWith(replacement): boolean

Parameters

NameType
replacementLexicalNode

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:535


clear

clear(): ElementNode

Returns

ElementNode

Defined in

lexical/src/nodes/LexicalElementNode.ts:343


collapseAtStart

collapseAtStart(selection): boolean

Parameters

NameType
selectionRangeSelection

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:526


excludeFromCopy

excludeFromCopy(destination?): boolean

Parameters

NameType
destination?"clone" | "html"

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:529


exportJSON

exportJSON(): SerializedElementNode

Returns

SerializedElementNode

Overrides

LexicalNode.exportJSON

Defined in

lexical/src/nodes/LexicalElementNode.ts:498


extractWithChild

extractWithChild(child, selection, destination): boolean

Parameters

NameType
childLexicalNode
selectionnull | RangeSelection | NodeSelection | GridSelection
destination"clone" | "html"

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:563


getAllTextNodes

getAllTextNodes(): TextNode[]

Returns

TextNode[]

Defined in

lexical/src/nodes/LexicalElementNode.ts:131


getChildAtIndex

getChildAtIndex<T>(index): null | T

Type parameters

NameType
Textends LexicalNode<T>

Parameters

NameType
indexnumber

Returns

null | T

Defined in

lexical/src/nodes/LexicalElementNode.ts:218


getChildren

getChildren<T>(): T[]

Type parameters

NameType
Textends LexicalNode<T>

Returns

T[]

Defined in

lexical/src/nodes/LexicalElementNode.ts:96


getChildrenKeys

getChildrenKeys(): string[]

Returns

string[]

Defined in

lexical/src/nodes/LexicalElementNode.ts:105


getChildrenSize

getChildrenSize(): number

Returns

number

Defined in

lexical/src/nodes/LexicalElementNode.ts:114


getDescendantByIndex

getDescendantByIndex<T>(index): null | T

Type parameters

NameType
Textends LexicalNode<T>

Parameters

NameType
indexnumber

Returns

null | T

Defined in

lexical/src/nodes/LexicalElementNode.ts:174


getDirection

getDirection(): null | "ltr" | "rtl"

Returns

null | "ltr" | "rtl"

Defined in

lexical/src/nodes/LexicalElementNode.ts:262


getFirstChild

getFirstChild<T>(): null | T

Type parameters

NameType
Textends LexicalNode<T>

Returns

null | T

Defined in

lexical/src/nodes/LexicalElementNode.ts:194


getFirstChildOrThrow

getFirstChildOrThrow<T>(): T

Type parameters

NameType
Textends LexicalNode<T>

Returns

T

Defined in

lexical/src/nodes/LexicalElementNode.ts:199


getFirstDescendant

getFirstDescendant<T>(): null | T

Type parameters

NameType
Textends LexicalNode<T>

Returns

null | T

Defined in

lexical/src/nodes/LexicalElementNode.ts:146


getFormat

getFormat(): number

Returns

number

Defined in

lexical/src/nodes/LexicalElementNode.ts:84


getFormatType

getFormatType(): ElementFormatType

Returns

ElementFormatType

Defined in

lexical/src/nodes/LexicalElementNode.ts:88


getIndent

getIndent(): number

Returns

number

Defined in

lexical/src/nodes/LexicalElementNode.ts:92


getLastChild

getLastChild<T>(): null | T

Type parameters

NameType
Textends LexicalNode<T>

Returns

null | T

Defined in

lexical/src/nodes/LexicalElementNode.ts:206


getLastChildOrThrow

getLastChildOrThrow<T>(): T

Type parameters

NameType
Textends LexicalNode<T>

Returns

T

Defined in

lexical/src/nodes/LexicalElementNode.ts:211


getLastDescendant

getLastDescendant<T>(): null | T

Type parameters

NameType
Textends LexicalNode<T>

Returns

null | T

Defined in

lexical/src/nodes/LexicalElementNode.ts:160


getTextContent

getTextContent(): string

Returns

string

Overrides

LexicalNode.getTextContent

Defined in

lexical/src/nodes/LexicalElementNode.ts:245


hasFormat

hasFormat(type): boolean

Parameters

NameType
typeElementFormatType

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:266


insertNewAfter

insertNewAfter(selection, restoreSelection?): null | LexicalNode

Parameters

NameType
selectionRangeSelection
restoreSelection?boolean

Returns

null | LexicalNode

Defined in

lexical/src/nodes/LexicalElementNode.ts:509


isDirty

isDirty(): boolean

Returns

boolean

Overrides

LexicalNode.isDirty

Defined in

lexical/src/nodes/LexicalElementNode.ts:121


isEmpty

isEmpty(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:118


isInline

isInline(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:550


isLastChild

isLastChild(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:126


isShadowRoot

isShadowRoot(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:557


select

select(_anchorOffset?, _focusOffset?): RangeSelection

Parameters

NameType
_anchorOffset?number
_focusOffset?number

Returns

RangeSelection

Defined in

lexical/src/nodes/LexicalElementNode.ts:276


selectEnd

selectEnd(): RangeSelection

Returns

RangeSelection

Defined in

lexical/src/nodes/LexicalElementNode.ts:332


selectStart

selectStart(): RangeSelection

Returns

RangeSelection

Defined in

lexical/src/nodes/LexicalElementNode.ts:321


setDirection

setDirection(direction): ElementNode

Parameters

NameType
directionnull | "ltr" | "rtl"

Returns

ElementNode

Defined in

lexical/src/nodes/LexicalElementNode.ts:352


setFormat

setFormat(type): ElementNode

Parameters

NameType
typeElementFormatType

Returns

ElementNode

Defined in

lexical/src/nodes/LexicalElementNode.ts:357


setIndent

setIndent(indentLevel): ElementNode

Parameters

NameType
indentLevelnumber

Returns

ElementNode

Defined in

lexical/src/nodes/LexicalElementNode.ts:362


splice

splice(start, deleteCount, nodesToInsert): ElementNode

Parameters

NameType
startnumber
deleteCountnumber
nodesToInsertLexicalNode[]

Returns

ElementNode

Defined in

lexical/src/nodes/LexicalElementNode.ts:367