-
Notifications
You must be signed in to change notification settings - Fork 236
Expand file tree
/
Copy pathtypes.py
More file actions
40 lines (30 loc) · 1.07 KB
/
types.py
File metadata and controls
40 lines (30 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
"""Internal, :const:`typing.TYPE_CHECKING` guarded :term:`typings <annotation>`.
These are _not_ to be imported at runtime as `typing_extensions` is not
bundled with tmuxp. Usage example:
>>> import typing as t
>>> if t.TYPE_CHECKING:
... from tmuxp._internal.types import PluginConfigSchema
...
"""
from __future__ import annotations
import logging
import typing as t
from typing import TypedDict
logger = logging.getLogger(__name__)
if t.TYPE_CHECKING:
import sys
if sys.version_info >= (3, 11):
from typing import NotRequired
else:
from typing_extensions import NotRequired
class PluginConfigSchema(TypedDict):
plugin_name: NotRequired[str]
tmux_min_version: NotRequired[str]
tmux_max_version: NotRequired[str]
tmux_version_incompatible: NotRequired[list[str]]
libtmux_min_version: NotRequired[str]
libtmux_max_version: NotRequired[str]
libtmux_version_incompatible: NotRequired[list[str]]
tmuxp_min_version: NotRequired[str]
tmuxp_max_version: NotRequired[str]
tmuxp_version_incompatible: NotRequired[list[str]]