import type { App } from '@vitebook/core/node'; import type MarkdownIt from 'markdown-it'; import { MarkdownFrontmatter, MarkdownHeader, MarkdownLinks, MarkdownPageMeta } from '../../shared'; import type { AnchorPluginOptions, CodePluginOptions, CustomComponentPluginOptions, EmojiPluginOptions, ExtractHeadersPluginOptions, ImportCodePluginOptions, LinksPluginOptions, TocPluginOptions } from './plugins'; export declare type MarkdownParser = MarkdownIt; export declare type MarkdownParserOptions = MarkdownIt.Options & { anchor?: false | AnchorPluginOptions; code?: false | CodePluginOptions; customContainers?: false; customComponent?: false | CustomComponentPluginOptions; emoji?: false | EmojiPluginOptions; extractHeaders?: false | ExtractHeadersPluginOptions; extractTitle?: false; importCode?: false | ImportCodePluginOptions; links?: false | LinksPluginOptions; toc?: false | TocPluginOptions; configureParser?(parser: MarkdownParser): void | Promise; }; export declare type ParseMarkdownOptions = { escapeConstants?: boolean; define?: Record; }; export declare type ParsedMarkdownResult = { content: string; meta: Meta; html: string; links: MarkdownLinks; importedFiles: string[]; env: MarkdownParserEnv; }; /** * Metadata provided to markdown parser. */ export declare type MarkdownParserEnvInput = { /** Server application context. */ app?: App; /** Absolute system file path of the markdown file. */ filePath?: string | null; /** Frontmatter of the markdown file. */ frontmatter?: MarkdownFrontmatter; }; /** * Resources extracted from markdown parser. */ export declare type MarkdownParserEnvOutput = { /** Headers that are extracted by `extractHeadersPlugin`. */ headers?: MarkdownHeader[]; /** Imported files that are extracted by `importCodePlugin`. */ importedFiles?: string[]; /** Links that are extracted by `linksPlugin`. */ links?: MarkdownLinks; /** Title that is extracted by `extractTitlePlugin`. */ title?: string; }; /** * The `env` object to be passed to `markdown-it` render function. */ export declare type MarkdownParserEnv = MarkdownParserEnvInput & MarkdownParserEnvOutput; //# sourceMappingURL=types.d.ts.map