add generic to commands type

This commit is contained in:
Philipp Kühn
2021-06-04 21:56:29 +02:00
parent af91b811bf
commit 78e2a6e775
75 changed files with 258 additions and 272 deletions

View File

@@ -1,5 +1,4 @@
import {
Command,
Mark,
markPasteRule,
mergeAttributes,
@@ -22,20 +21,20 @@ export interface LinkOptions {
}
declare module '@tiptap/core' {
interface Commands {
interface Commands<ReturnType> {
link: {
/**
* Set a link mark
*/
setLink: (attributes: { href: string, target?: string }) => Command,
setLink: (attributes: { href: string, target?: string }) => ReturnType,
/**
* Toggle a link mark
*/
toggleLink: (attributes: { href: string, target?: string }) => Command,
toggleLink: (attributes: { href: string, target?: string }) => ReturnType,
/**
* Unset a link mark
*/
unsetLink: () => Command,
unsetLink: () => ReturnType,
}
}
}