Skip to main content

Class: LexicalNode

lexical.LexicalNode

Hierarchy

Constructors

constructor

new LexicalNode(key?)

Parameters

NameType
key?string

Defined in

lexical/src/LexicalNode.ts:186

Methods

createDOM

createDOM(_config, _editor): HTMLElement

Parameters

NameType
_configEditorConfig
_editorLexicalEditor

Returns

HTMLElement

Defined in

lexical/src/LexicalNode.ts:593


createParentElementNode

createParentElementNode(): ElementNode

Returns

ElementNode

Defined in

lexical/src/LexicalNode.ts:813


exportDOM

exportDOM(editor): DOMExportOutput

Parameters

NameType
editorLexicalEditor

Returns

DOMExportOutput

Defined in

lexical/src/LexicalNode.ts:615


exportJSON

exportJSON(): any

Returns

any

Defined in

lexical/src/LexicalNode.ts:620


getCommonAncestor

getCommonAncestor<T>(node): null | T

Type parameters

NameType
Textends ElementNode<T> = ElementNode

Parameters

NameType
nodeLexicalNode

Returns

null | T

Defined in

lexical/src/LexicalNode.ts:378


getIndexWithinParent

getIndexWithinParent(): number

Returns

number

Defined in

lexical/src/LexicalNode.ts:262


getKey

getKey(): string

Returns

string

Defined in

lexical/src/LexicalNode.ts:257


getLatest

getLatest(): LexicalNode

Returns

LexicalNode

Defined in

lexical/src/LexicalNode.ts:525


getNextSibling

getNextSibling<T>(): null | T

Type parameters

NameType
Textends LexicalNode<T>

Returns

null | T

Defined in

lexical/src/LexicalNode.ts:362


getNextSiblings

getNextSiblings<T>(): T[]

Type parameters

NameType
Textends LexicalNode<T>

Returns

T[]

Defined in

lexical/src/LexicalNode.ts:368


getNodesBetween

getNodesBetween(targetNode): LexicalNode[]

Parameters

NameType
targetNodeLexicalNode

Returns

LexicalNode[]

Defined in

lexical/src/LexicalNode.ts:458


getParent

getParent<T>(): null | T

Type parameters

NameType
Textends ElementNode<T>

Returns

null | T

Defined in

lexical/src/LexicalNode.ts:279


getParentKeys

getParentKeys(): string[]

Returns

string[]

Defined in

lexical/src/LexicalNode.ts:329


getParentOrThrow

getParentOrThrow<T>(): T

Type parameters

NameType
Textends ElementNode<T>

Returns

T

Defined in

lexical/src/LexicalNode.ts:287


getParents

getParents(): ElementNode[]

Returns

ElementNode[]

Defined in

lexical/src/LexicalNode.ts:319


getPreviousSibling

getPreviousSibling<T>(): null | T

Type parameters

NameType
Textends LexicalNode<T>

Returns

null | T

Defined in

lexical/src/LexicalNode.ts:339


getPreviousSiblings

getPreviousSiblings<T>(): T[]

Type parameters

NameType
Textends LexicalNode<T>

Returns

T[]

Defined in

lexical/src/LexicalNode.ts:345


getTextContent

getTextContent(): string

Returns

string

Defined in

lexical/src/LexicalNode.ts:583


getTextContentSize

getTextContentSize(): number

Returns

number

Defined in

lexical/src/LexicalNode.ts:587


getTopLevelElement

getTopLevelElement(): null | LexicalNode | ElementNode

Returns

null | LexicalNode | ElementNode

Defined in

lexical/src/LexicalNode.ts:295


getTopLevelElementOrThrow

getTopLevelElementOrThrow(): LexicalNode | ElementNode

Returns

LexicalNode | ElementNode

Defined in

lexical/src/LexicalNode.ts:307


getType

getType(): string

Returns

string

Defined in

lexical/src/LexicalNode.ts:207


getWritable

getWritable(): LexicalNode

Returns

LexicalNode

Defined in

lexical/src/LexicalNode.ts:536


insertAfter

insertAfter(nodeToInsert, restoreSelection?): LexicalNode

Parameters

NameTypeDefault value
nodeToInsertLexicalNodeundefined
restoreSelectionbooleantrue

Returns

LexicalNode

Defined in

lexical/src/LexicalNode.ts:715


insertBefore

insertBefore(nodeToInsert, restoreSelection?): LexicalNode

Parameters

NameTypeDefault value
nodeToInsertLexicalNodeundefined
restoreSelectionbooleantrue

Returns

LexicalNode

Defined in

lexical/src/LexicalNode.ts:775


is

is(object): boolean

Parameters

NameType
objectundefined | null | LexicalNode

Returns

boolean

Defined in

lexical/src/LexicalNode.ts:404


isAttached

isAttached(): boolean

Returns

boolean

Defined in

lexical/src/LexicalNode.ts:211


isBefore

isBefore(targetNode): boolean

Parameters

NameType
targetNodeLexicalNode

Returns

boolean

Defined in

lexical/src/LexicalNode.ts:411


isDirty

isDirty(): boolean

Returns

boolean

Defined in

lexical/src/LexicalNode.ts:519


isParentOf

isParentOf(targetNode): boolean

Parameters

NameType
targetNodeLexicalNode

Returns

boolean

Defined in

lexical/src/LexicalNode.ts:442


isParentRequired

isParentRequired(): boolean

Returns

boolean

Defined in

lexical/src/LexicalNode.ts:809


isSelected

isSelected(selection?): boolean

Parameters

NameType
selection?null | RangeSelection | NodeSelection | GridSelection

Returns

boolean

Defined in

lexical/src/LexicalNode.ts:228


markDirty

markDirty(): void

Returns

void

Defined in

lexical/src/LexicalNode.ts:849


remove

remove(preserveEmptyParent?): void

Parameters

NameType
preserveEmptyParent?boolean

Returns

void

Defined in

lexical/src/LexicalNode.ts:650


replace

replace<N>(replaceWith, includeChildren?): N

Type parameters

NameType
Nextends LexicalNode<N>

Parameters

NameType
replaceWithN
includeChildren?boolean

Returns

N

Defined in

lexical/src/LexicalNode.ts:654


selectNext

selectNext(anchorOffset?, focusOffset?): RangeSelection

Parameters

NameType
anchorOffset?number
focusOffset?number

Returns

RangeSelection

Defined in

lexical/src/LexicalNode.ts:833


selectPrevious

selectPrevious(anchorOffset?, focusOffset?): RangeSelection

Parameters

NameType
anchorOffset?number
focusOffset?number

Returns

RangeSelection

Defined in

lexical/src/LexicalNode.ts:817


updateDOM

updateDOM(_prevNode, _dom, _config): boolean

Parameters

NameType
_prevNodeunknown
_domHTMLElement
_configEditorConfig

Returns

boolean

Defined in

lexical/src/LexicalNode.ts:607


clone

Static clone(_data): LexicalNode

Parameters

NameType
_dataunknown

Returns

LexicalNode

Defined in

lexical/src/LexicalNode.ts:178


getType

Static getType(): string

Returns

string

Defined in

lexical/src/LexicalNode.ts:170