1313from cleo .io .null_io import NullIO
1414from cleo .io .outputs .output import Verbosity
1515from cleo .parser import Parser
16+ from cleo .ui .table_separator import TableSeparator
1617
1718from .base_command import BaseCommand
1819
@@ -34,7 +35,7 @@ class Command(BaseCommand):
3435
3536 commands = []
3637
37- def __init__ (self ):
38+ def __init__ (self ) -> None :
3839 self ._io : Optional [IO ] = None
3940 super ().__init__ ()
4041
@@ -222,23 +223,23 @@ def table(self, header=None, rows=None, style=None):
222223
223224 return table
224225
225- def table_separator (self ):
226+ def table_separator (self ) -> "TableSeparator" :
226227 """
227228 Return a TableSeparator instance.
228229 """
229230 from cleo .ui .table_separator import TableSeparator
230231
231232 return TableSeparator ()
232233
233- def render_table (self , headers , rows , style = None ):
234+ def render_table (self , headers , rows , style = None ) -> None :
234235 """
235236 Format input to textual table.
236237 """
237238 table = self .table (headers , rows , style )
238239
239240 table .render ()
240241
241- def write (self , text , style = None ):
242+ def write (self , text : str , style : Optional [ str ] = None ) -> None :
242243 """
243244 Writes a string without a new line.
244245 Useful if you want to use overwrite().
@@ -255,7 +256,7 @@ def line(
255256 text : str ,
256257 style : Optional [str ] = None ,
257258 verbosity : Verbosity = Verbosity .NORMAL ,
258- ):
259+ ) -> None :
259260 """
260261 Write a string as information output.
261262 """
@@ -271,7 +272,7 @@ def line_error(
271272 text : str ,
272273 style : Optional [str ] = None ,
273274 verbosity : Verbosity = Verbosity .NORMAL ,
274- ):
275+ ) -> None :
275276 """
276277 Write a string as information output to stderr.
277278 """
@@ -282,7 +283,7 @@ def line_error(
282283
283284 self ._io .write_error_line (styled , verbosity )
284285
285- def info (self , text ) :
286+ def info (self , text : str ) -> None :
286287 """
287288 Write a string as information output.
288289
@@ -291,7 +292,7 @@ def info(self, text):
291292 """
292293 self .line (text , "info" )
293294
294- def comment (self , text ) :
295+ def comment (self , text : str ) -> None :
295296 """
296297 Write a string as comment output.
297298
@@ -300,7 +301,7 @@ def comment(self, text):
300301 """
301302 self .line (text , "comment" )
302303
303- def question (self , text ) :
304+ def question (self , text : str ) -> None :
304305 """
305306 Write a string as question output.
306307
@@ -330,15 +331,28 @@ def progress_indicator(
330331
331332 return ProgressIndicator (self .io , fmt , interval , values )
332333
333- def spin (self , start_message , end_message , fmt = None , interval = 100 , values = None ):
334+ def spin (
335+ self ,
336+ start_message : str ,
337+ end_message : str ,
338+ fmt : Optional [str ] = None ,
339+ interval = 100 ,
340+ values : Optional [List [str ]] = None ,
341+ ):
334342 """
335343 Automatically spin a progress indicator.
336344 """
337345 spinner = ProgressIndicator (self .io , fmt , interval , values )
338346
339347 return spinner .auto (start_message , end_message )
340348
341- def add_style (self , name , fg = None , bg = None , options = None ):
349+ def add_style (
350+ self ,
351+ name : str ,
352+ fg : Optional [str ] = None ,
353+ bg : Optional [str ] = None ,
354+ options : Optional [List [str ]] = None ,
355+ ) -> None :
342356 """
343357 Adds a new style
344358 """
@@ -359,7 +373,7 @@ def add_style(self, name, fg=None, bg=None, options=None):
359373 self ._io .output .formatter .add_style (style )
360374 self ._io .error_output .formatter .add_style (style )
361375
362- def overwrite (self , text ) :
376+ def overwrite (self , text : str ) -> None :
363377 """
364378 Overwrites the current line.
365379
0 commit comments