import { Root } from 'xast'; import { Plugin } from 'unified'; export interface FormatOptions { breakLines?: "few" | "some" | "many"; breakSentences?: boolean; /** Wrap long block start-tag attributes onto separate lines. */ breakLongAttributes?: boolean; insertSpaces?: boolean; tabSize?: number; /** Target line width for paragraph text reflow. 0 = no width limit. Default 80. */ printWidth?: number; } /** * Serialize an already-parsed xast Root tree to formatted PreTeXt XML. * * Pipeline: each node is dispatched to a category-specific appender that pushes * indented lines into an array, then applyBlankLines inserts blank separators as * a post-processing pass, and the array is joined with newlines. */ export declare function serializeXast(tree: Root, options?: FormatOptions): string; /** Unified compiler plugin: formats the xast tree produced by the pipeline. */ export declare const pretextFormatPlugin: Plugin<[FormatOptions?], Root, string>; /** Main entry point for formatting PreTeXt XML strings. */ export declare function formatPretext(text: string, options?: FormatOptions): string;