29
29
if t .TYPE_CHECKING :
30
30
from libtmux .session import Session
31
31
from libtmux .window import Window
32
- from typing_extensions import TypedDict , Unpack
32
+ from typing_extensions import TypedDict , TypeGuard , Unpack
33
33
34
34
from ._types import PluginConfigSchema
35
35
@@ -72,7 +72,7 @@ class Config(t.TypedDict):
72
72
}
73
73
74
74
75
- def validate_plugin_config (config : "PluginConfigSchema" ) -> t . TypeGuard [" Config" ] :
75
+ def validate_plugin_config (config : "PluginConfigSchema" ) -> " TypeGuard[Config]" :
76
76
return isinstance (config , dict )
77
77
78
78
@@ -82,7 +82,7 @@ def setup_plugin_config(
82
82
new_config = config .copy ()
83
83
for default_key , default_value in default_config .items ():
84
84
if default_key not in new_config :
85
- new_config [default_key ] = default_value
85
+ new_config [default_key ] = default_value # type:ignore
86
86
87
87
assert validate_plugin_config (new_config )
88
88
@@ -204,7 +204,7 @@ def _pass_version_check(
204
204
205
205
return True
206
206
207
- def before_workspace_builder (self , session : "Session" ):
207
+ def before_workspace_builder (self , session : "Session" ) -> None :
208
208
"""
209
209
Provide a session hook previous to creating the workspace.
210
210
@@ -217,7 +217,7 @@ def before_workspace_builder(self, session: "Session"):
217
217
session to hook into
218
218
"""
219
219
220
- def on_window_create (self , window : "Window" ):
220
+ def on_window_create (self , window : "Window" ) -> None :
221
221
"""
222
222
Provide a window hook previous to doing anything with a window.
223
223
@@ -229,7 +229,7 @@ def on_window_create(self, window: "Window"):
229
229
window to hook into
230
230
"""
231
231
232
- def after_window_finished (self , window : "Window" ):
232
+ def after_window_finished (self , window : "Window" ) -> None :
233
233
"""
234
234
Provide a window hook after creating the window.
235
235
@@ -243,7 +243,7 @@ def after_window_finished(self, window: "Window"):
243
243
window to hook into
244
244
"""
245
245
246
- def before_script (self , session : "Session" ):
246
+ def before_script (self , session : "Session" ) -> None :
247
247
"""
248
248
Provide a session hook after the workspace has been built.
249
249
@@ -271,7 +271,7 @@ def before_script(self, session: "Session"):
271
271
session to hook into
272
272
"""
273
273
274
- def reattach (self , session : "Session" ):
274
+ def reattach (self , session : "Session" ) -> None :
275
275
"""
276
276
Provide a session hook before reattaching to the session.
277
277
0 commit comments