massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stdlib / wsgiref / simple_server.pyi
1 from http.server import BaseHTTPRequestHandler, HTTPServer
2 from typing import Type, TypeVar, overload
3
4 from .handlers import SimpleHandler
5 from .types import ErrorStream, StartResponse, WSGIApplication, WSGIEnvironment
6
7 server_version: str  # undocumented
8 sys_version: str  # undocumented
9 software_version: str  # undocumented
10
11 class ServerHandler(SimpleHandler):  # undocumented
12     server_software: str
13     def close(self) -> None: ...
14
15 class WSGIServer(HTTPServer):
16     application: WSGIApplication | None
17     base_environ: WSGIEnvironment  # only available after call to setup_environ()
18     def setup_environ(self) -> None: ...
19     def get_app(self) -> WSGIApplication | None: ...
20     def set_app(self, application: WSGIApplication | None) -> None: ...
21
22 class WSGIRequestHandler(BaseHTTPRequestHandler):
23     server_version: str
24     def get_environ(self) -> WSGIEnvironment: ...
25     def get_stderr(self) -> ErrorStream: ...
26     def handle(self) -> None: ...
27
28 def demo_app(environ: WSGIEnvironment, start_response: StartResponse) -> list[bytes]: ...
29
30 _S = TypeVar("_S", bound=WSGIServer)
31
32 @overload
33 def make_server(host: str, port: int, app: WSGIApplication, *, handler_class: Type[WSGIRequestHandler] = ...) -> WSGIServer: ...
34 @overload
35 def make_server(
36     host: str, port: int, app: WSGIApplication, server_class: Type[_S], handler_class: Type[WSGIRequestHandler] = ...
37 ) -> _S: ...