import { VFile } from "vfile"; import * as vscode from "vscode"; import { CodeChunkData } from "./code-chunk-data"; import { MarkdownEngineConfig } from "./markdown-engine-config"; export interface MarkdownEngineRenderOption { useRelativeFilePath: boolean; isForPreview: boolean; hideFrontMatter: boolean; triggeredBySave?: boolean; runAllCodeChunks?: boolean; emojiToSvg?: boolean; vscodePreviewPanel?: vscode.WebviewPanel; fileDirectoryPath?: string; } export interface MarkdownEngineOutput { html: string; markdown: string; tocHTML: string; yamlConfig: any; /** * imported javascript and css files * convert .js file to * convert .css file to */ JSAndCssFiles: string[]; } export interface HTMLTemplateOption { /** * whether is for print. */ isForPrint: boolean; /** * whether is for prince export. */ isForPrince: boolean; /** * whether for offline use */ offline: boolean; /** * whether to embed local images as base64 */ embedLocalImages: boolean; /** * whether to embed svg images */ embedSVG?: boolean; } /** * The markdown engine that can be used to parse markdown and export files */ export declare class MarkdownEngine { /** * Modify markdown source, append `result` after corresponding code chunk. * @param codeChunkData * @param result */ static modifySource(codeChunkData: CodeChunkData, result: string, filePath: string): Promise; /** * Bind cb to MODIFY_SOURCE * @param cb */ static onModifySource(cb: (codeChunkData: CodeChunkData, result: string, filePath: string) => Promise): void; static updateLintingReport(vFiles: VFile[]): Promise; static onUpdateLintingReport(cb: (vFiles: VFile[]) => void): void; /** * markdown file path */ private readonly filePath; private readonly fileDirectoryPath; private readonly projectDirectoryPath; private originalConfig; private config; private breakOnSingleNewLine; private enableTypographer; private enableLinkify; private protocolsWhiteListRegExp; private headings; private tocHTML; private md; /** * Dirty variable just made for VSCode preview. */ private vscodePreviewPanel; private graphsCache; private litvisEnhancerCache; private codeChunksData; private filesCache; /** * cachedHTML is the cache of html generated from the markdown file. */ /** * Check whether the preview is in presentation mode. */ isPreviewInPresentationMode: boolean; constructor(args: { /** * The markdown file path. */ filePath: string; /** * The project directory path. */ projectDirectoryPath: string; /** * Markdown Engine configuration. */ config?: MarkdownEngineConfig; }); /** * Reset config */ resetConfig(): void; /** * Set default values */ private initConfig; interpolateConfig(config: MarkdownEngineConfig, projectDirectoryPath: string): void; updateConfiguration(config: any): void; cacheCodeChunkResult(id: string, result: string): void; /** * Generate scripts string for preview usage. */ generateScriptsForPreview(isForPresentation?: boolean, yamlConfig?: {}, vscodePreviewPanel?: vscode.WebviewPanel): string; /** * Map preview theme to prism theme. */ private static AutoPrismThemeMap; private static AutoPrismThemeMapForPresentation; /** * Automatically pick code block theme for preview. */ private getPrismTheme; /** * Generate styles string for preview usage. */ generateStylesForPreview(isPresentationMode?: boolean, yamlConfig?: {}, vscodePreviewPanel?: vscode.WebviewPanel): string; /** * Generate