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

Methods

createDOM

createDOM(config): HTMLElement

Parameters

NameType
configEditorConfig

Returns

HTMLElement

Overrides

TextNode.createDOM

Defined in

lexical-code/src/CodeHighlightNode.ts:130


exportJSON

exportJSON(): SerializedCodeHighlightNode

Returns

SerializedCodeHighlightNode

Overrides

TextNode.exportJSON

Defined in

lexical-code/src/CodeHighlightNode.ts:179


getHighlightType

getHighlightType(): undefined | null | string

Returns

undefined | null | string

Defined in

lexical-code/src/CodeHighlightNode.ts:125


setFormat

setFormat(format): CodeHighlightNode

Parameters

NameType
formatnumber

Returns

CodeHighlightNode

Overrides

TextNode.setFormat

Defined in

lexical-code/src/CodeHighlightNode.ts:189


updateDOM

updateDOM(prevNode, dom, config): boolean

Parameters

NameType
prevNodeCodeHighlightNode
domHTMLElement
configEditorConfig

Returns

boolean

Overrides

TextNode.updateDOM

Defined in

lexical-code/src/CodeHighlightNode.ts:140


clone

Static clone(node): CodeHighlightNode

Parameters

NameType
nodeCodeHighlightNode

Returns

CodeHighlightNode

Overrides

TextNode.clone

Defined in

lexical-code/src/CodeHighlightNode.ts:117


getType

Static getType(): string

Returns

string

Overrides

TextNode.getType

Defined in

lexical-code/src/CodeHighlightNode.ts:113


importJSON

Static importJSON(serializedNode): CodeHighlightNode

Parameters

NameType
serializedNodeSerializedCodeHighlightNode

Returns

CodeHighlightNode

Overrides

TextNode.importJSON

Defined in

lexical-code/src/CodeHighlightNode.ts:165