import { DecorationSet, EditorView } from "prosemirror-view"; import { Node as PMNode } from "prosemirror-model"; import { EditorState, StateField } from "prosemirror-state"; export type ImagePluginState = DecorationSet; export interface InsertImagePlaceholder { type: "add"; pos: number; id: unknown; previewSrc?: string; } export interface RemoveImagePlaceholder { type: "remove"; id: unknown; } export type ImagePluginAction = InsertImagePlaceholder | RemoveImagePlaceholder; export type ImagePlaceholderObject = { src?: string; className?: string; }; export interface ImagePluginSettings { downloadImage?: (url: string) => Promise; downloadPlaceholder?: (url: string, view: EditorView) => string | ImagePlaceholderObject; uploadFile: (file: File) => Promise; deleteSrc: (src: string) => Promise; hasTitle: boolean; extraAttributes: Record; createOverlay: (node: PMNode, getPos: () => number | undefined, view: EditorView) => Node | undefined; updateOverlay: (overlayRoot: Node, getPos: () => number | undefined, view: EditorView, node: PMNode) => void; defaultTitle: string; defaultAlt: string; enableResize: boolean; isBlock: boolean; resizeCallback: (el: Element, updateCallback: () => void) => () => void; imageMargin: number; minSize: number; maxSize: number; scaleImage: boolean; showPreviewDuringUpload?: boolean; createState: (pluginSettings: ImagePluginSettings) => StateField; createDecorations: (state: EditorState) => DecorationSet; findPlaceholder: (state: EditorState, id: object) => number | undefined; } export declare enum imageAlign { left = "left", right = "right", center = "center", fullWidth = "fullWidth" } export declare enum resizeDirection { top = "top", topRight = "topRight", right = "right", bottomRight = "bottomRight", bottom = "bottom", bottomLeft = "bottomLeft", left = "left", topLeft = "topLeft" } export declare enum imagePluginClassNames { imageResizeBoxWrapper = "imageResizeBoxWrapper", imageResizeBoxCenter = "imageResizeBoxCenter", imageResizeBox = "imageResizeBox", imageResizeBoxControl = "imageResizeBoxControl", imagePluginRoot = "imagePluginRoot", imagePluginImg = "imagePluginImg" } //# sourceMappingURL=types.d.ts.map