All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.net.folivo.trixnity.client.store.createStoreModule.kt Maven / Gradle / Ivy

There is a newer version: 4.7.1
Show newest version
package net.folivo.trixnity.client.store

import net.folivo.trixnity.client.media.MediaStore
import org.koin.core.module.dsl.singleOf
import org.koin.dsl.bind
import org.koin.dsl.module

fun createStoreModule() = module {
    singleOf(::TransactionManagerImpl).bind()
    singleOf(::AccountStore)
    singleOf(::GlobalAccountDataStore)
    single {
        KeyStore(
            outdatedKeysRepository = get(),
            deviceKeysRepository = get(),
            crossSigningKeysRepository = get(),
            keyVerificationStateRepository = get(),
            keyChainLinkRepository = get(),
            secretsRepository = get(),
            secretKeyRequestRepository = get(),
            roomKeyRequestRepository = get(),
            tm = get(),
            config = get(),
            storeScope = get()
        )
    }
    singleOf(::MediaCacheMappingStore)
    singleOf(::OlmCryptoStore)
    singleOf(::RoomAccountDataStore)
    singleOf(::RoomOutboxMessageStore)
    singleOf(::RoomStateStore)
    singleOf(::RoomStore)
    singleOf(::RoomTimelineStore)
    singleOf(::RoomUserStore)

    single {
        RootStore(
            listOfNotNull(
                getOrNull(),
                getOrNull(),
                getOrNull(),
                getOrNull(),
                getOrNull(),
                getOrNull(),
                getOrNull(),
                getOrNull(),
                getOrNull(),
                getOrNull(),
                getOrNull(),
                getOrNull(),
            )
        )
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy