add Commands interface

This commit is contained in:
Philipp Kühn
2021-02-10 09:59:35 +01:00
parent 0ed368e9f4
commit 290ff76e37
100 changed files with 695 additions and 487 deletions

View File

@@ -6,6 +6,12 @@ export interface ParagraphOptions {
},
}
declare module '@tiptap/core' {
interface Commands {
setParagraph: () => Command,
}
}
export const Paragraph = Node.create({
name: 'paragraph',
@@ -32,7 +38,7 @@ export const Paragraph = Node.create({
/**
* Toggle a paragraph
*/
setParagraph: (): Command => ({ commands }) => {
setParagraph: () => ({ commands }) => {
return commands.toggleNode('paragraph', 'paragraph')
},
}
@@ -44,9 +50,3 @@ export const Paragraph = Node.create({
}
},
})
declare module '@tiptap/core' {
interface AllExtensions {
Paragraph: typeof Paragraph,
}
}