Skip to content
GitHub

Image

The image node is used to represent images in the document.

import { defineImagefunction defineImage(): ImageExtension
@public
} from 'prosekit/extensions/image'
const extensionconst extension: ImageExtension = defineImagefunction defineImage(): ImageExtension
@public
()
editorconst 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`.
({ srcImageAttrs.src?: string | null | undefined: 'https://placehold.co/400' })