import { MarkdownToSpeechOptions } from '../utils/markdown-to-speech'; export type DocumentFormat = "markdown" | "text"; /** What the caller asked for; `auto` defers to the extension, then the content. */ export type RequestedFormat = DocumentFormat | "auto"; /** Extensions read as Markdown. Everything else is treated as plain text. */ export declare const MARKDOWN_EXTENSIONS: string[]; /** Extensions the CLI accepts without complaint. Others still work, with a warning. */ export declare const TEXT_EXTENSIONS: string[]; /** Lowercased extension of a path, including the dot (`""` when there is none). */ export declare function extensionOf(filename: string): string; /** * Decides how to read a document. * * An explicit `requested` format always wins — a `.txt` file full of Markdown is * still the user's call. Otherwise the extension decides, and content sniffing * is the last resort for input that arrived without a name. */ export declare function detectFormat(content: string, filename?: string, requested?: RequestedFormat): DocumentFormat; /** Converts document content to the text that should be spoken. */ export declare function toSpeechText(content: string, format: DocumentFormat, options?: MarkdownToSpeechOptions): string; export interface LoadedDocument { /** The speakable text, Markdown already converted. */ text: string; /** How the content was read. */ format: DocumentFormat; /** Where it came from, for log lines: a path, `stdin`, or `--text`. */ source: string; } export interface LoadDocumentOptions { /** Path to read. Use `-` for stdin. Mutually exclusive with `text`. */ file?: string; /** Literal content to speak, instead of reading a file. */ text?: string; format?: RequestedFormat; markdown?: MarkdownToSpeechOptions; /** Reads stdin. Injected so the CLI tests do not need a real pipe. */ readStdin?: () => Promise; } /** * Reads a document from a path, stdin, or an inline string and returns the text * to synthesize. */ export declare function loadDocument(options: LoadDocumentOptions): Promise; /** Collects all of stdin as UTF-8 text. */ export declare function readStdinToString(): Promise;