const sendWebWiew = (refValue, paramValue, callName = 'onReceive') => {
    if (!refValue) {
        console.error('evalJs: The reference to the webview is not provided or is null.');
        return;
    }

    if (typeof refValue.evalJs !== 'function') {
        console.error('evalJs: The evalJs method is not available on the provided reference.');
        return;
    }

    try {
        const jsonString = JSON.stringify(paramValue);
        const jsCode = `window.${callName}(${jsonString})`;

        refValue.evalJs(jsCode);
    } catch (error) {
        console.error('evalJs: An error occurred while trying to stringify the parameter value or while invoking evalJs.', error);
    }
};
const receiveWebView=(e)=>{
    return e.detail.data[0]
}
export{
    sendWebWiew,
    receiveWebView
}
