import type { Replacement } from '../seam/types'; /** * True when `code` parses as a syntactically valid JS/TS expression, a top-level * statement program, OR a statement valid only inside a function body. The three * attempts run cheapest-/likeliest-first: a bare expression (the common mutant * shape), then a full program (top-level statements), then the text wrapped in a * function body (so a function-only statement like `return x;` is accepted). * Returns `false` for any input none of the three accept, or for empty/ * whitespace-only text. * * Pure and offline: `@babel/parser` does no I/O and no network. */ export declare function isParseable(code: string): boolean; /** * Drop replacements whose `replacement` text does not parse (filter #1). Pure: * returns a new array, preserving input order of the survivors. */ export declare function filterUnparseable(replacements: readonly Replacement[]): Replacement[]; /** * Drop no-op mutants where `replacement === original` (filter #2). Comparison is * exact-string; callers wanting whitespace-insensitive equality should normalize * upstream. Pure: returns a new array preserving order. */ export declare function filterIdentical(replacements: readonly Replacement[]): Replacement[]; /** * Build the dedup identity key for a replacement: the same * `{ fileName, range, replacement }` tuple the seam hashes into a deterministic * mutant id (development-plan §4.2). Two replacements with the same key would * produce the same mutant, so only the first is kept. `original` and * `mutatorName`/`rationale` are deliberately NOT part of the identity — they do * not change what the mutant DOES. * * Uses `JSON.stringify` over a fixed field order so the key is stable and * collision-free for these flat values. */ export declare function dedupKey(replacement: Replacement): string; /** * Collapse replacements identical in `{ fileName, range, replacement }` to the * first occurrence (filter #3). Pure: returns a new array preserving the order * of first appearance. */ export declare function dedupReplacements(replacements: readonly Replacement[]): Replacement[]; /** * Run all three cheap deterministic filters in cheapest-first order: * identical-reject, then dedup, then the (more expensive) parse-check on the * survivors. Pure and offline; the input array is never mutated. * * @param replacements raw propose-stage output. * @returns the survivors, in first-appearance order. */ export declare function applyFilters(replacements: readonly Replacement[]): Replacement[];