1# Stubs for mimetypes
2
3from typing import Dict, IO, List, Optional, Sequence, Text, Tuple
4import sys
5
6def guess_type(url: Text,
7               strict: bool = ...) -> Tuple[Optional[str], Optional[str]]: ...
8def guess_all_extensions(type: str, strict: bool = ...) -> List[str]: ...
9def guess_extension(type: str, strict: bool = ...) -> Optional[str]: ...
10
11def init(files: Optional[Sequence[str]] = ...) -> None: ...
12def read_mime_types(filename: str) -> Optional[Dict[str, str]]: ...
13def add_type(type: str, ext: str, strict: bool = ...) -> None: ...
14
15inited: bool
16knownfiles: List[str]
17suffix_map: Dict[str, str]
18encodings_map: Dict[str, str]
19types_map: Dict[str, str]
20common_types: Dict[str, str]
21
22class MimeTypes:
23    suffix_map: Dict[str, str]
24    encodings_map: Dict[str, str]
25    types_map: Tuple[Dict[str, str], Dict[str, str]]
26    types_map_inv: Tuple[Dict[str, str], Dict[str, str]]
27    def __init__(self, filenames: Tuple[str, ...] = ...,
28                 strict: bool = ...) -> None: ...
29    def guess_extension(self, type: str,
30                        strict: bool = ...) -> Optional[str]: ...
31    def guess_type(self, url: str,
32                   strict: bool = ...) -> Tuple[Optional[str], Optional[str]]: ...
33    def guess_all_extensions(self, type: str,
34                             strict: bool = ...) -> List[str]: ...
35    def read(self, filename: str, strict: bool = ...) -> None: ...
36    def readfp(self, fp: IO[str], strict: bool = ...) -> None: ...
37    if sys.platform == 'win32':
38        def read_windows_registry(self, strict: bool = ...) -> None: ...
39