massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stubs / Jinja2 / jinja2 / environment.pyi
1 import sys
2 from typing import Any, Callable, Iterator, Sequence, Text, Type
3
4 from .bccache import BytecodeCache
5 from .loaders import BaseLoader
6 from .runtime import Context, Undefined
7
8 if sys.version_info >= (3, 6):
9     from typing import AsyncIterator, Awaitable
10
11 def get_spontaneous_environment(*args): ...
12 def create_cache(size): ...
13 def copy_cache(cache): ...
14 def load_extensions(environment, extensions): ...
15
16 class Environment:
17     sandboxed: bool
18     overlayed: bool
19     linked_to: Any
20     shared: bool
21     exception_handler: Any
22     exception_formatter: Any
23     code_generator_class: Any
24     context_class: Any
25     block_start_string: Text
26     block_end_string: Text
27     variable_start_string: Text
28     variable_end_string: Text
29     comment_start_string: Text
30     comment_end_string: Text
31     line_statement_prefix: Text
32     line_comment_prefix: Text
33     trim_blocks: bool
34     lstrip_blocks: Any
35     newline_sequence: Text
36     keep_trailing_newline: bool
37     undefined: Type[Undefined]
38     optimized: bool
39     finalize: Callable[..., Any]
40     autoescape: Any
41     filters: Any
42     tests: Any
43     globals: dict[str, Any]
44     loader: BaseLoader
45     cache: Any
46     bytecode_cache: BytecodeCache
47     auto_reload: bool
48     extensions: list[Any]
49     def __init__(
50         self,
51         block_start_string: Text = ...,
52         block_end_string: Text = ...,
53         variable_start_string: Text = ...,
54         variable_end_string: Text = ...,
55         comment_start_string: Any = ...,
56         comment_end_string: Text = ...,
57         line_statement_prefix: Text = ...,
58         line_comment_prefix: Text = ...,
59         trim_blocks: bool = ...,
60         lstrip_blocks: bool = ...,
61         newline_sequence: Text = ...,
62         keep_trailing_newline: bool = ...,
63         extensions: list[Any] = ...,
64         optimized: bool = ...,
65         undefined: Type[Undefined] = ...,
66         finalize: Callable[..., Any] | None = ...,
67         autoescape: bool | Callable[[str], bool] = ...,
68         loader: BaseLoader | None = ...,
69         cache_size: int = ...,
70         auto_reload: bool = ...,
71         bytecode_cache: BytecodeCache | None = ...,
72         enable_async: bool = ...,
73     ) -> None: ...
74     def add_extension(self, extension): ...
75     def extend(self, **attributes): ...
76     def overlay(
77         self,
78         block_start_string: Text = ...,
79         block_end_string: Text = ...,
80         variable_start_string: Text = ...,
81         variable_end_string: Text = ...,
82         comment_start_string: Any = ...,
83         comment_end_string: Text = ...,
84         line_statement_prefix: Text = ...,
85         line_comment_prefix: Text = ...,
86         trim_blocks: bool = ...,
87         lstrip_blocks: bool = ...,
88         extensions: list[Any] = ...,
89         optimized: bool = ...,
90         undefined: Type[Undefined] = ...,
91         finalize: Callable[..., Any] = ...,
92         autoescape: bool = ...,
93         loader: BaseLoader | None = ...,
94         cache_size: int = ...,
95         auto_reload: bool = ...,
96         bytecode_cache: BytecodeCache | None = ...,
97     ): ...
98     lexer: Any
99     def iter_extensions(self): ...
100     def getitem(self, obj, argument): ...
101     def getattr(self, obj, attribute): ...
102     def call_filter(
103         self, name, value, args: Any | None = ..., kwargs: Any | None = ..., context: Any | None = ..., eval_ctx: Any | None = ...
104     ): ...
105     def call_test(self, name, value, args: Any | None = ..., kwargs: Any | None = ...): ...
106     def parse(self, source, name: Any | None = ..., filename: Any | None = ...): ...
107     def lex(self, source, name: Any | None = ..., filename: Any | None = ...): ...
108     def preprocess(self, source: Text, name: Any | None = ..., filename: Any | None = ...): ...
109     def compile(self, source, name: Any | None = ..., filename: Any | None = ..., raw: bool = ..., defer_init: bool = ...): ...
110     def compile_expression(self, source: Text, undefined_to_none: bool = ...): ...
111     def compile_templates(
112         self,
113         target,
114         extensions: Any | None = ...,
115         filter_func: Any | None = ...,
116         zip: str = ...,
117         log_function: Any | None = ...,
118         ignore_errors: bool = ...,
119         py_compile: bool = ...,
120     ): ...
121     def list_templates(self, extensions: Any | None = ..., filter_func: Any | None = ...): ...
122     def handle_exception(self, exc_info: Any | None = ..., rendered: bool = ..., source_hint: Any | None = ...): ...
123     def join_path(self, template: Template | Text, parent: Text) -> Text: ...
124     def get_template(self, name: Template | Text, parent: Text | None = ..., globals: Any | None = ...) -> Template: ...
125     def select_template(
126         self, names: Sequence[Template | Text], parent: Text | None = ..., globals: dict[str, Any] | None = ...
127     ) -> Template: ...
128     def get_or_select_template(
129         self,
130         template_name_or_list: Template | Text | Sequence[Template | Text],
131         parent: Text | None = ...,
132         globals: dict[str, Any] | None = ...,
133     ) -> Template: ...
134     def from_string(
135         self, source: Text, globals: dict[str, Any] | None = ..., template_class: Type[Template] | None = ...
136     ) -> Template: ...
137     def make_globals(self, d: dict[str, Any] | None) -> dict[str, Any]: ...
138     # Frequently added extensions are included here:
139     # from InternationalizationExtension:
140     def install_gettext_translations(self, translations: Any, newstyle: bool | None = ...): ...
141     def install_null_translations(self, newstyle: bool | None = ...): ...
142     def install_gettext_callables(
143         self, gettext: Callable[..., Any], ngettext: Callable[..., Any], newstyle: bool | None = ...
144     ): ...
145     def uninstall_gettext_translations(self, translations: Any): ...
146     def extract_translations(self, source: Any, gettext_functions: Any): ...
147     newstyle_gettext: bool
148
149 class Template:
150     name: str | None
151     filename: str | None
152     def __new__(
153         cls,
154         source,
155         block_start_string: Any = ...,
156         block_end_string: Any = ...,
157         variable_start_string: Any = ...,
158         variable_end_string: Any = ...,
159         comment_start_string: Any = ...,
160         comment_end_string: Any = ...,
161         line_statement_prefix: Any = ...,
162         line_comment_prefix: Any = ...,
163         trim_blocks: Any = ...,
164         lstrip_blocks: Any = ...,
165         newline_sequence: Any = ...,
166         keep_trailing_newline: Any = ...,
167         extensions: Any = ...,
168         optimized: bool = ...,
169         undefined: Any = ...,
170         finalize: Any | None = ...,
171         autoescape: bool = ...,
172     ): ...
173     environment: Environment = ...
174     @classmethod
175     def from_code(cls, environment, code, globals, uptodate: Any | None = ...): ...
176     @classmethod
177     def from_module_dict(cls, environment, module_dict, globals): ...
178     def render(self, *args, **kwargs) -> Text: ...
179     def stream(self, *args, **kwargs) -> TemplateStream: ...
180     def generate(self, *args, **kwargs) -> Iterator[Text]: ...
181     def new_context(
182         self, vars: dict[str, Any] | None = ..., shared: bool = ..., locals: dict[str, Any] | None = ...
183     ) -> Context: ...
184     def make_module(
185         self, vars: dict[str, Any] | None = ..., shared: bool = ..., locals: dict[str, Any] | None = ...
186     ) -> Context: ...
187     @property
188     def module(self) -> Any: ...
189     def get_corresponding_lineno(self, lineno): ...
190     @property
191     def is_up_to_date(self) -> bool: ...
192     @property
193     def debug_info(self): ...
194     if sys.version_info >= (3, 6):
195         def render_async(self, *args, **kwargs) -> Awaitable[Text]: ...
196         def generate_async(self, *args, **kwargs) -> AsyncIterator[Text]: ...
197
198 class TemplateModule:
199     __name__: Any
200     def __init__(self, template, context) -> None: ...
201     def __html__(self): ...
202
203 class TemplateExpression:
204     def __init__(self, template, undefined_to_none) -> None: ...
205     def __call__(self, *args, **kwargs): ...
206
207 class TemplateStream:
208     def __init__(self, gen) -> None: ...
209     def dump(self, fp, encoding: Text | None = ..., errors: Text = ...): ...
210     buffered: bool
211     def disable_buffering(self) -> None: ...
212     def enable_buffering(self, size: int = ...) -> None: ...
213     def __iter__(self): ...
214     def __next__(self): ...