Package-level declarations

Types

Link copied to clipboard
typealias CacheKeySelector = suspend (StoreAccessor) -> Any?
Link copied to clipboard
data class EntryDefinition(val route: RouteSelector? = null, val loadingThreshold: Duration = 200.milliseconds, val cacheKey: CacheKeySelector? = null)

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
data class GuardChainEntry(val guard: NavigationGuard, val loadingThreshold: Duration, val cacheKey: CacheKeySelector? = null)
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, val cacheKey: CacheKeySelector? = null, outerGuards: List<GuardChainEntry> = 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
data class NavigationEntry(val navigatable: Navigatable, val path: String, val params: Params, val stackPosition: Int = 0)

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

Link copied to clipboard
class NavigationEntrySerializer(resolvePath: (String) -> Navigatable?) : KSerializer<NavigationEntry>

Serializes NavigationEntry as (path, params, stackPosition) and rehydrates the Navigatable reference from the registered navigation graph on deserialization.

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

A suspend function evaluated before navigation is committed.

Link copied to clipboard
@Serializable
data class NavigationProjection

Everything about the navigation position that is a pure function of the back stack, the active modal contexts, and the registered graph definitions.

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 owningGraphId: String, val extractedParams: Params, val requestedGraphId: String? = null, val isGraphReference: Boolean = false, val path: String? = null)

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.

Link copied to clipboard
@Serializable
data class StartFailure(val exceptionType: String, val exceptionMessage: String)

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.