mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 04:34:28 +08:00
Add stubs for chevron package (#7139)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
This commit is contained in:
1
stubs/chevron/METADATA.toml
Executable file
1
stubs/chevron/METADATA.toml
Executable file
@@ -0,0 +1 @@
|
||||
version = "0.14.*"
|
||||
5
stubs/chevron/chevron/__init__.pyi
Executable file
5
stubs/chevron/chevron/__init__.pyi
Executable file
@@ -0,0 +1,5 @@
|
||||
from .main import cli_main as cli_main, main as main
|
||||
from .renderer import render as render
|
||||
from .tokenizer import ChevronError as ChevronError
|
||||
|
||||
__all__ = ["main", "render", "cli_main", "ChevronError"]
|
||||
7
stubs/chevron/chevron/main.pyi
Executable file
7
stubs/chevron/chevron/main.pyi
Executable file
@@ -0,0 +1,7 @@
|
||||
from _typeshed import StrOrBytesPath
|
||||
from typing import Any
|
||||
|
||||
_OpenFile = StrOrBytesPath | int
|
||||
|
||||
def main(template: _OpenFile, data: _OpenFile | None = ..., **kwargs: Any) -> str: ...
|
||||
def cli_main() -> None: ...
|
||||
1
stubs/chevron/chevron/metadata.pyi
Executable file
1
stubs/chevron/chevron/metadata.pyi
Executable file
@@ -0,0 +1 @@
|
||||
version: str
|
||||
17
stubs/chevron/chevron/renderer.pyi
Executable file
17
stubs/chevron/chevron/renderer.pyi
Executable file
@@ -0,0 +1,17 @@
|
||||
from _typeshed import StrPath, SupportsRead
|
||||
from typing import Any, MutableSequence, Sequence
|
||||
|
||||
g_token_cache: dict[str, list[tuple[str, str]]] # undocumented
|
||||
|
||||
def render(
|
||||
template: SupportsRead[str] | str | Sequence[tuple[str, str]] = ...,
|
||||
data: dict[str, Any] = ...,
|
||||
partials_path: StrPath | None = ...,
|
||||
partials_ext: str = ...,
|
||||
partials_dict: dict[str, str] = ...,
|
||||
padding: str = ...,
|
||||
def_ldel: str | None = ...,
|
||||
def_rdel: str | None = ...,
|
||||
scopes: MutableSequence[int] | None = ...,
|
||||
warn: bool = ...,
|
||||
) -> str: ...
|
||||
11
stubs/chevron/chevron/tokenizer.pyi
Executable file
11
stubs/chevron/chevron/tokenizer.pyi
Executable file
@@ -0,0 +1,11 @@
|
||||
from typing import Iterator
|
||||
|
||||
class ChevronError(SyntaxError): ...
|
||||
|
||||
def grab_literal(template: str, l_del: str | None) -> tuple[str, str]: ... # undocumented
|
||||
def l_sa_check(template: str, literal: str, is_standalone: bool) -> bool | None: ... # undocumented
|
||||
def r_sa_check(template: str, tag_type: str, is_standalone: bool) -> bool: ... # undocumented
|
||||
def parse_tag(template: str, l_del: str | None, r_del: str | None) -> tuple[tuple[str, str], str]: ... # undocumented
|
||||
def tokenize(
|
||||
template: str, def_ldel: str | None = ..., def_rdel: str | None = ...
|
||||
) -> Iterator[tuple[str, str]]: ... # undocumented
|
||||
Reference in New Issue
Block a user