from dataclasses import dataclass

from kiutils.items.common import Position as Position
from kiutils.utils.strings import dequote as dequote

@dataclass
class KeepoutSettings:
    tracks: str = ...
    vias: str = ...
    pads: str = ...
    copperpour: str = ...
    footprints: str = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> KeepoutSettings: ...
    def to_sexpr(self, indent: int = 0, newline: bool = False) -> str: ...

@dataclass
class FillSettings:
    yes: bool = ...
    mode: str | None = ...
    thermalGap: float | None = ...
    thermalBridgeWidth: float | None = ...
    smoothingStyle: str | None = ...
    smoothingRadius: float | None = ...
    islandRemovalMode: int | None = ...
    islandAreaMin: float | None = ...
    hatchThickness: float | None = ...
    hatchGap: float | None = ...
    hatchOrientation: float | None = ...
    hatchSmoothingLevel: int | None = ...
    hatchSmoothingValue: float | None = ...
    hatchBorderAlgorithm: int | None = ...
    hatchMinHoleArea: float | None = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> FillSettings: ...
    def to_sexpr(self, indent: int = 0, newline: bool = False) -> str: ...

@dataclass
class ZonePolygon:
    coordinates: list[Position] = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> ZonePolygon: ...
    def to_sexpr(self, indent: int = 4, newline: bool = True) -> str: ...

@dataclass
class FilledPolygon:
    layer: str = ...
    island: bool = ...
    coordinates: list[Position] = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> FilledPolygon: ...
    def to_sexpr(self, indent: int = 4, newline: bool = True) -> str: ...

@dataclass
class FillSegments:
    layer: str = ...
    coordinates: list[Position] = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> FillSegments: ...
    def to_sexpr(self, indent: int = 4, newline: bool = True) -> str: ...

@dataclass
class Hatch:
    style: str = ...
    pitch: float = ...

@dataclass
class Zone:
    locked: bool = ...
    net: int = ...
    netName: str = ...
    layers: list[str] = ...
    tstamp: str | None = ...
    name: str | None = ...
    hatch: Hatch = ...
    priority: int | None = ...
    connectPads: str | None = ...
    clearance: float = ...
    minThickness: float = ...
    filledAreasThickness: str | None = ...
    keepoutSettings: KeepoutSettings | None = ...
    fillSettings: FillSettings | None = ...
    polygons: list[ZonePolygon] = ...
    filledPolygons: list[FilledPolygon] = ...
    fillSegments: FillSegments | None = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> Zone: ...
    def to_sexpr(self, indent: int = 2, newline: bool = True) -> str: ...
