forked from typeddjango/djangorestframework-stubs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompat.pyi
83 lines (75 loc) · 2.16 KB
/
compat.pyi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
from typing import Any
from django.db.models import QuerySet
from typing_extensions import TypeAlias
try:
from django.contrib.postgres import fields as postgres_fields
except ImportError:
postgres_fields: TypeAlias = None # type: ignore[no-redef]
try:
import coreapi
except ImportError:
coreapi: TypeAlias = None # type: ignore[no-redef]
try:
import uritemplate
except ImportError:
uritemplate: TypeAlias = None # type: ignore[no-redef]
try:
import coreschema
except ImportError:
coreschema: TypeAlias = None # type: ignore[no-redef]
try:
import yaml
except ImportError:
yaml: TypeAlias = None # type: ignore[no-redef]
try:
import inflection # type: ignore[import-not-found,unused-ignore]
except ImportError:
inflection: TypeAlias = None # type: ignore[no-redef]
try:
import requests
except ImportError:
requests: TypeAlias = None # type: ignore[no-redef]
try:
import pygments
except ImportError:
pygments: TypeAlias = None # type: ignore[no-redef]
try:
import markdown
from markdown.preprocessors import Preprocessor
def apply_markdown(text: str) -> str: ...
class CodeBlockPreprocessor(Preprocessor):
pattern: Any
formatter: Any
def run(self, lines: list[str]) -> list[str]: ...
except ImportError:
apply_markdown: TypeAlias = None # type: ignore[no-redef]
markdown: TypeAlias = None # type: ignore[no-redef]
def pygments_css(style: Any) -> str | None: ...
def pygments_highlight(text: str, lang: str, style: Any) -> Any: ...
def md_filter_add_syntax_highlight(md: Any) -> bool: ...
def unicode_http_header(value: str | bytes) -> str: ...
SHORT_SEPARATORS: tuple[str, str]
LONG_SEPARATORS: tuple[str, str]
INDENT_SEPARATORS: tuple[str, str]
__all__ = [
"coreapi",
"coreschema",
"requests",
"postgres_fields",
"QuerySet",
"uritemplate",
"yaml",
"inflection",
"pygments",
"markdown",
"apply_markdown",
"Preprocessor",
"CodeBlockPreprocessor",
"pygments_css",
"pygments_highlight",
"md_filter_add_syntax_highlight",
"unicode_http_header",
"SHORT_SEPARATORS",
"LONG_SEPARATORS",
"INDENT_SEPARATORS",
]