import { ReactNodeViewProps } from "@tiptap/react"; //#region src/extensions/rich-text/rich-text-image.d.ts /** * The properties that describe `RichTextImage` node attributes. */ type RichTextImageAttributes = { /** * Additional metadata about an image attachment upload. */ metadata?: { /** * A unique ID for the image attachment. */ attachmentId: string; /** * Specifies if the image attachment failed to upload. */ isUploadFailed: boolean; /** * The upload progress for the image attachment. */ uploadProgress: number; }; } & Pick & Pick, 'alt' | 'title'>; /** * Augment the official `@tiptap/core` module with extra commands, relevant for this extension, so * that the compiler knows about them. */ declare module '@tiptap/core' { interface Commands { richTextImage: { /** * Inserts an image into the editor with the given attributes. */ insertImage: (attributes: RichTextImageAttributes) => ReturnType; /** * Updates the attributes for an existing image in the editor. */ updateImage: (attributes: Partial & Required>) => ReturnType; }; } } /** * The options available to customize the `RichTextImage` extension. */ type RichTextImageOptions = { /** * A list of accepted MIME types for images pasting. */ acceptedImageMimeTypes: string[]; /** * Renders the image node inline (e.g.,

). By default images are on * the same level as paragraphs. */ inline: boolean; /** * Custom HTML attributes that should be added to the rendered HTML tag. */ HTMLAttributes: Record; /** * A React component to render inside the interactive node view. */ NodeViewComponent?: React.ComponentType; /** * The event handler that is fired when an image file is pasted. */ onImageFilePaste?: (file: File) => void; }; /** * Custom extension that extends the built-in `Image` extension to add support for image pasting, * and also adds the ability to pass aditional metadata about an image attachment upload. */ //#endregion export { type RichTextImageAttributes, type RichTextImageOptions }; //# sourceMappingURL=rich-text-image.d.ts.map