UNPKG

@diplodoc/transform

Version:

A simple transformer of text in YFM (Yandex Flavored Markdown) to HTML

28 lines (27 loc) 1.01 kB
import type { MarkdownItPluginCb, MarkdownItPluginOpts } from '../typings'; import type { ImageOptions, StateCore } from '../../typings'; interface ImageOpts extends MarkdownItPluginOpts { assetsPublicPath: string; inlineSvg?: boolean; } interface InlineOptions { enabled: boolean; maxFileSize: number; } interface SVGOpts extends MarkdownItPluginOpts { notFoundCb: (s: string) => void; imageOpts: ImageOptions; svgInline: InlineOptions; } declare type Opts = SVGOpts & ImageOpts & { rawContent: (path: string) => string; calcPath: (root: string, path: string) => string; replaceImageSrc: (state: StateCore, currentPath: string, path: string, imgSrc: string, opts: ImageOpts) => string; file: string; }; declare const index: MarkdownItPluginCb<Opts>; declare function replaceSvgContent(content: string | null, options: ImageOptions): string; declare const imagesPlugin: typeof index & { replaceSvgContent: typeof replaceSvgContent; }; export = imagesPlugin;