koin-core / org.koin.dsl

Package org.koin.dsl

Types

ScopeSet

data class ScopeSet

DSL Scope Definition

Type Aliases

KoinAppDeclaration

typealias KoinAppDeclaration = KoinApplication.() -> Unit

ModuleDeclaration

typealias ModuleDeclaration = Module.() -> Unit

Functions

bind

infix fun <T> BeanDefinition<T>.bind(clazz: KClass<*>): BeanDefinition<T>

Add a compatible type to match for definition

binds

infix fun BeanDefinition<*>.binds(classes: Array<KClass<*>>): BeanDefinition<*>

Add compatible types to match for definition

koinApplication

fun koinApplication(appDeclaration: KoinAppDeclaration): KoinApplication

Create a KoinApplication instance and help configure it

module

fun module(createdAtStart: Boolean = false, override: Boolean = false, moduleDeclaration: ModuleDeclaration): Module

Define a Module

onClose

infix fun <T> BeanDefinition<T>.onClose(onClose: OnCloseCallback<T>): BeanDefinition<T>

Callback when closing instance from registry (called just before final close)

onRelease

infix fun <T> BeanDefinition<T>.onRelease(onRelease: OnReleaseCallback<T>): BeanDefinition<T>

Callback when releasing instance