Class: CodeNode
lexical-code/src.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:82
Methods
canIndent
▸ canIndent(): false
Returns
false
Overrides
Defined in
lexical-code/src/CodeNode.ts:258
canInsertTab
▸ canInsertTab(): boolean
Returns
boolean
Overrides
Defined in
lexical-code/src/CodeNode.ts:250
collapseAtStart
▸ collapseAtStart(): true
Returns
true
Overrides
Defined in
lexical-code/src/CodeNode.ts:262
createDOM
▸ createDOM(config
): HTMLElement
Parameters
Name | Type |
---|---|
config | EditorConfig |
Returns
HTMLElement
Overrides
ElementNode.createDOM
Defined in
lexical-code/src/CodeNode.ts:88
exportJSON
▸ exportJSON(): SerializedCodeNode
Returns
SerializedCodeNode
Overrides
Defined in
lexical-code/src/CodeNode.ts:192
getLanguage
▸ getLanguage(): undefined
| null
| string
Returns
undefined
| null
| string
Defined in
lexical-code/src/CodeNode.ts:275
insertNewAfter
▸ insertNewAfter(selection
): null
| ParagraphNode
| CodeHighlightNode
Parameters
Name | Type |
---|---|
selection | RangeSelection |
Returns
null
| ParagraphNode
| CodeHighlightNode
Overrides
Defined in
lexical-code/src/CodeNode.ts:202
setLanguage
▸ setLanguage(language
): void
Parameters
Name | Type |
---|---|
language | string |
Returns
void
Defined in
lexical-code/src/CodeNode.ts:270
updateDOM
▸ updateDOM(prevNode
, dom
): boolean
Parameters
Name | Type |
---|---|
prevNode | CodeNode |
dom | HTMLElement |
Returns
boolean
Overrides
ElementNode.updateDOM
Defined in
lexical-code/src/CodeNode.ts:98
clone
▸ Static
clone(node
): CodeNode
Parameters
Name | Type |
---|---|
node | CodeNode |
Returns
Overrides
ElementNode.clone
Defined in
lexical-code/src/CodeNode.ts:78
getType
▸ Static
getType(): string
Returns
string
Overrides
ElementNode.getType
Defined in
lexical-code/src/CodeNode.ts:74
importDOM
▸ Static
importDOM(): null
| DOMConversionMap
<HTMLElement
>
Returns
null
| DOMConversionMap
<HTMLElement
>
Defined in
lexical-code/src/CodeNode.ts:112
importJSON
▸ Static
importJSON(serializedNode
): CodeNode
Parameters
Name | Type |
---|---|
serializedNode | SerializedCodeNode |
Returns
Overrides
ElementNode.importJSON
Defined in
lexical-code/src/CodeNode.ts:184