import { type NodeMutator } from './mutators/index'; /** * A mutable mutator registry: the structural minimum {@link injectMutators} * mutates. Stryker's real `allMutators` (a `NodeMutator[]`) satisfies it. */ type MutatorRegistry = NodeMutator[]; /** Options controlling how {@link injectMutators} registers mutators. */ export interface InjectMutatorsOptions { /** * Registration mode. * • `'augment'` (default) — KEEP Stryker's sixteen built-ins and ADD ours * after them, so a run emits both built-in and heuristic mutants. * • `'replace'` — CLEAR the built-ins first (`length = 0`) and register * ONLY ours, so a run emits heuristic mutants exclusively. The M0 * isambard driver uses this to prove our mutant in isolation. */ mode?: 'augment' | 'replace'; /** * The registry array to mutate. Defaults to Stryker's real, deep-imported * `allMutators` — the normal production target. Overridable ONLY so an * out-of-process proof (the Node injection-proof worker) can pass the * `allMutators` instance IT imported, guaranteeing it mutates the exact array * its in-process instrumenter reads. Production callers never set this. */ target?: MutatorRegistry; } /** * The outcome of an {@link injectMutators} call, for assertions and logging. * All counts are read from the live `allMutators` array after mutation. */ export interface InjectMutatorsResult { /** The mode that was applied. */ mode: 'augment' | 'replace'; /** `allMutators.length` BEFORE this call mutated it. */ countBefore: number; /** `allMutators.length` AFTER this call mutated it. */ countAfter: number; /** The `name`s of the mutators that were registered by this call. */ injectedNames: readonly string[]; } /** * Register heuristic mutators into Stryker's live `allMutators` registry by * mutating that shared array IN PLACE. Pure and synchronous: the only side * effect is the array mutation; the return value is a snapshot for assertions. * * In `'augment'` mode (the default) the given mutators are appended after the * built-ins. In `'replace'` mode the array is first emptied (preserving its * identity via `length = 0`, NOT reassignment — reassignment would break the * by-reference binding `babel-transformer.js` captured) and then filled with * only the given mutators. * * Idempotency note: this function does NOT de-duplicate. Calling it twice in * `'augment'` mode registers the heuristics twice. Callers that re-inject within * one process (e.g. tests) should restore the array between calls — see the * snapshot/restore pattern in the injection proof test. * * @param mutators The mutators to register. Defaults to {@link heuristicMutators}. * @param options Registration options; see {@link InjectMutatorsOptions}. * @returns A snapshot of what was injected and the before/after counts. */ export declare function injectMutators(mutators?: readonly NodeMutator[], options?: InjectMutatorsOptions): InjectMutatorsResult; export {};