/**
 * 路由监控服务
 * 提供路由访问统计、性能监控、错误监控等功能
 */
import type { RouteLocation } from '../types';
import type { RouterError } from '../errors';
/**
 * 路由性能指标
 */
interface RoutePerformanceMetrics {
    /**
     * 路由匹配时间（毫秒）
     */
    matchTime?: number;
    /**
     * 组件加载时间（毫秒）
     */
    loadTime?: number;
    /**
     * 路由渲染时间（毫秒）
     */
    renderTime?: number;
    /**
     * 总时间（毫秒）
     */
    totalTime?: number;
}
/**
 * 路由监控配置
 */
export interface RouterMonitoringConfig {
    /**
     * 是否启用路由监控
     * @default true
     */
    enabled?: boolean;
    /**
     * 是否记录路由访问
     * @default true
     */
    trackAccess?: boolean;
    /**
     * 是否记录性能指标
     * @default true
     */
    trackPerformance?: boolean;
    /**
     * 是否记录错误
     * @default true
     */
    trackErrors?: boolean;
    /**
     * 最大记录数量
     * @default 1000
     */
    maxRecords?: number;
    /**
     * 采样率 (0-1)
     * @default 1.0
     */
    sampleRate?: number;
}
/**
 * 路由监控服务
 */
export declare class RouterMonitoring {
    private accessRecords;
    private performanceMetrics;
    private config;
    private monitoringService;
    private currentRouteStartTime;
    private currentRoute?;
    constructor(config?: RouterMonitoringConfig);
    /**
     * 记录路由访问
     */
    trackRouteAccess(to: RouteLocation, from?: RouteLocation, success?: boolean, error?: Error): void;
    /**
     * 记录路由性能指标
     */
    trackRoutePerformance(routeName: string, metrics: RoutePerformanceMetrics): void;
    /**
     * 记录路由错误
     */
    trackRouteError(error: RouterError | Error, context?: Record<string, unknown>): void;
    /**
     * 获取路由访问统计
     */
    getAccessStats(): {
        total: number;
        success: number;
        failed: number;
        byPath: Record<string, number>;
        byName: Record<string, number>;
        averageDuration: number;
    };
    /**
     * 获取路由性能统计
     */
    getPerformanceStats(): Record<string, {
        count: number;
        averageMatchTime: number;
        averageLoadTime: number;
        averageRenderTime: number;
        averageTotalTime: number;
    }>;
    /**
     * 清空所有记录
     */
    clear(): void;
    /**
     * 获取监控报告
     */
    getReport(): {
        access: {
            total: number;
            success: number;
            failed: number;
            byPath: Record<string, number>;
            byName: Record<string, number>;
            averageDuration: number;
        };
        performance: Record<string, {
            count: number;
            averageMatchTime: number;
            averageLoadTime: number;
            averageRenderTime: number;
            averageTotalTime: number;
        }>;
        timestamp: number;
    };
}
export declare function getRouterMonitoring(config?: RouterMonitoringConfig): RouterMonitoring;
export {};
//# sourceMappingURL=RouterMonitoring.d.ts.map