Class: CodeNode
@lexical/code.CodeNode
Hierarchy
↳
CodeNode
Constructors
constructor
• new CodeNode(language?
, key?
)
Parameters
Name | Type |
---|---|
language? | null | string |
key? | string |
Overrides
Defined in
lexical-code/src/CodeNode.ts:94
Methods
canIndent
▸ canIndent(): false
Returns
false
Overrides
Defined in
lexical-code/src/CodeNode.ts:268
canInsertTab
▸ canInsertTab(): boolean
Returns
boolean
Overrides
Defined in
lexical-code/src/CodeNode.ts:260
collapseAtStart
▸ collapseAtStart(): boolean
Returns
boolean
Overrides
Defined in
lexical-code/src/CodeNode.ts:272
createDOM
▸ createDOM(config
): HTMLElement
Parameters
Name | Type |
---|---|
config | EditorConfig |
Returns
HTMLElement
Overrides
ElementNode.createDOM
Defined in
lexical-code/src/CodeNode.ts:100
exportJSON
▸ exportJSON(): SerializedCodeNode
Returns
Overrides
Defined in
lexical-code/src/CodeNode.ts:201
getLanguage
▸ getLanguage(): undefined
| null
| string
Returns
undefined
| null
| string
Defined in
lexical-code/src/CodeNode.ts:285
insertNewAfter
▸ insertNewAfter(selection
, restoreSelection?
): null
| ParagraphNode
| CodeHighlightNode
Parameters
Name | Type | Default value |
---|---|---|
selection | RangeSelection | undefined |
restoreSelection | boolean | true |
Returns
null
| ParagraphNode
| CodeHighlightNode
Overrides
Defined in
lexical-code/src/CodeNode.ts:211
setLanguage
▸ setLanguage(language
): void
Parameters
Name | Type |
---|---|
language | string |
Returns
void
Defined in
lexical-code/src/CodeNode.ts:280
updateDOM
▸ updateDOM(prevNode
, dom
, config
): boolean
Parameters
Name | Type |
---|---|
prevNode | CodeNode |
dom | HTMLElement |
config | EditorConfig |
Returns
boolean
Overrides
ElementNode.updateDOM
Defined in
lexical-code/src/CodeNode.ts:110
clone
▸ Static
clone(node
): CodeNode
Parameters
Name | Type |
---|---|
node | CodeNode |
Returns
Overrides
ElementNode.clone
Defined in
lexical-code/src/CodeNode.ts:90
getType
▸ Static
getType(): string
Returns
string
Overrides
ElementNode.getType
Defined in
lexical-code/src/CodeNode.ts:86
importDOM
▸ Static
importDOM(): null
| DOMConversionMap
<HTMLElement
>
Returns
null
| DOMConversionMap
<HTMLElement
>
Defined in
lexical-code/src/CodeNode.ts:128