From 8e29b5f8543a4c2b709d5a2068a1105af6b901ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Fri, 4 Jun 2021 22:58:50 +0200 Subject: [PATCH] improve types --- packages/core/src/commands/first.ts | 4 ++-- packages/core/src/commands/forEach.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/core/src/commands/first.ts b/packages/core/src/commands/first.ts index fe4f27b6..6bd33368 100644 --- a/packages/core/src/commands/first.ts +++ b/packages/core/src/commands/first.ts @@ -1,4 +1,4 @@ -import { Command, RawCommands } from '../types' +import { Command, CommandProps, RawCommands } from '../types' declare module '@tiptap/core' { interface Commands { @@ -6,7 +6,7 @@ declare module '@tiptap/core' { /** * Runs one command after the other and stops at the first which returns true. */ - first: (commands: Command[] | ((props: Parameters[0]) => Command[])) => ReturnType, + first: (commands: Command[] | ((props: CommandProps) => Command[])) => ReturnType, } } } diff --git a/packages/core/src/commands/forEach.ts b/packages/core/src/commands/forEach.ts index 5b383ac0..5d95b40e 100644 --- a/packages/core/src/commands/forEach.ts +++ b/packages/core/src/commands/forEach.ts @@ -1,4 +1,4 @@ -import { Command, RawCommands } from '../types' +import { CommandProps, RawCommands } from '../types' declare module '@tiptap/core' { interface Commands { @@ -10,7 +10,7 @@ declare module '@tiptap/core' { items: T[], fn: ( item: T, - props: Parameters[0] & { + props: CommandProps & { index: number, }, ) => boolean,