# 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
defmodule Kreuzberg.ContentFilterConfig do
  @moduledoc """
  Cross-extractor content filtering configuration.

  Controls whether "furniture" content (headers, footers, page numbers,
  watermarks, repeating text) is included in or stripped from extraction
  results. Applies across all extractors (PDF, DOCX, RTF, ODT, HTML, etc.)
  with format-specific implementation.

  When `None` on `ExtractionConfig`, each extractor uses its current
  default behavior unchanged.
  """

  @typedoc "Cross-extractor content filtering configuration."
  @type t :: %__MODULE__{
          include_headers: boolean(),
          include_footers: boolean(),
          strip_repeating_text: boolean(),
          include_watermarks: boolean()
        }

  defstruct include_headers: false,
            include_footers: false,
            strip_repeating_text: true,
            include_watermarks: false

  defimpl Jason.Encoder do
    @doc false
    def encode(value, opts) do
      value
      |> Map.from_struct()
      |> Enum.reject(fn {_k, v} -> v == nil end)
      |> Enum.into(%{})
      |> Jason.Encoder.encode(opts)
    end
  end
end
