from collections.abc import Callable
from ralium.window import Window
from ralium.util import RaliumIdStr
from typing import LiteralString, AnyStr, Dict, Any

from bs4 import BeautifulSoup, Tag

def create_ralium_id(tag: Tag) -> RaliumIdStr: ...
def create_soup_element(
    soup: BeautifulSoup, 
    tag: str, 
    attrs: Dict[str, Any] | None = ..., 
    **props: Dict[str, Any]
) -> Tag: ...

class JS:
    class _RawStr(str): pass

    @staticmethod
    def str(__value: Any) -> str: ...
    @staticmethod
    def raw(__value: Any) -> _RawStr: ...

    true: LiteralString
    false: LiteralString

    @staticmethod
    def bool(__value: AnyStr) -> bool: ...

    class ClassList(list):
        def __init__(self, element: HTMLElement) -> None: ...
        def add(self, classname: AnyStr) -> None: ...
        def remove(self, classname: AnyStr) -> None: ...
    
class HTMLElement:
    def __init__(self, window: Window, id: RaliumIdStr) -> None: ...
    def __getattr__(self, identifier: str) -> Callable[..., Any] | Any: ...
    def __setattr__(self, identifier: str, value: Any) -> None: ...
    def _get_js_element(self) -> AnyStr: ...
    def _as_js_str(self) -> AnyStr: ...
    def _eval(self, cmd: AnyStr) -> Any: ...
    def _parse(self, value: AnyStr) -> Any: ...