mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Add usersettings stub files (#10598)
This commit is contained in:
committed by
GitHub
parent
114949b5ad
commit
2c15a8e790
3
stubs/usersettings/@tests/stubtest_allowlist.txt
Normal file
3
stubs/usersettings/@tests/stubtest_allowlist.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
usersettings.Settings.app_id
|
||||
usersettings.Settings.settings_directory
|
||||
usersettings.Settings.settings_file
|
||||
2
stubs/usersettings/METADATA.toml
Normal file
2
stubs/usersettings/METADATA.toml
Normal file
@@ -0,0 +1,2 @@
|
||||
version = "1.1.*"
|
||||
upstream_repository = "https://github.com/glvnst/usersettings"
|
||||
14
stubs/usersettings/usersettings.pyi
Normal file
14
stubs/usersettings/usersettings.pyi
Normal file
@@ -0,0 +1,14 @@
|
||||
from typing import Any, TypeVar
|
||||
|
||||
_S = TypeVar("_S")
|
||||
|
||||
class Settings(dict[str, Any]):
|
||||
app_id: str
|
||||
settings_directory: str
|
||||
settings_file: str
|
||||
def __init__(self, app_id: str) -> None: ...
|
||||
def add_setting(self, setting_name: str, setting_type: type[_S] = ..., default: _S | None = None) -> None: ...
|
||||
def load_settings(self) -> None: ...
|
||||
def save_settings(self) -> None: ...
|
||||
def __getattr__(self, setting_name: str) -> Any: ...
|
||||
def __setattr__(self, setting_name: str, setting_value: Any) -> None: ...
|
||||
Reference in New Issue
Block a user