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

commonMain.com.seiko.imageloader.component.fetcher.Fetcher.kt Maven / Gradle / Ivy

There is a newer version: 1.9.0
Show newest version
package com.seiko.imageloader.component.fetcher

import com.seiko.imageloader.model.EmptyExtraData
import com.seiko.imageloader.model.ExtraData
import com.seiko.imageloader.option.Options
import okio.BufferedSource

interface Fetcher {
    suspend fun fetch(): FetchResult?
    fun interface Factory {
        fun create(data: Any, options: Options): Fetcher?
    }
}

sealed interface FetchResult {
    data class Source(
        val source: BufferedSource,
        val extra: ExtraData = EmptyExtraData,
    ) : FetchResult

    data class Bitmap(
        val bitmap: com.seiko.imageloader.Bitmap,
    ) : FetchResult

    data class Image(
        val image: com.seiko.imageloader.Image,
    ) : FetchResult

    data class Painter(
        val painter: androidx.compose.ui.graphics.painter.Painter,
    ) : FetchResult
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy