feat(typing): More types, cleaner structure

This commit is contained in:
2026-04-30 14:12:35 +02:00
parent 31426c006b
commit f9e6120910
8 changed files with 95 additions and 57 deletions
+4 -1
View File
@@ -64,7 +64,10 @@
} }
} }
} }
} },
"required": [
"name"
]
} }
}, },
"reflector": { "reflector": {
-56
View File
@@ -1,56 +0,0 @@
from typing import Optional, TypedDict
class ArchMgrConfig(TypedDict):
pkgs: ArchMgrPkgConfig
users: list[ArchMgrUserConfig]
class ArchMgrPkgConfig(TypedDict):
individual: list[str]
bundles: list[object] # TODO: Better typing
repos: object # TODO: Repo typing
class ArchMgrUserConfig(TypedDict):
username: str
groups: list[str]
home_dir: bool
class ArchMgrBootConfig(TypedDict):
bootloader: str
esp_dir: str
theme_folder: str
os_prober: bool
class ArchMgrThemeConfig(TypedDict):
gtk: str
qt: str
font: str
icon_theme: str
cursor_theme: str
class ArchMgrGitConfig(TypedDict):
creds: object # TODO:
repos: object # TODO
class ArchMgrGitRepoConfig(TypedDict):
clone_path: str
url: str
class ArchMgrCmdsConfig(TypedDict):
always: ArchMgrCommand
once: ArchMgrCommand
class ArchMgrCommand(TypedDict):
cmd: str
name: Optional[str]
capture_output: Optional[bool]
hook: Optional[str]
user: Optional[str]
+9
View File
@@ -0,0 +1,9 @@
from typing import TypedDict
from config.dtype.others import ArchMgrUserConfig
from config.dtype.pkgs import ArchMgrPkgConfig
class ArchMgrConfig(TypedDict):
pkgs: ArchMgrPkgConfig
users: list[ArchMgrUserConfig]
+14
View File
@@ -0,0 +1,14 @@
from typing import Optional, TypedDict
class ArchMgrCmdsConfig(TypedDict):
always: ArchMgrCommand
once: ArchMgrCommand
class ArchMgrCommand(TypedDict):
cmd: str
name: Optional[str]
capture_output: Optional[bool]
hook: Optional[str]
user: Optional[str]
+11
View File
@@ -0,0 +1,11 @@
from typing import TypedDict
class ArchMgrGitConfig(TypedDict):
creds: dict # TODO:
repos: dict # TODO
class ArchMgrGitRepoConfig(TypedDict):
clone_path: str
url: str
+22
View File
@@ -0,0 +1,22 @@
from typing import TypedDict
class ArchMgrUserConfig(TypedDict):
username: str
groups: list[str]
home_dir: bool
class ArchMgrBootConfig(TypedDict):
bootloader: str
esp_dir: str
theme_folder: str
os_prober: bool
class ArchMgrThemeConfig(TypedDict):
gtk: str
qt: str
font: str
icon_theme: str
cursor_theme: str
+35
View File
@@ -0,0 +1,35 @@
from typing import Optional, TypedDict
class ArchMgrPkgConfig(TypedDict):
individual: list[str]
bundles: list[ArchMgrBundleConfig]
repos: ArchMgrRepoSettings
class ArchMgrReposConfig(TypedDict):
enabled_repos: list[ArchMgrRepoSettings]
reflector: ArchMgrReflectorConfig
class ArchMgrReflectorConfig(TypedDict):
enabled: bool
interval: Optional[int]
countries: Optional[list[str]]
count: Optional[int]
class ArchMgrBundleConfig(TypedDict):
name: str
ignored_pkgs: Optional[list[str]]
class ArchMgrRepoSettings(TypedDict):
name: str
setup_cmds: Optional[list[str]]
mirrors: ArchMgrRepoMirrors
class ArchMgrRepoMirrors(TypedDict):
use_default: bool
extra_mirrors: Optional[list[str]]
View File