import { ReadOptions } from './document'; import { type ReadabilityContent } from './readability'; import { TurndownOptions } from './turndown'; /** * Result of converting HTML content to Markdown. */ export interface MarkdownContent extends ReadabilityContent { /** The converted markdown content */ markdown: string; /** Length of the markdown content in characters */ length: number; } /** * Options for the markdown conversion process. */ export interface MarkdownOptions extends ReadOptions, TurndownOptions { } /** * Converts a web page to Markdown format * * @param url - The URL of the web page to convert * @param options - Optional settings for document retrieval and conversion * @returns A Promise that resolves to a MarkdownContent object * @throws {MarkdownError} When URL is invalid or when document retrieval fails * @throws {Error} When readability parsing or markdown conversion fails * * @example * ```typescript * try { * const result = await markdown('https://example.com', { timeout: 5000 }); * console.log(result.markdown); * } catch (error) { * console.error('Conversion failed:', error.message); * } * ``` */ declare function markdown(url: string, options?: MarkdownOptions): Promise; export { markdown };