"""Standalone LibreVNA signal-generator sweep support."""

__all__ = [
    "GeneratorSweepConfig",
    "GeneratorSweepRunner",
    "HardwarePwmGate",
    "ResolvedGeneratorSweepConfig",
    "resolve_generator_sweep_config",
]


def __getattr__(name: str) -> object:
    """Load generator sweep helpers lazily to avoid heavy hardware imports."""
    if name in {"GeneratorSweepConfig", "ResolvedGeneratorSweepConfig", "resolve_generator_sweep_config"}:
        from .config import GeneratorSweepConfig, ResolvedGeneratorSweepConfig, resolve_generator_sweep_config

        exports = {
            "GeneratorSweepConfig": GeneratorSweepConfig,
            "ResolvedGeneratorSweepConfig": ResolvedGeneratorSweepConfig,
            "resolve_generator_sweep_config": resolve_generator_sweep_config,
        }
        return exports[name]
    if name == "HardwarePwmGate":
        from .pwm import HardwarePwmGate

        return HardwarePwmGate
    if name == "GeneratorSweepRunner":
        from .runner import GeneratorSweepRunner

        return GeneratorSweepRunner
    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
