Notes/src/routes/api/keys.ts

21 lines
511 B
TypeScript
Raw Normal View History

2019-11-19 20:53:04 +01:00
"use strict";
import keyboardActions from "../../services/keyboard_actions.js";
import becca from "../../becca/becca.js";
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() {
2025-01-09 18:07:02 +02: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
2025-01-09 18:07:02 +02:00
return labels.filter((attr) => becca.getNote(attr.noteId)?.type !== "launcher");
}
export default {
getKeyboardActions,
getShortcutsForNotes
2020-06-20 12:31:38 +02:00
};