/** * CST-based formatter — walks the untyped CST tree and produces a Doc tree. * * The Doc tree is then rendered to a string by the Wadler-Lindig renderer * in doc.ts. The formatter normalizes all structural whitespace to canonical * form. Comments are the only authored content that survives formatting, * preserved at their logical attachment positions. * * Key design choices: * - Whitespace trivia is ignored (replaced by Doc-generated whitespace) * - Block comments (/* ... * /) become Text nodes in the Doc * - Line comments (// ...) become LineComment nodes (force hard break) * - Blank lines between top-level statements are preserved (up to 1 blank line) */ import type { UntypedCstNode } from '../cst/builder'; import type { TriviaNode } from '../cst/types'; import { type Doc } from './doc'; /** * Build the Doc tree for a CST program without rendering it. * Useful for inspecting the formatter's intermediate representation. */ export declare function buildDocTree(tree: UntypedCstNode, trailingTrivia: TriviaNode[]): Doc; export declare function formatCst(tree: UntypedCstNode, trailingTrivia: TriviaNode[]): string;