import type { Component } from "../tui.js"; import { type DefaultTextStyle, type MarkdownTheme } from "./markdown.js"; /** * Markdown renderer for chunked, in-flight assistant text. * * Wraps Markdown so partial content renders cleanly even while half-formed * tokens (open fences, unfinished bold, dangling link brackets) are still * arriving. Once the stream finalizes, swap in the canonical render via * `finalize()`. */ export declare class StreamingMarkdown implements Component { readonly paddingX: number; readonly paddingY: number; readonly theme: MarkdownTheme; readonly defaultTextStyle?: DefaultTextStyle | undefined; private inner; private rawBuffer; private finalized; constructor(initial: string, paddingX: number, paddingY: number, theme: MarkdownTheme, defaultTextStyle?: DefaultTextStyle | undefined); /** Append a streamed chunk and update the render. */ append(chunk: string): void; /** Replace the entire buffer (e.g. when retrying). */ setText(text: string): void; /** * Mark the stream complete and swap to the canonical full markdown render. * Subsequent appends (rare) keep the canonical render path. */ finalize(canonical?: string): void; getRawText(): string; invalidate(): void; render(width: number): string[]; } /** * Balance partial markdown so the in-flight render doesn't trip over * unfinished syntax. Conservative: no semantic re-parsing, just close the * obvious cases (fences, runs of ** / * / ~~, dangling [ ). */ export declare function balancePartial(text: string): string; //# sourceMappingURL=streaming-markdown.d.ts.map