"""Format exporters registry."""

from .binary import BinaryFormatExporter
from .safetensors import SafetensorsFormatExporter


FORMAT_REGISTRY = {
    'binary': BinaryFormatExporter,
    'safetensors': SafetensorsFormatExporter,
    # 'gguf': GGUFFormatExporter,  # To be implemented
    # 'onnx': ONNXFormatExporter,  # To be implemented
}


def get_format_exporter(format_name: str):
    """
    Get format exporter by name.
    
    Args:
        format_name: Format name ('binary', 'safetensors', etc.)
    
    Returns:
        Format exporter class
    
    Raises:
        ValueError: If format not supported
    """
    if format_name not in FORMAT_REGISTRY:
        available = ', '.join(FORMAT_REGISTRY.keys())
        raise ValueError(
            f"Format '{format_name}' not supported. "
            f"Available formats: {available}"
        )
    
    return FORMAT_REGISTRY[format_name]


def list_formats() -> list:
    """List all available export formats."""
    return list(FORMAT_REGISTRY.keys())


__all__ = [
    'BinaryFormatExporter',
    'SafetensorsFormatExporter',
    'get_format_exporter',
    'list_formats',
]