from dataclasses import dataclass

from kiutils.items.common import ColorRGBA as ColorRGBA
from kiutils.items.common import Effects as Effects
from kiutils.items.common import Fill as Fill
from kiutils.items.common import Position as Position
from kiutils.items.common import ProjectInstance as ProjectInstance
from kiutils.items.common import Property as Property
from kiutils.items.common import Stroke as Stroke
from kiutils.utils.strings import dequote as dequote

@dataclass
class Junction:
    position: Position = ...
    diameter: float = ...
    color: ColorRGBA = ...
    uuid: str | None = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> Junction: ...
    def to_sexpr(self, indent: int = 2, newline: bool = True) -> str: ...

@dataclass
class NoConnect:
    position: Position = ...
    uuid: str | None = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> NoConnect: ...
    def to_sexpr(self, indent: int = 2, newline: bool = True) -> str: ...

@dataclass
class BusEntry:
    position: Position = ...
    uuid: str | None = ...
    size: Position = ...
    stroke: Stroke = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> BusEntry: ...
    def to_sexpr(self, indent: int = 2, newline: bool = True) -> str: ...

@dataclass
class BusAlias:
    name: str = ...
    members: list[str] = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> BusAlias: ...
    def to_sexpr(self, indent: int = 2, newline: bool = True) -> str: ...

@dataclass
class Connection:
    type: str = ...
    points: list[Position] = ...
    stroke: Stroke = ...
    uuid: str | None = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> Connection: ...
    def to_sexpr(self, indent: int = 2, newline: bool = True) -> str: ...

@dataclass
class PolyLine:
    points: list[Position] = ...
    stroke: Stroke = ...
    uuid: str | None = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> PolyLine: ...
    def to_sexpr(self, indent: int = 2, newline: bool = True) -> str: ...

@dataclass
class Text:
    text: str = ...
    position: Position = ...
    effects: Effects = ...
    uuid: str | None = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> Text: ...
    def to_sexpr(self, indent: int = 2, newline: bool = True) -> str: ...

@dataclass
class TextBox:
    text: str = ...
    position: Position = ...
    size: Position = ...
    stroke: Stroke = ...
    fill: Fill = ...
    effects: Effects = ...
    uuid: str | None = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> TextBox: ...
    def to_sexpr(self, indent: int = 2, newline: bool = True) -> str: ...

@dataclass
class LocalLabel:
    text: str = ...
    position: Position = ...
    effects: Effects = ...
    uuid: str | None = ...
    fieldsAutoplaced: bool = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> LocalLabel: ...
    def to_sexpr(self, indent: int = 2, newline: bool = True) -> str: ...

@dataclass
class GlobalLabel:
    text: str = ...
    shape: str = ...
    fieldsAutoplaced: bool = ...
    position: Position = ...
    effects: Effects = ...
    uuid: str | None = ...
    properties: list[Property] = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> GlobalLabel: ...
    def to_sexpr(self, indent: int = 2, newline: bool = True) -> str: ...

@dataclass
class HierarchicalLabel:
    text: str = ...
    shape: str = ...
    position: Position = ...
    effects: Effects = ...
    uuid: str | None = ...
    fieldsAutoplaced: bool = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> HierarchicalLabel: ...
    def to_sexpr(self, indent: int = 2, newline: bool = True) -> str: ...

@dataclass
class SymbolProjectPath:
    sheetInstancePath: str = ...
    reference: str = ...
    unit: int = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> SymbolProjectPath: ...
    def to_sexpr(self, indent: int = 4, newline: bool = True) -> str: ...

@dataclass
class SymbolProjectInstance(ProjectInstance):
    paths: list[SymbolProjectPath] = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> SymbolProjectInstance: ...
    def to_sexpr(self, indent: int = 2, newline: bool = True) -> str: ...

@dataclass
class SchematicSymbol:
    @property
    def libId(self) -> str: ...
    libraryNickname = ...
    entryName = ...
    @libId.setter
    def libId(self, symbol_id: str): ...
    libName: str | None = ...
    position: Position = ...
    unit: int | None = ...
    inBom: bool = ...
    onBoard: bool = ...
    dnp: bool | None = ...
    fieldsAutoplaced: bool = ...
    uuid: str | None = ...
    properties: list[Property] = ...
    pins: dict[str, str] = ...
    mirror: str | None = ...
    instances: list[SymbolProjectInstance] = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> SchematicSymbol: ...
    def to_sexpr(self, indent: int = 2, newline: bool = True) -> str: ...

@dataclass
class HierarchicalPin:
    name: str = ...
    connectionType: str = ...
    position: Position = ...
    effects: Effects = ...
    uuid: str | None = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> HierarchicalPin: ...
    def to_sexpr(self, indent: int = 4, newline: bool = True) -> str: ...

@dataclass
class HierarchicalSheetProjectPath:
    sheetInstancePath: str = ...
    page: str = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> HierarchicalSheetProjectPath: ...
    def to_sexpr(self, indent: int = 4, newline: bool = True) -> str: ...

@dataclass
class HierarchicalSheetProjectInstance(ProjectInstance):
    paths: list[HierarchicalSheetProjectPath] = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> HierarchicalSheetProjectInstance: ...
    def to_sexpr(self, indent: int = 2, newline: bool = True) -> str: ...

@dataclass
class HierarchicalSheet:
    position: Position = ...
    width: float = ...
    height: float = ...
    fieldsAutoplaced: bool = ...
    stroke: Stroke = ...
    fill: ColorRGBA = ...
    uuid: str | None = ...
    sheetName: Property = ...
    fileName: Property = ...
    properties: list[Property] = ...
    pins: list[HierarchicalPin] = ...
    instances: list[HierarchicalSheetProjectInstance] = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> HierarchicalSheet: ...
    def to_sexpr(self, indent: int = 2, newline: bool = True) -> str: ...

@dataclass
class HierarchicalSheetInstance:
    instancePath: str = ...
    page: str = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> HierarchicalSheetInstance: ...
    def to_sexpr(self, indent: int = 4, newline: bool = True) -> str: ...

@dataclass
class SymbolInstance:
    path: str = ...
    reference: str = ...
    unit: int = ...
    value: str = ...
    footprint: str = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> SymbolInstance: ...
    def to_sexpr(self, indent: int = 4, newline: bool = True) -> str: ...

@dataclass
class Rectangle:
    start: Position = ...
    end: Position = ...
    stroke: Stroke = ...
    fill: Fill = ...
    uuid: str | None = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> Rectangle: ...
    def to_sexpr(self, indent: int = 2, newline: bool = True) -> str: ...

@dataclass
class Arc:
    start: Position = ...
    mid: Position = ...
    end: Position = ...
    stroke: Stroke = ...
    fill: Fill = ...
    uuid: str | None = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> Arc: ...
    def to_sexpr(self, indent: int = 2, newline: bool = True) -> str: ...

@dataclass
class Circle:
    center: Position = ...
    radius: float = ...
    stroke: Stroke = ...
    fill: Fill = ...
    uuid: str | None = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> Circle: ...
    def to_sexpr(self, indent: int = 2, newline: bool = True) -> str: ...

@dataclass
class NetclassFlag:
    text: str = ...
    length: float = ...
    shape: str = ...
    position: Position = ...
    effects: Effects = ...
    properties: list[Property] = ...
    uuid: str | None = ...
    fieldsAutoplaced: bool = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> NetclassFlag: ...
    def to_sexpr(self, indent: int = 2, newline: bool = True) -> str: ...
