UNPKG

@datadog/mobile-react-native-webview

Version:

A client-side React Native module to interact with react-native-webview and Datadog

34 lines 1.19 kB
export declare const DATADOG_MESSAGE_PREFIX = "[DATADOG]"; /** * Internal Datadog Message Type */ export type DatadogMessageType = /** * Signals errors that occured during the execution of JavaScript code in the WebView. */ 'ERROR' /** * Signals events that should be forwarded and consumed by the native SDK. */ | 'NATIVE_EVENT'; /** * Internal Datadog Message Format. */ export type DatadogMessageFormat = { type: DatadogMessageType; message: string; }; /** * Wraps the given JS Code in a try and catch block. * @param javascriptCode The JS Code to wrap in a try and catch block. * @returns the wrapped JS code. */ export declare const wrapJsCodeInTryAndCatch: (javascriptCode?: string) => string | undefined; /** * Legacy JS code for bridging the WebView events to DataDog native SDKs for consumption. * @param allowedHosts The list of allowed hosts. * @param customJavaScriptCode Custom user JS code to inject along with the Datadog bridging logic. * @returns The JS code block as a string. */ export declare const getWebViewEventBridgingJS: (allowedHosts?: string[], customJavaScriptCode?: string) => string; //# sourceMappingURL=webview-js-utils.d.ts.map