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

package dev.kreuzberg

object RendererBridge {
    private val registered = mutableMapOf<String, IRenderer>()

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

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

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

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