@opentui/core
Version:
OpenTUI is a TypeScript library on a native Zig core for building terminal user interfaces (TUIs)
12 lines (11 loc) • 463 B
TypeScript
import { type MarkedToken } from "marked";
export interface ParseState {
content: string;
tokens: MarkedToken[];
stableTokenCount?: number;
}
/**
* Incrementally parse markdown, reusing unchanged tokens from previous parse.
* Compares token.raw at each offset - matching tokens keep same object reference.
*/
export declare function parseMarkdownIncremental(newContent: string, prevState: ParseState | null, trailingUnstable?: number): ParseState;