From bccb3c02cbd3e01f75fd9457882e54066999a9a5 Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Tue, 21 May 2024 18:35:40 +0300 Subject: [PATCH] Deprecate unused methods on ElementNode (#5782) --- packages/lexical-list/src/LexicalListItemNode.ts | 2 ++ packages/lexical/src/nodes/LexicalElementNode.ts | 3 +++ 2 files changed, 5 insertions(+) diff --git a/packages/lexical-list/src/LexicalListItemNode.ts b/packages/lexical-list/src/LexicalListItemNode.ts index c63f24653ea..f593a5cf321 100644 --- a/packages/lexical-list/src/LexicalListItemNode.ts +++ b/packages/lexical-list/src/LexicalListItemNode.ts @@ -369,10 +369,12 @@ export class ListItemNode extends ElementNode { return this; } + /** @deprecated @internal */ canInsertAfter(node: LexicalNode): boolean { return $isListItemNode(node); } + /** @deprecated @internal */ canReplaceWith(replacement: LexicalNode): boolean { return $isListItemNode(replacement); } diff --git a/packages/lexical/src/nodes/LexicalElementNode.ts b/packages/lexical/src/nodes/LexicalElementNode.ts index 2a521ab5f4e..2707fb318de 100644 --- a/packages/lexical/src/nodes/LexicalElementNode.ts +++ b/packages/lexical/src/nodes/LexicalElementNode.ts @@ -525,9 +525,11 @@ export class ElementNode extends LexicalNode { excludeFromCopy(destination?: 'clone' | 'html'): boolean { return false; } + /** @deprecated @internal */ canReplaceWith(replacement: LexicalNode): boolean { return true; } + /** @deprecated @internal */ canInsertAfter(node: LexicalNode): boolean { return true; } @@ -550,6 +552,7 @@ export class ElementNode extends LexicalNode { isShadowRoot(): boolean { return false; } + /** @deprecated @internal */ canMergeWith(node: ElementNode): boolean { return false; }