export enum DetectionType { DOCUMENT, PASSPORT, BIOMETRIC_SELFIE, NO_DETECTION, } export enum VerificationStatus { CAN_BE_PROCESSED, UNSUPPORTED_DOCUMENT, EXPIRED_DOCUMENT, CANNOT_BE_CLASSIFIED, GLARE, SKEWED, BLUR, ERROR, } export interface PointCoordinates { x: number y: number } /** * The cartesian point coordinate system is used for the Capture Region * where the origin (0,0) is in the top-left corner. */ export interface CaptureRegion { topLeft: PointCoordinates bottomRight: PointCoordinates center: PointCoordinates selfieRadius: number } export interface ITruliooCameraConfig { detectionType: DetectionType } export interface ICaptureResponse { imageId: string /** * To get post capture verify feedback of the captured image */ verifyImage: () => Promise /** * To submit the captured image for verification */ acceptImage: () => Promise } export interface ITruliooImageFeedback { /** * The combination of all the feedback on a given image. If this value is true, it means that the image is of high enough quality to be sent for verification */ hasAcceptableQuality: boolean /** * The blur of the given image is detectable to a degree that will affect usability in document verification */ hasBlur: boolean /** * A detection type has been captured with enough confidence to be usable for verification */ hasDetection: boolean /** * The type of detection that was found */ detectionType: DetectionType /** * The object is too close to the camera */ tooClose: boolean /** * The object is too far to the camera */ tooFar: boolean /** * Indicates if the document image requires a back capture */ requiresBackCapture: boolean } export interface ITruliooCaptureResponse extends ITruliooImageFeedback, ICaptureResponse {} export interface ITruliooManualCaptureResponse extends ICaptureResponse {} export interface ITruliooVerifyResponse { isVerifyAttemptAvailable: boolean verificationStatus: VerificationStatus requiresBackCapture: Boolean } /** * The current state that the SDK is communicating for capture feedback. * */ export enum FeedbackState { /** * The SDK has no feedback to the user at this time */ NONE, /** * The SDK is currently attempting to capture the subject within the capture frame */ CAPTURING, /** * The current image subject has blur that would impact the verification */ BLUR, /** * The image acceptable for use with verification */ SUCCESS, /** * The object is too far from the camera */ TOO_FAR, /** * The object is too close to the camera */ TOO_CLOSE, /** * An issue with capture has been found */ ERROR, } export type TruliooImageFeedback = ITruliooImageFeedback | Error export type TruliooFeedbackState = FeedbackState | Error export type TruliooVerifyFeedback = ITruliooVerifyResponse | Error export type ImageFeedbackCallback = (feedback: TruliooImageFeedback) => void export type FeedbackStateCallback = (feedback: TruliooFeedbackState) => void