tiptap: fix type

This commit is contained in:
fantasticit 2022-06-05 00:03:20 +08:00
parent a589db9978
commit 7e46e7ba65
3 changed files with 2 additions and 4 deletions

View File

@ -7,7 +7,7 @@ const resolveImageEl = (element) => (element.nodeName === 'IMG' ? element : elem
declare module '@tiptap/core' {
interface Commands<ReturnType> {
iamge: {
setEmptyImage: () => ReturnType;
setEmptyImage: (arg: { width?: number | string }) => ReturnType;
};
}
}

View File

@ -11,7 +11,7 @@ const DEFAULT_MIND_DATA = {
};
export interface IMindAttrs {
width?: number;
width?: number | string;
height?: number;
data?: Record<string, unknown>;
template?: string;

View File

@ -91,7 +91,6 @@ export const COMMANDS: ICommand[] = [
{
icon: <IconImage />,
label: '图片',
// @ts-ignore
action: (editor) => editor.chain().focus().setEmptyImage({ width: '100%' }).run(),
},
{
@ -123,7 +122,6 @@ export const COMMANDS: ICommand[] = [
icon: <IconMind />,
label: '思维导图',
action: (editor) => {
// @ts-ignore
editor.chain().focus().setMind({ width: '100%' }).run();
},
},