import { Observable } from 'rxjs';
import * as i0 from "@angular/core";
export interface TestingDashboardKPIs {
    totalTestsActive: number;
    passRateThisMonth: number;
    totalCostThisMonth: number;
    averageDuration: number;
    testsPendingReview: number;
    totalTestRuns: number;
    failedTests: number;
    skippedTests: number;
    passRateTrend: number;
}
export interface TestRunSummary {
    id: string;
    testId: string;
    testName: string;
    suiteName: string;
    testType: string;
    status: 'Passed' | 'Failed' | 'Skipped' | 'Error' | 'Running' | 'Timeout';
    score: number;
    duration: number;
    cost: number;
    runDateTime: Date;
    targetType: string;
    targetLogID: string;
}
export interface SuiteHierarchyNode {
    id: string;
    name: string;
    parentID: string | null;
    level: number;
    children: SuiteHierarchyNode[];
    testCount: number;
    passRate: number;
    totalCost: number;
    averageScore: number;
    expanded?: boolean;
}
export interface VersionMetrics {
    version: string;
    gitCommit: string;
    agentVersion: string;
    runDate: Date;
    totalTests: number;
    passRate: number;
    averageScore: number;
    totalCost: number;
    averageDuration: number;
    newFailures: number;
    newPasses: number;
}
export interface TestTrendData {
    timestamp: Date;
    totalRuns: number;
    passed: number;
    failed: number;
    skipped: number;
    errors: number;
    averageScore: number;
    totalCost: number;
    averageDuration: number;
}
export interface FeedbackPending {
    testRunID: string;
    testName: string;
    automatedScore: number;
    automatedStatus: string;
    runDateTime: Date;
    reason: 'no-feedback' | 'high-score-failed' | 'low-score-passed';
}
export interface TestAnalytics {
    topFailingTests: Array<{
        testName: string;
        failureCount: number;
        failureRate: number;
    }>;
    mostExpensiveTests: Array<{
        testName: string;
        totalCost: number;
        avgCost: number;
    }>;
    slowestTests: Array<{
        testName: string;
        avgDuration: number;
        maxDuration: number;
    }>;
    costByType: Array<{
        testType: string;
        totalCost: number;
        testCount: number;
    }>;
    costBySuite: Array<{
        suiteName: string;
        totalCost: number;
        testCount: number;
    }>;
    passingRateByType: Array<{
        testType: string;
        passRate: number;
        totalTests: number;
    }>;
}
export interface FeedbackStats {
    totalFeedback: number;
    reviewedCount: number;
    avgRating: number;
    agreementRate: number;
    disagreementRate: number;
    accuracyRate: number;
}
/**
 * Extended test run summary with human feedback data included
 */
export interface TestRunWithFeedbackSummary extends TestRunSummary {
    humanRating: number | null;
    humanIsCorrect: boolean | null;
    humanComments: string | null;
    hasHumanFeedback: boolean;
    feedbackId: string | null;
    passedChecks: number | null;
    failedChecks: number | null;
    totalChecks: number | null;
}
/**
 * Aggregated evaluation metrics
 */
export interface EvaluationSummaryMetrics {
    totalRuns: number;
    execCompletedCount: number;
    execErrorCount: number;
    execSuccessRate: number;
    humanReviewedCount: number;
    humanPendingCount: number;
    humanAvgRating: number;
    humanCorrectRate: number;
    autoEvaluatedCount: number;
    autoAvgScore: number;
    autoPassRate: number;
    agreementRate: number;
}
export declare class TestingInstrumentationService {
    private readonly _dateRange$;
    private readonly _suiteFilter$;
    private readonly _testTypeFilter$;
    private readonly _refreshTrigger$;
    private readonly _isLoading$;
    private readonly metadata;
    readonly isLoading$: Observable<boolean>;
    readonly dateRange$: Observable<{
        start: Date;
        end: Date;
    }>;
    constructor();
    readonly kpis$: Observable<TestingDashboardKPIs>;
    readonly testRuns$: Observable<TestRunSummary[]>;
    readonly suiteHierarchy$: Observable<SuiteHierarchyNode[]>;
    readonly trends$: Observable<TestTrendData[]>;
    readonly analytics$: Observable<TestAnalytics>;
    readonly pendingFeedback$: Observable<FeedbackPending[]>;
    readonly feedbackStats$: Observable<FeedbackStats>;
    /**
     * Test runs with feedback data joined - for evaluation display
     */
    readonly testRunsWithFeedback$: Observable<TestRunWithFeedbackSummary[]>;
    /**
     * Aggregated evaluation metrics from test runs with feedback
     */
    readonly evaluationMetrics$: Observable<EvaluationSummaryMetrics>;
    private checkLoadingComplete;
    setDateRange(start: Date, end: Date): void;
    setSuiteFilter(suiteId: string | null): void;
    setTestTypeFilter(typeId: string | null): void;
    refresh(): void;
    private loadKPIs;
    private countTestsPendingReview;
    private loadTestRuns;
    private loadSuiteHierarchy;
    private loadTrends;
    private loadAnalytics;
    private loadPendingFeedback;
    private loadFeedbackStats;
    submitFeedback(testRunID: string, rating: number, isCorrect: boolean, comments: string): Promise<boolean>;
    getVersionMetrics(): Promise<VersionMetrics[]>;
    private createTimeBuckets;
    private getBucketSize;
    /**
     * Load test runs with feedback data joined for evaluation display
     */
    private loadTestRunsWithFeedback;
    /**
     * Calculate aggregated evaluation metrics from test runs with feedback
     */
    private calculateEvaluationMetrics;
    static ɵfac: i0.ɵɵFactoryDeclaration<TestingInstrumentationService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<TestingInstrumentationService>;
}
//# sourceMappingURL=testing-instrumentation.service.d.ts.map