/**
 * This file define the interface of coverage information
 */
import { Type } from "wasmparser";
export interface InstrumentResult {
    sourceWasm: string;
    instrumentedWasm: string;
    debugInfo: string;
    expectInfo: string;
}
export type CodeSnippetIndex = number;
export type FunctionIndex = number;
export type LineIndex = number;
export type ColumnIndex = number;
export type FileIndex = number;
export type UncoveredBasicBlocks = Set<CodeSnippetIndex>;
export type UncoveredLines = Set<LineIndex>;
export type BranchInfo = [CodeSnippetIndex, CodeSnippetIndex];
export type BranchInfos = BranchInfo[];
export type LineRange = [FileIndex, LineIndex, ColumnIndex][];
export type LineInfos = (LineRange | null)[];
export type LineInfoMap = Map<number, Set<LineIndex>>;
export interface CovDebugInfo {
    branchInfo: BranchInfos;
    index: FunctionIndex;
    lineInfo: LineInfos;
}
export interface CovInfo {
    branchInfo: BranchInfos;
    lineInfo: LineInfoMap;
}
export interface DebugInfo {
    debugInfos: Record<string, CovDebugInfo>;
    debugFiles: string[];
}
export type CovTrace = [FunctionIndex, CodeSnippetIndex];
export type TestCaseName = string;
export type ExpectInfoIndex = string;
export type AssertExpectValue = string;
export type AssertActualValue = string;
export type AssertMessages = [ExpectInfoIndex, AssertActualValue, AssertExpectValue][];
export type AssertFailMessage = Record<TestCaseName, AssertMessages>;
export type ErrorMessages = string[];
export type AssertErrorMessages = Map<TestCaseName, ErrorMessages>;
export type ExpectInfoDebugLocation = string;
export type ExpectInfo = Record<ExpectInfoIndex, ExpectInfoDebugLocation>;
export interface IAssertResult {
    fail: number;
    total: number;
    failed_info: AssertFailMessage;
}
export interface ImportFunctionInfo {
    module: string;
    name: string;
    args: Type[];
    return: Type | undefined;
}
export declare class Rate {
    used: number;
    total: number;
    getRate(): number;
    toString(): string;
    static summarize(rates: Rate[]): Rate;
}
export declare class FileCoverageResult {
    filename: string;
    constructor(filename: string);
    statementCoverageRate: Rate;
    branchCoverageRate: Rate;
    functionCoverageRate: Rate;
    lineCoverageRate: Rate;
    sourceUsedCount: CodeCoverage[];
    uncoveredlines: Set<number>;
}
export declare class FunctionCoverageResult {
    functionName: string;
    constructor(functionName: string);
    branchCoverageRate: Rate;
    uncoveredlines: UncoveredLines;
    lineRange: [number, number];
    /**
     * first means lineIndex;
     * second means usedCount;
     */
    sourceUsedCount: Map<number, number>;
    /**
     * Now assemblyscrpt will compile foo<T>() to different function like foo<f64>() , foo<u32>() etc;
     * We need merge the generic function to foo() for coverage statistics
     */
    static mergeFromGeneric(nameWithoutGeneric: string, infos: FunctionCoverageResult[]): FunctionCoverageResult;
}
export declare class CodeCoverage {
    static readonly default = -1;
    source: string;
    /**
     * Default means not a effect line;
     * 0 means not used but effect;
     * more than 0 means a used line;
     */
    usedCount: number;
    constructor(src: string);
}
export interface UnittestPackage {
    readonly testCodePaths: string[];
    readonly sourceFunctions: Map<string, SourceFunctionInfo[]>;
}
export interface SourceFunctionInfo {
    name: string;
    range: [number, number];
}
export declare const OrganizationName = "wasm-ecosystem";
export declare const Repository = "https://github.com/wasm-ecosystem/assemblyscript-unittest-framework";
//# sourceMappingURL=interface.d.ts.map