NavEaseAutoRegistry

Global registry populated by NavEase KSP-generated code.

Holds all screens annotated with @AutoRegister. Used by the auto-discover NavEaseHost overload.

You do not normally interact with this object directly. It is populated automatically by the KSP-generated NavEaseAutoInit initializer.

The start destination is not stored here — it is declared explicitly at the host level via the start parameter of NavEaseHost.

Initialization per platform:

  • Android / JVM / Desktop: automatic — NavEaseHost loads the generated class via Class.forName on first composition.

  • iOS / Native: automatic via @EagerInitialization in the Gradle-plugin-generated glue file.

  • JS / WasmJS: automatic — module-level property init runs at module load time.

Types

Link copied to clipboard
data class RegistryEntry(val keyClass: KClass<*>, val rootKeyClass: KClass<*>, val serializer: KSerializer<*>, val screen: ActivityScreen<*>)

A registered screen entry produced by addEntry.

Properties

Link copied to clipboard

Fully-qualified class name of the KSP-generated initializer file.

Link copied to clipboard

true once entries has been populated by the KSP-generated initializer.

Functions

Link copied to clipboard
fun <K : NavKey> addEntry(screen: ActivityScreen<K>, keyClass: KClass<K>, rootKeyClass: KClass<*>, serializer: KSerializer<K>)

Registers one screen into this registry.

Link copied to clipboard
fun registerBootstrapHook(hook: () -> Unit)

Called by the KSP-generated AutoRegisterScreens.kt when _navEaseAutoInit is first accessed, registering the lambda that can re-trigger NavEaseAutoInit.init {}.