Skip to content
On this page

Module: features/hotkey

Interfaces

BaseHotkey

BaseHotkey: Object

The properties that are added onto a processed HotkeyOptions to create an Hotkey.

NameTypeDescription
typetypeof HotkeyTypeA 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.

NameTypeDescription
descriptionComputable<string>The description of this hotkey, to display in the settings.
enabled?Computable<boolean>Whether or not this hotkey is currently enabled.
keystringThe key tied to this hotkey
onPressVoidFunctionWhat 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

NameType
Textends 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
NameType
Textends HotkeyOptions
Parameters
NameTypeDescription
optionsFuncOptionsFunc<T, BaseHotkey, GenericHotkey>Hotkey options.
Returns

Hotkey<T>

Defined in

profectus/src/features/hotkey.tsx:68