Class: CodeHighlightNode
@lexical/code.CodeHighlightNode
Hierarchy
↳
CodeHighlightNode
Constructors
constructor
• new CodeHighlightNode(text
, highlightType?
, key?
)
Parameters
Name | Type |
---|---|
text | string |
highlightType? | null | string |
key? | string |
Overrides
Defined in
lexical-code/src/CodeHighlightNode.ts:101
Methods
createDOM
▸ createDOM(config
): HTMLElement
Parameters
Name | Type |
---|---|
config | EditorConfig |
Returns
HTMLElement
Overrides
Defined in
lexical-code/src/CodeHighlightNode.ts:127
exportJSON
▸ exportJSON(): SerializedCodeHighlightNode
Returns
SerializedCodeHighlightNode
Overrides
Defined in
lexical-code/src/CodeHighlightNode.ts:176
getHighlightType
▸ getHighlightType(): undefined
| null
| string
Returns
undefined
| null
| string
Defined in
lexical-code/src/CodeHighlightNode.ts:122
setFormat
▸ setFormat(format
): CodeHighlightNode
Parameters
Name | Type |
---|---|
format | number |
Returns
Overrides
Defined in
lexical-code/src/CodeHighlightNode.ts:186
updateDOM
▸ updateDOM(prevNode
, dom
, config
): boolean
Parameters
Name | Type |
---|---|
prevNode | CodeHighlightNode |
dom | HTMLElement |
config | EditorConfig |
Returns
boolean
Overrides
Defined in
lexical-code/src/CodeHighlightNode.ts:137
clone
▸ Static
clone(node
): CodeHighlightNode
Parameters
Name | Type |
---|---|
node | CodeHighlightNode |
Returns
Overrides
Defined in
lexical-code/src/CodeHighlightNode.ts:114
getType
▸ Static
getType(): string
Returns
string
Overrides
Defined in
lexical-code/src/CodeHighlightNode.ts:110
importJSON
▸ Static
importJSON(serializedNode
): CodeHighlightNode
Parameters
Name | Type |
---|---|
serializedNode | SerializedCodeHighlightNode |
Returns
Overrides
Defined in
lexical-code/src/CodeHighlightNode.ts:162