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:104
Methods
createDOM
▸ createDOM(config
): HTMLElement
Parameters
Name | Type |
---|---|
config | EditorConfig |
Returns
HTMLElement
Overrides
Defined in
lexical-code/src/CodeHighlightNode.ts:130
exportJSON
▸ exportJSON(): SerializedCodeHighlightNode
Returns
SerializedCodeHighlightNode
Overrides
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
Name | Type |
---|---|
format | number |
Returns
Overrides
Defined in
lexical-code/src/CodeHighlightNode.ts:189
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:140
clone
▸ Static
clone(node
): CodeHighlightNode
Parameters
Name | Type |
---|---|
node | CodeHighlightNode |
Returns
Overrides
Defined in
lexical-code/src/CodeHighlightNode.ts:117
getType
▸ Static
getType(): string
Returns
string
Overrides
Defined in
lexical-code/src/CodeHighlightNode.ts:113
importJSON
▸ Static
importJSON(serializedNode
): CodeHighlightNode
Parameters
Name | Type |
---|---|
serializedNode | SerializedCodeHighlightNode |
Returns
Overrides
Defined in
lexical-code/src/CodeHighlightNode.ts:165