improve types
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Command, RawCommands } from '../types'
|
||||
import { Command, CommandProps, RawCommands } from '../types'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
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.
|
||||
*/
|
||||
first: (commands: Command[] | ((props: Parameters<Command>[0]) => Command[])) => ReturnType,
|
||||
first: (commands: Command[] | ((props: CommandProps) => Command[])) => ReturnType,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Command, RawCommands } from '../types'
|
||||
import { CommandProps, RawCommands } from '../types'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
@@ -10,7 +10,7 @@ declare module '@tiptap/core' {
|
||||
items: T[],
|
||||
fn: (
|
||||
item: T,
|
||||
props: Parameters<Command>[0] & {
|
||||
props: CommandProps & {
|
||||
index: number,
|
||||
},
|
||||
) => boolean,
|
||||
|
||||
Reference in New Issue
Block a user