@@ -2,7 +2,7 @@ from _typeshed import Incomplete
22from collections .abc import Callable
33from logging import Logger
44from threading import Thread
5- from typing import Any , Literal , Protocol , TypedDict , TypeVar , overload
5+ from typing import Any , Literal , Protocol , TypedDict , TypeVar , overload , type_check_only
66from typing_extensions import ParamSpec , TypeAlias , Unpack
77
88from flask import Flask
@@ -16,19 +16,23 @@ _R_co = TypeVar("_R_co", covariant=True)
1616_ExceptionHandler : TypeAlias = Callable [[BaseException ], _R_co ]
1717_Handler : TypeAlias = Callable [_P , _R_co ]
1818
19+ @type_check_only
1920class _HandlerDecorator (Protocol ):
2021 def __call__ (self , handler : _Handler [_P , _R_co ]) -> _Handler [_P , _R_co ]: ...
2122
23+ @type_check_only
2224class _ExceptionHandlerDecorator (Protocol ):
2325 def __call__ (self , exception_handler : _ExceptionHandler [_R_co ]) -> _ExceptionHandler [_R_co ]: ...
2426
27+ @type_check_only
2528class _SocketIOServerOptions (TypedDict , total = False ):
2629 client_manager : Incomplete
2730 logger : Logger | bool
2831 json : Incomplete
2932 async_handlers : bool
3033 always_connect : bool
3134
35+ @type_check_only
3236class _EngineIOServerConfig (TypedDict , total = False ):
3337 async_mode : Literal ["threading" , "eventlet" , "gevent" , "gevent_uwsgi" ]
3438 ping_interval : float | tuple [float , float ] # seconds
@@ -43,6 +47,7 @@ class _EngineIOServerConfig(TypedDict, total=False):
4347 monitor_clients : bool
4448 engineio_logger : Logger | bool
4549
50+ @type_check_only
4651class _SocketIOKwargs (_SocketIOServerOptions , _EngineIOServerConfig ): ...
4752
4853class SocketIO :
0 commit comments