Skip to content

Commit 9ab9a18

Browse files
committed
fix: types
1 parent 5f2463b commit 9ab9a18

5 files changed

Lines changed: 9 additions & 15 deletions

File tree

src/socketio-stubs/async_namespace.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class AsyncNamespace(BaseServerNamespace[Literal[True]], Generic[_A]):
4242
to: None = ...,
4343
sid: None = ...,
4444
namespace: str | None = ...,
45-
timeout: int = ...,
45+
timeout: int | None = ...,
4646
ignore_queue: bool = ...,
4747
) -> NoReturn: ...
4848
@overload
@@ -53,7 +53,7 @@ class AsyncNamespace(BaseServerNamespace[Literal[True]], Generic[_A]):
5353
to: str | None = ...,
5454
sid: str | None = ...,
5555
namespace: str | None = ...,
56-
timeout: int = ...,
56+
timeout: int | None = ...,
5757
ignore_queue: bool = ...,
5858
) -> tuple[Any, ...] | None: ...
5959
async def enter_room(
@@ -95,6 +95,6 @@ class AsyncClientNamespace(BaseClientNamespace[Literal[True]]):
9595
event: str,
9696
data: DataType | tuple[DataType, ...] | None = ...,
9797
namespace: str | None = ...,
98-
timeout: int = ...,
98+
timeout: int | None = ...,
9999
) -> tuple[Any, ...] | None: ...
100100
async def disconnect(self) -> None: ...

src/socketio-stubs/async_pubsub_manager.pyi

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ class AsyncPubSubManager(AsyncManager):
3232
**kwargs: Any,
3333
) -> None: ...
3434
async def can_disconnect(self, sid: str, namespace: str) -> bool: ...
35-
async def disconnect(
36-
self, sid: str, namespace: str | None = ..., **kwargs: Any
37-
) -> None: ...
35+
async def disconnect(self, sid: str, namespace: str, **kwargs: Any) -> None: ...
3836
async def enter_room(
3937
self, sid: str, namespace: str, room: str, eio_sid: str | None = ...
4038
) -> None: ...

src/socketio-stubs/async_server.pyi

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ from socketio._types import (
1818
AsyncSessionContextManager,
1919
DataType,
2020
JsonModule,
21-
SerializerType,
2221
SocketIOModeType,
2322
TransportType,
2423
)
@@ -27,7 +26,6 @@ from socketio.async_admin import InstrumentedAsyncServer
2726
from socketio.async_manager import AsyncManager
2827
from socketio.async_namespace import AsyncNamespace
2928
from socketio.base_server import BaseServer
30-
from socketio.packet import Packet
3129

3230
_A = TypeVar("_A", bound=AsyncAsyncModeType, default=Any)
3331
_P = ParamSpec("_P")
@@ -41,10 +39,8 @@ class AsyncServer(BaseServer[Literal[True], engineio.AsyncServer], Generic[_A]):
4139
self,
4240
client_manager: AsyncManager | None = ...,
4341
logger: logging.Logger | bool = ...,
44-
serializer: SerializerType | type[Packet] = ...,
4542
json: JsonModule | None = ...,
4643
async_handlers: bool = ...,
47-
always_connect: bool = ...,
4844
namespaces: list[str] | None = ...,
4945
*,
5046
async_mode: _A = ...,

src/socketio-stubs/async_simple_client.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ from typing import Any, ClassVar, Literal, Self
44

55
from socketio._types import DataType, TransportType
66
from socketio.async_client import AsyncClient
7-
from socketio.client import Client
87

98
class AsyncSimpleClient:
109
client_class: ClassVar[type[AsyncClient]]
1110
client_args: tuple[Any, ...]
1211
client_kwargs: dict[str, Any]
13-
client: Client | None
12+
client: AsyncClient | None
1413
namespace: str
1514
connected_event: asyncio.Event
1615
connected: bool

src/socketio-stubs/namespace.pyi

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Namespace(BaseServerNamespace[Literal[False]], Generic[_A]):
4242
to: None = ...,
4343
sid: None = ...,
4444
namespace: str | None = ...,
45-
timeout: int = ...,
45+
timeout: int | None = ...,
4646
ignore_queue: bool = ...,
4747
) -> NoReturn: ...
4848
@overload
@@ -53,7 +53,7 @@ class Namespace(BaseServerNamespace[Literal[False]], Generic[_A]):
5353
to: str | None = ...,
5454
sid: str | None = ...,
5555
namespace: str | None = ...,
56-
timeout: int = ...,
56+
timeout: int | None = ...,
5757
ignore_queue: bool = ...,
5858
) -> tuple[Any, ...] | None: ...
5959
def enter_room(self, sid: str, room: str, namespace: str | None = ...) -> None: ...
@@ -81,6 +81,7 @@ class ClientNamespace(BaseClientNamespace[Literal[False]]):
8181
def send(
8282
self,
8383
data: DataType | tuple[DataType, ...] | None,
84+
room: str | None = ...,
8485
namespace: str | None = ...,
8586
callback: Callable[..., Any] = ...,
8687
) -> None: ...
@@ -89,6 +90,6 @@ class ClientNamespace(BaseClientNamespace[Literal[False]]):
8990
event: str,
9091
data: DataType | tuple[DataType, ...] | None = ...,
9192
namespace: str | None = ...,
92-
timeout: int = ...,
93+
timeout: int | None = ...,
9394
) -> tuple[Any, ...] | None: ...
9495
def disconnect(self) -> None: ...

0 commit comments

Comments
 (0)