/**
 * @fileoverview Solution compilation, execution, and verification utilities.
 * Provides functions to run solutions on test inputs, compare outputs with checkers,
 * and validate solution behavior against expected verdicts (TLE, MLE, WA, etc.).
 */
import ConfigFile, { LocalSolution, LocalTestset } from '../types';
import type { LocalChecker } from '../types';
/**
 * Ensures solutions are defined in configuration.
 * Type assertion function that throws if no solutions exist.
 *
 * @param {LocalSolution[] | undefined} solutions - Solutions array to validate
 *
 * @throws {Error} If no solutions are defined
 *
 * @example
 * const config = readConfigFile();
 * validateSolutionsExist(config.solutions);
 * // Now TypeScript knows solutions is defined and non-empty
 */
export declare function validateSolutionsExist(solutions: LocalSolution[] | undefined): asserts solutions is LocalSolution[];
/**
 * Finds solutions matching a given name or returns all solutions.
 *
 * @param {LocalSolution[]} solutions - Array of solution configurations
 * @param {string} solutionName - Name of solution to find, or 'all' for all solutions
 * @returns {LocalSolution[]} Array of matching solutions
 *
 * @throws {Error} If no solutions match the name
 *
 * @example
 * const matching = findMatchingSolutions(config.solutions, 'main');
 * // Returns: [{ name: 'main', source: 'Solution.cpp', type: 'main-correct' }]
 */
export declare function findMatchingSolutions(solutions: LocalSolution[], solutionName: string): LocalSolution[];
/**
 * Compiles a solution based on file extension.
 * Supports C++ (.cpp), Python (.py), and Java (.java).
 * For interpreted languages, returns the interpreter command.
 *
 * @param {string} sourcePath - Path to solution source file
 * @returns {Promise<void>} Resolves when compilation completes
 *
 * @throws {Error} If compilation fails
 * @throws {Error} If file extension is not supported
 *
 * @example
 * await compileSolution('Solution.cpp')
 * // Compiles to ./Solution executable
 *
 * @example
 * await compileSolution('Solution.py')
 * // No compilation needed (interpreted)
 */
export declare function compileSolution(sourcePath: string): Promise<void>;
/**
 * Compiles all matching solutions.
 * Compiles each solution based on file extension.
 *
 * @param {LocalSolution[]} solutions - Array of solutions to compile
 * @returns {Promise<void>} Resolves when all compilations complete
 *
 * @throws {Error} If any compilation fails
 *
 * @example
 * await compileAllSolutions(config.solutions);
 * // Compiles all solutions in parallel
 */
export declare function compileAllSolutions(solutions: LocalSolution[]): Promise<void>;
/**
 * Runs a single solution on a single test within a testset.
 * Executes it on the specified test using pre-compiled executable.
 * Note: Solution must be compiled before calling this function.
 *
 * @param {LocalSolution} solution - Solution configuration
 * @param {ConfigFile} config - Configuration containing time/memory limits
 * @param {string} testsetName - Name of testset containing the test
 * @param {number} testIndex - Test index (1-based)
 *
 * @throws {Error} If solution execution fails
 *
 * @example
 * await runSolutionOnSingleTest(solution, config, 'testsets', 5);
 */
export declare function runSolutionOnSingleTest(solution: LocalSolution, config: ConfigFile, testsetName: string, testIndex: number): Promise<void>;
/**
 * Runs a single solution on an entire testset.
 * Executes it on all tests in the testset using pre-compiled executable.
 * Note: Solution must be compiled before calling this function.
 *
 * @param {LocalSolution} solution - Solution configuration
 * @param {ConfigFile} config - Configuration containing time/memory limits
 * @param {string} testsetName - Name of testset to run on
 *
 * @throws {Error} If solution fails on any test
 *
 * @example
 * await runSolutionOnTestset(solution, config, 'testsets');
 */
export declare function runSolutionOnTestset(solution: LocalSolution, config: ConfigFile, testsetName: string): Promise<void>;
/**
 * Runs a single solution on a specific group within a testset.
 * Executes it on all tests in the group using pre-compiled executable.
 * Note: Solution must be compiled before calling this function.
 *
 * @param {LocalSolution} solution - Solution configuration
 * @param {ConfigFile} config - Configuration containing time/memory limits
 * @param {LocalTestset} testset - Testset configuration
 * @param {string} groupName - Name of group to run on
 *
 * @throws {Error} If solution fails on any test in the group
 *
 * @example
 * await runSolutionOnGroup(solution, config, testset, 'samples');
 */
export declare function runSolutionOnGroup(solution: LocalSolution, config: ConfigFile, testset: LocalTestset, groupName: string): Promise<void>;
/**
 * Runs a single solution on all testsets.
 * Compiles the solution and executes it on every test in every testset.
 *
 * @param {LocalSolution} solution - Solution configuration
 * @param {ConfigFile} config - Configuration containing time/memory limits
 * @param {LocalTestset[]} testsets - Array of testset configurations
 *
 * @throws {Error} If solution compilation fails
 * @throws {Error} If solution fails on any test
 *
 * @example
 * await runSolutionOnAllTestsets(solution, config, config.testsets);
 */
export declare function runSolutionOnAllTestsets(solution: LocalSolution, config: ConfigFile, testsets: LocalTestset[]): Promise<void>;
/**
 * Tests a solution against the main correct solution using the checker.
 * Runs both solutions on all testsets, then compares outputs with the checker.
 * Validates that the solution behaves according to its expected type (TLE, WA, etc.).
 * Note: Solutions and checker must be compiled before calling this function.
 *
 * @param {string} solutionName - Name of solution to test
 *
 * @throws {Error} If main solution doesn't exist
 * @throws {Error} If target solution doesn't exist
 * @throws {Error} If main solution fails
 * @throws {Error} If comparison fails
 *
 * @example
 * // From actions.ts testWhat command
 * await testSolutionAgainstMainCorrect('wa-solution');
 * // Validates that wa-solution gets WA on at least one test
 */
export declare function testSolutionAgainstMainCorrect(solutionName: string): Promise<void>;
/**
 * Ensures a main-correct solution exists in the configuration.
 * Type assertion function that throws if no MA (main correct) solution found.
 *
 * @param {LocalSolution[] | undefined} solutions - Solutions array to validate
 *
 * @throws {Error} If no solutions are defined
 * @throws {Error} If no MA (main correct) solution exists
 *
 * @example
 * const config = readConfigFile();
 * ensureMainSolutionExists(config.solutions);
 */
export declare function ensureMainSolutionExists(solutions: LocalSolution[] | undefined): asserts solutions is LocalSolution[];
/**
 * Ensures a specific solution exists in the configuration.
 * Type assertion function that throws if solution not found.
 *
 * @param {LocalSolution[] | undefined} solutions - Solutions array to validate
 * @param {string} solutionName - Name of solution to find
 *
 * @throws {Error} If no solutions are defined
 * @throws {Error} If solution with given name doesn't exist
 *
 * @example
 * ensureSolutionExists(config.solutions, 'wa-solution');
 */
export declare function ensureSolutionExists(solutions: LocalSolution[] | undefined, solutionName: string): asserts solutions is LocalSolution[];
/**
 * Gets the MA (main correct) solution from solutions array.
 *
 * @param {LocalSolution[]} solutions - Array of solution configurations
 * @returns {LocalSolution} The MA (main correct) solution
 *
 * @throws {Error} If no MA solution found (should never happen if ensureMainSolutionExists called first)
 *
 * @example
 * const mainSolution = getMainSolution(config.solutions);
 * // Returns: { name: 'main', source: 'Solution.cpp', tag: 'MA' }
 */
export declare function getMainSolution(solutions: LocalSolution[]): LocalSolution;
/**
 * Compares target solution outputs against main solution using checker.
 * Runs checker on all test cases in all testsets and tracks verdicts (WA, TLE, MLE, RTE).
 * Validates that verdicts match the target solution's expected tag.
 * Note: Checker must be compiled before calling this function.
 *
 * @param {LocalChecker} checker - Checker configuration
 * @param {LocalSolution} mainSolution - Main correct solution
 * @param {LocalSolution} targetSolution - Solution to validate
 * @param {LocalTestset[]} testsets - Array of testsets to check
 *
 * @throws {Error} If verdict validation fails
 * @throws {Error} If main solution has unexpected errors
 *
 * @example
 * // From fullVerification and testSolutionAgainstMainCorrect
 * await startTheComparisonProcess(
 *   config.checker,
 *   mainSolution,
 *   waSolution,
 *   config.testsets
 * );
 */
export declare function startTheComparisonProcess(checker: LocalChecker, mainSolution: LocalSolution, targetSolution: LocalSolution, testsets: LocalTestset[]): Promise<void>;
//# sourceMappingURL=solution.d.ts.map