function hotkeySequence(sequence, options): <T>(proto, methodName, descriptor) => void;function hotkeySequence(sequence, options): <T>(proto, methodName, descriptor) => void;Defined in: decorators/hotkey-sequence.ts:30
Decorator that registers a keyboard sequence (e.g. Vim-style) on the element when it connects and unregisters when it disconnects. Uses HotkeySequenceController under the hood.
HotkeySequence
The key sequence to listen for (e.g. ['G', 'G'] for "g g").
SequenceOptions = HOTKEY_SEQUENCE_DEFAULT_OPTIONS
Optional sequence options (target, timeout, enabled, etc.).
A method decorator for use on LitElement methods.
<T>(
proto,
methodName,
descriptor): void;<T>(
proto,
methodName,
descriptor): void;T extends HotkeyCallback
LitElement
string
TypedPropertyDescriptor<T>
void
class MyElement extends LitElement {
@hotkeySequence(['G', 'G'])
goToTop() { window.scrollTo(0, 0) }
@hotkeySequence(['D', 'D'], { timeout: 500 })
deleteLine() { this.deleteCurrentLine() }
}class MyElement extends LitElement {
@hotkeySequence(['G', 'G'])
goToTop() { window.scrollTo(0, 0) }
@hotkeySequence(['D', 'D'], { timeout: 500 })
deleteLine() { this.deleteCurrentLine() }
}