From 894b74bfae93d4013698d5a0f7721057f4d54cc4 Mon Sep 17 00:00:00 2001 From: Dominik Biedebach Date: Fri, 11 Oct 2024 09:56:08 +0200 Subject: [PATCH] added onNodeRemoved to extensions --- packages/core/src/Extension.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/packages/core/src/Extension.ts b/packages/core/src/Extension.ts index a4f98853c..127a0c823 100644 --- a/packages/core/src/Extension.ts +++ b/packages/core/src/Extension.ts @@ -345,6 +345,27 @@ declare module '@tiptap/core' { ) => void) | null + /** + * A node has been removed from the document. + */ + onNodeRemoved?: + | (( + this: { + name: string + options: Options + storage: Storage + editor: Editor + parent: ParentConfig>['onNodeRemoved'] + }, + props: { + editor: Editor + transaction: Transaction + node: Node + range: { from: number; to: number } + }, + ) => void) + | null + /** * The editor is focused. */