from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from typing import Type, Protocol, Callable
    from types import TracebackType, ModuleType

    from datetime import timedelta
    from logging import Logger

    from shinqlx import Plugin, StatsListener

class PluginLoadError(Exception): ...
class PluginUnloadError(Exception): ...

DEFAULT_PLUGINS: tuple[str, ...]

_thread_count: int
_thread_name: str

def parse_variables(varstr: str, ordered: bool = False) -> dict[str, str]: ...
def get_logger(plugin: Plugin | str | None = ...) -> Logger: ...
def _configure_logger() -> None: ...
def log_exception(plugin: Plugin | str | None = ...) -> None: ...
def handle_exception(
    exc_type: Type[BaseException],
    exc_value: BaseException,
    exc_traceback: TracebackType | None,
) -> None: ...

class ExceptHookArgs(Protocol):
    exc_traceback: TracebackType
    exc_type: Type[BaseException]
    exc_value: BaseException

def threading_excepthook(args: ExceptHookArgs) -> None: ...
def uptime() -> timedelta: ...
def owner() -> int | None: ...

_stats: StatsListener | None

def stats_listener() -> StatsListener: ...
def set_plugins_version(path: str) -> None: ...
def set_map_subtitles() -> None: ...
def next_frame(func: Callable) -> Callable: ...
def delay(time: float) -> Callable: ...
def thread(func: Callable) -> Callable: ...

_modules: dict[str, ModuleType]

def load_preset_plugins() -> None: ...
def load_plugin(plugin: str) -> None: ...
def unload_plugin(plugin: str) -> None: ...
def reload_plugin(plugin: str) -> None: ...
def initialize_cvars() -> None: ...
def initialize() -> None: ...
def late_init() -> None: ...
