Module: features/hotkey
Interfaces
BaseHotkey
• BaseHotkey: Object
The properties that are added onto a processed HotkeyOptions to create an Hotkey.
Name | Type | Description |
---|---|---|
type | typeof HotkeyType | A symbol that helps identify features of the same type. |
Defined in
profectus/src/features/hotkey.tsx:40
HotkeyOptions
• HotkeyOptions: Object
An object that configures a Hotkey.
Name | Type | Description |
---|---|---|
description | Computable <string > | The description of this hotkey, to display in the settings. |
enabled? | Computable <boolean > | Whether or not this hotkey is currently enabled. |
key | string | The key tied to this hotkey |
onPress | VoidFunction | What to do upon pressing the key. |
Defined in
profectus/src/features/hotkey.tsx:26
Type Aliases
GenericHotkey
Ƭ GenericHotkey: Replace
<Hotkey
<HotkeyOptions
>, { enabled
: ProcessedComputable
<boolean
> }>
A type that matches any valid Hotkey object.
Defined in
profectus/src/features/hotkey.tsx:55
Hotkey
Ƭ Hotkey<T
>: Replace
<T
& BaseHotkey
, { description
: GetComputableType
<T
["description"
]> ; enabled
: GetComputableTypeWithDefault
<T
["enabled"
], true
> }>
An object that represents a hotkey shortcut that performs an action upon a key sequence being pressed.
Type parameters
Name | Type |
---|---|
T | extends HotkeyOptions |
Defined in
profectus/src/features/hotkey.tsx:46
Variables
HotkeyType
• Const
HotkeyType: typeof HotkeyType
A symbol used to identify Hotkey features.
Defined in
profectus/src/features/hotkey.tsx:21
hotkeys
• Const
hotkeys: Record
<string
, GenericHotkey
| undefined
>
A dictionary of all hotkeys.
Defined in
profectus/src/features/hotkey.tsx:19
Functions
createHotkey
▸ createHotkey<T
>(optionsFunc
): Hotkey
<T
>
Lazily creates a hotkey with the given options.
Type parameters
Name | Type |
---|---|
T | extends HotkeyOptions |
Parameters
Name | Type | Description |
---|---|---|
optionsFunc | OptionsFunc <T , BaseHotkey , GenericHotkey > | Hotkey options. |
Returns
Hotkey
<T
>