UNPKG

@idscan/idvc2

Version:

component for the capturing documents

76 lines (75 loc) 2.14 kB
import MrzModel, { PredictionList } from '../neural models/mrzModel'; import type { IMrzScanRes } from '../types/mrz'; import type { IMrzCoords } from '../loop'; import type { StepFunctionResult } from '../types/loop'; import type { MRZLocation } from './manualUploadProcessing'; interface IMrzStepResult extends StepFunctionResult { coords?: IMrzCoords; needToCut?: boolean; results?: { mrzText: string; }; } interface ILicenceError { errorType: string; error: boolean; errorVal: string; } interface IDetectRes { status: boolean; results?: { mrzText: string; } | null; locations?: MRZLocation; error?: ILicenceError; isNotMRZ: boolean; } export declare class MrzModule { w: number; h: number; successCount: number; worker: Worker; model: MrzModel; isInitialized: boolean; isProcessing: boolean; MIN_MRZ_FRAMES: number; constructor(worker: any, key: string, networkUrl: string); getErrorVal(errorId: number): any; /** * returns error Object * @return {ILicenceError} */ licenseError(errorId: number): ILicenceError; yComparator(point1: any, point2: any): any[]; allocate(): void; prepareMRZLocation(locations: any): MRZLocation; writeResults(mrzResults: IMrzScanRes): { mrzText: string; }; predict(batchArr: Float32Array, batchSize: any): Promise<PredictionList[]>; scan(iData: ImageData): Promise<IMrzScanRes>; /** * process frame for MRZ * @param data */ processMRZ(data: any): Promise<IMrzStepResult | { error: ILicenceError; status: { value: number; }; fields: import("../types/mrz").MrzFields; count: number; location: import("../types/mrz").IMRZLocation; errorStatus?: string; symbolsConf: number; errorId: number; }>; estimateResults(data: any): number; /** * detects MRZ on ImageData * @param {ImageData} imageData * @return {Promise<>} */ detectMrz(imageData: ImageData): Promise<IDetectRes>; } export default MrzModule;