from typing import Any, Callable, Optional, Tuple

class CoolSignal:
    @staticmethod
    def _wrap_handler(func: Callable[..., Any]) -> Callable[..., Any]: ...
    def connect(self, receiver: Callable[..., Any], sender: Any = ..., weak: bool = ...) -> None: ...
    def send(self, sender: Optional[Any] = ..., **kwargs: Any) -> Optional[Any]: ...
    def emit(self, value: Any = ..., *, sender: Optional[Any] = ...) -> Optional[Any]: ...

class CoolSignalAsync:
    @staticmethod
    def _wrap_handler(func: Callable[..., Any]) -> Callable[..., Any]: ...
    def connect(self, receiver: Callable[..., Any], sender: Any = ..., weak: bool = ...) -> None: ...
    async def send(self, sender: Optional[Any] = ..., **kwargs: Any) -> Optional[Any]: ...
    async def emit(self, value: Any = ..., *, sender: Optional[Any] = ...) -> Optional[Any]: ...
    async def _send_all(self, sender: Any, **payload: Any): ... 