zulip/zerver/lib/request.pyi

17 lines
549 B
Python

# This mypy stubs file ensures that mypy can correctly analyze REQ.
from typing import Any, Callable, TypeVar
from django.http import HttpResponse
ViewFuncT = TypeVar('ViewFuncT', bound=Callable[..., HttpResponse])
class JsonableError(Exception):
error = ... # type: Any
def to_json_error_msg(self) -> Any: ...
class RequestVariableMissingError(JsonableError): ...
class RequestVariableConversionError(JsonableError): ...
def REQ(*args: Any, **kwargs: Any) -> Any: ...
def has_request_variables(view_func: ViewFuncT) -> ViewFuncT: ...