Skip to content

Commit 5f92c66

Browse files
committed
!squash plugin types
1 parent 91e0feb commit 5f92c66

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/tmuxp/plugin.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828

2929
if t.TYPE_CHECKING:
30-
from typing_extensions import TypedDict
30+
from typing_extensions import TypedDict, NotRequired
3131

3232
class VersionConstraints(TypedDict):
3333
version: t.Union[Version, str]
@@ -40,6 +40,18 @@ class TmuxpPluginVersionConstraints(TypedDict):
4040
tmuxp: VersionConstraints
4141
libtmux: VersionConstraints
4242

43+
class ConfigSchema(TypedDict):
44+
plugin_name: NotRequired[str]
45+
tmux_min_version: NotRequired[str]
46+
tmux_max_version: NotRequired[str]
47+
tmux_version_incompatible: NotRequired[t.List[str]]
48+
libtmux_min_version: NotRequired[str]
49+
libtmux_max_version: NotRequired[str]
50+
libtmux_version_incompatible: NotRequired[t.List[str]]
51+
tmuxp_min_version: NotRequired[str]
52+
tmuxp_max_version: NotRequired[str]
53+
tmuxp_version_incompatible: NotRequired[t.List[str]]
54+
4355

4456
class Config(t.TypedDict):
4557
plugin_name: str
@@ -69,7 +81,7 @@ class Config(t.TypedDict):
6981

7082

7183
def setup_config(
72-
config: dict[str, t.Any], default_config: "Config" = DEFAULT_CONFIG
84+
config: "ConfigSchema", default_config: "Config" = DEFAULT_CONFIG
7385
) -> t.TypeGuard["Config"]:
7486
new_config = config.copy()
7587
for default_key, default_value in default_config.items():

0 commit comments

Comments
 (0)