// Accelerated Shape Detection in Images // Specification: https://wicg.github.io/shape-detection-api/ // Repository: https://github.com/WICG/shape-detection-api /// interface FaceDetector { detect(image: ImageBitmapSource): Promise; } declare var FaceDetector: { prototype: FaceDetector; new(faceDetectorOptions?: FaceDetectorOptions): FaceDetector; } interface FaceDetectorOptions { maxDetectedFaces?: number; fastMode?: boolean; } interface DetectedFace { boundingBox: DOMRectReadOnly; landmarks: ReadonlyArray; } interface Landmark { locations: ReadonlyArray; type?: LandmarkType; } type LandmarkType = ( | "mouth" | "eye" | "nose" ); interface BarcodeDetector { detect(image: ImageBitmapSource): Promise; } declare var BarcodeDetector: { prototype: BarcodeDetector; new(barcodeDetectorOptions?: BarcodeDetectorOptions): BarcodeDetector; getSupportedFormats(): Promise; }; interface BarcodeDetectorOptions { formats?: BarcodeFormat[]; } interface DetectedBarcode { boundingBox: DOMRectReadOnly; rawValue: string; format: BarcodeFormat; cornerPoints: ReadonlyArray; } type BarcodeFormat = ( | "aztec" | "code_128" | "code_39" | "code_93" | "codabar" | "data_matrix" | "ean_13" | "ean_8" | "itf" | "pdf417" | "qr_code" | "unknown" | "upc_a" | "upc_e" );