import type { Node } from '@babel/types'; /** * The structural fingerprint of one function's source text: hex SHA-256 of the * canonical AST serialization (see the module header for what is ignored and * what is kept). When the text does not parse under any wrapper, falls back to * the SHA-256 of its {@link fallbackText} — comment-insensitive and stable * across re-indentation and space/tab runs, but newline-preserving (nothing * was parsed, so ASI could make a moved newline behavioural). The fallback * should be rare (a probe over a real cache saw none in 1,107 functions); pass * `log` to have each use reported. */ export declare function functionFingerprint(text: string, log?: (line: string) => void): string; /** * The canonical structural serialization of ONE already-parsed AST node — the * same string {@link functionFingerprint} hashes, unhashed. Two nodes with equal * shapes are the same expression up to comments, whitespace, literal spelling * and redundant parens. Used by `range-align.ts` to compare candidate nodes of * the CURRENT source against a cached candidate's {@link expressionShape}. */ export declare function nodeShape(node: unknown): string; /** * The canonical structural serialization of a sub-expression's SOURCE TEXT (a * cached candidate's `original`), or `undefined` when the text is not a single * expression. Parsed with the pipeline's plugin set; the context errors a bare * sub-expression cannot avoid (`this.#x`, `super.x`, `yield x`, `new.target`) * are tolerated because the expression was cut from a function where they are * legal — a real syntax error still yields `undefined`. */ export declare function expressionShape(text: string): string | undefined; /** * Parse ONE sub-expression's source text with the pipeline's plugin set, * tolerating only the context errors a bare sub-expression cannot avoid * (`this.#x`, `super.x`, `yield x`, `new.target`) — the exact parse route * {@link expressionShape} takes before canonicalizing. Returns the expression * node, or `undefined` on a real syntax error. Shared with the mutant * classifier (`classify.ts`) so a cached candidate's `original` is parsed the * same way there as it is for shape matching. */ export declare function parseExpressionTolerant(text: string): Node | undefined; /** * Remove every comment from a function's source text WITHOUT changing what the * text means (line terminators and token separation survive; see the module * header) and without touching any code line: a comment owning its whole * line(s) disappears with them, an inline one leaves the line feeds it held (or * one space if two tokens would otherwise fuse). Returns the text unchanged * when it does not parse. */ export declare function stripComments(text: string): string;