import { type FormatOptions, type FormatResult } from "./format/options.ts"; export { type FormatOptions } from "./format/options.ts"; export { type FormatResult } from "./format/options.ts"; /** * Formats VelarScript source without round-tripping through generated JavaScript. * The formatter tokenizes each logical source line so strings, comments, * extension-owned embeddings and literals, operators, named arguments, and * type syntax retain their meaning while whitespace becomes canonical. * * Reading tokens rather than a program is what lets it lay out a fragment, an * unfinished line, and source a loaded extension does not claim. Anything that * *writes the result back* has to ask a second question first; that question is * `formatSourceResult`, and every writer asks it. */ export declare function formatSource(text: string, options?: FormatOptions): string; /** * D114 0.28.0 I-D1: formatting for a writer — the layout, and the diagnostic * that says this file must keep the bytes its author wrote. * * Reading tokens rather than a program means the formatter has an answer for * source that is not a program, and one of those answers destroys the file: * extension-owned angle-bracket markup that no loaded extension claims lexes as * `<` and `>`, so an element is written back as a chain of comparison * operators. That is reachable from `velar format` on a lone file and from an * editor formatting on save. So the question every writer asks — the CLI, the * language server's formatting request, and the repository's own format gate — * is stated once here: a source whose lexer or parser reports a diagnostic it * did not recover from is answered unchanged, beside the diagnostic to report, * so the author fixes the syntax first. * * Recovered guidance is deliberately not blocking. A `!` the parser rewrote to * `not` left it holding a program, so a file whose only diagnostics are * guidance is written back exactly as it always was. * * Neither is whitespace the formatter owns. A module indented with tabs is * refused by the lexer (VEL1002) and is exactly the file `velar format` exists * to correct, so "does not parse" cannot be the whole question — the question * is whether the formatter's *own result* is still not a program. Asking it * that way needs no roster of which diagnostics the formatter can fix: it * formats, asks again, and keeps the result only when the second answer is * clean. What survives both is precisely the file whose layout is not the * module its author wrote. */ export declare function formatSourceResult(text: string, options?: FormatOptions): FormatResult; //# sourceMappingURL=formatter.d.ts.map