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:70

Methods

append

append(...nodesToAppend): ElementNode

Parameters

NameType
...nodesToAppendLexicalNode[]

Returns

ElementNode

Defined in

lexical/src/nodes/LexicalElementNode.ts:318


canBeEmpty

canBeEmpty(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:494


canExtractContents

canExtractContents(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:485


canIndent

canIndent(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:471


canInsertAfter

canInsertAfter(node): boolean

Parameters

NameType
nodeLexicalNode

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:491


canInsertTab

canInsertTab(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:468


canInsertTextAfter

canInsertTextAfter(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:500


canInsertTextBefore

canInsertTextBefore(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:497


canMergeWith

canMergeWith(node): boolean

Parameters

NameType
nodeElementNode

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:513


canReplaceWith

canReplaceWith(replacement): boolean

Parameters

NameType
replacementLexicalNode

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:488


clear

clear(): ElementNode

Returns

ElementNode

Defined in

lexical/src/nodes/LexicalElementNode.ts:312


collapseAtStart

collapseAtStart(selection): boolean

Parameters

NameType
selectionRangeSelection

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:479


excludeFromCopy

excludeFromCopy(destination?): boolean

Parameters

NameType
destination?"clone" | "html"

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:482


exportJSON

exportJSON(): SerializedElementNode

Returns

SerializedElementNode

Overrides

LexicalNode.exportJSON

Defined in

lexical/src/nodes/LexicalElementNode.ts:454


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:516


getAllTextNodes

getAllTextNodes(): TextNode[]

Returns

TextNode[]

Defined in

lexical/src/nodes/LexicalElementNode.ts:126


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:221


getChildren

getChildren<T>(): T[]

Type parameters

NameType
Textends LexicalNode<T>

Returns

T[]

Defined in

lexical/src/nodes/LexicalElementNode.ts:94


getChildrenKeys

getChildrenKeys(): string[]

Returns

string[]

Defined in

lexical/src/nodes/LexicalElementNode.ts:106


getChildrenSize

getChildrenSize(): number

Returns

number

Defined in

lexical/src/nodes/LexicalElementNode.ts:109


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:169


getDirection

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

Returns

null | "ltr" | "rtl"

Defined in

lexical/src/nodes/LexicalElementNode.ts:247


getFirstChild

getFirstChild<T>(): null | T

Type parameters

NameType
Textends LexicalNode<T>

Returns

null | T

Defined in

lexical/src/nodes/LexicalElementNode.ts:189


getFirstChildOrThrow

getFirstChildOrThrow<T>(): T

Type parameters

NameType
Textends LexicalNode<T>

Returns

T

Defined in

lexical/src/nodes/LexicalElementNode.ts:198


getFirstDescendant

getFirstDescendant<T>(): null | T

Type parameters

NameType
Textends LexicalNode<T>

Returns

null | T

Defined in

lexical/src/nodes/LexicalElementNode.ts:141


getFormat

getFormat(): number

Returns

number

Defined in

lexical/src/nodes/LexicalElementNode.ts:82


getFormatType

getFormatType(): ElementFormatType

Returns

ElementFormatType

Defined in

lexical/src/nodes/LexicalElementNode.ts:86


getIndent

getIndent(): number

Returns

number

Defined in

lexical/src/nodes/LexicalElementNode.ts:90


getLastChild

getLastChild<T>(): null | T

Type parameters

NameType
Textends LexicalNode<T>

Returns

null | T

Defined in

lexical/src/nodes/LexicalElementNode.ts:205


getLastChildOrThrow

getLastChildOrThrow<T>(): T

Type parameters

NameType
Textends LexicalNode<T>

Returns

T

Defined in

lexical/src/nodes/LexicalElementNode.ts:214


getLastDescendant

getLastDescendant<T>(): null | T

Type parameters

NameType
Textends LexicalNode<T>

Returns

null | T

Defined in

lexical/src/nodes/LexicalElementNode.ts:155


getTextContent

getTextContent(): string

Returns

string

Overrides

LexicalNode.getTextContent

Defined in

lexical/src/nodes/LexicalElementNode.ts:230


hasFormat

hasFormat(type): boolean

Parameters

NameType
typeElementFormatType

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:251


insertNewAfter

insertNewAfter(selection): null | LexicalNode

Parameters

NameType
selectionRangeSelection

Returns

null | LexicalNode

Defined in

lexical/src/nodes/LexicalElementNode.ts:465


isDirty

isDirty(): boolean

Returns

boolean

Overrides

LexicalNode.isDirty

Defined in

lexical/src/nodes/LexicalElementNode.ts:116


isEmpty

isEmpty(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:113


isInline

isInline(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:503


isLastChild

isLastChild(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:121


isShadowRoot

isShadowRoot(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:510


select

select(_anchorOffset?, _focusOffset?): RangeSelection

Parameters

NameType
_anchorOffset?number
_focusOffset?number

Returns

RangeSelection

Defined in

lexical/src/nodes/LexicalElementNode.ts:261


selectEnd

selectEnd(): RangeSelection

Returns

RangeSelection

Defined in

lexical/src/nodes/LexicalElementNode.ts:301


selectStart

selectStart(): RangeSelection

Returns

RangeSelection

Defined in

lexical/src/nodes/LexicalElementNode.ts:290


setDirection

setDirection(direction): ElementNode

Parameters

NameType
directionnull | "ltr" | "rtl"

Returns

ElementNode

Defined in

lexical/src/nodes/LexicalElementNode.ts:321


setFormat

setFormat(type): ElementNode

Parameters

NameType
typeElementFormatType

Returns

ElementNode

Defined in

lexical/src/nodes/LexicalElementNode.ts:326


setIndent

setIndent(indentLevel): ElementNode

Parameters

NameType
indentLevelnumber

Returns

ElementNode

Defined in

lexical/src/nodes/LexicalElementNode.ts:331


splice

splice(start, deleteCount, nodesToInsert): ElementNode

Parameters

NameType
startnumber
deleteCountnumber
nodesToInsertLexicalNode[]

Returns

ElementNode

Defined in

lexical/src/nodes/LexicalElementNode.ts:336