Skip to content

Commit

Permalink
Add usersettings stub files (#10598)
Browse files Browse the repository at this point in the history
  • Loading branch information
aitorres authored Aug 21, 2023
1 parent 114949b commit 2c15a8e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions stubs/usersettings/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
usersettings.Settings.app_id
usersettings.Settings.settings_directory
usersettings.Settings.settings_file
2 changes: 2 additions & 0 deletions stubs/usersettings/METADATA.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version = "1.1.*"
upstream_repository = "https://github.com/glvnst/usersettings"
14 changes: 14 additions & 0 deletions stubs/usersettings/usersettings.pyi
Original file line number Diff line number Diff line change
@@ -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: ...

0 comments on commit 2c15a8e

Please sign in to comment.