/** * Safe markdown preparation for the full-screen pager. * * - Markdown docs (help, shortcuts, plan) force-render with classic parity. * - Tool / log / plain bodies use a conservative heuristic so normal output * is not mangled by italic underscores or stray asterisks. * - Any render failure falls back to plain lines (never throws into the UI). */ import { renderStyledMarkdownLines } from "./styled-markdown.js"; export type PagerMarkdownMode = "auto" | "force" | "plain"; /** Opaque styled line from renderMarkdownLines (avoids @opentui import here). */ export type PagerStyledLine = ReturnType[number]; export interface PagerDisplayLine { /** Plain text used for search, line counts, and export fallbacks. */ readonly plain: string; /** * Pre-styled line when markdown rendered successfully. * Undefined → paint as plain `plain` with baseLineFg heuristics. */ readonly styled?: PagerStyledLine | undefined; } export interface PreparePagerDisplayOptions { readonly body: string; readonly width: number; readonly mode?: PagerMarkdownMode | undefined; /** Default body foreground when markdown renders (theme.foreground). */ readonly defaultFg?: string | undefined; } /** * Prepare body lines for the pager. Never throws. */ export declare function preparePagerDisplay(options: PreparePagerDisplayOptions): { readonly mode: "markdown" | "plain"; readonly lines: readonly PagerDisplayLine[]; };