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

package dev.kreuzberg

object DocumentExtractorBridge {
    private val registered = mutableMapOf<String, IDocumentExtractor>()

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

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

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

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