import enum
import tkinter as tk
from cairo import Antialias, LineCap, LineJoin
from dataclasses import dataclass
from typing import Any, NamedTuple

__version__: str

@dataclass
class Brush:
    width: float
    color: str | tuple
    fill: bool
    edge: str | tuple
    dash: list | tuple
    line_cap: LineCap
    line_join: LineJoin
    def copy(self, width: float | None = None, color: str | tuple | None = None, fill: bool | None = None) -> Brush: ...
    def __init__(self, width: float = 1.0, color: str | tuple = 'black', fill: bool = False, edge: str | tuple = '', dash: list | tuple = (), line_cap: LineCap = LineCap.BUTT, line_join: LineJoin = LineJoin.MITER) -> None: ...

@dataclass
class Font:
    family: str
    height: float
    bold: bool
    italic: bool
    def __init__(self, family: str = 'Arial', height: float = 12.0, bold: bool = False, italic: bool = False) -> None: ...

@dataclass
class TextStyle:
    font: Font
    color: str | tuple
    anchor: str
    angle: float
    border_width: float
    def __init__(self, font: Font = Font(), color: str | tuple = 'black', anchor: str = tk.LEFT, angle: float = 0.0, border_width: float = -1.0) -> None: ...

class Shape(enum.IntEnum):
    CIRCLE = 0
    DIAMOND = 1
    SQUARE = 2
    TRIANGLE = 3

class Size(NamedTuple):
    width: float
    height: float

class Vector:
    x: float
    y: float
    def __init__(self, x: float, y: float) -> None: ...
    @classmethod
    def from_polar_coords(cls, length: float, angle: float) -> Vector: ...
    @property
    def length(self) -> float: ...
    @property
    def angle(self) -> float: ...
    def __eq__(self, other: Any) -> bool: ...
    def __len__(self) -> int: ...
    def __iter__(self) -> Any: ...
    def __getitem__(self, index: int) -> float: ...
    def __setitem__(self, index: int, value: float) -> None: ...
    def __abs__(self) -> float: ...
    def __neg__(self) -> Vector: ...
    def __pos__(self) -> Vector: ...
    def __add__(self, other: Vector) -> Vector: ...
    def __iadd__(self, other: Vector) -> Vector: ...
    def __sub__(self, other: Vector) -> Vector: ...
    def __isub__(self, other: Vector) -> Vector: ...
    def __mul__(self, scale: float) -> Vector: ...
    def __rmul__(self, scale: float) -> Vector: ...
    def __imul__(self, scale: float) -> Vector: ...
    def __truediv__(self, scale: float) -> Vector: ...
    def __itruediv__(self, scale: float) -> Vector: ...
    def __matmul__(self, other: Vector) -> float: ...
    def __xor__(self, other: Vector) -> float: ...
    def rotated(self, angle: float) -> Vector: ...

@dataclass(frozen=True)
class BorderStyle:
    Raised: str
    Sunken: str
    Groove: str
    Ridge: str
    Solid: str
    Flat: str

class DrawArea(tk.Label):
    def __init__(self, parent: Any, width: int, height: int, antialias: Antialias = Antialias.DEFAULT) -> None: ...
    @property
    def border_style(self) -> str: ...
    @border_style.setter
    def border_style(self, style: str) -> None: ...
    @property
    def cursor(self) -> str: ...
    @cursor.setter
    def cursor(self, style: str) -> None: ...
    @property
    def width(self) -> int: ...
    @property
    def height(self) -> int: ...
    @property
    def origin(self) -> tuple[float, float]: ...
    @origin.setter
    def origin(self, point: tuple[float, float]) -> None: ...
    def clear(self) -> None: ...
    def display(self) -> None: ...
    def save(self, filename: str) -> bool: ...
    def set_background(self, color: str | tuple) -> None: ...
    def arc(self, brush: Brush, radius: float, start: Vector | tuple[float, float], end: Vector | tuple[float, float]) -> None: ...
    def arrow(self, brush: Brush, location: Vector | tuple[float, float], angle: float) -> Vector: ...
    def circle(self, brush: Brush, center: Vector | tuple[float, float], radius: float) -> None: ...
    def datapoint(self, brush: Brush, center: Vector | tuple[float, float], shape: Shape = Shape.CIRCLE) -> None: ...
    def ellipse(self, brush: Brush, center: Vector | tuple[float, float], size: Size | tuple[float, float], angle: float = 0.0) -> None: ...
    def label(self, style: TextStyle, start: Vector | tuple[float, float], text: str) -> Size: ...
    def line(self, brush: Brush, start: Vector | tuple[float, float], end: Vector | tuple[float, float]) -> None: ...
    def polygon(self, brush: Brush, coords: list[Vector] | list[tuple[float, float]], segments: list[int] | list[float] | None = None) -> None: ...
    def rectangle(self, brush: Brush, start: Vector | tuple[float, float], size: Size | tuple[float, float]) -> None: ...
    def square(self, brush: Brush, center: Vector | tuple[float, float], side: float, angle: float = 0.0) -> None: ...
