function hotkey(hotkey, options): <T>(proto, propertyKey, descriptor?) => void;function hotkey(hotkey, options): <T>(proto, propertyKey, descriptor?) => void;Defined in: decorators/hotkey.ts:29
Decorator that registers a keyboard hotkey on the element when it connects and unregisters when it disconnects. Uses HotkeyController under the hood.
RegisterableHotkey
The key or key combo to listen for (e.g. 'Mod+S' or a raw hotkey object).
HotkeyOptions = HOTKEY_DEFAULT_OPTIONS
Optional registration options (target, platform, enabled, etc.).
A method decorator for use on LitElement methods.
<T>(
proto,
propertyKey,
descriptor?): void;<T>(
proto,
propertyKey,
descriptor?): void;T extends HotkeyCallback
LitElement
string
TypedPropertyDescriptor<T>
void
class MyElement extends LitElement {
@hotkey('Mod+S')
save() { this.doSave() }
@hotkey('Escape')
close() { this.dismiss() }
}class MyElement extends LitElement {
@hotkey('Mod+S')
save() { this.doSave() }
@hotkey('Escape')
close() { this.dismiss() }
}