Raxol.Core.KeyboardShortcutsBehaviour behaviour (Raxol v0.3.0)
View SourceBehaviour for the KeyboardShortcuts module. This allows for mocking the KeyboardShortcuts module in tests.
Summary
Types
Callbacks
@callback cleanup() :: :ok
@callback get_current_context() :: shortcut_context()
@callback get_shortcuts_for_context(context :: shortcut_context()) :: [map()]
@callback handle_keyboard_event(event :: tuple()) :: :ok
@callback init() :: :ok
@callback register_shortcut( shortcut :: shortcut(), name :: shortcut_name(), callback :: shortcut_callback(), opts :: shortcut_opts() ) :: :ok
@callback set_context(context :: shortcut_context()) :: :ok
@callback show_shortcuts_help() :: {:ok, String.t()} | :ok
@callback trigger_shortcut( name :: shortcut_name(), context :: shortcut_context() ) :: :ok | {:error, :shortcut_not_found}
@callback unregister_shortcut( name :: shortcut_name(), context :: shortcut_context() ) :: :ok