refactoring

This commit is contained in:
Philipp Kühn
2021-02-10 18:05:02 +01:00
parent f70974678b
commit 55ff908423
69 changed files with 519 additions and 527 deletions

View File

@@ -14,6 +14,9 @@ export interface ImageOptions {
declare module '@tiptap/core' {
interface Commands {
/**
* Add an image
*/
setImage: (options: { src: string, alt?: string, title?: string }) => Command,
}
}
@@ -66,9 +69,6 @@ export const Image = Node.create({
addCommands() {
return {
/**
* Add an image
*/
setImage: options => ({ tr, dispatch }) => {
const { selection } = tr
const node = this.type.create(options)