Skip to main content

Class: LexicalNode

lexical.LexicalNode

Hierarchy

Indexable

[x: string]: any

Constructors

constructor

new LexicalNode(key?)

Parameters

NameType
key?string

Defined in

lexical/src/LexicalNode.ts:200

Methods

createDOM

createDOM(_config, _editor): HTMLElement

Parameters

NameType
_configEditorConfig
_editorLexicalEditor

Returns

HTMLElement

Defined in

lexical/src/LexicalNode.ts:602


exportDOM

exportDOM(editor): DOMExportOutput

Parameters

NameType
editorLexicalEditor

Returns

DOMExportOutput

Defined in

lexical/src/LexicalNode.ts:624


exportJSON

exportJSON(): SerializedLexicalNode

Returns

SerializedLexicalNode

Defined in

lexical/src/LexicalNode.ts:629


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


getIndexWithinParent

getIndexWithinParent(): number

Returns

number

Defined in

lexical/src/LexicalNode.ts:272


getKey

getKey(): string

Returns

string

Defined in

lexical/src/LexicalNode.ts:267


getLatest

getLatest(): LexicalNode

Returns

LexicalNode

Defined in

lexical/src/LexicalNode.ts:538


getNextSibling

getNextSibling<T>(): null | T

Type parameters

NameType
Textends LexicalNode<T>

Returns

null | T

Defined in

lexical/src/LexicalNode.ts:366


getNextSiblings

getNextSiblings<T>(): T[]

Type parameters

NameType
Textends LexicalNode<T>

Returns

T[]

Defined in

lexical/src/LexicalNode.ts:380


getNodesBetween

getNodesBetween(targetNode): LexicalNode[]

Parameters

NameType
targetNodeLexicalNode

Returns

LexicalNode[]

Defined in

lexical/src/LexicalNode.ts:471


getParent

getParent<T>(): null | T

Type parameters

NameType
Textends ElementNode<T>

Returns

null | T

Defined in

lexical/src/LexicalNode.ts:281


getParentKeys

getParentKeys(): string[]

Returns

string[]

Defined in

lexical/src/LexicalNode.ts:331


getParentOrThrow

getParentOrThrow<T>(): T

Type parameters

NameType
Textends ElementNode<T>

Returns

T

Defined in

lexical/src/LexicalNode.ts:289


getParents

getParents(): ElementNode[]

Returns

ElementNode[]

Defined in

lexical/src/LexicalNode.ts:321


getPreviousSibling

getPreviousSibling<T>(): null | T

Type parameters

NameType
Textends LexicalNode<T>

Returns

null | T

Defined in

lexical/src/LexicalNode.ts:341


getPreviousSiblings

getPreviousSiblings<T>(): T[]

Type parameters

NameType
Textends LexicalNode<T>

Returns

T[]

Defined in

lexical/src/LexicalNode.ts:354


getTextContent

getTextContent(): string

Returns

string

Defined in

lexical/src/LexicalNode.ts:592


getTextContentSize

getTextContentSize(): number

Returns

number

Defined in

lexical/src/LexicalNode.ts:596


getTopLevelElement

getTopLevelElement(): null | LexicalNode | ElementNode

Returns

null | LexicalNode | ElementNode

Defined in

lexical/src/LexicalNode.ts:297


getTopLevelElementOrThrow

getTopLevelElementOrThrow(): LexicalNode | ElementNode

Returns

LexicalNode | ElementNode

Defined in

lexical/src/LexicalNode.ts:309


getType

getType(): string

Returns

string

Defined in

lexical/src/LexicalNode.ts:221


getWritable

getWritable(): LexicalNode

Returns

LexicalNode

Defined in

lexical/src/LexicalNode.ts:549


insertAfter

insertAfter(nodeToInsert): LexicalNode

Parameters

NameType
nodeToInsertLexicalNode

Returns

LexicalNode

Defined in

lexical/src/LexicalNode.ts:682


insertBefore

insertBefore(nodeToInsert): LexicalNode

Parameters

NameType
nodeToInsertLexicalNode

Returns

LexicalNode

Defined in

lexical/src/LexicalNode.ts:735


is

is(object): boolean

Parameters

NameType
objectundefined | null | LexicalNode

Returns

boolean

Defined in

lexical/src/LexicalNode.ts:418


isAttached

isAttached(): boolean

Returns

boolean

Defined in

lexical/src/LexicalNode.ts:225


isBefore

isBefore(targetNode): boolean

Parameters

NameType
targetNodeLexicalNode

Returns

boolean

Defined in

lexical/src/LexicalNode.ts:425


isDirty

isDirty(): boolean

Returns

boolean

Defined in

lexical/src/LexicalNode.ts:532


isParentOf

isParentOf(targetNode): boolean

Parameters

NameType
targetNodeLexicalNode

Returns

boolean

Defined in

lexical/src/LexicalNode.ts:456


isSelected

isSelected(): boolean

Returns

boolean

Defined in

lexical/src/LexicalNode.ts:242


markDirty

markDirty(): void

Returns

void

Defined in

lexical/src/LexicalNode.ts:794


remove

remove(preserveEmptyParent?): void

Parameters

NameType
preserveEmptyParent?boolean

Returns

void

Defined in

lexical/src/LexicalNode.ts:643


replace

replace<N>(replaceWith): N

Type parameters

NameType
Nextends LexicalNode<N>

Parameters

NameType
replaceWithN

Returns

N

Defined in

lexical/src/LexicalNode.ts:647


selectNext

selectNext(anchorOffset?, focusOffset?): RangeSelection

Parameters

NameType
anchorOffset?number
focusOffset?number

Returns

RangeSelection

Defined in

lexical/src/LexicalNode.ts:778


selectPrevious

selectPrevious(anchorOffset?, focusOffset?): RangeSelection

Parameters

NameType
anchorOffset?number
focusOffset?number

Returns

RangeSelection

Defined in

lexical/src/LexicalNode.ts:762


updateDOM

updateDOM(_prevNode, _dom, _config): boolean

Parameters

NameType
_prevNodeunknown
_domHTMLElement
_configEditorConfig

Returns

boolean

Defined in

lexical/src/LexicalNode.ts:616


clone

Static clone(_data): LexicalNode

Parameters

NameType
_dataunknown

Returns

LexicalNode

Defined in

lexical/src/LexicalNode.ts:192


getType

Static getType(): string

Returns

string

Defined in

lexical/src/LexicalNode.ts:184


importJSON

Static importJSON(_serializedNode): LexicalNode

Parameters

NameType
_serializedNodeSerializedLexicalNode

Returns

LexicalNode

Defined in

lexical/src/LexicalNode.ts:633