Class: HeadingNode
@lexical/rich-text.HeadingNode
Hierarchy
-
↳
HeadingNode
Constructors
constructor
• new HeadingNode(tag
, key?
): HeadingNode
Parameters
Name | Type |
---|---|
tag | HeadingTagType |
key? | string |
Returns
Overrides
Defined in
packages/lexical-rich-text/src/index.ts:236
Methods
collapseAtStart
▸ collapseAtStart(): true
Returns
true
Overrides
Defined in
packages/lexical-rich-text/src/index.ts:377
createDOM
▸ createDOM(config
): HTMLElement
Parameters
Name | Type |
---|---|
config | EditorConfig |
Returns
HTMLElement
Overrides
ElementNode.createDOM
Defined in
packages/lexical-rich-text/src/index.ts:247
exportDOM
▸ exportDOM(editor
): DOMExportOutput
Parameters
Name | Type |
---|---|
editor | LexicalEditor |
Returns
Overrides
ElementNode.exportDOM
Defined in
packages/lexical-rich-text/src/index.ts:317
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
Overrides
Defined in
packages/lexical-rich-text/src/index.ts:347
extractWithChild
▸ extractWithChild(): boolean
Returns
boolean
Overrides
Defined in
packages/lexical-rich-text/src/index.ts:387
getTag
▸ getTag(): HeadingTagType
Returns
Defined in
packages/lexical-rich-text/src/index.ts:241
insertNewAfter
▸ insertNewAfter(selection?
, restoreSelection?
): ParagraphNode
| HeadingNode
Parameters
Name | Type | Default value |
---|---|---|
selection? | RangeSelection | undefined |
restoreSelection | boolean | true |
Returns
Overrides
Defined in
packages/lexical-rich-text/src/index.ts:357
updateDOM
▸ updateDOM(prevNode
, dom
): boolean
Parameters
Name | Type |
---|---|
prevNode | HeadingNode |
dom | HTMLElement |
Returns
boolean
Overrides
ElementNode.updateDOM
Defined in
packages/lexical-rich-text/src/index.ts:259
clone
▸ clone(node
): HeadingNode
Parameters
Name | Type |
---|---|
node | HeadingNode |
Returns
Overrides
ElementNode.clone
Defined in
packages/lexical-rich-text/src/index.ts:232
getType
▸ getType(): string
Returns
string
Overrides
ElementNode.getType
Defined in
packages/lexical-rich-text/src/index.ts:228
importDOM
▸ importDOM(): null
| DOMConversionMap
Returns
null
| DOMConversionMap
Overrides
ElementNode.importDOM
Defined in
packages/lexical-rich-text/src/index.ts:263
importJSON
▸ importJSON(serializedNode
): HeadingNode
Parameters
Name | Type |
---|---|
serializedNode | SerializedHeadingNode |
Returns
Overrides
ElementNode.importJSON