Skip to main content

Class: CodeHighlightNode

@lexical/code.CodeHighlightNode

Hierarchy

Constructors

constructor

new CodeHighlightNode(text, highlightType?, key?)

Parameters

NameType
textstring
highlightType?null | string
key?string

Overrides

TextNode.constructor

Defined in

lexical-code/src/CodeHighlightNode.ts:112

Methods

createDOM

createDOM(config): HTMLElement

Parameters

NameType
configEditorConfig

Returns

HTMLElement

Overrides

TextNode.createDOM

Defined in

lexical-code/src/CodeHighlightNode.ts:138


createParentElementNode

createParentElementNode(): ElementNode

Returns

ElementNode

Overrides

TextNode.createParentElementNode

Defined in

lexical-code/src/CodeHighlightNode.ts:205


exportJSON

exportJSON(): SerializedCodeHighlightNode

Returns

SerializedCodeHighlightNode

Overrides

TextNode.exportJSON

Defined in

lexical-code/src/CodeHighlightNode.ts:187


getHighlightType

getHighlightType(): undefined | null | string

Returns

undefined | null | string

Defined in

lexical-code/src/CodeHighlightNode.ts:133


isParentRequired

isParentRequired(): true

Returns

true

Overrides

TextNode.isParentRequired

Defined in

lexical-code/src/CodeHighlightNode.ts:201


setFormat

setFormat(format): CodeHighlightNode

Parameters

NameType
formatnumber

Returns

CodeHighlightNode

Overrides

TextNode.setFormat

Defined in

lexical-code/src/CodeHighlightNode.ts:197


updateDOM

updateDOM(prevNode, dom, config): boolean

Parameters

NameType
prevNodeCodeHighlightNode
domHTMLElement
configEditorConfig

Returns

boolean

Overrides

TextNode.updateDOM

Defined in

lexical-code/src/CodeHighlightNode.ts:148


clone

Static clone(node): CodeHighlightNode

Parameters

NameType
nodeCodeHighlightNode

Returns

CodeHighlightNode

Overrides

TextNode.clone

Defined in

lexical-code/src/CodeHighlightNode.ts:125


getType

Static getType(): string

Returns

string

Overrides

TextNode.getType

Defined in

lexical-code/src/CodeHighlightNode.ts:121


importJSON

Static importJSON(serializedNode): CodeHighlightNode

Parameters

NameType
serializedNodeSerializedCodeHighlightNode

Returns

CodeHighlightNode

Overrides

TextNode.importJSON

Defined in

lexical-code/src/CodeHighlightNode.ts:173