Compare commits

..

1 Commits

Author SHA1 Message Date
aa0522acf8 docs(prof.py): add CommandCallback, TimedCallback, WindowCallback protocols
Some checks failed
CI / Check spelling (pull_request) Successful in 36s
CI / Test C API Documentation Generation (pull_request) Successful in 1m12s
CI / Check coding style (pull_request) Successful in 1m26s
CI / Test Python API Documentation Generation (pull_request) Failing after 1m26s
CI / Linux (debian) (pull_request) Successful in 12m48s
CI / Linux (ubuntu) (pull_request) Successful in 13m12s
CI / Linux (arch) (pull_request) Successful in 16m14s
- Defined callback protocols for register_command, register_timed, win_create.
- Fixed Sphinx callable warnings with proper type hints.
2025-09-15 14:38:20 +02:00

View File

@@ -12,6 +12,20 @@ settings, user/room information, and notifications/logging.
"""
from typing import Protocol
# Callback Protocols
# -----------------
class CommandCallback(Protocol):
"""Protocol for command callbacks accepting variable string arguments."""
def __call__(self, *command_parameters: str) -> None: ...
class TimedCallback(Protocol):
"""Protocol for timed callbacks accepting no arguments."""
def __call__(self) -> None: ...
class WindowCallback(Protocol):
"""Protocol for window callbacks accepting a window ID and message."""
def __call__(self, win_id: str, message: str) -> None: ...
# Console Functions
# -----------------
@@ -1191,17 +1205,3 @@ def log_error(message: str) -> None:
prof.log_error("Failed to connect to server")
"""
pass
# Callback Protocols
# -----------------
class CommandCallback(Protocol):
"""Protocol for command callbacks accepting variable string arguments."""
def __call__(self, *command_parameters: str) -> None: ...
class TimedCallback(Protocol):
"""Protocol for timed callbacks accepting no arguments."""
def __call__(self) -> None: ...
class WindowCallback(Protocol):
"""Protocol for window callbacks accepting a window ID and message."""
def __call__(self, win_id: str, message: str) -> None: ...