import type { VulnerabilitySeverity, VulnerabilityFinding, ScanResult } from './continuous-monitoring.js';
import type { POAMItem, PoamRiskLevel, POAMStatus } from './poam.js';
import type { FedRAMPControl } from './controls.js';
import type { ImplementationStatus } from '../types.js';
/**
 * Time periods for metrics
 */
export declare const TIME_PERIODS: readonly ["daily", "weekly", "monthly", "quarterly", "annually"];
export type TimePeriod = (typeof TIME_PERIODS)[number];
/**
 * Metric trend direction
 */
export declare const TREND_DIRECTIONS: readonly ["improving", "stable", "degrading"];
export type TrendDirection = (typeof TREND_DIRECTIONS)[number];
/**
 * Vulnerability aging metrics
 */
export interface VulnerabilityAgingMetrics {
    /** Calculation timestamp */
    calculatedAt: Date;
    /** Total open vulnerabilities */
    totalOpen: number;
    /** By severity */
    bySeverity: Record<VulnerabilitySeverity, {
        total: number;
        averageAgeDays: number;
        oldestDays: number;
        withinSLA: number;
        outsideSLA: number;
        percentWithinSLA: number;
    }>;
    /** Aging buckets */
    agingBuckets: {
        '0-30': number;
        '31-60': number;
        '61-90': number;
        '91-180': number;
        '180+': number;
    };
    /** Overall average age */
    overallAverageAgeDays: number;
    /** Oldest vulnerability age */
    oldestVulnerabilityDays: number;
    /** Trend vs previous period */
    trend: TrendDirection;
    /** Previous period average for comparison */
    previousPeriodAverage?: number;
}
/**
 * POA&M metrics
 */
export interface POAMMetrics {
    /** Calculation timestamp */
    calculatedAt: Date;
    /** Total POA&M items */
    totalItems: number;
    /** By status */
    byStatus: Record<POAMStatus, number>;
    /** By risk level */
    byRiskLevel: Record<PoamRiskLevel, {
        total: number;
        open: number;
        overdue: number;
        averageAgeDays: number;
    }>;
    /** Overdue items */
    overdueItems: number;
    /** Overdue percentage */
    overduePercentage: number;
    /** Average time to close (days) */
    averageTimeToCloseDays: number;
    /** Closure rate (last 90 days) */
    closureRateLast90Days: number;
    /** Items opened last 30 days */
    openedLast30Days: number;
    /** Items closed last 30 days */
    closedLast30Days: number;
    /** Net change last 30 days */
    netChangeLast30Days: number;
    /** Trend */
    trend: TrendDirection;
    /** Deviations pending */
    deviationsPending: number;
    /** Deviations approved */
    deviationsApproved: number;
}
/**
 * Control implementation metrics
 */
export interface ControlImplementationMetrics {
    /** Calculation timestamp */
    calculatedAt: Date;
    /** Total controls in baseline */
    totalControls: number;
    /** By implementation status */
    byStatus: Record<ImplementationStatus, number>;
    /** Implementation percentage */
    implementationPercentage: number;
    /** Partial implementation percentage */
    partialImplementationPercentage: number;
    /** By control family */
    byFamily: Array<{
        family: string;
        total: number;
        implemented: number;
        percentage: number;
    }>;
    /** Controls with automated testing */
    automatedTestingCoverage: {
        total: number;
        withAutomatedTests: number;
        percentage: number;
    };
    /** High priority (P1) implementation */
    p1Implementation: {
        total: number;
        implemented: number;
        percentage: number;
    };
    /** Trend */
    trend: TrendDirection;
    /** Previous period percentage */
    previousPeriodPercentage?: number;
}
/**
 * Scan compliance metrics
 */
export interface ScanComplianceMetrics {
    /** Calculation timestamp */
    calculatedAt: Date;
    /** Monthly scan compliance */
    monthlyScanCompliance: {
        lastTwelveMonths: number[];
        percentCompliant: number;
        missedMonths: string[];
    };
    /** Last scan information */
    lastScan: {
        date?: Date;
        type?: string;
        daysSinceLastScan?: number;
        isOverdue: boolean;
    };
    /** Scan coverage */
    coverage: {
        totalAssets: number;
        scannedAssets: number;
        coveragePercentage: number;
        unscannedAssets: string[];
    };
    /** Scan findings trends */
    findingsTrends: {
        period: string;
        critical: number;
        high: number;
        moderate: number;
        low: number;
    }[];
    /** Authenticated scan percentage */
    authenticatedScanPercentage: number;
    /** Trend */
    trend: TrendDirection;
}
/**
 * ConMon dashboard metrics
 */
export interface ConMonDashboardMetrics {
    /** Generation timestamp */
    generatedAt: Date;
    /** System name */
    systemName: string;
    /** Authorization status */
    authorizationStatus: 'active' | 'expiring-soon' | 'expired';
    /** Days until ATO expiration */
    daysUntilATOExpiration: number;
    /** Overall compliance score (0-100) */
    overallComplianceScore: number;
    /** Vulnerability metrics */
    vulnerabilityMetrics: VulnerabilityAgingMetrics;
    /** POA&M metrics */
    poamMetrics: POAMMetrics;
    /** Control metrics */
    controlMetrics: ControlImplementationMetrics;
    /** Scan metrics */
    scanMetrics: ScanComplianceMetrics;
    /** Key risk indicators */
    keyRiskIndicators: Array<{
        indicator: string;
        value: number;
        threshold: number;
        status: 'green' | 'yellow' | 'red';
        trend: TrendDirection;
    }>;
    /** Action items */
    actionItems: Array<{
        priority: 'critical' | 'high' | 'medium' | 'low';
        description: string;
        dueDate?: Date;
    }>;
}
/**
 * Historical metric data point
 */
export interface MetricDataPoint {
    timestamp: Date;
    value: number;
    metadata?: Record<string, unknown>;
}
/**
 * Metrics configuration
 */
export interface MetricsConfig {
    /** System name */
    systemName: string;
    /** ATO date */
    atoDate: Date;
    /** ATO expiration date */
    atoExpirationDate: Date;
    /** Authorization level */
    authorizationLevel: 'low' | 'moderate' | 'high';
    /** SLA for vulnerability remediation (days) */
    remediationSLAs: Record<VulnerabilitySeverity, number>;
    /** Monthly scan requirement day */
    monthlyScanRequirementDay: number;
    /** Enable historical tracking */
    trackHistory: boolean;
}
/**
 * FedRAMP Metrics Service
 */
export declare class MetricsService {
    private config;
    private vulnerabilityHistory;
    private poamHistory;
    private controlHistory;
    private scanHistory;
    constructor(config: MetricsConfig);
    /**
     * Calculate vulnerability aging metrics
     */
    calculateVulnerabilityMetrics(vulnerabilities: VulnerabilityFinding[]): VulnerabilityAgingMetrics;
    private calculateSeverityMetrics;
    private calculateAgingBuckets;
    /**
     * Calculate POA&M metrics
     */
    calculatePOAMMetrics(poamItems: POAMItem[]): POAMMetrics;
    private calculatePOAMRiskLevelMetrics;
    /**
     * Calculate control implementation metrics
     */
    calculateControlMetrics(controls: FedRAMPControl[]): ControlImplementationMetrics;
    private calculateFamilyMetrics;
    /**
     * Calculate scan compliance metrics
     */
    calculateScanMetrics(scans: ScanResult[], totalAssets: number, scannedAssetIds: string[]): ScanComplianceMetrics;
    private calculateFindingsTrends;
    /**
     * Generate comprehensive ConMon dashboard metrics
     */
    generateDashboardMetrics(vulnerabilities: VulnerabilityFinding[], poamItems: POAMItem[], controls: FedRAMPControl[], scans: ScanResult[], totalAssets: number, scannedAssetIds: string[]): ConMonDashboardMetrics;
    private calculateOverallScore;
    private calculateKeyRiskIndicators;
    private generateActionItems;
    private calculateTrend;
    /**
     * Get historical data for a metric
     */
    getHistory(metricType: 'vulnerability' | 'poam' | 'control' | 'scan'): MetricDataPoint[];
    /**
     * Export metrics to JSON
     */
    exportMetrics(dashboard: ConMonDashboardMetrics): string;
}
export default MetricsService;
//# sourceMappingURL=metrics.d.ts.map