UNPKG

react-native-scanbot-sdk

Version:

Scanbot Document and Barcode Scanner SDK React Native Plugin for Android and iOS

140 lines 4.96 kB
import { CommonFieldType } from './CommonFieldType'; import { DeepPartial, PartiallyConstructible, Point } from '../utils'; /** Result of OCR text recognition. */ export declare class OcrResult extends PartiallyConstructible { /** Maximum number of accumulated frames to inspect before actual result is returned. */ readonly text: string; /** Minimum number of accumulated frames that have equal result. */ readonly confidence: number; /** @param source {@displayType `DeepPartial<OcrResult>`} */ constructor(source?: DeepPartial<OcrResult>); } /** Field validation status. - `UNDEFINED`: Field value was not considered during validation. iOS only - `INVALID`: Field value failed validation. - `VALID`: Field value passed validation. - `CONFIRMED`: Field value was confirmed. */ export type ValidationStatus = 'UNDEFINED' | 'INVALID' | 'VALID' | 'CONFIRMED'; /**` Generic document field */ export declare class Field extends PartiallyConstructible { /** The type of the field. */ readonly type: Field.Type; /** Value of the field. Applicable only to text fields. */ readonly value: OcrResult | null; /** Coordinates of the field in the root document coordinate system. Android only. */ readonly polygonInRoot?: Point[]; /** Field validation status. Applicable only to fields that support some kind of validation. */ readonly validationStatus: ValidationStatus | null; /** @param source {@displayType `DeepPartial<Field>`} */ constructor(source?: DeepPartial<Field>); } export declare namespace Field { /** Generic Document Type */ class Type extends PartiallyConstructible { /** Local field type name scoped to the containing document type */ readonly name: string; /** Unique global field type name prefixed with the document types of all containing documents */ readonly fullName: string; /** Normalized global field type name. Fields in document types derived from the same base document type in the schema will have the same normalized name. */ readonly normalizedName: string; /** Commonly occurring fields that have the same semantic meaning in different document types will often have a set common type. */ readonly commonType: CommonFieldType | null; /** The friendly, human-readable display name of this field type in English. iOS only. */ displayText?: string | null; /** A document can contain multiple fields of the same name, the property serves for storing natural order of such fields, null if multiple entries aren't allowed for this field */ readonly listIndex: number | null; /** @param source {@displayType `DeepPartial<Type>`} */ constructor(source?: DeepPartial<Type>); } } /** Generic document */ export declare class GenericDocument extends PartiallyConstructible { /** Document type */ readonly type: GenericDocument.Type; /** List of document fields */ readonly fields: Field[]; /** List of document sub-documents */ readonly children: GenericDocument[]; /** The average confidence in the accuracy of the document recognition result Default is 0 */ readonly confidence: number; /** The weight of the confidence. Can be used to calculate the weighted average confidence of two documents. Default is 0 */ readonly confidenceWeight: number; /** @param source {@displayType `DeepPartial<GenericDocument>`} */ constructor(source?: DeepPartial<GenericDocument>); } export declare namespace GenericDocument { /** Generic Document Type */ class Type extends PartiallyConstructible { /** Local document type name */ readonly name: string; /** Unique global document type name prefixed with the document types of all containing documents */ readonly fullName: string; /** Normalized global document type name. Common document types appearing as child documents in different places will often have the same normalized type name. */ readonly normalizedName: string; /** The friendly, human-readable display name of this document type in English. iOS only. */ displayText?: string | null; /** A document can contain multiple fields of the same name, the property serves for storing natural order of such fields, null if multiple entries aren't allowed for this field */ readonly listIndex: number | null; /** @param source {@displayType `DeepPartial<Type>`} */ constructor(source?: DeepPartial<Type>); } } //# sourceMappingURL=GenericDocument.d.ts.map