import * as ESTree from "estree"; export declare type ResultReporter = (r: RunnerResult) => void; export declare type AggregateReporter = (rs: RunnerResult[], cfg: PerturbConfig, m?: PerturbMetadata) => void; export declare type NodeMutator = (n: ESTree.Node) => ESTree.Node | ESTree.Node[]; export declare type NodeFilter = (n: ESTree.Node) => boolean; export declare type Skipper = (node: ESTree.Node, path: string[]) => boolean; export declare type ComparativeMatcher = (sourceFile: string, testFile: string) => boolean; export declare type GenerativeMatcher = (sourceFile: string) => string; export declare type MutatorFinder = (n: ESTree.Node) => MutatorPlugin[]; export declare type PluginLocator = (name: string) => T; export declare type PluginType = "reporter" | "runner" | "matcher" | "mutator"; export interface BasePlugin { name: string; type: PluginType; } export interface ReporterPlugin extends BasePlugin { onResult: ResultReporter; onFinish: AggregateReporter; } export interface MutatorPlugin extends BasePlugin { nodeTypes: string[]; mutator: NodeMutator; filter?: NodeFilter; } export interface RunnerPluginConstructor { new (m: Mutant): RunnerPlugin; } export interface RunnerPlugin extends BasePlugin { setup(): Promise; run(): Promise; cleanup(): Promise; } export interface SkipperPlugin extends BasePlugin { skipper: Skipper; } export interface MatcherPlugin extends BasePlugin { matchType: "generative" | "comparative"; makeMatcher: (c: PerturbConfig) => GenerativeMatcher | ComparativeMatcher; } export interface GenerativeMatcherPlugin extends MatcherPlugin { matchType: "generative"; makeMatcher: (c: PerturbConfig) => GenerativeMatcher; } export interface ComparativeMatcherPlugin extends MatcherPlugin { matchType: "comparative"; makeMatcher: (c: PerturbConfig) => ComparativeMatcher; } export interface PerturbConfig { testCmd: string; mutators: string[]; skippers: string[]; reporter: string; matcher: string; runner: string; projectRoot: string; perturbDir: string; sourceDir: string; testDir: string; sourceGlob: string; testGlob: string; killRateMin: number; } export declare type OptionalPerturbConfig = Partial; export interface Mutant { mutatorName: string; sourceFile: string; testFiles: string[]; path: string[]; astBefore: ESTree.Node; astAfter: ESTree.Node; loc: ESTree.SourceLocation; originalSourceCode: string; mutatedSourceCode: string; } export interface RunnerResult extends Mutant { error?: any; } export interface Match { source: string; tests: string[]; sourceCode: string; } export interface ParsedMatch extends Match { ast: ESTree.Node; code: string; locations: MutantLocation[]; } export interface MutantLocation { mutator: MutatorPlugin; path: string[]; node: ESTree.Node; } export interface PerturbMetadata { duration: number; }