import { PowerAuthError } from '../model/PowerAuthError'; /** * The `NativeWrapper` class is a bridge between JS and Native PowerAuth library. */ export declare class NativeWrapper { private static staticTrampoline; private static thisTrampoline; /** * Perform call to the native function with given name. * @param name Name of function to call. * @param instanceId PowerAuth instance identifier. * @param args Additional arguments for the function. * @returns Promise with return type. */ static thisCall(name: string, instanceId: string, ...args: any[]): Promise; /** * Perform call to the native function with given name. * @param name Name of function to call. * @param instanceId PowerAuth instance identifier. * @param args Additional arguments for the function. * @returns Promise with optional return type. */ static thisCallNull(name: string, instanceId: string, ...args: any[]): Promise; /** * Perform call to the native function with given name, returning bool. * @param name Name of function to call. * @param instanceId PowerAuth instance identifier. * @param args Additional arguments for the function. * @returns Promise with boolean type. */ static thisCallBool(name: string, instanceId: string, ...args: any[]): Promise; /** * Perform call to the native function with given name. The method is useful in case that * call to functions doesn't require instance identifier. * @param name Name of function to call. * @param args Additional arguments for the function. * @returns Promise with type. */ static staticCall(name: string, ...args: any[]): Promise; /** * Perform call to the native function with given name. The method is useful in case that * call to functions doesn't require instance identifier. * @param name Name of function to call. * @param args Additional arguments for the function. * @returns Promise with optiomal return type. */ static staticCallNull(name: string, ...args: any[]): Promise; /** * Perform call to the native function with given name. The method is useful in case that * call to functions doesn't require instance identifier. * @param name Name of function to call. * @param args Additional arguments for the function. * @returns Promise with bool type. */ static staticCallBool(name: string, ...args: any[]): Promise; /** * Enable or disable low level debug features. The `PowerAuthDebug.isEnabled` variable must be true. * @param traceFail If true, then detailed log entry about failure will be printed to the console. * @param traceCall If true, then each call to native code will be printed with a detailed information. */ static setDebugFeatures(traceFail: boolean, traceCall: boolean): void; /** * Process any exception reported from the native module and handle platfrom specific cases. * The method also validate whether exception parameter is already PowerAuthError type, to prevent * double error wrapping. * * @param exception Exception to process. * @param message Optional message. * @returns Instance of PowerAuthError. */ static processException(exception: any, message?: string | undefined): PowerAuthError; /** * Process iOS specific exception reported from the native module. * * @param exception Original exception reported from iOS native module. * @param message Optional message. * @returns Instance of PowerAuthError. */ private static processIosException; /** * Process Android specific exception reported from the native module. * * @param exception Original exception reported from Android native module. * @param message Optional message. * @returns Instance of PowerAuthError. */ private static processAndroidException; } /** * Function patch boolean value returned on iOS platform to be always true or false. * The reason for this is that on iOS, we marshal BOOL as NSNumber. * @param originalPromise Original promise which result needs to be patched. * @returns Patched promise that always resolve to true or false. */ export declare function patchBool(originalPromise: Promise): Promise; /** * Function patch nullable value (e.g. null or undefined) returned from native code to be always undefined. * The reason for this is that on iOS, we marshal BOOL as NSNumber. * @param originalPromise Original promise which result needs to be patched. * @returns Patched promise that always resolve to value or undefined. */ export declare function patchNull(originalPromise: Promise): Promise;