/**
 * UITelemetry - Collects and tracks UI performance metrics and user interactions
 * Provides insights into UI responsiveness, user behavior, and system performance
 */
import { EventEmitter } from 'events';
export interface UIEvent {
    type: string;
    timestamp: number;
    duration?: number;
    metadata?: any;
}
export interface PerformanceMetric {
    name: string;
    value: number;
    unit: string;
    timestamp: number;
}
export interface UserInteraction {
    type: 'command' | 'keypress' | 'menu-selection' | 'cancel' | 'confirm';
    target?: string;
    timestamp: number;
    responseTime?: number;
    completed: boolean;
}
export interface RenderMetric {
    component: string;
    renderTime: number;
    frameCount: number;
    dropped: number;
    timestamp: number;
}
export interface TelemetrySnapshot {
    timestamp: number;
    period: {
        start: number;
        end: number;
    };
    events: {
        total: number;
        byType: Record<string, number>;
    };
    performance: {
        avgRenderTime: number;
        avgResponseTime: number;
        framerate: number;
        memoryUsage: NodeJS.MemoryUsage;
        cpuUsage: NodeJS.CpuUsage;
    };
    interactions: {
        total: number;
        completed: number;
        cancelled: number;
        avgResponseTime: number;
    };
    errors: {
        total: number;
        byType: Record<string, number>;
    };
}
export interface TelemetryConfig {
    enabled: boolean;
    bufferSize: number;
    flushInterval: number;
    captureStackTraces: boolean;
    anonymize: boolean;
    performanceThresholds: {
        renderTime: number;
        responseTime: number;
        framerate: number;
        memory: number;
    };
}
export declare class UITelemetry extends EventEmitter {
    private config;
    private events;
    private metrics;
    private interactions;
    private renderMetrics;
    private errors;
    private sessionStart;
    private marks;
    private measures;
    private flushTimer;
    private frameCounter;
    constructor(config?: Partial<TelemetryConfig>);
    /**
     * Start telemetry collection
     */
    private startCollection;
    /**
     * Record a UI event
     */
    recordEvent(type: string, eventMetadata?: any): void;
    /**
     * Start a performance mark
     */
    markStart(name: string): void;
    /**
     * End a performance mark and record the duration
     */
    markEnd(name: string, _metadata?: any): number;
    /**
     * Record a user interaction
     */
    recordInteraction(type: UserInteraction['type'], target?: string): {
        complete: () => void;
        cancel: () => void;
    };
    /**
     * Record render metrics
     */
    recordRender(component: string, renderTime: number): void;
    /**
     * Record an error
     */
    recordError(error: any, context?: any): void;
    /**
     * Record memory usage
     */
    private recordMemoryUsage;
    /**
     * Check performance threshold
     */
    private checkPerformanceThreshold;
    /**
     * Check response time threshold
     */
    private checkResponseTimeThreshold;
    /**
     * Trim buffer to prevent memory issues
     */
    private trimBuffer;
    /**
     * Anonymize sensitive data
     */
    private anonymizeData;
    /**
     * Get current telemetry snapshot
     */
    getSnapshot(): TelemetrySnapshot;
    /**
     * Get performance summary
     */
    getPerformanceSummary(): {
        measures: Record<string, {
            avg: number;
            min: number;
            max: number;
            count: number;
        }>;
        slowestOperations: Array<{
            name: string;
            duration: number;
        }>;
    };
    /**
     * Flush telemetry data
     */
    flush(): void;
    /**
     * Enable or disable telemetry
     */
    setEnabled(enabled: boolean): void;
    /**
     * Update configuration
     */
    updateConfig(config: Partial<TelemetryConfig>): void;
    /**
     * Reset all telemetry data
     */
    reset(): void;
    /**
     * Stop telemetry collection
     */
    stop(): void;
    /**
     * Dispose of telemetry
     */
    dispose(): void;
}
//# sourceMappingURL=UITelemetry.d.ts.map