Package-level declarations

Types

Link copied to clipboard
data class ResponseMetaData(val url: String)

Represents the result of loading and transforming a web snippet, including the final URL and content metadata.

Link copied to clipboard
sealed class TWSLoadingState

TWSLoadingState is a sealed class for constraining possible loading states.

Link copied to clipboard

TWSViewDeepLinkInterceptor is an implementation of TWSViewInterceptor that handles deep link URLs by launching the appropriate in-app activity if the URL matches the app's package name.

Link copied to clipboard
fun interface TWSViewInterceptor

TWSViewInterceptor is a functional interface used to intercept URLs within a WebView. This interface provides a single method, handleUrl, which takes a URL as input and returns a Boolean indicating whether the URL has been handled by the application.

Link copied to clipboard
class TWSViewNavigator(coroutineScope: CoroutineScope, snippetLoader: SnippetWebLoader)

Allows control over the navigation of a WebView from outside the composable. E.g. for performing a back/forward navigation in response to the user clicking the "up" or "down" button in a TopAppBar.

Link copied to clipboard

TWSViewNoOpInterceptor is a TWSViewInterceptor that ignores all URLs, allowing the WebView to load them by default.

Link copied to clipboard
class TWSViewState(webContent: WebContent)

A state holder to hold the state for the WebView.

Link copied to clipboard
sealed class WebContent

Represents different types of content that can be loaded in a WebView.

Link copied to clipboard
data class WebViewError(val request: WebResourceRequest?, val error: WebResourceError)

A wrapper class to hold errors from the WebView.

Functions

Link copied to clipboard
fun rememberSavableTWSViewState(vararg inputs: Any?, default: TWSSnippet? = null, key: String = default?.id.orEmpty()): TWSViewState

Creates a TWSView state that persists across recompositions and is saved across activity recreation. This state is remembered via a key and stored using Composes rememberSaveable to restore state after process death.

Link copied to clipboard
fun rememberTWSViewNavigator(coroutineScope: CoroutineScope = rememberCoroutineScope()): TWSViewNavigator

Creates and remembers a TWSViewNavigator with the default CoroutineScope.

fun rememberTWSViewNavigator(key1: Any?, coroutineScope: CoroutineScope = rememberCoroutineScope()): TWSViewNavigator

Creates and remembers a TWSViewNavigator with an optional key and default CoroutineScope.

Link copied to clipboard

Creates a TWSView state that persists across recompositions, configured to display URL with optional additional headers.