from __future__ import annotations

from enum import Enum
from typing import Any, Optional, Type

import PySimpleGUI as PySG
import wrapt

from xleapp.app import Application
from xleapp.gui.utils import ProcessThread

class ArtifactProxy(wrapt.ObjectProxy):
    def __hash__(self) -> int: ...

class ArtifactEnum(Enum):
    def __lt__(self, other: ArtifactEnum): ...
    def __getattr__(self, name: str) -> Any: ...
    def process(self) -> None: ...

class ArtifactError:
    pass

class Artifacts:
    data: Type[ArtifactEnum]
    def __init__(self, app: Application) -> None: ...
    def __call__(self, device_type: str) -> Artifacts: ...
    def __getattr__(self, name: str) -> Any: ...
    def __iter__(self) -> ArtifactEnum: ...
    def __getitem__(self, name: str) -> ArtifactEnum: ...
    def __contains__(cls, item: str) -> bool: ...
    def __len__(self) -> int: ...
    @property
    def installed(self) -> list[str]: ...
    @property
    def selected(self) -> list[str]: ...
    def reset(self) -> None: ...
    def select(
        self,
        *artifacts: str,
        selected: Optional[bool],
        long_running_process: Optional[bool],
        all: Optional[bool],
    ) -> None: ...
    @staticmethod
    def generate_artifact_enum(
        app: Application, device_type: str
    ) -> Type[ArtifactEnum]: ...
    def crunch_artifacts(
        self,
        window: Optional[PySG.Window],
        thread: Optional[ProcessThread],
    ) -> None: ...
