import type { AutoCaptureError } from '../../error/auto-capture-error'; import type { AppState, ObjectValues, Resolution } from '../common'; export declare const ControlEventInstruction: { readonly CONTINUE_DETECTION: "continue-detection"; readonly SWITCH_CAMERA: "switch-camera"; readonly TOGGLE_MIRROR: "toggle-mirror"; }; export type ControlEventInstructionValues = ObjectValues; export declare const RequestCaptureInstruction: { readonly FIRST_FRAME: "first-frame"; readonly FIRST_VALID_FRAME: "first-valid-frame"; }; export type RequestCaptureInstructionValues = ObjectValues; export declare const ComponentCustomEvent: { readonly REQUEST_CAPTURE: "dot-custom-event:request-capture"; }; export type ComponentCustomEventValues = ObjectValues; export type ControlEvent = { detail?: { instruction: T; }; } & Event; export type CameraPropsChangeEvent = { detail?: { cameraResolution: Resolution; isMirroring: boolean; }; } & Event; export type CameraStateChangeEvent = { detail?: { appState: AppState; error?: AutoCaptureError; }; } & Event; export type InstructionChangeEvent = { detail?: { instructionCode: T; isEscalated: boolean; }; } & Event; export type PhaseChangedEvent = { detail?: { phaseName: T; }; } & Event; export type InstructionEscalatedEvent = { detail?: { instructionCode: T; }; } & Event; export type VideoElementSizeChangeEvent = { detail?: { size: DOMRect; }; } & Event; export type DetectionEvent = { detail?: { data: { detection: TDetectedObject; fps: number; imageResolution: Resolution; invalidValidators: Array; isInCandidateSelection: boolean; }; image: HTMLCanvasElement; }; } & Event; type DetectionDetails = { avgFps: number; detectionTime: number; fps: number; processedImage: ProcessedImage; resolution: Resolution; }; type ProcessedImage = { detection: TDetection; instructionCode: TInstructionCode; invalidValidators: TInstructionCode[]; isEscalated: boolean; isInCandidateSelection: boolean; }; export type DetectionChangedEvent = { detail?: { detectionDetails: DetectionDetails; image: HTMLCanvasElement; }; } & Event; export type CommonCustomEventKeys = { CAMERA_PROPS_CHANGED: string; CONTROL: string; DETECTION_CHANGED: string; INSTRUCTION_CHANGED: string; INSTRUCTION_ESCALATED: string; PHASE_CHANGED: string; STATE_CHANGED: string; VIDEO_ELEMENT_SIZE: string; }; type DashCase = T extends `${infer A}_${infer B}` ? `${Lowercase}-${DashCase}` : Lowercase; export type CommonCustomEvent = { [K in keyof TKeys]: `${TPrefix}:${DashCase}`; }; export {};