mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-09 21:46:43 +08:00
move generated stubs to separate directory, too messty
This commit is contained in:
60
django-stubs-generated/core/signing.pyi
Normal file
60
django-stubs-generated/core/signing.pyi
Normal file
@@ -0,0 +1,60 @@
|
||||
from datetime import datetime
|
||||
from typing import Any, Dict, List, Optional, Type, Union
|
||||
|
||||
from django.contrib.sessions.serializers import PickleSerializer
|
||||
|
||||
|
||||
class BadSignature(Exception): ...
|
||||
class SignatureExpired(BadSignature): ...
|
||||
|
||||
def b64_encode(s: bytes) -> bytes: ...
|
||||
def b64_decode(s: bytes) -> bytes: ...
|
||||
def base64_hmac(
|
||||
salt: str, value: Union[bytes, str], key: Union[bytes, str]
|
||||
) -> str: ...
|
||||
def get_cookie_signer(salt: str = ...) -> TimestampSigner: ...
|
||||
|
||||
class JSONSerializer:
|
||||
def dumps(
|
||||
self, obj: Union[Dict[str, Union[int, str]], List[str], str]
|
||||
) -> bytes: ...
|
||||
def loads(self, data: bytes) -> Dict[str, Union[int, str]]: ...
|
||||
|
||||
def dumps(
|
||||
obj: Union[Dict[str, Union[datetime, str]], List[str], str],
|
||||
key: None = ...,
|
||||
salt: str = ...,
|
||||
serializer: Type[Union[PickleSerializer, JSONSerializer]] = ...,
|
||||
compress: bool = ...,
|
||||
) -> str: ...
|
||||
def loads(
|
||||
s: str,
|
||||
key: None = ...,
|
||||
salt: str = ...,
|
||||
serializer: Type[Union[PickleSerializer, JSONSerializer]] = ...,
|
||||
max_age: Optional[int] = ...,
|
||||
) -> Union[
|
||||
Dict[str, Union[datetime, str]], Dict[str, Union[int, str]], List[str], str
|
||||
]: ...
|
||||
|
||||
class Signer:
|
||||
key: str = ...
|
||||
sep: str = ...
|
||||
salt: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
key: Optional[Union[bytes, str]] = ...,
|
||||
sep: str = ...,
|
||||
salt: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
def signature(self, value: Union[bytes, str]) -> str: ...
|
||||
def sign(self, value: str) -> str: ...
|
||||
def unsign(self, signed_value: str) -> str: ...
|
||||
|
||||
class TimestampSigner(Signer):
|
||||
key: str
|
||||
salt: str
|
||||
sep: str
|
||||
def timestamp(self) -> str: ...
|
||||
def sign(self, value: str) -> str: ...
|
||||
def unsign(self, value: str, max_age: Optional[int] = ...) -> str: ...
|
||||
Reference in New Issue
Block a user