/**
 * Toolchain error-count extractor.
 *
 * Given stderr/stdout from a compiler or test runner, count the number
 * of reported errors/failures. Patterns are deliberately narrow —
 * unknown stderr returns `null` rather than zero so callers can
 * distinguish "no errors" from "different toolchain, couldn't parse".
 *
 * All patterns are anchored to the start of a line and use bounded
 * character classes to avoid catastrophic backtracking on pathological
 * inputs.
 *
 * Add new toolchains by appending to {@link ERROR_COUNT_PATTERNS};
 * order matters only in the sense that the first matching pattern wins.
 */
export interface ErrorCountPattern {
    /** Stable identifier for logging + tests. */
    name: string;
    /** Must be global (`g` flag) — the extractor counts matches. */
    regex: RegExp;
    /** Optional post-processing to extract a count from a single captured match. */
    transform?: (match: RegExpMatchArray) => number;
}
export declare const ERROR_COUNT_PATTERNS: ErrorCountPattern[];
export interface ExtractOptions {
    /** Restrict to named patterns — default: all patterns. */
    only?: string[];
    /** Additional patterns to consider BEFORE the built-in list. */
    extra?: ErrorCountPattern[];
}
export interface ExtractResult {
    /** Total count of matched errors, or null when no pattern matched. */
    count: number | null;
    /** Name of the pattern that matched, or null. */
    matched: string | null;
    /** Original matches for callers that want to surface specifics. */
    samples: string[];
}
/**
 * Try each pattern in order; return the first with matches.
 *
 * Returning `null` (instead of zero) on no-match is deliberate — a
 * callsite that greps for "typescript errors" on cargo output should
 * NOT treat that as "zero TS errors" because the toolchain is wrong.
 */
export declare function extractErrorCount(text: string, opts?: ExtractOptions): ExtractResult;
//# sourceMappingURL=error-count-extractor.d.ts.map