@@ -21,17 +21,17 @@ class NoBinding(Exception):
2121@dataclass (frozen = True )
2222class Binding :
2323 key : str
24- """Key to bind. This can also be a comma-separated list of keys to map multiple keys to a single action."""
24+ """str: Key to bind. This can also be a comma-separated list of keys to map multiple keys to a single action."""
2525 action : str
26- """Action to bind to."""
26+ """str: Action to bind to."""
2727 description : str
28- """Description of action."""
28+ """str: Description of action."""
2929 show : bool = True
30- """Show the action in Footer, or False to hide."""
30+ """bool: Show the action in Footer, or False to hide."""
3131 key_display : str | None = None
32- """How the key should be shown in footer."""
32+ """str | None: How the key should be shown in footer."""
3333 universal : bool = False
34- """Allow forwarding from app to focused widget."""
34+ """bool: Allow forwarding from app to focused widget."""
3535
3636
3737@rich .repr .auto
@@ -107,6 +107,16 @@ def bind(
107107 key_display : str | None = None ,
108108 universal : bool = False ,
109109 ) -> None :
110+ """Bind keys to an action.
111+
112+ Args:
113+ keys (str): The keys to bind. Can be a comma-separated list of keys.
114+ action (str): The action to bind the keys to.
115+ description (str, optional): An optional description for the binding.
116+ show (bool, optional): A flag to say if the binding should appear in the footer.
117+ key_display (str | None, optional): Optional string to display in the footer for the key.
118+ universal (bool, optional): Allow forwarding from the app to the focused widget.
119+ """
110120 all_keys = [key .strip () for key in keys .split ("," )]
111121 for key in all_keys :
112122 self .keys [key ] = Binding (
0 commit comments