mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Jinja2 async support (#2278)
This commit is contained in:
11
third_party/2and3/jinja2/environment.pyi
vendored
11
third_party/2and3/jinja2/environment.pyi
vendored
@@ -1,9 +1,13 @@
|
||||
import sys
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Text, Type, Union
|
||||
|
||||
from .bccache import BytecodeCache
|
||||
from .loaders import BaseLoader
|
||||
from .runtime import Context, Undefined
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
from typing import Awaitable, AsyncIterator
|
||||
|
||||
def get_spontaneous_environment(*args): ...
|
||||
def create_cache(size): ...
|
||||
def copy_cache(cache): ...
|
||||
@@ -42,7 +46,7 @@ class Environment:
|
||||
bytecode_cache = ... # type: BytecodeCache
|
||||
auto_reload = ... # type: bool
|
||||
extensions = ... # type: List
|
||||
def __init__(self, block_start_string: Text = ..., block_end_string: Text = ..., variable_start_string: Text = ..., variable_end_string: Text = ..., comment_start_string: Any = ..., comment_end_string: Text = ..., line_statement_prefix: Text = ..., line_comment_prefix: Text = ..., trim_blocks: bool = ..., lstrip_blocks: bool = ..., newline_sequence: Text = ..., keep_trailing_newline: bool = ..., extensions: List = ..., optimized: bool = ..., undefined: Type[Undefined] = ..., finalize: Optional[Callable] = ..., autoescape: Union[bool, Callable[[str], bool]] = ..., loader: Optional[BaseLoader] = ..., cache_size: int = ..., auto_reload: bool = ..., bytecode_cache: Optional[BytecodeCache] = ...) -> None: ...
|
||||
def __init__(self, block_start_string: Text = ..., block_end_string: Text = ..., variable_start_string: Text = ..., variable_end_string: Text = ..., comment_start_string: Any = ..., comment_end_string: Text = ..., line_statement_prefix: Text = ..., line_comment_prefix: Text = ..., trim_blocks: bool = ..., lstrip_blocks: bool = ..., newline_sequence: Text = ..., keep_trailing_newline: bool = ..., extensions: List = ..., optimized: bool = ..., undefined: Type[Undefined] = ..., finalize: Optional[Callable] = ..., autoescape: Union[bool, Callable[[str], bool]] = ..., loader: Optional[BaseLoader] = ..., cache_size: int = ..., auto_reload: bool = ..., bytecode_cache: Optional[BytecodeCache] = ..., enable_async: bool = ...) -> None: ...
|
||||
def add_extension(self, extension): ...
|
||||
def extend(self, **attributes): ...
|
||||
def overlay(self, block_start_string: Text = ..., block_end_string: Text = ..., variable_start_string: Text = ..., variable_end_string: Text = ..., comment_start_string: Any = ..., comment_end_string: Text = ..., line_statement_prefix: Text = ..., line_comment_prefix: Text = ..., trim_blocks: bool = ..., lstrip_blocks: bool = ..., extensions: List = ..., optimized: bool = ..., undefined: Type[Undefined] = ..., finalize: Callable = ..., autoescape: bool = ..., loader: Optional[BaseLoader] = ..., cache_size: int = ..., auto_reload: bool = ..., bytecode_cache: Optional[BytecodeCache] = ...): ...
|
||||
@@ -97,6 +101,11 @@ class Template:
|
||||
@property
|
||||
def debug_info(self): ...
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
def render_async(self, *args, **kwargs) -> Awaitable[Text]: ...
|
||||
def generate_async(self, *args, **kwargs) -> AsyncIterator[Text]: ...
|
||||
|
||||
|
||||
class TemplateModule:
|
||||
__name__ = ... # type: Any
|
||||
def __init__(self, template, context) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user