UNPKG

@privateid/small-age-sdk-alpha

Version:
121 lines (120 loc) 4.06 kB
import { CameraFaceMode, DocType } from './types'; declare let faceMode: CameraFaceMode; export declare const multiframeLivenessAndAge: (callback: any, config?: any) => Promise<{ result: string; }>; /** * This function open camera, and returns the stream, current faceMode and the list of available media devices * @category Face * @param domElement id of the video tag * @param requireHD * @param deviceId * @param requestFaceMode * @param canvasResolution * @param isDocumentScan */ export declare const openCamera: (domElement: string, requireHD: boolean, deviceId?: string | null, requestFaceMode?: CameraFaceMode | null, canvasResolution?: { width: number; height: number; } | null, isDocumentScan?: boolean) => Promise<{ stream: MediaStream | null; devices: MediaDeviceInfo[] | null; faceMode: CameraFaceMode | null; settings: MediaTrackSettings | null; status: boolean; errorMessage?: string | null; capabilities: MediaTrackCapabilities | null; }>; /** * This function open camera, and returns the stream, current faceMode and the list of available media devices * @category Face * @param domElement id of the video tag */ export declare const closeCamera: (element: string | undefined) => Promise<void>; /** * This function switch camera from front to back on mobile, and to another device on desktop * @category Face * @param selectedCamera Selected camera either front or back * @param device Selected camera ID * @param canvasResolution */ export declare const switchCamera: (selectedCamera: CameraFaceMode | null, device: string, canvasResolution?: { width: number; height: number; } | null) => Promise<{ capabilities: MediaTrackCapabilities | null; settings: MediaTrackSettings | null; } | null>; export declare const openFrontCameraOnly: (domElement: string, deviceId?: string | null) => Promise<{ stream: MediaStream | null; devices: MediaDeviceInfo[] | null; faceMode: CameraFaceMode | null; settings: MediaTrackSettings | null; status: boolean; errorMessage?: string | null; capabilities: MediaTrackCapabilities | null; }>; export declare const documentMugshotFaceCompare: (callback: (input: { result?: number; }) => void, imageDataA: ImageData, imageDataB: ImageData, config?: { input_image_format: string; }) => Promise<{ result: number; }>; export declare const isValidPhotoID: (docType: DocType, callback?: any, image?: ImageData, config?: { input_image_format: string; document_scan_barcode_only?: string; } | null, canvasSize?: { width: number; height: number; } | Record<string, never>) => Promise<{ result: number; croppedDocument: Uint8ClampedArray; croppedMugshot: Uint8ClampedArray; imageData: ImageData; } | { result: number; croppedDocument: Uint8ClampedArray; croppedBarcode: Uint8ClampedArray; imageData: ImageData; } | { result: string; } | { result: number; croppedDocument: Uint8ClampedArray; croppedMugshot: Uint8ClampedArray; } | { result: number; croppedDocument: Uint8ClampedArray; croppedBarcode: Uint8ClampedArray; } | { result: number; }>; export declare const scanDocumentWithOcr: (callback?: any, image?: ImageData, config?: { input_image_format: string; document_scan_barcode_only?: string; } | null, canvasSize?: { width: number; height: number; } | Record<string, never>) => Promise<{ result: string; } | { result: number; croppedDocument: Uint8ClampedArray; croppedMugshot: Uint8ClampedArray; } | { result: number; }>; export declare const ocrDocumentImage: (callback: any, image: ImageData, config?: { input_image_format: string; document_scan_barcode_only?: string; } | null) => Promise<{ result: string; } | { result: number; croppedDocument: Uint8ClampedArray; croppedMugshot: Uint8ClampedArray; } | { result: number; }>; export {};