package mg.dot.feufaro.di

import android.content.Context
import mg.dot.feufaro.AndroidFileRepository
import mg.dot.feufaro.config.AppConfig
import org.koin.core.module.dsl.singleOf      // Import for Koin DSL
import org.koin.core.module.dsl.bind         // Import for Koin DSL
import org.koin.dsl.module
import mg.dot.feufaro.FileRepository
import org.koin.android.ext.koin.androidContext // Import for androidContext()

val androidModule = module {
    // Koin will automatically provide the Android Context because you called androidContext() in AndroidApp.
    // It then uses this Context to construct AndroidFileRepository.
    single<AppConfig> {
        AppConfig(
            transposeto = "C",
            transposeasif = "C",
        )
    }

}

// androidMain/kotlin/mg/dot/feufaro/Koin.android.kt
actual val platformModule = module {
    single<FileRepository> { AndroidFileRepository(get()) } // get() récupère androidContext
}