import { Slice, Node as PMNode, Schema } from '@milkdown/kit/prose/model'; import { Plugin } from '@milkdown/kit/prose/state'; import { Root } from 'mdast'; /** * Walks the markdown AST after `remark-image-block` has run. Any `image-block` sitting directly * under a `tableCell` is converted to a single paragraph containing one standard `image` node, * which matches what GFM table cell parsers expect. */ export declare function revertImageBlocksToInlineInTableCells(tree: Root): void; /** * Builds a ProseMirror inline `image` node (commonmark) for use inside a table cell paragraph. * Block `image-block` uses `caption`; inline `image` uses `alt` for accessibility text. */ export declare function createCellImageNode(schema: Schema, src: string, alt: string, title?: string): PMNode | null; /** Milkdown `parserCtx` return type for markdown/plain clipboard pastes. */ export type ClipboardMarkdownParser = (text: string) => PMNode | string | null | undefined; /** * Returns true if the pasted slice contains at least one `image-block` node anywhere in its tree. */ export declare function sliceContainsImageBlock(slice: Slice): boolean; /** * Recursively replaces `image-block` nodes with inline `image` nodes, preserving all other structure. * Used so a cut `image-block` becomes pastable content for a cell (which cannot host block images). */ export declare function mapImageBlocksToInlineImages(schema: Schema, node: PMNode): PMNode; /** * If the slice contains any `image-block`, returns a new slice with those mapped to inline `image`; * otherwise returns the original slice (same reference). */ export declare function inlineImageBlocksInSlice(schema: Schema, slice: Slice): Slice; /** * ProseMirror plugin: when the user pastes into a table cell and the clipboard slice contains * `image-block` nodes (e.g. cut from elsewhere in the doc), rewrite them to inline `image` so the * insert is schema-valid. */ export declare function createTableCellImageTransformPlugin(): Plugin; /** * Builds the same {@link Slice} Crepe’s Milkdown clipboard `handlePaste` builds from `text/plain` * / `text/html` (see `@milkdown/plugin-clipboard`). Returns `null` when that path would bail early. */ export declare function buildMilkdownClipboardPasteSlice(schema: Schema, parser: ClipboardMarkdownParser, clipboardData: Pick): Slice | null; /** * Prepends (via Milkdown `prosePluginsCtx`) so this runs before Crepe’s clipboard `handlePaste`. * Only intercepts pastes that would insert an `image-block` while the cursor is in a table cell. * This plugin only intercept pastes if `true` is returned from this function. */ export declare function createTableCellImagePasteProsePlugin(options: { getParser: () => ClipboardMarkdownParser; getSchema: () => Schema; }): Plugin;