import Config from '../core/Config'; import { GUI } from '../core/GUI'; export default class User { static gui: GUI; static configuration: { captureMode: string; }; static config: Config; /** * This method is used to capture the front side of the id card * @param data - Data URI obtained from the canvas * @returns File Data from the URI */ dataURIToFile: (data: any) => Promise; /** * To encode the data URI from the canvas * @param dataURI - Captured canvas data uri * @returns - Promise resolves to encoded uri */ encodeDataURI: (dataURI: string) => Promise; /** * This method is used to capture the front side of the id card * @param data - Data URI obtained from the canvas * @param cardType - Type of the card to be scanned */ captureFrontSide: (data: any, cardType: number) => Promise<{ image: string; name: string; sex: string; uniqueId: string; dob: string; address: string; fatherName?: string; yob?: string; pincode?: string; country?: string; state?: string; district?: string; city?: string; relation?: string; place?: string; doorNo?: string; relationName?: string; age?: string; }>; /** * This method is used to capture back side of the id card * @param data - Data URI from canvas * @param cardType - Type of the card to be scanned */ captureBackSide: (data: any, cardType: number) => Promise<{ image: string; name: string; sex: string; uniqueId: string; dob: string; address: string; fatherName?: string; yob?: string; pincode?: string; country?: string; state?: string; district?: string; city?: string; relation?: string; place?: string; doorNo?: string; relationName?: string; age?: string; }>; /** * Process the image capture from the canvas * @param data - Data URI * @param cardType - Type of card * @returns -User Data */ processCaptureImage: (data: any, cardType: number) => Promise; /** * This method set front captured data * @param userData - Userdata with front side details * @param cardType - Type of the card to be scanned * @returns - userData */ setFrontCapturedData: (userData: any, cardType: number) => { image: string; name: string; sex: string; uniqueId: string; dob: string; address: string; fatherName?: string; yob?: string; pincode?: string; country?: string; state?: string; district?: string; city?: string; relation?: string; place?: string; doorNo?: string; relationName?: string; age?: string; }; /** * This method is used to process the voter id capture and returns the result * @param userData - Userdata with back side details * @returns - userData */ processVoterIDCapture: (userData: any) => { image: string; name: string; sex: string; uniqueId: string; dob: string; address: string; fatherName?: string; yob?: string; pincode?: string; country?: string; state?: string; district?: string; city?: string; relation?: string; place?: string; doorNo?: string; relationName?: string; age?: string; }; /** * This method set back captured data * @param userData - Userdata with back side details * @param cardType - Type of the card to be scanned * @returns - userData */ setBackCapturedData: (userData: any, cardType: number) => { image: string; name: string; sex: string; uniqueId: string; dob: string; address: string; fatherName?: string; yob?: string; pincode?: string; country?: string; state?: string; district?: string; city?: string; relation?: string; place?: string; doorNo?: string; relationName?: string; age?: string; }; /** * To set the captured data obtained by processing api request. * @param userData - The data obtained as a result of passing api request */ setCapturedData: (userData: any) => void; /** * To check the key is present in the data * @param userData - The userData object * @param key - environment key value * @returns - if the key is present it returns or null */ checkValueIsPresent: (userData: any, key: string) => any; /** * To check the split address is present in the data * @param userData - The userData object * @param key - environment key value * @returns - if the key is present it returns or null */ checkSplitAddress: (userData: any, key: string) => any; /** * This method get all the user Data. */ getUserData: () => Promise<{ image: string; name: string; sex: string; uniqueId: string; dob: string; address: string; fatherName?: string; yob?: string; pincode?: string; country?: string; state?: string; district?: string; city?: string; relation?: string; place?: string; doorNo?: string; relationName?: string; age?: string; }>; /** * This method get all the captured Data. */ getCapturedData: () => Promise<{ image: string; name: string; sex: string; uniqueId: string; dob: string; address: string; fatherName?: string; yob?: string; pincode?: string; country?: string; state?: string; district?: string; city?: string; relation?: string; place?: string; doorNo?: string; relationName?: string; age?: string; }>; /** * This method get all the captured Data. */ getProcessedData: () => Promise; /** * Gets the Front Side data * @returns - The array of the front side Data */ getFrontSideData: () => Promise; /** * Gets the Back Side data * @returns - The array of the front side Data */ getBackSideData: () => Promise; /** * This method clears the user data. */ clearUserData: () => void; }