/**
 * TypeScript declarations for experimental Shape Detection API
 * Used for native OCR via TextDetector
 */

interface DetectedText {
    boundingBox: DOMRectReadOnly;
    cornerPoints: { x: number; y: number }[];
    rawValue: string;
}

interface TextDetector {
    detect(image: ImageBitmapSource): Promise<DetectedText[]>;
}

interface TextDetectorConstructor {
    new(): TextDetector;
}

declare global {
    interface Window {
        TextDetector?: TextDetectorConstructor;
        ai?: {
            languageModel?: {
                create(): Promise<{
                    prompt(text: string): Promise<string>;
                    destroy(): void;
                }>;
            };
        };
    }
}

export { };
