import { SDK_VERSION, SDK_NAME } from '../../EKYCModule'; import { SmsOtpConfig, SendOtpResponse, VerifyOtpResponse, ResendOtpResponse } from '../types/ekycSmsOtpType'; import { ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest, AuthorizeInfo, ESignPdfResult, ESignApiResponse } from '../types/ekycESignType'; import { LivenessConfig, LivenessSuccessEvent } from '../types/ekycLivenessType'; import { FaceServiceConfig, FaceCompareSuccessEvent } from '../types/ekycFaceType'; import { EKYCError } from '../types/ekycType'; /** * Finos eSign SDK Module * * A React Native module for eSign (Electronic Signature), SMS OTP, Liveness detection, * and Face matching operations. This module excludes NFC, C06, and OCR features. * * @version Dynamic from package.json * @author FinOS * @license MIT */ export declare class FinosESignModule { private static instance; private sdk; private isInitialized; private platform; private constructor(); /** * Get singleton instance of FinosESignModule */ static getInstance(): FinosESignModule; /** * Get SDK information */ getSDKInfo(): Promise<{ name: string; version: string; buildNumber: string; platform: string; isInitialized: boolean; }>; /** * Initialize the eSign SDK * Must be called before using any other methods */ initialize(isProd?: boolean): Promise; /** * Check if SDK is initialized */ isSDKReady(): boolean; /** * 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; onSmsOtpVerifySuccess(callback: (data: VerifyOtpResponse) => 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 * @param finosToken Optional access token (Client Credentials) * @param isProd Optional flag for production environment (default: false) */ initializeESign(finosToken?: string, isProd?: boolean): Promise; /** * Get SDK Token for Session * @param identity User Identity (CCCD/CMND) * @param name User Name * @param deviceId Device ID */ getSdkToken(identity: string, name: string, deviceId: string): 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; }>; /** * Start Authorize Init * @param serial Serial number * @param quantity Quantity * @param time Time * @param message Message */ initAuthorize(serial: string, quantity: number, time: number, message: string): Promise<{ code: string; message: string; }>; /** * List Authorize * @param pageNumber Page number * @param pageSize Page size * @param status Status filter */ listAuthorize(pageNumber?: number, pageSize?: number, status?: string): Promise<{ requests: AuthorizeInfo[]; }>; /** * Register Authorize * @param authId Auth ID * @param authData Auth Data * @param authorizeRequestId Request ID * @param userPin User PIN * @param confirm Confirm (default true) */ registerAuthorize(authId: string, authData: string, authorizeRequestId: string, userPin: string, confirm?: boolean): Promise<{ code: string; message: string; }>; /** * Sign PDF Multiple Positions * @param requestJson Request JSON * @returns ESignPdfResult with status, msg, and data.transactionId */ signPdfMultiplePositions(requestJson: string): Promise; /** * Register remote signing certificate * @param requestJson JSON request body * @returns ESignApiResponse (status, msg, data.sessionId, response) */ registerRemoteSigning(requestJson: string): Promise; /** * Sign PDF document * @param requestJson JSON request body * @returns ESignPdfResult with status, msg, and data.transactionId */ signPdf(requestJson: string): Promise; /** * Send confirmation document * @param requestJson JSON string containing request data */ sendConfirmationDocument(requestJson: string): Promise<{ response: string; }>; /** * Composite API: Register Remote Signing + Send Confirmation Document * Align với SdkeSignImpl.registerAndConfirm * @param requestJson JSON request body for registerRemoteSigning * @param confirmationDocBase64 PDF base64 for acceptanceDocs * @returns ESignApiResponse (status, msg, data.sessionId, response) */ registerAndConfirm(requestJson: string, confirmationDocBase64: string): Promise; /** * Remove all event listeners */ removeAllListeners(): void; 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; onESignInitAuthorizeSuccess(callback: (data: { code: string; message: string; }) => void): import("react-native").EmitterSubscription | null; onESignListAuthorizeSuccess(callback: (data: { requests: AuthorizeInfo[]; }) => void): import("react-native").EmitterSubscription | null; onESignRegisterAuthorizeSuccess(callback: (data: { code: string; message: string; }) => void): import("react-native").EmitterSubscription | null; onESignSignPdfMultiplePositionsSuccess(callback: (data: { response: 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; onESignRegisterAndConfirmSuccess(callback: (data: ESignApiResponse) => void): import("react-native").EmitterSubscription | null; /** Payload là EKYCError: { event, code, message }. */ onESignError(callback: (error: EKYCError) => void): import("react-native").EmitterSubscription | null; /** * 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 - Custom actions array (LEFT, RIGHT, STRAIGHT). If provided, uses these actions instead of random * @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) */ startLiveness(config: LivenessConfig): Promise; onLivenessSuccess(callback: (data: LivenessSuccessEvent) => void): import("react-native").EmitterSubscription | null; /** Payload là EKYCError: { event, code, message }. */ onLivenessError(callback: (error: EKYCError) => void): import("react-native").EmitterSubscription | null; /** * Face matching (Face Service) * @param config Face service configuration */ startFaceCompare(config: FaceServiceConfig): Promise; 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; /** * Start eKYC UI with flow (excluding NFC, C06, OCR) * Only supports LIVENESS and FACE in flowSDK array * @param appKey Main app key * @param flowSDK Array of SDK types (only 'LIVENESS' and 'FACE' are allowed) * @param language Language code (vi/en) * @param transactionId Transaction ID * @param appKeyConfig App key configuration * @param optionConfig Optional configuration settings (includes switchFrontCamera for camera control) * @param styleConfig Optional style configuration */ startEkycUI(appKey: string, flowSDK: string[], language: string, transactionId: string, appKeyConfig: { appKey: string; appKeyLiveness: string; appKeyFaceService: string; }, optionConfig?: { baseUrl?: string; countMaxRetry?: number; language?: string; /** Network timeout in milliseconds (default: 30000). callTimeout = networkTimeoutMs * 2 */ networkTimeoutMs?: number; switchFrontCamera?: boolean; }, 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; }; }): Promise; private validateSDKReady; } export declare const FinosESign: FinosESignModule; export type { SmsOtpConfig, SmsOtpResult, SmsOtpError, SendOtpResponse, VerifyOtpResponse, ResendOtpResponse } from '../types/ekycSmsOtpType'; export type { ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest, ESignError, ESignAuthenticateResult, AuthorizeInfo, ESignApiResponse } from '../types/ekycESignType'; export type { LivenessConfig, LivenessError } from '../types/ekycLivenessType'; export { SDKFaceDetectStatus } from '../types/ekycLivenessType'; export type { FaceServiceConfig, FaceCompareError } from '../types/ekycFaceType'; export type { SDKEkycResultStringWithEvent, SDKEkycResultWithEvent, EKYCError } from '../types/ekycType'; export { getEkycError } from '../types/ekycType'; export { SDK_VERSION, SDK_NAME }; export default FinosESign;