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

commonMain.com.seiko.imageloader.intercept.Interceptor.kt Maven / Gradle / Ivy

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

import com.seiko.imageloader.component.ComponentRegistry
import com.seiko.imageloader.request.ImageRequest
import com.seiko.imageloader.request.ImageResult
import com.seiko.imageloader.request.Options

interface Interceptor {

    suspend fun intercept(chain: Chain): ImageResult

    interface Chain {

        val initialRequest: ImageRequest
        val request: ImageRequest
        val options: Options
        val components: ComponentRegistry

        // /**
        //  * Set the requested [Size] to load the image at.
        //  *
        //  * @param size The requested size for the image.
        //  */
        // fun withSize(size: Size): Chain

        /**
         * Continue executing the chain.
         *
         * @param request The request to proceed with.
         */
        suspend fun proceed(request: ImageRequest): ImageResult

        operator fun component1() = request

        operator fun component2() = options

        operator fun component3() = components
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy