import { SDK_VERSION, SDK_NAME } from '../../EKYCModule'; import { NfcConfig } from '../types/ekycNFCType'; import { SDKEkycResultWithEvent, SDKEkycResultStringWithEvent, EKYCError, AppIDType, SDKEnv } from '../types/ekycType'; import { C06Config } from '../types/ekycC06Type'; import { OcrConfig } from '../types/ekycOCRType'; import { LivenessConfig, SDKFaceDetectStatus, LivenessSuccessEvent } from '../types/ekycLivenessType'; import { FaceServiceConfig, FaceCompareSuccessEvent } from '../types/ekycFaceType'; import { SmsOtpConfig, SendOtpResponse, VerifyOtpResponse, ResendOtpResponse } from '../types/ekycSmsOtpType'; import { ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest, ESignPdfResult, ESignApiResponse } from '../types/ekycESignType'; import { SDKFlowType } from '../types/ekycFlowType'; import { ExitConfirmConfig } from '../types/ekycExitConfirmType'; /** * Finos eKYC SDK Module * * A comprehensive React Native module for electronic Know Your Customer (eKYC) operations * including Vietnamese CCCD NFC reading, OCR, Liveness detection, Face matching, and C06 residence verification. * * @version Dynamic from package.json * @author FinOS * @license MIT */ export declare class FinosEKYCModule { private static instance; private sdk; private isInitialized; private platform; private constructor(); /** * Get singleton instance of FinosEKYCModule */ static getInstance(): FinosEKYCModule; /** * Get SDK information */ getSDKInfo(): Promise<{ name: string; version: string; buildNumber: string; platform: string; isInitialized: boolean; }>; /** * Initialize the eKYC SDK * Must be called before using any other methods */ initialize(isProd?: boolean): Promise; /** * Check if SDK is initialized */ isSDKReady(): boolean; /** * Set transaction ID * @param transactionId Transaction ID string */ setTransactionId(transactionId: string): Promise; /** * Set SDK environment (1.5.4+). * @param env SDKEnv.DEV | SDKEnv.PROD */ setEnv(env: SDKEnv): Promise; /** * Get current SDK environment (1.5.4+). * @returns SDKEnv string ("DEV" | "PROD") */ getEnv(): Promise; /** * Start NFC scanning for Vietnamese CCCD * @param config NFC configuration */ startNfcScan(config: NfcConfig): Promise; /** * Check C06 residence verification * @param config C06 configuration */ checkC06(config: C06Config): Promise; /** * Start OCR document scanning * @param config OCR configuration */ startOcr(config: OcrConfig): Promise; /** * Start liveness detection * @param config Liveness configuration * @param config.isActiveLiveness - Enable active liveness detection (default: false) * @param config.autoCapture - Enable auto capture (default: true) * @param config.isShowCameraFont - Show camera font (default: true) * @param config.customActions - SDKFaceDetectStatus[] enum (LEFT, RIGHT, SMILE, BLINK, ...). Bên sử dụng truyền enum thay vì string * @param config.activeActionCount - Number of random actions (1-10), only used when customActions is null (default: 2) * @param config.switchFrontCamera - Use front camera (default: false) * @param exitConfirmConfig - Optional config tuỳ chỉnh bottom sheet xác nhận thoát. null = mặc định SDK. */ startLiveness(config: LivenessConfig, exitConfirmConfig?: ExitConfirmConfig): Promise; /** * Start face comparison (Face Service) * @param config Face service configuration */ startFaceCompare(config: FaceServiceConfig): Promise; /** * Extract NFC data for C06 verification * @param nfcResultJson NFC result JSON string */ extractNfcDataForC06(nfcResultJson: string): Promise; /** * Handle app lifecycle - Resume */ onResume(): void; /** * Handle app lifecycle - Pause */ onPause(): void; /** * Handle new intent (Android) */ handleNewIntent(): void; /** * Listen for NFC scan start events */ onNfcScanStart(callback: (data: SDKEkycResultWithEvent) => void): import("react-native").EmitterSubscription | null; /** * Listen for NFC scan success events */ onNfcScanSuccess(callback: (data: SDKEkycResultStringWithEvent) => void): import("react-native").EmitterSubscription | null; /** * Listen for NFC error events */ /** Payload là EKYCError: { event, code, message }. */ onNfcError(callback: (error: EKYCError) => void): import("react-native").EmitterSubscription | null; /** * Listen for C06 success events */ onC06Success(callback: (data: SDKEkycResultWithEvent) => void): import("react-native").EmitterSubscription | null; /** * Listen for C06 error events */ /** Payload là EKYCError: { event, code, message }. */ onC06Error(callback: (error: EKYCError) => void): import("react-native").EmitterSubscription | null; /** * Listen for OCR success events */ onOcrSuccess(callback: (data: SDKEkycResultStringWithEvent) => void): import("react-native").EmitterSubscription | null; /** * Listen for OCR error events */ /** Payload là EKYCError: { event, code, message }. */ onOcrError(callback: (error: EKYCError) => void): import("react-native").EmitterSubscription | null; /** * Listen for liveness success events */ onLivenessSuccess(callback: (data: LivenessSuccessEvent) => void): import("react-native").EmitterSubscription | null; /** * Listen for liveness error events */ /** Payload là EKYCError: { event, code, message }. */ onLivenessError(callback: (error: EKYCError) => void): import("react-native").EmitterSubscription | null; /** * Listen for face compare success events */ onFaceCompareSuccess(callback: (data: FaceCompareSuccessEvent) => void): import("react-native").EmitterSubscription | null; /** Payload là EKYCError: { event, code, message }. */ onFaceCompareError(callback: (error: EKYCError) => void): import("react-native").EmitterSubscription | null; /** * Listen for eKYC UI success events (including LOG_SUCCESS from Liveness/FaceService submit) */ onEkycUISuccess(callback: (data: any) => void): import("react-native").EmitterSubscription | null; /** * Listen for eKYC UI error events */ onEkycUIError(callback: (error: any) => void): import("react-native").EmitterSubscription | null; /** * Remove all event listeners */ removeAllListeners(): void; /** * Send SMS OTP * @param config SMS OTP configuration */ sendOtp(config: SmsOtpConfig): Promise; /** * Verify SMS OTP * @param config SMS OTP configuration (must include requestId) * @param otpCode OTP code from SMS */ verifyOtp(config: SmsOtpConfig, otpCode: string): Promise; /** * Resend SMS OTP * @param config SMS OTP configuration (must include requestId) */ resendOtp(config: SmsOtpConfig): Promise; onSmsOtpSendSuccess(callback: (data: SendOtpResponse) => void): import("react-native").EmitterSubscription | null; onSmsOtpResendSuccess(callback: (data: ResendOtpResponse) => void): import("react-native").EmitterSubscription | null; /** Payload là EKYCError: { event, code, message }. */ onSmsOtpError(callback: (error: EKYCError) => void): import("react-native").EmitterSubscription | null; /** * Initialize eSign SDK */ initializeESign(isProd?: boolean): Promise; /** * Open eSign Session * @param accessToken Access token (JWT) * @param username Username * @param rememberMe Remember me flag * @param userEsignModel User info model (for auto-token generation) * @param privateKeyFilePath Path to private key file (for auto-token generation) */ openSessionId(accessToken: string | null, username: string | null, rememberMe: boolean | null): Promise; /** * Register device for eSign * @param recoverCode 8-digit recovery code * @param pinCode 6-digit PIN code * @param fcmToken Optional FCM token */ registerDevice(recoverCode: string, pinCode: string, fcmToken?: string): Promise<{ code: string; message: string; }>; /** * List eSign certificates * @param pageNumber Page number (default: 1) * @param pageSize Page size (default: 10) */ listCerts(pageNumber?: number, pageSize?: number): Promise<{ certs: ESignCertificate[]; }>; /** * Verify eSign certificate * @param serial Certificate serial number */ verifyCert(serial: string): Promise<{ code: string; message: string; }>; /** * List eSign sign requests * @param pageNumber Page number (default: 1) * @param pageSize Page size (default: 10) */ listSignRequest(pageNumber?: number, pageSize?: number): Promise<{ requests: ESignSignRequest[]; }>; /** * Confirm eSign signature * @param signRequestId Sign request ID * @param pinCode 6-digit PIN code * @param authId Optional auth ID * @param authData Optional auth data * @param confirm Confirm the signature (default: true) */ confirmSign(signRequestId: string, pinCode: string, authId?: string, authData?: string, confirm?: boolean): Promise<{ code: string; message: string; }>; /** * Register remote signing certificate * @param requestJson JSON request body * @returns ESignApiResponse (status, msg, data.sessionId, response) */ registerRemoteSigning(requestJson: string): Promise; /** * Sign PDF document * @param accessToken JWT access token * @param requestJson JSON request body * @returns ESignPdfResult with status, msg, and data.transactionId */ signPdf(requestJson: string): Promise; /** * Send confirmation document * @param accessToken JWT access token * @param requestJson JSON string containing request data */ sendConfirmationDocument(requestJson: string): Promise<{ response: string; }>; onESignInitSuccess(callback: (data: ESignInitResult) => void): import("react-native").EmitterSubscription | null; onESignOpenSessionSuccess(callback: (data: ESignOpenSessionResult) => void): import("react-native").EmitterSubscription | null; onESignRegisterDeviceSuccess(callback: (data: { code: string; message: string; }) => void): import("react-native").EmitterSubscription | null; onESignListCertsSuccess(callback: (data: { certs: ESignCertificate[]; }) => void): import("react-native").EmitterSubscription | null; onESignVerifyCertSuccess(callback: (data: { code: string; message: string; }) => void): import("react-native").EmitterSubscription | null; onESignListSignRequestSuccess(callback: (data: { requests: ESignSignRequest[]; }) => void): import("react-native").EmitterSubscription | null; onESignConfirmSignSuccess(callback: (data: { code: string; message: string; }) => void): import("react-native").EmitterSubscription | null; onESignRegisterRemoteSigningSuccess(callback: (data: ESignApiResponse) => void): import("react-native").EmitterSubscription | null; onESignSignPdfSuccess(callback: (data: { response: string; }) => void): import("react-native").EmitterSubscription | null; onESignSendConfirmationDocumentSuccess(callback: (data: { response: string; }) => void): import("react-native").EmitterSubscription | null; /** Payload là EKYCError: { event, code, message }. */ onESignError(callback: (error: EKYCError) => void): import("react-native").EmitterSubscription | null; /** * Start eKYC UI with flow (like MainActivity.kt) * @param appKey Main app key * @param flowSDK Array of SDKFlowType enum (OCR, NFC, LIVENESS) – bên sử dụng truyền enum * @param language Language code (vi/en) * @param transactionId Transaction ID * @param appKeyConfig Optional app key configuration * @param optionConfig Optional configuration settings (includes switchFrontCamera for camera control) * @param styleConfig Optional style configuration * @param exitConfirmConfig Optional config tuỳ chỉnh bottom sheet xác nhận thoát (icon, title, content, buttons). * null = giữ default SDK. Xem EXIT_CONFIRM_CONFIG.md. */ startEkycUI(appKey: string, flowSDK: SDKFlowType[], language: string, transactionId: string, appKeyConfig: { appKey: string; appKeyNfc: string; appKeyOcr: string; appKeyLiveness: string; appKeyC06: string; appKeyFaceService: string; }, optionConfig?: { baseUrl?: string; countMaxRetry?: number; language?: string; /** Network timeout in milliseconds (default: 30000). callTimeout = networkTimeoutMs * 2 */ networkTimeoutMs?: number; switchFrontCamera?: boolean; /** LivenessConfig – SDKeKYCActivity (157-169) */ isActiveLiveness?: boolean; autoCapture?: boolean; forceCaptureTimeout?: number; /** Bên sử dụng truyền enum – SDKFaceDetectStatus[] thay vì string[] */ customActions?: SDKFaceDetectStatus[]; activeActionCount?: number; /** AppIDType: NONE | HD_BANK | VIKKI (default: AppIDType.NONE) */ appIDType?: AppIDType; }, styleConfig?: { textSize?: number; textFont?: string; textColor?: number; statusBarBackground?: number; backIcon?: number; titleStyle?: { textSize?: number; textFont?: string; textColor?: number; }; toolbarStyle?: { textSize?: number; textFont?: string; textColor?: number; }; instructionStyle?: { textSize?: number; textFont?: string; textColor?: number; }; errorStyle?: { textSize?: number; textFont?: string; textColor?: number; }; successStyle?: { textSize?: number; textFont?: string; textColor?: number; }; warningStyle?: { textSize?: number; textFont?: string; textColor?: number; }; captureButtonColor?: number; captureButtonDisabledColor?: number; }, exitConfirmConfig?: ExitConfirmConfig): Promise; private validateSDKReady; private validatePlatform; } export declare const FinosEKYC: FinosEKYCModule; export type { NfcConfig, NfcError } from '../types/ekycNFCType'; export type { C06Config } from '../types/ekycC06Type'; export type { OcrConfig, OcrError } from '../types/ekycOCRType'; export type { LivenessConfig, LivenessError } from '../types/ekycLivenessType'; export { SDKFaceDetectStatus } from '../types/ekycLivenessType'; export type { FaceServiceConfig, FaceCompareError } from '../types/ekycFaceType'; export type { SDKEkycResultWithEvent, SDKEkycResultStringWithEvent, EKYCError } from '../types/ekycType'; export { getEkycError, AppIDType } from '../types/ekycType'; export type { SmsOtpConfig, SmsOtpResult, SmsOtpError, SendOtpResponse, VerifyOtpResponse, ResendOtpResponse } from '../types/ekycSmsOtpType'; export type { ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest, ESignError, ESignAuthenticateResult } from '../types/ekycESignType'; export { SDK_VERSION, SDK_NAME }; export default FinosEKYC;