from typing import Any, Tuple, Union, Optional, Callable
from AppKit import NSControl


# General Types
PosSize = Union[Tuple[int | float, int | float, int | float, int | float], str]

Size = Tuple[int, int]


class VanillaBaseObject:
    _nsObject: NSControl
    def __init__(self) -> None: ...
    def __getattr__(self, name: str) -> Any: ...
    def __setattr__(self, name: str, value: Any) -> None: ...
    def _setupView(self, viewClass: Any, posSize: Any) -> None: ...
    def getNSView(self) -> Any: ...
    def getPosSize(self) -> Tuple[int, int, int, int]: ...
    def setPosSize(self, posSize: PosSize, animate: bool = False) -> None: ...
    def move(self, x: int, y: int, animate: bool = False) -> None: ...
    def resize(self, width: int, height: int, animate: bool = False) -> None: ...
    def show(self, onOff: bool) -> None: ...
    def isVisible(self) -> bool: ...
    def enable(self, onOff: bool) -> None: ...

class VanillaBaseControl(VanillaBaseObject):

    def setTitle(self, title: str) -> None: ...

    def getTitle(self) -> str: ...

    def isEnabled(self) -> bool: ...

    def set(self, value: Any) -> None: ...

    def get(self) -> Any: ...

    def bind(self, key: str, callback: Optional[Callable[..., Any]]) -> None: ...
