mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Add types for pygments.lex. (#10998)
This commit is contained in:
committed by
GitHub
parent
d6403b14aa
commit
7ef466e88d
@@ -1,14 +1,17 @@
|
||||
from _typeshed import SupportsWrite
|
||||
from collections.abc import Iterator
|
||||
from typing import TypeVar, overload
|
||||
|
||||
from pygments.formatter import Formatter
|
||||
from pygments.lexer import Lexer
|
||||
from pygments.token import _TokenType
|
||||
|
||||
_T = TypeVar("_T", str, bytes)
|
||||
|
||||
__version__: str
|
||||
__all__ = ["lex", "format", "highlight"]
|
||||
|
||||
def lex(code, lexer): ...
|
||||
def lex(code: str, lexer: Lexer) -> Iterator[tuple[_TokenType, str]]: ...
|
||||
@overload
|
||||
def format(tokens, formatter: Formatter[_T], outfile: SupportsWrite[_T]) -> None: ...
|
||||
@overload
|
||||
|
||||
Reference in New Issue
Block a user