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

@@ -7,6 +7,12 @@ export interface IframeOptions {
},
}
declare module '@tiptap/core' {
interface Commands {
setIframe: (options: { src: string }) => Command,
}
}
export default Node.create({
name: 'iframe',
@@ -55,7 +61,7 @@ export default Node.create({
/**
* Add an iframe
*/
setIframe: (options: { src: string }): Command => ({ tr, dispatch }) => {
setIframe: (options: { src: string }) => ({ tr, dispatch }) => {
const { selection } = tr
const node = this.type.create(options)