// Generated by alef. Do not edit by hand.
@file:Suppress(
    "ktlint:standard:trailing-comma-on-call-site",
    "ktlint:standard:trailing-comma-on-declaration-site",
    "ktlint:standard:spacing-between-declarations-with-comments",
    "ktlint:standard:spacing-between-declarations-with-annotations",
    "ktlint:standard:when-entry-bracing",
    "ktlint:standard:blank-line-between-when-conditions",
    "ktlint:standard:blank-line-before-declaration",
    "ktlint:standard:chain-method-continuation",
    "ktlint:standard:annotation",
    "ktlint:standard:max-line-length",
    "ktlint:standard:no-semi",
    "ktlint:standard:statement-wrapping",
    "MaxLineLength",
    "TooManyFunctions",
    "FunctionParameterNaming",
    "LongParameterList",
    "CyclomaticComplexMethod",
    "LongMethod",
)

package dev.kreuzberg

/**
 * Trait for document renderers that convert `InternalDocument` to output strings.
 *
 * Renderers are typically stateless converters that transform the internal
 * document representation into a specific output format (Markdown, HTML,
 * Djot, plain text, etc.). They participate in the standard `Plugin`
 * lifecycle so custom renderers can be registered from any supported binding
 * language.
 *
 * The format name is exposed via `Plugin.name`. For stateless renderers
 * the `Plugin` lifecycle methods (`version`, `initialize`, `shutdown`) all
 * take no-op defaults and need not be overridden.
 *
 * # Thread Safety
 *
 * Renderers must be `Send + Sync` (inherited from `Plugin`).
 */
interface IRenderer {
    fun name(): String
    fun version(): String
    fun initialize() {}
    fun shutdown() {}
    /**
     * Render an `InternalDocument` to the output format.
     *
     * **Returns:**
     *
     * The rendered output as a string.
     *
     * **Errors:**
     *
     * Returns an error if rendering fails.
     */
    fun render(doc: ExtractionResult): String
}
