A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
web: migrate keyboard.js to typescript (#2160)
Abdulrehman-Jaferf5be8a0c862e
diff --git a/apps/web/src/utils/keyboard.js b/apps/web/src/utils/keyboard.tssimilarity index 79%rename from apps/web/src/utils/keyboard.jsrename to apps/web/src/utils/keyboard.tsindex 81682fcc6..85a0d8c51 100644--- a/apps/web/src/utils/keyboard.js+++ b/apps/web/src/utils/keyboard.ts@@ -19,17 +19,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.import EventManager from "@notesnook/core/utils/event-manager";-const GlobalKeyboard = {};-const KeyboardEventManager = new EventManager();-GlobalKeyboard.addEventListener = (name, handler) => {- KeyboardEventManager.subscribe(name, handler);+const GlobalKeyboard = {+ addEventListener: (name: string, handler: (...args: any[]) => void) => {+ KeyboardEventManager.subscribe(name, handler);+ },+ removeEventListener: (name: string, handler: (...args: any[]) => void) =>+ KeyboardEventManager.unsubscribe(name, handler)};-GlobalKeyboard.removeEventListener = (name, handler) =>- KeyboardEventManager.unsubscribe(name, handler);-// window.addEventListener("keydown", (e) => {// // KeyboardEventManager.publish("keydown", e);// });