Image
The image
node is used to represent images in the document.
import { defineImage function defineImage(): ImageExtension
} from 'prosekit/extensions/image'
const extension const extension: ImageExtension
= defineImage function defineImage(): ImageExtension
()
Commands
Section titled “Commands”insertImage
Section titled “insertImage”editor const editor: Editor<ImageExtension>
.commands Editor<ImageExtension>.commands: ToCommandAction<{
insertImage: [attrs?: ImageAttrs];
}>
All
{@link
CommandAction
}
s defined by the editor. .insertImage insertImage: CommandAction
(attrs?: ImageAttrs | undefined) => boolean
Execute the current command. Return `true` if the command was successfully
executed, otherwise `false`. ({ src ImageAttrs.src?: string | null | undefined
: 'https://placehold.co/400' })