// This file is auto-generated by alef — DO NOT EDIT.
// alef:hash:4e15143f4af1ae8bafbdb1506ef057da924484c66a19483966333558ad437e75
// To regenerate: alef generate
// To verify freshness: alef verify --exit-code
// Issues & docs: https://github.com/kreuzberg-dev/alef
// swift-format-ignore-file

import XCTest
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
import Kreuzberg
import RustBridge

/// E2e tests for category: plugin_api.
final class PluginApiTests: XCTestCase {
    func testRegisterDocumentExtractorTraitBridge() throws {
        // register_document_extractor: trait bridge
        class TestStubRegisterDocumentExtractorTraitBridge: SwiftDocumentExtractorBridge {
    var name: String { "register_document_extractor_trait_bridge" }
    func extractBytes(content: Data, mimeType: String, config: ExtractionConfig) async throws -> InternalDocument { InternalDocument() }
    func supportedMimeTypes() -> [String] { [] }
}

        let result = try Kreuzberg.registerDocumentExtractor(TestStubRegisterDocumentExtractorTraitBridge())
        try? Kreuzberg.unregisterDocumentExtractor("swift-bridge-document_extractor")
    }

    func testRegisterEmbeddingBackendTraitBridge() throws {
        // register_embedding_backend: trait bridge
        class TestStubRegisterEmbeddingBackendTraitBridge: SwiftEmbeddingBackendBridge {
    var name: String { "register_embedding_backend_trait_bridge" }
    func dimensions() -> UInt { 0 }
    func embed(texts: [String]) async throws -> [[Float]] { [] }
}

        let result = try Kreuzberg.registerEmbeddingBackend(TestStubRegisterEmbeddingBackendTraitBridge())
        try? Kreuzberg.unregisterEmbeddingBackend("swift-bridge-embedding_backend")
    }

    func testRegisterOcrBackendTraitBridge() throws {
        // register_ocr_backend: trait bridge
        class TestStubRegisterOcrBackendTraitBridge: SwiftOcrBackendBridge {
    var name: String { "register_ocr_backend_trait_bridge" }
    func processImage(imageBytes: Data, config: OcrConfig) async throws -> ExtractionResult { ExtractionResult() }
    func supportsLanguage(lang: String) -> Bool { false }
    func backendType() -> OcrBackendType { OcrBackendType() }
}

        let result = try Kreuzberg.registerOcrBackend(TestStubRegisterOcrBackendTraitBridge())
        try? Kreuzberg.unregisterOcrBackend("swift-bridge-ocr_backend")
    }

    func testRegisterPostProcessorTraitBridge() throws {
        // register_post_processor: trait bridge
        class TestStubRegisterPostProcessorTraitBridge: SwiftPostProcessorBridge {
    var name: String { "register_post_processor_trait_bridge" }
    func process(result: ExtractionResult, config: ExtractionConfig) async throws -> Void { () }
    func processingStage() -> ProcessingStage { ProcessingStage() }
}

        let result = try Kreuzberg.registerPostProcessor(TestStubRegisterPostProcessorTraitBridge())
        try? Kreuzberg.unregisterPostProcessor("swift-bridge-post_processor")
    }

    func testRegisterRendererTraitBridge() throws {
        // register_renderer: trait bridge
        class TestStubRegisterRendererTraitBridge: SwiftRendererBridge {
    var name: String { "register_renderer_trait_bridge" }
    func render(doc: InternalDocument) -> String { "" }
}

        let result = try Kreuzberg.registerRenderer(TestStubRegisterRendererTraitBridge())
        try? Kreuzberg.unregisterRenderer("swift-bridge-renderer")
    }

    func testRegisterValidatorTraitBridge() throws {
        // register_validator: trait bridge
        class TestStubRegisterValidatorTraitBridge: SwiftValidatorBridge {
    var name: String { "register_validator_trait_bridge" }
    func validate(result: ExtractionResult, config: ExtractionConfig) async throws -> Void { () }
}

        let result = try Kreuzberg.registerValidator(TestStubRegisterValidatorTraitBridge())
        try? Kreuzberg.unregisterValidator("swift-bridge-validator")
    }

    func testUnregisterDocumentExtractorAfterRegister() throws {
        // unregister_document_extractor
        let result = try Kreuzberg.unregisterDocumentExtractor(name: "test-extractor")
    }

    func testUnregisterEmbeddingBackendAfterRegister() throws {
        // unregister_embedding_backend
        let result = try Kreuzberg.unregisterEmbeddingBackend(name: "test-embedding-backend")
    }

    func testUnregisterPostProcessorAfterRegister() throws {
        // unregister_post_processor
        let result = try Kreuzberg.unregisterPostProcessor(name: "test-processor")
    }

    func testUnregisterRendererAfterRegister() throws {
        // unregister_renderer
        let result = try Kreuzberg.unregisterRenderer(name: "test-renderer")
    }

    func testUnregisterValidatorAfterRegister() throws {
        // unregister_validator
        let result = try Kreuzberg.unregisterValidator(name: "test-validator")
    }

}
