from ralium.window import Window
from ralium._util import FunctionType
from typing import Iterator
import os

HTML_TEMPLATE: str

class FileReader:
    def __init__(self, file: str | os.PathLike, encoding: str) -> None: ...
    @property
    def content(self) -> str: ...
    def _read(self) -> None: ...

class CSSReader:
    def __init__(self, *files: list[str | os.PathLike], encoding: str) -> None: ...
    @property
    def content(self) -> str: None

class WebHookNamespace(dict):
    def __init__(self, 
        name: str, 
        *functions: tuple[FunctionType], 
        **named_functions: dict[str, FunctionType]
    ) -> None: ...

    def add_functions(self, *functions: tuple[FunctionType]) -> None: ...
    def add_named_functions(self, **functions: dict[str, FunctionType]) -> None: ...

class WebHookFunction:
    def __new__(cls, function: FunctionType, window: Window) -> function: ...

class WebHook:
    def __init__(self, 
        url: str, 
        html: str | os.PathLike, 
        css: str | list[str] | None = None, 
        functions: list[FunctionType] | None = None, 
        namespaces: list[WebHookNamespace] | None = None,
        homepage: bool = False, 
        encoding: str = "UTF-8"
    ) -> None: ...
    def __repr__(self) -> str: ...
    
    def _get_html(self) -> None: ...
    def _get_css(self) -> None: ...
    def _wrap_functions(self) -> None: ...
    def set_window(self, window: Window) -> None: ...

class WebHookDict(dict):
    def __init__(self, webhooks: list[WebHook]) -> None: ...
    def __repr__(self) -> str: ...
    def __iter__(self) -> Iterator[tuple]: ...
    def get(self, url: str) -> WebHook: ...

def create_namespace(
    name: str, 
    *functions: tuple[FunctionType], 
    **named_functions: dict[str, FunctionType]
) -> WebHookNamespace: ...