aboutsummaryrefslogtreecommitdiffstats
path: root/typings
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2023-07-14 12:39:55 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2024-02-18 11:32:53 +0100
commit1b2f7742c9893a86bc150dcaec1b76b899f042be (patch)
treeba3db2bfff6970d429bd8b48d53c02b446532028 /typings
parent9457fb1de585458db6330e0b52805131300584c6 (diff)
downloadwee-slack-1b2f7742c9893a86bc150dcaec1b76b899f042be.tar.gz
Fix typings for create_connection
Diffstat (limited to 'typings')
-rw-r--r--typings/websocket.pyi30
1 files changed, 27 insertions, 3 deletions
diff --git a/typings/websocket.pyi b/typings/websocket.pyi
index 0eaeda7..0b9b769 100644
--- a/typings/websocket.pyi
+++ b/typings/websocket.pyi
@@ -1,5 +1,7 @@
from socket import socket
-from typing import Any, Dict, Optional, Tuple
+from typing import Any
+
+from _typeshed import ReadableBuffer
STATUS_NORMAL = 1000
@@ -52,11 +54,33 @@ class WebSocket:
def ping(self, payload: str = ...) -> None: ...
def recv_data(
self, control_frame: bool
- ) -> Tuple[int, Any,]: ...
+ ) -> tuple[int, Any,]: ...
def close(
self, status: int = STATUS_NORMAL, reason: bytes = b"", timeout: int = 3
) -> None: ...
def create_connection(
- url: str, timeout: Optional[int] = ..., **options: Dict[str, Any]
+ url: str,
+ timeout: int | float | None = ...,
+ class_: type[Any] = WebSocket,
+ header: list[str] | dict[str, str] | None = ...,
+ cookie: str | None = ...,
+ origin: str | None = ...,
+ suppress_origin: bool | None = ...,
+ host: str | None = ...,
+ proxy_type: str | None = ...,
+ http_proxy_host: str | None = ...,
+ http_proxy_port: str | int | None = ...,
+ http_no_proxy: list[str] | None = ...,
+ http_proxy_auth: tuple[str, str] | None = ...,
+ http_proxy_timeout: int | float | None = ...,
+ enable_multithread: bool | None = ...,
+ redirect_limit: int | None = ...,
+ sockopt: tuple[int, int, int | ReadableBuffer]
+ | tuple[int, int, None, int]
+ | None = ...,
+ sslopt: dict[str, Any] | None = ...,
+ subprotocols: list[str] | None = ...,
+ skip_utf8_validation: bool | None = ...,
+ socket: socket | None = ...,
) -> WebSocket: ...