package com.adealink.weparty.webview

import android.webkit.ValueCallback
import android.webkit.WebView
import com.adealink.weparty.webview.callback.IWebViewCallback

interface IWebView {

    var webViewCallback: IWebViewCallback?

    fun getUrl(): String?

    fun getOriginalUrl(): String?

    fun getLoadUrl(): String?

    fun loadUrl(url: String)

    fun evaluateJavascript(
        script: String,
        resultCallback: ValueCallback<String>?,
    )

    fun getCommonWebChromeClient(): CommonWebChromeClient?

    fun getCommonWebViewClient(): CommonWebViewClient?

    fun getWebView(): WebView

    /**
     * 拦截需要重加载url
     */
    fun shouldReloadUrl(url: String): Boolean
}