UNPKG

trustly-react-native-webview

Version:

Trustly ReactNative WebView needed when integrating Trustly Checkout in a ReactNative application.

10 lines 1.04 kB
export declare const NativeEventTypes: { readonly SUCCESS: "onTrustlyCheckoutSuccess"; readonly ERROR: "onTrustlyCheckoutError"; readonly REDIRECT: "onTrustlyCheckoutRedirect"; readonly ABORT: "onTrustlyCheckoutAbort"; }; export type NativeEventType = (typeof NativeEventTypes)[keyof typeof NativeEventTypes]; export declare const trustlyApplicationName = "TrustlyReactNativeWebView/v1"; export declare const trustlyCustomBridge = "\n window.addEventListener('message', (e) => {\n try {\n const data = e.data;\n const message = typeof data !== 'string' ? JSON.stringify(data) : data;\n if (window.ReactNativeWebView) {\n window.ReactNativeWebView.postMessage(message, '*');\n }\n } catch (e) {\n console.log('An error occurred while trying to handle message from Trustly SDK listener: ', e.message);\n }\n });\n /*\n NOTE: this is required, or you'll sometimes\n get silent failures\n */\n true;\n "; //# sourceMappingURL=common.d.ts.map