import type { Result } from '../../domain/result.js'; import type { GraphClient, GraphError } from '../../infra/graph-client.js'; import { type InlineAttachment } from './inline-image-embedder.js'; /** * Orchestrate the four steps that turn a Graph `?format=html` content * call into a markdown envelope: * * 1. getBinary(contentPath) * 2. if Graph returned a 302 downloadUrl, follow via fetchUrl (host * allow-list enforced inside fetchUrl, Hardening #3) * 3. embedInlineImages over any cid: refs (Hardening #1: image/* only) * 4. htmlToMarkdown via turndown * * Returns `{ contentType: 'text/markdown', size, text }` on success. */ type MarkdownEnvelope = { readonly contentType: 'text/markdown'; readonly size: number; readonly text: string; }; declare const convertToMarkdown: (graph: GraphClient, contentPath: string, inlineAttachments?: ReadonlyArray) => Promise>; export { convertToMarkdown }; export type { MarkdownEnvelope };