44
55from ..targets .target_types import (
66 CursorlessDestination ,
7+ CursorlessExplicitTarget ,
78 CursorlessTarget ,
89 ImplicitDestination ,
910)
4849 "custom_action" ,
4950]
5051
51- callback_actions : dict [str , Callable [[CursorlessTarget ], None ]] = {
52+ callback_actions : dict [str , Callable [[CursorlessExplicitTarget ], None ]] = {
5253 "nextHomophone" : cursorless_homophones_action ,
5354}
5455
@@ -88,7 +89,7 @@ def cursorless_action_or_ide_command(m) -> dict[str, str]:
8889
8990@mod .action_class
9091class Actions :
91- def cursorless_command (action_name : str , target : CursorlessTarget ):
92+ def cursorless_command (action_name : str , target : CursorlessExplicitTarget ): # pyright: ignore [reportGeneralTypeIssues]
9293 """Perform cursorless command on target"""
9394 if action_name in callback_actions :
9495 callback_actions [action_name ](target )
@@ -107,28 +108,30 @@ def cursorless_command(action_name: str, target: CursorlessTarget):
107108 action = {"name" : action_name , "target" : target }
108109 actions .user .private_cursorless_command_and_wait (action )
109110
110- def cursorless_vscode_command (command_id : str , target : CursorlessTarget ):
111+ def cursorless_vscode_command (command_id : str , target : CursorlessTarget ): # pyright: ignore [reportGeneralTypeIssues]
111112 """
112113 Perform vscode command on cursorless target
113114
114115 Deprecated: prefer `cursorless_ide_command`
115116 """
116117 return actions .user .cursorless_ide_command (command_id , target )
117118
118- def cursorless_ide_command (command_id : str , target : CursorlessTarget ):
119+ def cursorless_ide_command (command_id : str , target : CursorlessTarget ): # pyright: ignore [reportGeneralTypeIssues]
119120 """Perform ide command on cursorless target"""
120121 return cursorless_execute_command_action (command_id , target )
121122
122123 def cursorless_insert (
123- destination : CursorlessDestination , text : Union [str , list [str ]]
124+ destination : CursorlessDestination , # pyright: ignore [reportGeneralTypeIssues]
125+ text : Union [str , list [str ]],
124126 ):
125127 """Perform text insertion on Cursorless destination"""
126128 if isinstance (text , str ):
127129 text = [text ]
128130 cursorless_replace_action (destination , text )
129131
130132 def private_cursorless_action_or_ide_command (
131- instruction : dict [str , str ], target : CursorlessTarget
133+ instruction : dict [str , str ], # pyright: ignore [reportGeneralTypeIssues]
134+ target : CursorlessTarget ,
132135 ):
133136 """Perform cursorless action or ide command on target (internal use only)"""
134137 type = instruction ["type" ]
0 commit comments