@mdast2docx/image
Version:
MDAST to DOCX plugin for resolving and embedding images. Supports base64, URLs, and custom resolvers for seamless DOCX image integration.
18 lines (17 loc) • 690 B
TypeScript
import type { IImageOptions } from "docx";
import { IDefaultImagePluginOptions } from ".";
import { SVG } from "@m2d/core";
/**
* Applies generic fixes to known SVG rendering issues (e.g., Mermaid pie chart title alignment).
* Designed to be overridden to handle tool-specific quirks in generated SVGs.
*
* @param svg - Raw SVG string to transform.
* @returns Modified SVG string.
*/
export declare const fixGeneratedSvg: (svg: string, metadata: {
diagramType: string;
}) => string;
/**
* Converts SVG into fallback raster image (PNG/JPG/etc.) for DOCX insertion.
*/
export declare const handleSvg: (svgNode: SVG, options: IDefaultImagePluginOptions) => Promise<IImageOptions>;