Skip to main content

Class: HeadingNode

@lexical/rich-text.HeadingNode

Hierarchy

Constructors

constructor

new HeadingNode(tag, key?): HeadingNode

Parameters

NameType
tagHeadingTagType
key?string

Returns

HeadingNode

Overrides

ElementNode.constructor

Defined in

packages/lexical-rich-text/src/index.ts:232

Methods

collapseAtStart

collapseAtStart(): true

Returns

true

Overrides

ElementNode.collapseAtStart

Defined in

packages/lexical-rich-text/src/index.ts:373


createDOM

createDOM(config): HTMLElement

Parameters

NameType
configEditorConfig

Returns

HTMLElement

Overrides

ElementNode.createDOM

Defined in

packages/lexical-rich-text/src/index.ts:243


exportDOM

exportDOM(editor): DOMExportOutput

Parameters

NameType
editorLexicalEditor

Returns

DOMExportOutput

Overrides

ElementNode.exportDOM

Defined in

packages/lexical-rich-text/src/index.ts:313


exportJSON

exportJSON(): SerializedHeadingNode

Controls how the this node is serialized to JSON. This is important for copy and paste between Lexical editors sharing the same namespace. It's also important if you're serializing to JSON for persistent storage somewhere. See Serialization & Deserialization.

Returns

SerializedHeadingNode

Overrides

ElementNode.exportJSON

Defined in

packages/lexical-rich-text/src/index.ts:343


extractWithChild

extractWithChild(): boolean

Returns

boolean

Overrides

ElementNode.extractWithChild

Defined in

packages/lexical-rich-text/src/index.ts:383


getTag

getTag(): HeadingTagType

Returns

HeadingTagType

Defined in

packages/lexical-rich-text/src/index.ts:237


insertNewAfter

insertNewAfter(selection?, restoreSelection?): ParagraphNode | HeadingNode

Parameters

NameTypeDefault value
selection?RangeSelectionundefined
restoreSelectionbooleantrue

Returns

ParagraphNode | HeadingNode

Overrides

ElementNode.insertNewAfter

Defined in

packages/lexical-rich-text/src/index.ts:353


updateDOM

updateDOM(prevNode, dom): boolean

Parameters

NameType
prevNodeHeadingNode
domHTMLElement

Returns

boolean

Overrides

ElementNode.updateDOM

Defined in

packages/lexical-rich-text/src/index.ts:255


clone

clone(node): HeadingNode

Parameters

NameType
nodeHeadingNode

Returns

HeadingNode

Overrides

ElementNode.clone

Defined in

packages/lexical-rich-text/src/index.ts:228


getType

getType(): string

Returns

string

Overrides

ElementNode.getType

Defined in

packages/lexical-rich-text/src/index.ts:224


importDOM

importDOM(): null | DOMConversionMap

Returns

null | DOMConversionMap

Overrides

ElementNode.importDOM

Defined in

packages/lexical-rich-text/src/index.ts:259


importJSON

importJSON(serializedNode): HeadingNode

Parameters

NameType
serializedNodeSerializedHeadingNode

Returns

HeadingNode

Overrides

ElementNode.importJSON

Defined in

packages/lexical-rich-text/src/index.ts:335