Package-level declarations

Types

Link copied to clipboard
sealed interface DependencyFactory<T : Any>

A sealed interface representing a factory for creating dependency instances. A factory is a recipe that tells the DI container how to create an object of a specific type T.

Link copied to clipboard
data class DependencyModule(val factories: List<DependencyFactory<*>>)

A data class that holds a collection of DependencyFactory instances. A module is essentially a container for the recipes (factories) that teach the DI container how to create objects.

Link copied to clipboard
class InstanceDependencyFactory<T : Any>(val qualifier: Qualifier, val createRule: CreateRule, val create: () -> T) : DependencyFactory<T>

A concrete implementation of DependencyFactory for creating standard object instances. This is the most common factory, used for single and factory definitions.

Link copied to clipboard

A typealias for a lambda that defines a set of dependency bindings using the DependencyModuleBuilder DSL. This allows for a clean and readable way to declare modules.

Link copied to clipboard
class ScopeDependencyFactory(val qualifier: Qualifier, val createRule: CreateRule, val create: () -> DefaultScope) : DependencyFactory<DefaultScope>

A specialized DependencyFactory for creating nested Scope instances. This factory is used by the scope<T> { ... } DSL function to define a sub-scope within a module.

Functions

Link copied to clipboard

Applies a ModuleDefinition to a given DefaultScope, registering all the defined dependencies.

fun combine(scope: DefaultScope, vararg block: ModuleDefinition)

Applies multiple ModuleDefinitions to a given DefaultScope. This is a convenience function to register several modules at once.