| 1 | import sys |
| 2 | from _typeshed import StrPath |
| 3 | from collections.abc import Iterable |
| 4 | from typing import IO |
| 5 | |
| 6 | __all__ = [ |
| 7 | "knownfiles", |
| 8 | "inited", |
| 9 | "MimeTypes", |
| 10 | "guess_type", |
| 11 | "guess_all_extensions", |
| 12 | "guess_extension", |
| 13 | "add_type", |
| 14 | "init", |
| 15 | "read_mime_types", |
| 16 | "suffix_map", |
| 17 | "encodings_map", |
| 18 | "types_map", |
| 19 | "common_types", |
| 20 | ] |
| 21 | |
| 22 | if sys.version_info >= (3, 13): |
| 23 | __all__ += ["guess_file_type"] |
| 24 | |
| 25 | def guess_type(url: StrPath, strict: bool = True) -> tuple[str | None, str | None]: ... |
| 26 | def guess_all_extensions(type: str, strict: bool = True) -> list[str]: ... |
| 27 | def guess_extension(type: str, strict: bool = True) -> str | None: ... |
| 28 | def init(files: Iterable[StrPath] | None = None) -> None: ... |
| 29 | def read_mime_types(file: StrPath) -> dict[str, str] | None: ... |
| 30 | def add_type(type: str, ext: str, strict: bool = True) -> None: ... |
| 31 | |
| 32 | if sys.version_info >= (3, 13): |
| 33 | def guess_file_type(path: StrPath, *, strict: bool = True) -> tuple[str | None, str | None]: ... |
| 34 | |
| 35 | inited: bool |
| 36 | knownfiles: list[StrPath] |
| 37 | suffix_map: dict[str, str] |
| 38 | encodings_map: dict[str, str] |
| 39 | types_map: dict[str, str] |
| 40 | common_types: dict[str, str] |
| 41 | |
| 42 | class MimeTypes: |
| 43 | suffix_map: dict[str, str] |
| 44 | encodings_map: dict[str, str] |
| 45 | types_map: tuple[dict[str, str], dict[str, str]] |
| 46 | types_map_inv: tuple[dict[str, str], dict[str, str]] |
| 47 | def __init__(self, filenames: Iterable[StrPath] = (), strict: bool = True) -> None: ... |
| 48 | def add_type(self, type: str, ext: str, strict: bool = True) -> None: ... |
| 49 | def guess_extension(self, type: str, strict: bool = True) -> str | None: ... |
| 50 | def guess_type(self, url: StrPath, strict: bool = True) -> tuple[str | None, str | None]: ... |
| 51 | def guess_all_extensions(self, type: str, strict: bool = True) -> list[str]: ... |
| 52 | def read(self, filename: StrPath, strict: bool = True) -> None: ... |
| 53 | def readfp(self, fp: IO[str], strict: bool = True) -> None: ... |
| 54 | def read_windows_registry(self, strict: bool = True) -> None: ... |
| 55 | if sys.version_info >= (3, 13): |
| 56 | def guess_file_type(self, path: StrPath, *, strict: bool = True) -> tuple[str | None, str | None]: ... |