from ralium._util import (
    FilePathStr,
    DirPathStr,
    Callable
)

from typing import BinaryIO
import http.server

IMAGE_FILE_EXTENSIONS: list[str]

class BundledHTTPServer(http.server.SimpleHTTPRequestHandler):
    def do_GET(self) -> None: ...
    def do_HEAD(self) -> None: ...
    def send_head(self) -> bytes | None: ...
    def translate_path(self, path) -> str: ...
    def copyfile(self, fsrc: bytes, fdst: BinaryIO) -> None: ...

class File:
    def __init__(self, relpath: str, content: bytes) -> None: ...
    def __str__(self) -> str: ...
    def __repr__(self) -> str: ...

class Bundle:
    def __init__(self, *,
        url: str,
        page: bytes,
        server: bytes | None,
        styles: list[File]
    ) -> None: ...

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

class FileSystem(dict):
    def __init__(self, *,
        images: list[File],
        styles: list[File],
        bundles: list[Bundle]
    ) -> None: ...

    def __getitem__(self, __path: FilePathStr) -> bytes: ...

class PyBundler:
    def __init__(self, pyfile: FilePathStr, webfolder: DirPathStr) -> None: ...

    def view(self) -> list[bytes]: ...
    def relpath(self, filename: FilePathStr) -> FilePathStr: ...
    def collect(self, dir: DirPathStr, callback: Callable[[FilePathStr], bool]) -> list[File]: ...

    @staticmethod
    def iscss(filename: FilePathStr) -> bool: ...
    @staticmethod
    def isimage(filename: FilePathStr) -> bool: ...
    @staticmethod
    def get_content(filename: FilePathStr) -> bytes | None: ...