/** * Deterministic native (`format:false`) reflow that reproduces the subset of `gofmt`'s layout the * Typra Go emitter would otherwise depend on the external `gofmt`/`goimports` pipeline to apply. * * Issue #238: the guard proves each target's native output is a byte-level no-op under its default * formatter, so `format:true` and `format:false` agree. An audit of the emitted Go tree found the * drift is three transformations `gofmt` applies: * 1. Block indentation. Some emitters (notably the test emitter) emit flush-left Go and rely on * `gofmt` to add every level of indentation; others already indent. Reproducing `gofmt`'s * brace/paren/bracket-depth indentation (with the `switch`/`select` `case` dedent and raw-string * preservation) normalises both, and is a byte-level no-op on already-indented source. * 2. Columnar (tabwriter) alignment — struct field blocks, `const`/`var` spec blocks, and keyed * composite-literal elements — where non-terminal cells are space-padded to `maxCellWidth + 1`. * 3. Collapsing runs of blank lines to a single blank, and tightening the interior spaces of a * single-line composite literal (`T{ a: b }` → `T{a: b}`). * * `goimports` grouping is already reproduced by the emitter (imports are emitted pre-grouped), so * only its indentation needs applying — which falls out of the indentation pass. */ /** * Format Go source so it matches `gofmt` (+ `goimports`) output without invoking either tool. * Applies brace-depth reindentation and blank-line collapsing, single-line composite-literal brace * tightening, then columnar alignment of the three `gofmt`-aligned constructs (struct fields, * const/var specs, keyed composite elements). Raw string literals are preserved byte-for-byte. */ export declare function formatGoSource(source: string): string;