package com.kdanmobile.reader

import android.content.Context
import com.kdanmobile.reader.copyfile.CopyFileViewModel
import com.kdanmobile.reader.copyfile.CopyFileInfo
import android.net.Uri
import com.kdanmobile.reader.thumb.PdfThumbViewModel
import org.koin.android.viewmodel.ext.koin.viewModel
import org.koin.dsl.module.module

object KoinModule {
    val m = module {
        single { ReaderModelManager() }
        viewModel { (applicationContext: Context, info: CopyFileInfo) ->
            CopyFileViewModel(applicationContext, info)
        }
        viewModel { (uri: Uri) ->
            ReaderViewModel(
                    get(),
                    uri,
                    Config.PDF_SDK_LICENSE,
                    Config.PDF_SDK_RSA_MSG
            ) }
        viewModel { (readerModel: ReaderModel) -> PdfThumbViewModel(readerModel) }
    }
}