"""Abstract base converter."""
from __future__ import annotations

from abc import ABC, abstractmethod
from pathlib import Path
from ..types import ConversionResult, PipelineConfig


class BaseConverter(ABC):
    """Base class for document converters."""

    def __init__(self, config: PipelineConfig | None = None):
        self.config = config or PipelineConfig()

    @abstractmethod
    def convert(self, path: Path) -> ConversionResult:
        """Convert a document to structured markdown."""
        ...

    @abstractmethod
    def supports(self, path: Path) -> bool:
        """Check if this converter supports the given file type."""
        ...
