koin-core-ext / org.koin.experimental.builder / org.koin.dsl.context.ModuleDefinition

Extensions for org.koin.dsl.context.ModuleDefinition

create

fun <T : Any> ModuleDefinition.create(): T

Create instance for type T and inject dependencies into 1st constructor

factory

fun <T : Any> ModuleDefinition.factory(name: String = "", override: Boolean = false): BeanDefinition<T>

Create a Factory definition for given type T

factoryBy

fun <R : Any, T : R> ModuleDefinition.factoryBy(name: String = "", override: Boolean = false): BeanDefinition<R>

Create a Factory definition for given type T to build and cast as R

getForClass

fun <T : Any> ModuleDefinition.getForClass(name: String = "", clazz: Class<T>, parameters: ParameterDefinition = emptyParameterDefinition()): T

Resolve a component from its class

scope

fun <T : Any> ModuleDefinition.scope(name: String = "", override: Boolean = false): BeanDefinition<T>

Create a Scope definition for given type T

scopeBy

fun <R : Any, T : R> ModuleDefinition.scopeBy(name: String = "", override: Boolean = false): BeanDefinition<R>

Create a Scope definition for given type T, applied to R

single

fun <T : Any> ModuleDefinition.single(name: String = "", createOnStart: Boolean = false, override: Boolean = false): BeanDefinition<T>

Create a Single definition for given type T

singleBy

fun <R : Any, T : R> ModuleDefinition.singleBy(name: String = "", createOnStart: Boolean = false, override: Boolean = false): BeanDefinition<R>

Create a Single definition for given type T to build and cast as R