Class: ArtificialNode__DO_NOT_USE
lexical.ArtificialNode__DO_NOT_USE
Hierarchy
-
↳
ArtificialNode__DO_NOT_USE
Constructors
constructor
• new ArtificialNode__DO_NOT_USE(key?
): ArtificialNode__DO_NOT_USE
Parameters
Name | Type |
---|---|
key? | string |
Returns
Inherited from
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:85
Properties
constructor
• constructor: KlassConstructor
<typeof ElementNode
>
Inherited from
ElementNode.constructor
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:69
importDOM
▪ Static
Optional
importDOM: () => null
| DOMConversionMap
<any
>
Type declaration
▸ (): null
| DOMConversionMap
<any
>
Returns
null
| DOMConversionMap
<any
>
Inherited from
Defined in
packages/lexical/src/LexicalNode.ts:209
Methods
append
▸ append(...nodesToAppend
): this
Parameters
Name | Type |
---|---|
...nodesToAppend | LexicalNode [] |
Returns
this
Inherited from
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:362
canBeEmpty
▸ canBeEmpty(): boolean
Returns
boolean
Inherited from
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:555
canIndent
▸ canIndent(): boolean
Returns
boolean
Inherited from
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:533
canInsertTextAfter
▸ canInsertTextAfter(): boolean
Returns
boolean
Inherited from
ElementNode.canInsertTextAfter
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:561
canInsertTextBefore
▸ canInsertTextBefore(): boolean
Returns
boolean
Inherited from
ElementNode.canInsertTextBefore
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:558
canMergeWhenEmpty
▸ canMergeWhenEmpty(): boolean
Determines whether this node, when empty, can merge with a first block of nodes being inserted.
This method is specifically called in RangeSelection.insertNodes to determine merging behavior during nodes insertion.
Returns
boolean
Example
// In a ListItemNode or QuoteNode implementation:
canMergeWhenEmpty(): true {
return true;
}
Inherited from
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:599
clear
▸ clear(): this
Returns
this
Inherited from
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:356
collapseAtStart
▸ collapseAtStart(selection
): boolean
Parameters
Name | Type |
---|---|
selection | RangeSelection |
Returns
boolean
Inherited from
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:541
createDOM
▸ createDOM(config
): HTMLElement
Called during the reconciliation process to determine which nodes to insert into the DOM for this Lexical Node.
This method must return exactly one HTMLElement. Nested elements are not supported.
Do not attempt to update the Lexical EditorState during this phase of the update lifecyle.
Parameters
Name | Type | Description |
---|---|---|
config | EditorConfig | allows access to things like the EditorTheme (to apply classes) during reconciliation. |
Returns
HTMLElement
Overrides
Defined in
packages/lexical/src/nodes/ArtificialNode.ts:18
createParentElementNode
▸ createParentElementNode(): ElementNode
The creation logic for any required parent. Should be implemented if isParentRequired returns true.
Returns
Inherited from
ElementNode.createParentElementNode
Defined in
packages/lexical/src/LexicalNode.ts:1037
excludeFromCopy
▸ excludeFromCopy(destination?
): boolean
Parameters
Name | Type |
---|---|
destination? | "clone" | "html" |
Returns
boolean
Inherited from
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:544
exportDOM
▸ exportDOM(editor
): DOMExportOutput
Controls how the this node is serialized to HTML. This is important for copy and paste between Lexical and non-Lexical editors, or Lexical editors with different namespaces, in which case the primary transfer format is HTML. It's also important if you're serializing to HTML for any other reason via $generateHtmlFromNodes. You could also use this method to build your own HTML renderer.
Parameters
Name | Type |
---|---|
editor | LexicalEditor |
Returns
Inherited from
Defined in
packages/lexical/src/LexicalNode.ts:788
exportJSON
▸ exportJSON(): SerializedElementNode
<SerializedLexicalNode
>
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
SerializedElementNode
<SerializedLexicalNode
>
Inherited from
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:516
extractWithChild
▸ extractWithChild(child
, selection
, destination
): boolean
Parameters
Name | Type |
---|---|
child | LexicalNode |
selection | null | BaseSelection |
destination | "clone" | "html" |
Returns
boolean
Inherited from
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:578
getAllTextNodes
▸ getAllTextNodes(): TextNode
[]
Returns
TextNode
[]
Inherited from
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:147
getChildAtIndex
▸ getChildAtIndex<T
>(index
): null
| T
Type parameters
Name | Type |
---|---|
T | extends LexicalNode |
Parameters
Name | Type |
---|---|
index | number |
Returns
null
| T
Inherited from
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:228
getChildren
▸ getChildren<T
>(): T
[]
Type parameters
Name | Type |
---|---|
T | extends LexicalNode |
Returns
T
[]
Inherited from
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:112
getChildrenKeys
▸ getChildrenKeys(): string
[]
Returns
string
[]
Inherited from
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:121
getChildrenSize
▸ getChildrenSize(): number
Returns
number
Inherited from
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:130
getCommonAncestor
▸ getCommonAncestor<T
>(node
): null
| T
Returns the closest common ancestor of this node and the provided one or null if one cannot be found.
Type parameters
Name | Type |
---|---|
T | extends ElementNode = ElementNode |
Parameters
Name | Type | Description |
---|---|---|
node | LexicalNode | the other node to find the common ancestor of. |
Returns
null
| T
Inherited from
Defined in
packages/lexical/src/LexicalNode.ts:497
getDescendantByIndex
▸ getDescendantByIndex<T
>(index
): null
| T
Type parameters
Name | Type |
---|---|
T | extends LexicalNode |
Parameters
Name | Type |
---|---|
index | number |
Returns
null
| T
Inherited from
ElementNode.getDescendantByIndex
Defined in
packages/lexical/src/nodes/LexicalElementNode.ts:184