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:112
Methods
createDOM
▸ createDOM(config
): HTMLElement
Parameters
Name | Type |
---|---|
config | EditorConfig |
Returns
HTMLElement
Overrides
Defined in
lexical-code/src/CodeHighlightNode.ts:138
createParentElementNode
▸ createParentElementNode(): ElementNode
Returns
Overrides
TextNode.createParentElementNode
Defined in
lexical-code/src/CodeHighlightNode.ts:205
exportJSON
▸ exportJSON(): SerializedCodeHighlightNode
Returns
SerializedCodeHighlightNode
Overrides
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
Name | Type |
---|---|
format | number |
Returns
Overrides
Defined in
lexical-code/src/CodeHighlightNode.ts:197
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:148
clone
▸ Static
clone(node
): CodeHighlightNode
Parameters
Name | Type |
---|---|
node | CodeHighlightNode |
Returns
Overrides
Defined in
lexical-code/src/CodeHighlightNode.ts:125
getType
▸ Static
getType(): string
Returns
string
Overrides
Defined in
lexical-code/src/CodeHighlightNode.ts:121
importJSON
▸ Static
importJSON(serializedNode
): CodeHighlightNode
Parameters
Name | Type |
---|---|
serializedNode | SerializedCodeHighlightNode |
Returns
Overrides
Defined in
lexical-code/src/CodeHighlightNode.ts:173