import { CheerioAPI } from 'cheerio'; interface GetHtmlOptions { /** If true, returns raw HTML without cleaning. Default: false (cleaned). */ raw?: boolean; } declare class Unquote { private originalHtml; private originalText; private _html; private _cleanHtml; private _text; private _markdown; private _quoteHtml; private _parsed; private _cachedCheerio; constructor(html: string | null, text: string | null); /** * Get cached Cheerio instance, creating it on first access */ private getCheerio; /** * Capture HTML of elements before removing them and store as quote */ private captureAndRemove; /** * Get the HTML content without quoted replies. * @param options.raw - If true, returns raw HTML. Default: false (cleaned). */ getHtml(options?: GetHtmlOptions): string | null; getText(): string | null; getMarkdown(): string | null; /** * Get the quoted/replied content that was removed. * Returns the HTML of the quoted reply section, or null if no quote was found. * @param options.raw - If true, returns raw HTML. Default: false (cleaned). */ getQuote(options?: GetHtmlOptions): string | null; /** * Ensure parse() has been called, calling it if not yet done */ private ensureParsed; private parseHtml; private clearText; parse(): boolean; textToHtml(data: string | null): string | null; /** Override this method to handle cases when a quote class is found but not processed */ protected quoteFound(_$: CheerioAPI): void; /** Override this method to handle cases when a signature class is found but not processed */ protected signFound(_$: CheerioAPI): void; /** Override this method to handle cases when no patterns matched */ protected noPatternsFound(_text: string): void; } declare class VerboseUnquote extends Unquote { protected quoteFound($: CheerioAPI): void; protected signFound($: CheerioAPI): void; protected noPatternsFound(text: string): void; } /** * Regex patterns for detecting email quote headers in various languages and formats * * @see https://github.com/crisp-oss/email-reply-parser/blob/master/lib/regex.js * @see https://github.com/mailgun/talon/blob/master/talon/quotations.py */ declare const patterns: RegExp[]; /** * Simple HTML to text converter * Mimics the behavior of Python's html2text library */ declare function htmlToText(html: string): string; /** * Convert HTML to Markdown using node-html-markdown * Optimized for email HTML which often uses tables for layout */ declare function htmlToMarkdown(html: string): string; /** * Clean messy email HTML using a SAX parser. * Removes noise/metadata while preserving content. * * This is faster than Cheerio (no DOM) and safer than Regex (correct parsing). */ declare function cleanEmailHtml(rawHtml: string): string; export { type GetHtmlOptions, Unquote, VerboseUnquote, cleanEmailHtml, htmlToMarkdown, htmlToText, patterns };