![JAR search and dependency download from the Maven repository](/logo.png)
commonMain.com.freeletics.khonshu.codegen.NavDestination.kt Maven / Gradle / Ivy
package com.freeletics.khonshu.codegen
import com.freeletics.khonshu.navigation.BaseRoute
import com.freeletics.khonshu.statemachine.StateMachine
import kotlin.reflect.KClass
/**
* Add this annotation to a [androidx.compose.runtime.Composable] function. It is required that
* the annotated function has `State` as first parameter and `(Action) -> Unit` as second parameter,
* where `State` and `Action` match the given `StateMachine`.
*
* This will trigger the generation of
* - a wrapper Composable that sets up the annotated Composable with the given [stateMachine]
* - a Dagger subcomponent that uses [route] as scope marker and [parentScope] as `parentScope`
* - a `NavDestination` for [route] based on the given [destinationType] that is contributed
* to the Dagger component that uses [destinationScope]
*/
@Target(AnnotationTarget.FUNCTION)
@Retention(AnnotationRetention.RUNTIME)
public annotation class NavDestination(
val route: KClass,
val parentScope: KClass<*> = ActivityScope::class,
val stateMachine: KClass>,
val destinationScope: KClass<*> = AppScope::class,
)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy