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' {
|
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,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user