Skip to main content

Class: CodeHighlightNode

lexical-code/src.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:100

Methods

createDOM

createDOM(config): HTMLElement

Parameters

NameType
configEditorConfig

Returns

HTMLElement

Overrides

TextNode.createDOM

Defined in

lexical-code/src/CodeHighlightNode.ts:126


exportJSON

exportJSON(): SerializedCodeHighlightNode

Returns

SerializedCodeHighlightNode

Overrides

TextNode.exportJSON

Defined in

lexical-code/src/CodeHighlightNode.ts:175


getHighlightType

getHighlightType(): undefined | null | string

Returns

undefined | null | string

Defined in

lexical-code/src/CodeHighlightNode.ts:121


setFormat

setFormat(format): CodeHighlightNode

Parameters

NameType
formatnumber

Returns

CodeHighlightNode

Overrides

TextNode.setFormat

Defined in

lexical-code/src/CodeHighlightNode.ts:185


updateDOM

updateDOM(prevNode, dom, config): boolean

Parameters

NameType
prevNodeCodeHighlightNode
domHTMLElement
configEditorConfig

Returns

boolean

Overrides

TextNode.updateDOM

Defined in

lexical-code/src/CodeHighlightNode.ts:136


clone

Static clone(node): CodeHighlightNode

Parameters

NameType
nodeCodeHighlightNode

Returns

CodeHighlightNode

Overrides

TextNode.clone

Defined in

lexical-code/src/CodeHighlightNode.ts:113


getType

Static getType(): string

Returns

string

Overrides

TextNode.getType

Defined in

lexical-code/src/CodeHighlightNode.ts:109


importJSON

Static importJSON(serializedNode): CodeHighlightNode

Parameters

NameType
serializedNodeSerializedCodeHighlightNode

Returns

CodeHighlightNode

Overrides

TextNode.importJSON

Defined in

lexical-code/src/CodeHighlightNode.ts:161