package com.remax.visualnovel.app.initializer.di

import android.app.Application
import com.remax.visualnovel.app.initializer.AppInitializers
import com.remax.visualnovel.app.initializer.impl.ActivityLifecycleInitializer
import com.remax.visualnovel.app.initializer.impl.LocalDataInitializer
import com.remax.visualnovel.app.initializer.impl.RouterInitializer
import com.remax.visualnovel.app.initializer.impl.SystemInitializer
import com.remax.visualnovel.app.initializer.impl.ThirdInitializer
import com.remax.visualnovel.app.initializer.impl.UserInitializer
import com.remax.visualnovel.app.viewmodel.AppGlobalViewModel
import com.remax.visualnovel.app.viewmodel.AppIMViewModel
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent

/**
 * Created by HJW on 2023/5/11
 *
 * 添加容器注入
 */
@Module
@InstallIn(SingletonComponent::class)
object AppInitializersModule {

    @Provides
    fun provideAppInitializers(application: Application,
                               appIMViewModel: AppIMViewModel,
                               appGlobalViewModel: AppGlobalViewModel
    ): Set<AppInitializers> = setOf(
        // FirebaseInitializer(application), TODO- add firebase support later
        UserInitializer(application),
        //JsInitializer(application),
        LocalDataInitializer(application),
        RouterInitializer(application),
        ThirdInitializer(application),
        ActivityLifecycleInitializer(application, appIMViewModel),
        SystemInitializer(application, appGlobalViewModel)
    )

}