// Generated by alef. Do not edit by hand.

package dev.kreuzberg

object OcrBackendBridge {
    private val registered = mutableMapOf<String, IOcrBackend>()

    fun register(impl: IOcrBackend): Unit {
        val name = impl.name()
        registered[name] = impl
        KreuzbergBridge.nativeRegisterOcrBackend(impl)
    }

    fun unregister(name: String): Unit {
        registered.remove(name)
        KreuzbergBridge.nativeUnregisterOcrBackend(name)
    }

    fun clearAll(): Unit {
        registered.clear()
        KreuzbergBridge.nativeClearOcrBackends()
    }

    fun getAll(): Map<String, IOcrBackend> = registered.toMap()
}
