@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) • 775 B
TypeScript
import { IImageOptions } from "docx";
import { IDefaultImagePluginOptions } from ".";
/**
* Determines the MIME type of an image buffer using file signature detection.
*
* @param buffer - Binary image data as a Buffer or ArrayBuffer.
* @returns Detected MIME type, or `undefined` if unknown.
*/
export declare const getImageMimeType: (buffer: Buffer | ArrayBuffer) => "bmp" | "png" | "jpg" | "gif" | undefined;
/**
* Generates and returns a placeholder image.
* If a placeholder source is defined, attempts to resolve it; otherwise returns an empty fallback.
*
* @param options - Image plugin configuration.
* @returns Image options for the placeholder.
*/
export declare const getPlaceHolderImage: (options: IDefaultImagePluginOptions) => Promise<IImageOptions>;