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

Methods

append

append(...nodesToAppend): ElementNode

Parameters

NameType
...nodesToAppendLexicalNode[]

Returns

ElementNode

Defined in

lexical/src/nodes/LexicalElementNode.ts:308


canBeEmpty

canBeEmpty(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:479


canExtractContents

canExtractContents(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:470


canIndent

canIndent(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:461


canInsertAfter

canInsertAfter(node): boolean

Parameters

NameType
nodeLexicalNode

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:476


canInsertTab

canInsertTab(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:458


canInsertTextAfter

canInsertTextAfter(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:485


canInsertTextBefore

canInsertTextBefore(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:482


canMergeWith

canMergeWith(node): boolean

Parameters

NameType
nodeElementNode

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:498


canReplaceWith

canReplaceWith(replacement): boolean

Parameters

NameType
replacementLexicalNode

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:473


clear

clear(): ElementNode

Returns

ElementNode

Defined in

lexical/src/nodes/LexicalElementNode.ts:302


collapseAtStart

collapseAtStart(selection): boolean

Parameters

NameType
selectionRangeSelection

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:464


excludeFromCopy

excludeFromCopy(destination?): boolean

Parameters

NameType
destination?"html" | "clone"

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:467


exportJSON

exportJSON(): SerializedElementNode

Returns

SerializedElementNode

Overrides

LexicalNode.exportJSON

Defined in

lexical/src/nodes/LexicalElementNode.ts:444


extractWithChild

extractWithChild(child, selection, destination): boolean

Parameters

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

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:501


getAllTextNodes

getAllTextNodes(): TextNode[]

Returns

TextNode[]

Defined in

lexical/src/nodes/LexicalElementNode.ts:116


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


getChildren

getChildren<T>(): T[]

Type parameters

NameType
Textends LexicalNode<T>

Returns

T[]

Defined in

lexical/src/nodes/LexicalElementNode.ts:84


getChildrenKeys

getChildrenKeys(): string[]

Returns

string[]

Defined in

lexical/src/nodes/LexicalElementNode.ts:96


getChildrenSize

getChildrenSize(): number

Returns

number

Defined in

lexical/src/nodes/LexicalElementNode.ts:99


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


getDirection

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

Returns

null | "ltr" | "rtl"

Defined in

lexical/src/nodes/LexicalElementNode.ts:237


getFirstChild

getFirstChild<T>(): null | T

Type parameters

NameType
Textends LexicalNode<T>

Returns

null | T

Defined in

lexical/src/nodes/LexicalElementNode.ts:179


getFirstChildOrThrow

getFirstChildOrThrow<T>(): T

Type parameters

NameType
Textends LexicalNode<T>

Returns

T

Defined in

lexical/src/nodes/LexicalElementNode.ts:188


getFirstDescendant

getFirstDescendant<T>(): null | T

Type parameters

NameType
Textends LexicalNode<T>

Returns

null | T

Defined in

lexical/src/nodes/LexicalElementNode.ts:131


getFormat

getFormat(): number

Returns

number

Defined in

lexical/src/nodes/LexicalElementNode.ts:72


getFormatType

getFormatType(): ElementFormatType

Returns

ElementFormatType

Defined in

lexical/src/nodes/LexicalElementNode.ts:76


getIndent

getIndent(): number

Returns

number

Defined in

lexical/src/nodes/LexicalElementNode.ts:80


getLastChild

getLastChild<T>(): null | T

Type parameters

NameType
Textends LexicalNode<T>

Returns

null | T

Defined in

lexical/src/nodes/LexicalElementNode.ts:195


getLastChildOrThrow

getLastChildOrThrow<T>(): T

Type parameters

NameType
Textends LexicalNode<T>

Returns

T

Defined in

lexical/src/nodes/LexicalElementNode.ts:204


getLastDescendant

getLastDescendant<T>(): null | T

Type parameters

NameType
Textends LexicalNode<T>

Returns

null | T

Defined in

lexical/src/nodes/LexicalElementNode.ts:145


getTextContent

getTextContent(): string

Returns

string

Overrides

LexicalNode.getTextContent

Defined in

lexical/src/nodes/LexicalElementNode.ts:220


hasFormat

hasFormat(type): boolean

Parameters

NameType
typeElementFormatType

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:241


insertNewAfter

insertNewAfter(selection): null | LexicalNode

Parameters

NameType
selectionRangeSelection

Returns

null | LexicalNode

Defined in

lexical/src/nodes/LexicalElementNode.ts:455


isDirty

isDirty(): boolean

Returns

boolean

Overrides

LexicalNode.isDirty

Defined in

lexical/src/nodes/LexicalElementNode.ts:106


isEmpty

isEmpty(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:103


isInline

isInline(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:488


isLastChild

isLastChild(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:111


isShadowRoot

isShadowRoot(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalElementNode.ts:495


select

select(_anchorOffset?, _focusOffset?): RangeSelection

Parameters

NameType
_anchorOffset?number
_focusOffset?number

Returns

RangeSelection

Defined in

lexical/src/nodes/LexicalElementNode.ts:251


selectEnd

selectEnd(): RangeSelection

Returns

RangeSelection

Defined in

lexical/src/nodes/LexicalElementNode.ts:291


selectStart

selectStart(): RangeSelection

Returns

RangeSelection

Defined in

lexical/src/nodes/LexicalElementNode.ts:280


setDirection

setDirection(direction): ElementNode

Parameters

NameType
directionnull | "ltr" | "rtl"

Returns

ElementNode

Defined in

lexical/src/nodes/LexicalElementNode.ts:311


setFormat

setFormat(type): ElementNode

Parameters

NameType
typeElementFormatType

Returns

ElementNode

Defined in

lexical/src/nodes/LexicalElementNode.ts:316


setIndent

setIndent(indentLevel): ElementNode

Parameters

NameType
indentLevelnumber

Returns

ElementNode

Defined in

lexical/src/nodes/LexicalElementNode.ts:321


splice

splice(start, deleteCount, nodesToInsert): ElementNode

Parameters

NameType
startnumber
deleteCountnumber
nodesToInsertLexicalNode[]

Returns

ElementNode

Defined in

lexical/src/nodes/LexicalElementNode.ts:326