import type { PluginListenerHandle } from "@capacitor/core"; export declare enum SumsubSdkStatus { NOT_INITIALIZED = "NotInitialized", READY = "Ready", FAILED = "Failed", INITIAL = "Initial", INCOMPLETE = "Incomplete", PENDING = "Pending", TEMPORARILY_DECLINED = "TemporarilyDeclined", FINALLY_REJECTED = "FinallyRejected", APPROVED = "Approved", ACTION_COMPLETED = "ActionCompleted" } export declare enum LogLevel { OFF = "OFF", ERROR = "ERROR", WARNING = "WARNING", INFO = "INFO", DEBUG = "DEBUG", TRACE = "TRACE", UNKNOWN = "UNKNOWN" } export declare enum SumsubErrorType { /** Unknown or no fail */ Unknown = "Unknown", /** An attempt to setup with invalid parameters */ InvalidParameters = "InvalidParameters", /** Unauthorized access detected (most likely accessToken is invalid or expired and had failed to be refreshed) */ Unauthorized = "Unauthorized", /** Initial loading from backend is failed */ InitialLoadingFailed = "InitialLoadingFailed", /** No applicant is found for the given parameters */ ApplicantNotFound = "ApplicantNotFound", /** Applicant is found, but is misconfigured (most likely lacks of idDocs) */ ApplicantMisconfigured = "ApplicantMisconfigured", /** An initialization error occurred */ InitializationError = "InitializationError", /** A network error occurred (the user will be presented with Network Oops screen) */ NetworkError = "NetworkError", /** Some unexpected error occurred (the user will be presented with Fatal Oops screen) */ UnexpectedError = "UnexpectedError" } export interface SumsubMobileSdkPlugin { /** * Initializes the SDK with the given access token and optional configuration. * @param options - The options for initializing the SDK. * @returns A promise that resolves with the status of the SDK, `READY` if successful or `FAILED` if there was an error. Errors can be checked in `onLog` event. */ initialize(options: { accessToken: string; applicantConfig?: { email?: string; phone?: string; }; debug?: boolean; locale?: string; isAnalyticsEnabled?: boolean; }): Promise<{ status: SumsubSdkStatus; }>; /** * Present the verification flow. * This method should be called after the SDK is initialized. */ present(): Promise; dismiss(): Promise; setAccessToken(options: { token: string; }): Promise; /** * Returns the current verification status. * If the verification flow is not presented, the status will be `NOT_INITIALIZED` or `READY`. * You need to present the verification flow to get the actual verification status. */ getVerificationStatus(): Promise<{ status: SumsubSdkStatus; }>; addListener(eventName: 'onTokenExpired', listenerFunc: () => void): Promise; /** * This event is triggered when the verification status changes. */ addListener(eventName: 'onVerificationStatusChanged', listenerFunc: (status: { prevStatus: SumsubSdkStatus; newStatus: SumsubSdkStatus; statusDescription: string; verboseStatus: string; failReason: string; }) => void): Promise; /** * This event is triggered when the verification status changes to failed. */ addListener(eventName: 'onVerificationFailed', listenerFunc: (status: { failReason: string; }) => void): Promise; /** * This event is triggered when the approval changes to approved or rejected. */ addListener(eventName: 'onApprovedStatusChanged', listenerFunc: (event: { isApproved: boolean; }) => void): Promise; /** * All event notifications */ addListener(eventName: 'onEvent', listenerFunc: (event: { eventName: string; payload: any; }) => void): Promise; addListener(eventName: 'onApplicantLoaded', listenerFunc: (event: { applicantId: string; }) => void): Promise; addListener(eventName: 'onStepInitiated', listenerFunc: (event: { step: string; }) => void): Promise; addListener(eventName: 'onStepCompleted', listenerFunc: (event: { step: string; isCancelled: boolean; }) => void): Promise; addListener(eventName: 'onAnalyticsEvent', listenerFunc: (event: { eventName: string; payload: any; }) => void): Promise; addListener(eventName: 'onDidDismiss', listenerFunc: (event: { status: string; description: string; }) => void): Promise; /** * Logs all the messages from the SDK. Log level default is Error, can be change to debug when initializing the SDK. */ addListener(eventName: 'onLog', listenerFunc: (event: { level: LogLevel; message: string; }) => void): Promise; }