commonMain.web.IWebView.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of compose-webview-multiplatform Show documentation
Show all versions of compose-webview-multiplatform Show documentation
WebView for JetBrains Compose Multiplatform
package web
/**
* Created By Kevin Zou On 2023/9/5
*/
interface IWebView {
/**
* True when the web view is able to navigate backwards, false otherwise.
*/
fun canGoBack(): Boolean
/**
* True when the web view is able to navigate forwards, false otherwise.
*/
fun canGoForward(): Boolean
fun loadUrl(url: String, additionalHttpHeaders: Map = emptyMap())
fun loadHtml(
html: String? = null,
baseUrl: String? = null,
mimeType: String? = null,
encoding: String? = "utf-8",
historyUrl: String? = null
)
fun postUrl(
url: String,
postData: ByteArray
)
/**
* Navigates the webview back to the previous page.
*/
fun goBack()
/**
* Navigates the webview forward after going back from a page.
*/
fun goForward()
/**
* Reloads the current page in the webview.
*/
fun reload()
/**
* Stops the current page load (if one is loading).
*/
fun stopLoading()
}