Update stubs

This commit is contained in:
Trinh Anh Ngoc
2022-10-11 23:31:55 +07:00
parent 6144774401
commit b714b79c3d
6 changed files with 235 additions and 139 deletions

View File

@@ -0,0 +1,53 @@
from re import Pattern
from typing import Any, Generic, TypeVar
from werkzeug.datastructures import CallbackDict
_ModificationTrackingDictT = TypeVar('_ModificationTrackingDictT', bound=ModificationTrackingDict)
_SessionT = TypeVar('_SessionT', bound=Session)
_sha1_re: Pattern
def generate_key(salt: Any = ...) -> str: ...
class ModificationTrackingDict(CallbackDict):
__slots__ = ('modified',)
modified: bool
def __init__(self, *args, **kwargs): ...
def copy(self: _ModificationTrackingDictT) -> _ModificationTrackingDictT: ...
def __copy__(self: _ModificationTrackingDictT) -> _ModificationTrackingDictT: ...
class Session(ModificationTrackingDict):
__slots__ = ('modified', 'sid', 'new')
sid: str
new: bool
def __init__(self, data, sid, new: bool = ...): ...
def __repr__(self) -> str: ...
@property
def should_save(self) -> bool: ...
class SessionStore(Generic[_SessionT]):
session_class: type[_SessionT]
def __init__(self, session_class: type[_SessionT] | None = ...): ...
def is_valid_key(self, key) -> bool: ...
def generate_key(self, salt: Any = ...) -> str: ...
def new(self) -> _SessionT: ...
def save(self, session: _SessionT) -> None: ...
def save_if_modified(self, session: _SessionT) -> None: ...
def delete(self, session: _SessionT) -> None: ...
def get(self, sid: str) -> _SessionT: ...
_fs_transaction_suffix: str
class FilesystemSessionStore(SessionStore[_SessionT]):
path: str | None
filename_template: str
renew_missing: bool
mode: int
def __init__(self, path: str | None = ..., filename_template: str = ..., session_class: type[_SessionT] | None = ...,
renew_missing: bool = ..., mode: int = ...) -> None: ...
def get_session_filename(self, sid: str) -> str: ...
def save(self, session: _SessionT) -> None: ...
def delete(self, session: _SessionT) -> None: ...
def get(self, sid: str) -> _SessionT: ...
def list(self) -> list[str]: ...