import type { Editor } from '../../externals.js'; /** * The plain-object shape of a Tiptap/ProseMirror mark, suitable for passing to * `insertContent` JSON. Distinct from the runtime `Mark` instance, which carries * a `MarkType` reference and can't be inserted directly. */ export type UmbTiptapMarkInput = { type: string; attrs?: Record; }; /** * Data extracted from a `figure` enclosing the current selection: the inner * image's attributes and marks, the figcaption text (if any), and the figure's * document position so callers can replace it via `setNodeSelection` / `insertContent`. */ export type UmbFigureImageData = { imageAttrs: Record; caption?: string; pos: number; marks: Array; }; /** * Reads the marks (e.g. `umbLink`) off the selected image node. When the * selection is on a container that wraps an image (e.g. a `figure`, which is * atomic and can't be selected through), drills in to find the inner image's * marks. Returns an empty array when no image is reachable. * @param {unknown} selection The current editor selection. * @returns {Array} The marks on the image, or an empty array. */ export declare function extractImageMarks(selection: unknown): Array; /** * Reads the wrapping `figure` node's attributes from the current selection, so * they can be re-applied when the figure is rebuilt. * @param {Editor} editor The Tiptap editor instance. * @returns {Record | undefined} The figure's attrs, or `undefined` if no figure surrounds the selection. */ export declare function extractFigureAttrs(editor: Editor): Record | undefined; /** * Locates the `figure` that surrounds the current selection and pulls out the * inner image's attributes and marks, the figcaption text, and the figure's * document position so callers can replace it. * @param {Editor} editor The Tiptap editor instance. * @returns {UmbFigureImageData | undefined} The figure data, or `undefined` if no figure surrounds the selection or it contains no image with a `data-udi`. */ export declare function extractFigureImageData(editor: Editor): UmbFigureImageData | undefined;