Skip to main content

Class: CodeTabNode

@lexical/code.CodeTabNode

Hierarchy

Methods

createDOM

createDOM(config): HTMLElement

Parameters

NameType
configEditorConfig

Returns

HTMLElement

Overrides

TabNode.createDOM

Defined in

lexical-code/src/CodeTabNode.ts:42


exportJSON

exportJSON(): SerializedTextNode

Controls how the this node is serialized to JSON. This is important for copy and paste between Lexical editors sharing the same namespace. It's also important if you're serializing to JSON for persistent storage somewhere. See Serialization & Deserialization.

Returns

SerializedTextNode

Overrides

TabNode.exportJSON

Defined in

lexical-code/src/CodeTabNode.ts:34


updateDOM

updateDOM(prevNode, dom, config): boolean

Parameters

NameType
prevNodeTextNode
domHTMLElement
configEditorConfig

Returns

boolean

Overrides

TabNode.updateDOM

Defined in

lexical-code/src/CodeTabNode.ts:53


clone

Static clone(node): CodeTabNode

Clones this node, creating a new node with a different key and adding it to the EditorState (but not attaching it anywhere!). All nodes must implement this method.

Parameters

NameType
nodeCodeTabNode

Returns

CodeTabNode

Overrides

TabNode.clone

Defined in

lexical-code/src/CodeTabNode.ts:26


getType

Static getType(): string

Returns the string type of this node. Every node must implement this and it MUST BE UNIQUE amongst nodes registered on the editor.

Returns

string

Overrides

TabNode.getType

Defined in

lexical-code/src/CodeTabNode.ts:22


importJSON

Static importJSON(_serializedTabNode): CodeTabNode

Controls how the this node is deserialized from JSON. This is usually boilerplate, but provides an abstraction between the node implementation and serialized interface that can be important if you ever make breaking changes to a node schema (by adding or removing properties). See Serialization & Deserialization.

Parameters

NameType
_serializedTabNodeSerializedTextNode

Returns

CodeTabNode

Overrides

TabNode.importJSON

Defined in

lexical-code/src/CodeTabNode.ts:30