/**
 * @copyright Sister Software
 * @license AGPL-3.0
 * @author Teffen Ellis, et al.
 */
import { Classification, ClassificationRecord } from "mailwoman/core/classification";
import type { TokenContext } from "mailwoman/core/tokenization";
import { SerializedSolutionMatch, SolutionMatch } from "./SolutionMatch.js";
export interface SerializedSolution {
    score: number;
    penalty: number;
    classifications: ClassificationRecord;
    formatted_address: string;
    matches: SerializedSolutionMatch[];
}
export interface SolutionCreationOptions {
    context: TokenContext;
    matches?: SolutionMatch[];
}
export declare class Solution {
    matches: SolutionMatch[];
    /**
     * All classification in the solution.
     */
    collectClassifications(): Classification[];
    /**
     * Find the first matching pair in the solution by its classification.
     */
    find(classification: Classification): SolutionMatch | undefined;
    /**
     * Exclude match by classification.
     */
    findWithout(classification: Classification): SolutionMatch[];
    /**
     * Filter match by classification.
     */
    filter(classification: Classification): SolutionMatch[];
    /**
     * Absolute score of the solution.
     */
    score: number;
    /**
     * Penalty for the solution. This is used to penalize solutions that are not complete.
     */
    penalty: number;
    /**
     * Create a new solution.
     */
    constructor(matches?: Iterable<SolutionMatch>);
    /**
     * Predicate to determine if this solution covers another solution, i.e. the target solution is a
     * subset of this solution without any unique ranges.
     */
    covers(that: Solution): boolean;
    /**
     * Predicate to determine if a solution covers another solution with the same classification.
     */
    coversSameClassification(that: Solution): boolean;
    computeScore(contextCoverage: number): void;
    /**
     * @returns JSON representation of a solution
     */
    toJSON(): SerializedSolution;
}
/**
 * Compare solutions for sorting, first by score, then by classification.
 */
export declare function rankingSolutionsByAreaClassification(a: Solution, b: Solution): number;
//# sourceMappingURL=Solution.d.ts.map