Package-level declarations

Types

Link copied to clipboard
data class EntryDefinition(val route: RouteSelector? = null, val loadingThreshold: Duration = 200.milliseconds)

Defines per-graph entry behaviour: a dynamic route selector that determines which screen to navigate to when entering a graph directly.

Link copied to clipboard
sealed class GuardResult

The decision returned by a navigation guard or access check.

Link copied to clipboard
data class InterceptDefinition(val guard: NavigationGuard, val loadingThreshold: Duration = 200.milliseconds, outerGuards: List<Pair<NavigationGuard, Duration>> = emptyList())

Defines an intercept guard that applies to all navigation into a group of graphs, including deep links.

Link copied to clipboard
@Serializable
data class ModalContext(val modalEntry: NavigationEntry, val originalUnderlyingScreenEntry: NavigationEntry, val navigatedAwayToRoute: String? = null)

Tracks the relationship between a modal and the screen it was opened on top of.

Link copied to clipboard

Maps navigatables registered directly inside an intercept { } block to the guard that should protect them. Used to handle modals and screens that are promoted to the parent graph but must still be guarded.

Link copied to clipboard
@Serializable
data class NavigationEntry(val path: String, val params: Params, val stackPosition: Int = 0, val navigatableRoute: String = path.substringAfterLast("/"))

A single entry in the navigation back stack representing one visited destination.

Link copied to clipboard
typealias NavigationGuard = suspend (StoreAccessor) -> GuardResult

A suspend function evaluated before navigation is committed.

Link copied to clipboard
@Serializable
data class PendingNavigation(val route: String, val params: Params, val metadata: Map<String, String> = emptyMap(), val displayHint: String? = null)

Stores intent to navigate to a protected route while the user is being redirected for authentication.

Link copied to clipboard
data class RouteResolution(val targetNavigatable: Navigatable, val targetGraphId: String, val extractedParams: Params, val navigationGraphId: String? = null, val isGraphReference: Boolean = false)

The result of resolving a route string to a concrete Navigatable within the graph hierarchy.

Link copied to clipboard
typealias RouteSelector = suspend (StoreAccessor) -> NavigationNode

A suspend function that selects which destination to navigate to when entering a graph.

Link copied to clipboard
data class ScreenResolution(val navigatable: Navigatable, val actualGraphId: String)

A lightweight pairing of a resolved Navigatable and the graph ID it belongs to.

Functions

Link copied to clipboard
fun Navigatable.toNavigationEntry(path: String, params: Params = Params.empty(), stackPosition: Int = 0): NavigationEntry

Creates a NavigationEntry for this Navigatable at the given path.