/** * HTML → clean markdown via Readability (main-content extraction) + * Turndown (HTML → markdown). * * The library backing the `read` command. * * linkedom, @mozilla/readability, and turndown are heavy, so they are loaded * lazily inside `htmlToMarkdown` rather than at module top level. A static * import would pull them into CLI startup (every command is registered * eagerly). linkedom replaced jsdom here: jsdom's transitive dependency tree * (`html-encoding-sniffer`, `whatwg-url`) does a CommonJS `require()` of the * ESM-only `@exodus/bytes`, which crashes a plain `node` process via * ERR_REQUIRE_ESM. linkedom is a lighter, CJS-friendly DOM with no such chain. * See ADR 0002. */ export interface ReadabilityOptions { /** Base URL for resolving relative links. Default `http://local/`. */ url?: string; /** CSS selector for content. Bypasses Readability when set. */ selector?: string; /** Truncate output to N chars (0 = no limit). Default 100000. */ maxChars?: number; /** Return cleaned HTML instead of markdown (debugging). */ raw?: boolean; } export interface ReadabilityResult { /** Final output: markdown or cleaned HTML when `raw: true`. */ output: string; /** Pre-truncation length so callers can report what was dropped. */ rawLength: number; /** Article title from Readability (`null` when --selector is used). */ title: string | null; } /** * Convert raw HTML to clean markdown. * * Throws if input is empty, the selector matches nothing, or Readability * fails to find a main article (caller should retry with `selector`). */ export declare function htmlToMarkdown(html: string, opts?: ReadabilityOptions): Promise; //# sourceMappingURL=client.d.ts.map