import type { Script, Token } from '../core/index.js'; /** The three questions the tree answers, as sets of source offsets. */ export interface Shapes { /** Where a `+` or a `-` is a sign rather than an operator between two values. */ readonly signs: ReadonlySet; /** Where a `(` groups an expression, or a `[` opens an array literal. */ readonly grouped: ReadonlySet; /** Where a `:` separates the two arms of a ternary. */ readonly arms: ReadonlySet; } /** * Reads the three from a tree. * * A tree from a file that did not parse is not passed here: the formatter * refuses such a file before this is reached, because a tree with recovery in it * describes a program nobody wrote. */ export declare function shapesOf(script: Script, tokens: readonly Token[]): Shapes; /** * Whether a space goes between two tokens that are printed on one line. * * The default is a space, and every rule below takes one away. That direction is * deliberate: a missing space is almost always harmless to read and never * changes what the lexer sees, and an added space between two marks that have to * touch is the one mistake that changes a program. The arrow above is the only * case where that could happen, and it is refused first. */ export declare function spaceBetween(left: Token, right: Token, shapes: Shapes): boolean; //# sourceMappingURL=spacing.d.ts.map