import { EventEmitter } from '../../stencil-public-runtime';
import * as faceDetection from '@tensorflow-models/face-detection';
import '@tensorflow/tfjs-backend-webgl';
import '@tensorflow/tfjs-backend-cpu';
import '@tensorflow/tfjs-converter';
import { Results } from '@mediapipe/face_detection';
export interface VisageTexts {
    autoInstructions?: {
        step1Title?: string;
        step1Description?: string;
        step1Subtext?: string;
        step2Title?: string;
        step2Description?: string;
        step2Subtext?: string;
        pauseButton?: string;
        continueButton?: string;
        nextButton?: string;
    };
    manualInstructions?: {
        modeTitle?: string;
        modeDescription?: string;
        positionPrompt?: string;
        lowResourcePrompt?: string;
        modelFailurePrompt?: string;
        startRecordingButton?: string;
        recIndicator?: string;
    };
    positionFeedback?: {
        noFace?: string;
        multipleFaces?: string;
        tooClose?: string;
        tooFar?: string;
        notCentered?: string;
        perfect?: string;
    };
    errorMessages?: {
        noFaceDetected?: string;
        multipleFacesDetected?: string;
        faceNotVisible?: string;
        faceTooClose?: string;
        faceNotCentered?: string;
        noFaceWithLighting?: string;
    };
    cameraMenu?: {
        selectCamera?: string;
        cameraLabel?: string;
    };
    loading?: {
        initializingCamera?: string;
    };
}
export declare class FaceDetector {
    private static readonly MAX_ROTATION_THRESHOLD;
    private static readonly STABILITY_FRAMES_REQUIRED;
    private videoElement;
    private stream;
    private faceDetector;
    private mediapipeFaceDetection;
    private svgElement;
    private smoothedDetections;
    private pitchBaseline;
    private countdownTimer;
    private mediaRecorder;
    private recordedChunks;
    private wasInOptimalPosition;
    private recordingCancelled;
    private recordingStopHandled;
    private zoomedRecordingRafId;
    private currentMimeType;
    private instructionTimer;
    private manualHelpTimer;
    private buttonDebounce;
    private stableOptimalFrames;
    private stableNonOptimalFrames;
    private initialHelpDisplayed;
    private _cachedIsMobilePhone;
    private offscreenCanvas;
    private offscreenCtx;
    private lastDetectionInputWidth;
    private lastDetectionInputHeight;
    private frameSkipCounter;
    private currentDetectionMode;
    private detectionStartTime;
    private hasActivatedManualMode;
    private slowDetectionCount;
    private readonly DETECTION_TIMEOUT_MS;
    private readonly MAX_SLOW_DETECTIONS;
    private benchmarkScore;
    private readonly BENCHMARK_THRESHOLD_FULL;
    private readonly BENCHMARK_THRESHOLD_LIGHT;
    private fpsHistory;
    private lastFrameTime;
    private readonly FPS_HISTORY_SIZE;
    private readonly MIN_FPS_THRESHOLD;
    private readonly MIN_FPS_FOR_MANUAL;
    private hasDowngradedToLight;
    private fpsCheckInterval;
    private consecutiveLowFpsCount;
    private readonly CONSECUTIVE_LOW_FPS_THRESHOLD;
    private resizeObserver;
    private resizeDebounceTimer;
    private tracingService;
    private metricsService;
    private licenseValidationService;
    debug: boolean;
    camera: 'front' | 'back' | 'auto';
    showHelpOnStart: boolean;
    detectionMode: 'full' | 'light' | 'auto';
    captureMode: 'auto' | 'manual';
    language: 'es' | 'en';
    texts: VisageTexts;
    telemetryCollectorUrl?: string;
    metricsCollectorUrl?: string;
    enableTelemetry: boolean;
    enableMetrics: boolean;
    customerId?: string;
    tenantId?: string;
    environment?: string;
    propagateTraceHeaderCorsUrls?: string;
    metricsExportIntervalMillis?: number;
    license?: string;
    licenseEnvironment?: 'dev' | 'qa' | 'sandbox' | 'prod';
    traceId?: string;
    appId?: string;
    isStreaming: boolean;
    error: string;
    detections: faceDetection.Face[] | Results;
    faceRotation: number;
    facePitch: number;
    faceYaw: number;
    faceAreaPercentage: number;
    countdown: number;
    isRecording: boolean;
    showCaptureEffect: boolean;
    showInstructions: boolean;
    instructionStep: number;
    stepProgress: number;
    videoBase64: string;
    statusMessage: string;
    availableCameras: MediaDeviceInfo[];
    selectedCameraId: string;
    currentFacingMode: 'user' | 'environment';
    showCameraMenu: boolean;
    modelsLoaded: boolean;
    totalDetections: number;
    detectionsWithFaces: number;
    lastTwoDetectionTimes: number[];
    guideIsPaused: boolean;
    faceDetectionError: string;
    showPositionMask: boolean;
    manualInstructions: string;
    ovalStyle: {
        [key: string]: string;
    };
    firstDetectionMade: boolean;
    showManualModeHelp: boolean;
    manualHelpStep: number;
    manualHelpProgress: number;
    licenseValid: boolean;
    licenseError: string | null;
    videoCaptured: EventEmitter<{
        base64: string;
    }>;
    statusUpdated: EventEmitter<{
        status: string;
        message: string;
    }>;
    traceIdGenerated: EventEmitter<{
        traceId: string;
    }>;
    componentWillLoad(): Promise<void>;
    componentDidLoad(): Promise<void>;
    private initializeTelemetry;
    private validateLicense;
    private static readonly DEFAULT_TEXTS_ES;
    private static readonly DEFAULT_TEXTS_EN;
    private getTexts;
    private updateDetectionTimes;
    private setInitialFacingMode;
    private isMobilePhone;
    private get isRearMobile();
    private getFaceAreaThresholds;
    private detectDeviceCapabilities;
    /**
     * Runs a performance benchmark to determine actual device processing capability.
     * This is more accurate than static device detection as it measures real performance.
     * The benchmark performs canvas operations similar to those used in face detection.
     * @returns Score indicating iterations completed in 100ms. Higher = better performance.
     */
    private runPerformanceBenchmark;
    /**
     * Determines detection mode using benchmark results combined with device detection.
     * This provides a more accurate assessment than static detection alone.
     */
    private determineOptimalDetectionMode;
    /**
     * Updates FPS tracking and returns current average FPS.
     * Called after each frame is processed.
     */
    private updateFpsTracking;
    /**
     * Checks current FPS and adaptively switches detection mode if performance is poor.
     * This allows the system to react to real-world performance issues.
     */
    private checkAdaptivePerformance;
    /**
     * Switches from full mode to light mode dynamically.
     * This is called when adaptive detection finds poor performance.
     */
    private switchToLightMode;
    /**
     * Resets adaptive detection state.
     * Called when stopping or restarting detection.
     */
    private resetAdaptiveState;
    private updateOvalStyle;
    private setupResizeObserver;
    private isLowResourceDevice;
    private selectCameraByPreference;
    private initializeFaceDetection;
    private initializeMediaPipeDetection;
    private initializeTensorFlowDetection;
    disconnectedCallback(): void;
    startCamera(): Promise<void>;
    stopCamera(): Promise<void>;
    preload(): Promise<void>;
    start(): Promise<void>;
    stop(): Promise<void>;
    restart(): Promise<void>;
    private isVirtualCamera;
    getCameraDevices(): Promise<MediaDeviceInfo[]>;
    showHelp(): Promise<void>;
    captureNow(): Promise<void>;
    private startManualCountdown;
    switchCamera(deviceId?: string): Promise<void>;
    getAvailableCameras(): Promise<MediaDeviceInfo[]>;
    getCurrentCameraId(): Promise<string>;
    /**
     * Detecta automáticamente el tipo de cámara que se está usando realmente
     * basándose en el track de video activo y la lista de cámaras disponibles
     */
    private detectActualCameraType;
    private processVideoFrame;
    private processTensorFlowFrame;
    private startDetectionTiming;
    private checkDetectionTime;
    private activateManualMode;
    private activateManualModeOnModelFailure;
    private restartCameraWithLightMode;
    private releaseModelResources;
    private drawDetections;
    private processMediaPipeDetection;
    private processTensorFlowDetection;
    private calculateFaceRotation;
    private resetFaceRotation;
    private getCurrentDetectionBoxes;
    private drawDetectionBoxes;
    private smoothDetections;
    private handleOptimalPosition;
    private startCountdown;
    private cancelCountdown;
    private cancelCountdownAndRecording;
    private startRecording;
    private handleRecordingStop;
    private isIOSDevice;
    private isSafari;
    private applyRearCameraZoom;
    private createZoomedRecordingStream;
    private stopRecording;
    private stopFaceDetection;
    private triggerCaptureEffect;
    private startInstructionCycle;
    private stopInstructionCycle;
    private skipToNextStep;
    private reopenGuide;
    private startManualHelpCycle;
    private stopManualHelpCycle;
    private skipManualHelpStep;
    private clearDetections;
    private toggleGuidePause;
    private copyMetricsToClipboard;
    private showVideo;
    private blobToBase64;
    private debugLog;
    private updateStatus;
    private selectCameraFromMenu;
    private renderDebugAreaInfo;
    render(): any;
}
