2 from _typeshed.wsgi import StartResponse, WSGIApplication, WSGIEnvironment
3 from typing import IO, Callable, Iterable, Mapping, Optional, Text, Tuple, Union
5 _V = Union[Tuple[Text, Text], Text]
7 _Opener = Callable[[], Tuple[IO[bytes], datetime.datetime, int]]
8 _Loader = Callable[[Optional[Text]], Union[Tuple[None, None], Tuple[Text, _Opener]]]
10 class SharedDataMiddleware(object):
12 exports: list[tuple[Text, _Loader]]
18 exports: Mapping[Text, _V] | Iterable[tuple[Text, _V]],
19 disallow: Text | None = ...,
21 cache_timeout: float = ...,
22 fallback_mimetype: Text = ...,
24 def is_allowed(self, filename: Text) -> bool: ...
25 def get_file_loader(self, filename: Text) -> _Loader: ...
26 def get_package_loader(self, package: Text, package_path: Text) -> _Loader: ...
27 def get_directory_loader(self, directory: Text) -> _Loader: ...
28 def generate_etag(self, mtime: datetime.datetime, file_size: int, real_filename: Text | bytes) -> str: ...
29 def __call__(self, environment: WSGIEnvironment, start_response: StartResponse) -> WSGIApplication: ...