import { DocumentWriter, WriteResult } from '../core/ir/adapters.js'; import { FlowDoc } from '../core/ir/flow.js'; /** Options for {@link writeMarkdown}. */ export interface MarkdownWriteOptions { /** * How a picture reaches the output. `'dataUri'` (the default) inlines the * bytes as a `data:` URI, keeping the single-blob {@link WriteResult} * contract and the zero-I/O promise; `'link'` emits a relative * `./media/…` path and records that the bytes were not written anywhere; * `'drop'` omits pictures entirely. */ readonly images?: 'dataUri' | 'link' | 'drop'; /** * What a page break becomes. `'drop'` (the default) leaves it out and * reports it: a paginated document breaks its pages wherever the layout * needs to, and a rule at every one of them would litter the text. `'rule'` * writes a `---` thematic break instead, which is what a SLIDE DECK wants — * the `.pptx` and `.ppt` readers mark each slide boundary with a page break, * and it is the only structure a deck has. */ readonly pageBreaks?: 'rule' | 'drop'; } /** * Render a {@link FlowDoc} to GitHub-Flavored Markdown (ir-design §7). * * A flow medium: no pagination, no layout engine and no fonts, so this is a * pure, zero-I/O transform. Markdown says far less than the document model * does — alignment, indents, colour, font metrics, tab stops and page * geometry have no expression at all — so those are dropped and reported as * {@link Loss} entries, deduplicated so one recurring omission reports once. * * @param flow The format-neutral interlayer document tree. * @param options Picture handling; see {@link MarkdownWriteOptions}. * @returns The encoded Markdown bytes plus the recorded {@link Loss} list. */ export declare function writeMarkdown(flow: FlowDoc, options?: MarkdownWriteOptions): WriteResult; /** * The flow-medium {@link DocumentWriter} adapter (id `'md'`), wrapping * {@link writeMarkdown}, with the set of {@link FEATURES} it renders. */ export declare const markdownWriter: DocumentWriter;