@idscan/idvc2
Version:
component for the capturing documents
175 lines (174 loc) • 5.09 kB
TypeScript
import { CameraNotSupportedReason } from '../types/modules/camera.enum';
type LabelGroup = 'errorCodes' | 'hintTexts' | 'keyErrors' | 'general' | 'uploaderDescription' | 'documentsTypes' | 'loaderText';
type AllTypes = IErrorCodes | IHintTexts | KeyError | IGeneral | IDocumentsTypes | IUploaderDescription | ISpinnerText;
type Label = Record<LabelGroup, AllTypes>;
export type AllLabels = Record<SupportedLanguage, Label>;
type KeyError = string[];
type GetTranslation = {
(): Label;
(groupName: 'errorCodes'): IErrorCodes;
(groupName: 'hintTexts'): IHintTexts;
(groupName: 'keyErrors'): KeyError;
(groupName: 'general'): IGeneral;
(groupName: 'loaderText'): ISpinnerText;
(groupName: LabelGroup): AllTypes;
};
export type ErrorCodeNames = 'mrzNotFound' | 'mrzNotRecognized' | 'barcodeNotFound' | 'barcodeNotRecognized' | 'heic' | 'fileType' | 'fileTypeHeic' | 'faceNotFound' | 'disableStepFileUpload' | 'notAllowedDocument' | 'documentSideLowPerimeter' | 'faceOnFrontNotDetected' | 'frontSideNotDetected' | 'backSideNotDetected' | 'default' | 'lowImageResolution' | 'imageIsBlurred' | 'faceLowArea' | 'disabledManualUpload' | keyof typeof CameraNotSupportedReason;
export type ErrorCodes = '' | ErrorCodeNames;
export type SupportedLanguage = typeof supportedLanguages[number];
type IErrorCodes = Record<ErrorCodeNames, string | Record<string, any>>;
interface IHintTexts {
front: string;
frontMRZ: string;
mrz: string;
capturing: string;
pdf: string;
switchToUploader: string;
back: string;
barcode: string;
hold: {
front: string;
pdf: string;
mrz: string;
back: string;
barcode: string;
};
capture: {
pdf: string;
mrz: string;
back: string;
};
dontSee: string;
dontMove: string;
turnFaceLeft: string;
turnFaceRight: string;
turnFaceUp: string;
turnFaceDown: string;
faceCam: string;
camAway: string;
moveCenter: string;
comeCloser: string;
documentCloser: string;
holdCamera: string;
captureCorners: string;
frontSideNotMatch: string;
}
interface IGeneral {
step: string;
scan: string;
front: string;
mrz: string;
mrzFront: string;
pdf: string;
face: string;
barcode: string;
back: string;
awaiting: string;
notificationStepSuccess: string;
notificationStepWarning: string;
notificationDocumentTypeChangedInfo: string;
notificationStepsResetInfo: string;
notificationStepMinSize: string;
notificationSubmit: string;
notificationCaptureHook: string;
notificationCaptureSide: string;
notificationCaptureWithWarnings: string;
idvcVersionPlank: string;
submitProcessSpinner: {
top: string;
bottom: string;
};
card: {
edit: string;
complete: string;
};
modeSwitch: {
video: string;
uploader: string;
};
uploader: {
dragHint: string;
dividerHint: string;
fileHint: string;
successUpload: string;
warningUpload: string;
mainHint: string;
complete: string;
};
messageBox: {
default: string;
changeDocumentTypeText: string;
documentTypeText: string;
disableProcessing: string;
};
controlButtons: {
upload: string;
reset: string;
submit: string;
start: string;
back: string;
edit: string;
continue: string;
capture: string;
retake: string;
};
desktopNotification: {
barcode: string;
mrz: string;
other: string;
};
documentType: string;
selectDocumentTypeText: string;
changeBtn: string;
correctBtn: string;
cancelBtn: string;
doneBtn: string;
closeBtn: string;
retakeBtn: string;
continueBtn: string;
submitBtn: string;
resetAllStepsBtn: string;
btnUploader: string;
btnCamera: string;
pressToUpdateText: string;
pressToUpdateTextSuccess: string;
}
interface IDocumentsTypes {
DL: string;
IC: string;
Passport: string;
PassportCard: string;
GreenCard: string;
EmploymentAuthorization: string;
InternationalId: string;
Barcode: string;
FaceAuthorization: string;
}
interface IUploaderDescription {
textFront: string;
textBack: string;
textFace: string;
textPdf: string;
textMrz: string;
textFrontBack: string;
textPass: string;
textFacePosition: string;
}
interface ISpinnerText {
warmup: {
top: string;
bottom: string;
};
awaiting: string;
loadingStep: string;
changeMode: string;
resetting: string;
uploading: string;
preparingToWork: string;
loadingDocument: string;
}
export declare const supportedLanguages: readonly ["en", "es"];
export declare const labels: AllLabels;
export declare const setTranslation: (translationLang?: SupportedLanguage, customLang?: Partial<AllLabels>) => void;
export declare const getTranslation: GetTranslation;
export {};