Package-level declarations

Types

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class Binds(val to: KClass<*> = Nothing::class)

Mark it to provide as a supertype.

Link copied to clipboard
annotation class ExperimentalKojectApi

Marks declarations that is still experimental in Koject API

Link copied to clipboard
object Koject

Koject

Link copied to clipboard
interface KojectBuilder

Configurations to start Koject

Link copied to clipboard
annotation class Named(val name: String)

String-based Qualifier

Link copied to clipboard
annotation class Provides

Marks it providable by Koject DI Container

Link copied to clipboard
annotation class Qualifier

Identifies qualifier annotations

Link copied to clipboard

Mark as a type that Koject DI container instantiate only once

Functions

Link copied to clipboard
inline fun <T : Any> inject(qualifier: Any? = null): T

Inject an instance with resolved dependencies.

inline fun <T : Any> inject(name: String): T

Inject an Named instance with resolved dependencies.

inline fun <T : Any> inject(qualifier: Any? = null, componentExtras: ComponentExtras<*>? = null): T

Inject an instance with resolved dependencies (experimental)

Link copied to clipboard
inline fun <T : Any> lazyInject(qualifier: Any? = null): Lazy<T>

Inject an instance with lazily resolved dependencies.

inline fun <T : Any> lazyInject(qualifier: Any? = null, noinline componentExtrasProducer: () -> ComponentExtras<*>? = null): Lazy<T>

Inject an instance with lazily resolved dependencies (experimental).

Link copied to clipboard
fun Koject.start(doNotUse: DoNotUse = DoNotUse, builder: KojectBuilder.() -> Unit = {})

Start Koject application