// Generated by alef. Do not edit by hand.
@file:Suppress(
    "ktlint:standard:max-line-length",
    "ktlint:standard:trailing-comma-on-declaration-site",
    "ktlint:standard:trailing-comma-on-call-site",
    "ktlint:standard:annotation",
    "MaxLineLength",
    "TooManyFunctions",
    "LongParameterList",
)

package dev.kreuzberg

@Suppress("TooManyFunctions")
object KreuzbergBridge {
    init { System.loadLibrary("kreuzberg_jni") }

    @Throws(KreuzbergBridgeException::class)
    external fun nativeExtractBytes(content: ByteArray, mimeType: String, config: String): String

    @Throws(KreuzbergBridgeException::class)
    external fun nativeExtractFile(path: String, mimeType: String, config: String): String

    @Throws(KreuzbergBridgeException::class)
    external fun nativeExtractFileSync(path: String, mimeType: String, config: String): String

    @Throws(KreuzbergBridgeException::class)
    external fun nativeExtractBytesSync(content: ByteArray, mimeType: String, config: String): String

    @Throws(KreuzbergBridgeException::class)
    external fun nativeBatchExtractFilesSync(items: String, config: String): String

    @Throws(KreuzbergBridgeException::class)
    external fun nativeBatchExtractBytesSync(items: String, config: String): String

    @Throws(KreuzbergBridgeException::class)
    external fun nativeBatchExtractFiles(items: String, config: String): String

    @Throws(KreuzbergBridgeException::class)
    external fun nativeBatchExtractBytes(items: String, config: String): String

    @Throws(KreuzbergBridgeException::class)
    external fun nativeDetectMimeTypeFromBytes(content: ByteArray): String

    @Throws(KreuzbergBridgeException::class)
    external fun nativeGetExtensionsForMime(mimeType: String): String

    @Throws(KreuzbergBridgeException::class)
    external fun nativeClearEmbeddingBackends()

    @Throws(KreuzbergBridgeException::class)
    external fun nativeListEmbeddingBackends(): String

    @Throws(KreuzbergBridgeException::class)
    external fun nativeListDocumentExtractors(): String

    @Throws(KreuzbergBridgeException::class)
    external fun nativeClearDocumentExtractors()

    @Throws(KreuzbergBridgeException::class)
    external fun nativeListOcrBackends(): String

    @Throws(KreuzbergBridgeException::class)
    external fun nativeClearOcrBackends()

    @Throws(KreuzbergBridgeException::class)
    external fun nativeListPostProcessors(): String

    @Throws(KreuzbergBridgeException::class)
    external fun nativeClearPostProcessors()

    @Throws(KreuzbergBridgeException::class)
    external fun nativeListRenderers(): String

    @Throws(KreuzbergBridgeException::class)
    external fun nativeClearRenderers()

    @Throws(KreuzbergBridgeException::class)
    external fun nativeListValidators(): String

    @Throws(KreuzbergBridgeException::class)
    external fun nativeClearValidators()

    @Throws(KreuzbergBridgeException::class)
    external fun nativeCompare(a: String, b: String, opts: String): String

    @Throws(KreuzbergBridgeException::class)
    external fun nativeRenderPdfPageToPng(pdfBytes: ByteArray, pageIndex: Long, dpi: Int, password: String): ByteArray

    @Throws(KreuzbergBridgeException::class)
    external fun nativeDetectMimeType(path: String, checkExists: Boolean): String

    @Throws(KreuzbergBridgeException::class)
    external fun nativeEmbedTexts(texts: String, config: String): String

    @Throws(KreuzbergBridgeException::class)
    external fun nativeGetEmbeddingPreset(name: String): String?

    @Throws(KreuzbergBridgeException::class)
    external fun nativeListEmbeddingPresets(): String

    // JNI trait-bridge external funs — implementations are Rust JNI shims.

    @Throws(KreuzbergBridgeException::class)
    external fun nativeRegisterOcrBackend(impl: dev.kreuzberg.IOcrBackend)
    @Throws(KreuzbergBridgeException::class)
    external fun nativeUnregisterOcrBackend(name: String)

    @Throws(KreuzbergBridgeException::class)
    external fun nativeRegisterPostProcessor(impl: dev.kreuzberg.IPostProcessor)
    @Throws(KreuzbergBridgeException::class)
    external fun nativeUnregisterPostProcessor(name: String)

    @Throws(KreuzbergBridgeException::class)
    external fun nativeRegisterValidator(impl: dev.kreuzberg.IValidator)
    @Throws(KreuzbergBridgeException::class)
    external fun nativeUnregisterValidator(name: String)

    @Throws(KreuzbergBridgeException::class)
    external fun nativeRegisterEmbeddingBackend(impl: dev.kreuzberg.IEmbeddingBackend)
    @Throws(KreuzbergBridgeException::class)
    external fun nativeUnregisterEmbeddingBackend(name: String)

    @Throws(KreuzbergBridgeException::class)
    external fun nativeRegisterDocumentExtractor(impl: dev.kreuzberg.IDocumentExtractor)
    @Throws(KreuzbergBridgeException::class)
    external fun nativeUnregisterDocumentExtractor(name: String)

    @Throws(KreuzbergBridgeException::class)
    external fun nativeRegisterRenderer(impl: dev.kreuzberg.IRenderer)
    @Throws(KreuzbergBridgeException::class)
    external fun nativeUnregisterRenderer(name: String)
}
