package net.sergeych.toread

import androidx.compose.ui.graphics.ImageBitmap
import net.sergeych.toread.fb2.Fb2Binary
import kotlin.io.encoding.Base64
import kotlin.io.encoding.ExperimentalEncodingApi

@OptIn(ExperimentalEncodingApi::class)
fun Fb2Binary.imageBytes(): ByteArray = Base64.Default.decode(base64)

const val DefaultBookFileName: String = "Maraini_Zapiski-Terezy-Numy.G7vc8A.872381.fb2.zip"

expect fun loadDefaultBookBytes(): ByteArray?

expect fun decodeBookImage(binary: Fb2Binary): ImageBitmap?

expect fun decodeImageBytes(bytes: ByteArray): ImageBitmap?

expect suspend fun copyImageToClipboard(bytes: ByteArray, mimeType: String, label: String): Boolean
