import type { Options as TurndownOptions } from "turndown"; /** Raised when one of the optional extraction dependencies is not installed. */ export declare class ExtractorUnavailable extends Error { constructor(message: string); } interface LinkedomModule { parseHTML(html: string): { document: Document; }; } interface ReadabilityArticle { title?: string | null; content?: string | null; textContent?: string | null; length?: number | null; } interface ReadabilityModule { Readability: new (doc: Document, options?: { charThreshold?: number; }) => { parse(): ReadabilityArticle | null; }; } interface TurndownInstance { turndown(html: string): string; use(plugin: unknown): TurndownInstance; addRule(key: string, rule: unknown): TurndownInstance; remove(filter: string | string[]): TurndownInstance; } interface TurndownModule { default: new (options?: TurndownOptions) => TurndownInstance; } interface ExtractorModules { parseHTML: LinkedomModule["parseHTML"]; Readability: ReadabilityModule["Readability"]; TurndownService: TurndownModule["default"]; gfm: unknown; } /** * Lazily resolve the HTML→Markdown extraction stack (linkedom, Readability, * Turndown + GFM plugin). Mirrors `loadChromium()` in screenshot.ts: dynamic * imports behind a non-literal specifier so `tsc` does not statically require * the optional dependencies, with results cached. Throws `ExtractorUnavailable` * if any are missing so callers can degrade to the regex path. */ export declare function loadExtractor(): Promise; /** * Run Readability over the page HTML and convert the extracted main content to * clean Markdown (headings, lists, GFM tables, fenced code preserved). Returns * `null` when extraction fails or the article is too short, so the caller can * fall back to `htmlToCleanText`. */ export declare function extractToMarkdown(html: string, url: string): Promise<{ markdown: string; title?: string; } | null>; export {}; //# sourceMappingURL=html-extract.d.ts.map