Notes/src/routes/api/keys.ts

21 lines
509 B
TypeScript
Raw Normal View History

2019-11-19 20:53:04 +01:00
"use strict";
2024-04-06 21:31:09 +03:00
import keyboardActions = require('../../services/keyboard_actions');
import becca = require('../../becca/becca');
2019-11-19 20:53:04 +01:00
2020-06-20 12:31:38 +02:00
function getKeyboardActions() {
return keyboardActions.getKeyboardActions();
2019-11-19 20:53:04 +01:00
}
2020-06-20 12:31:38 +02:00
function getShortcutsForNotes() {
2022-12-01 16:22:04 +01:00
const labels = becca.findAttributes('label', 'keyboardShortcut');
2021-12-19 10:50:38 +01:00
2022-12-01 13:07:23 +01:00
// launchers have different handling
2022-12-01 16:22:04 +01:00
return labels.filter(attr => becca.getNote(attr.noteId)?.type !== 'launcher');
}
2024-04-06 21:31:09 +03:00
export = {
getKeyboardActions,
getShortcutsForNotes
2020-06-20 12:31:38 +02:00
};