improve types

This commit is contained in:
Philipp Kühn
2021-06-04 22:58:50 +02:00
parent 3e6d3dca1f
commit 8e29b5f854
2 changed files with 4 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
import { Command, RawCommands } from '../types' import { Command, CommandProps, RawCommands } from '../types'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {
@@ -6,7 +6,7 @@ declare module '@tiptap/core' {
/** /**
* Runs one command after the other and stops at the first which returns true. * Runs one command after the other and stops at the first which returns true.
*/ */
first: (commands: Command[] | ((props: Parameters<Command>[0]) => Command[])) => ReturnType, first: (commands: Command[] | ((props: CommandProps) => Command[])) => ReturnType,
} }
} }
} }

View File

@@ -1,4 +1,4 @@
import { Command, RawCommands } from '../types' import { CommandProps, RawCommands } from '../types'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {
@@ -10,7 +10,7 @@ declare module '@tiptap/core' {
items: T[], items: T[],
fn: ( fn: (
item: T, item: T,
props: Parameters<Command>[0] & { props: CommandProps & {
index: number, index: number,
}, },
) => boolean, ) => boolean,