"""Options dataclasses for generators.

Provides typed configuration options for BOM and placement generators.
"""
from __future__ import annotations
from dataclasses import dataclass, field
from typing import List, Literal, Optional, Set

__all__ = [
    "GeneratorOptions",
    "BOMOptions",
    "PlacementOptions",
]


@dataclass
class GeneratorOptions:
    """Base options for all generators."""

    verbose: bool = False
    debug: bool = False
    debug_categories: Set[str] = field(default_factory=set)
    fields: Optional[List[str]] = None


@dataclass
class BOMOptions(GeneratorOptions):
    """Options specific to BOM generation."""

    smd_only: bool = False


@dataclass
class PlacementOptions(GeneratorOptions):
    """Options specific to placement/CPL generation."""

    origin: Literal["board", "aux"] = "board"
    smd_only: bool = True
    layer_filter: Optional[Literal["TOP", "BOTTOM"]] = None
