From e3c8d812ae6646d678d964c384288817880a79d4 Mon Sep 17 00:00:00 2001 From: Xon <635541+Xon@users.noreply.github.com> Date: Thu, 26 Sep 2024 13:48:52 +0800 Subject: [PATCH] Replace enum with {} as const (compiles down to the same minified code) --- .../src/scripts/interfaces/keycode-map.d.ts | 22 +++++++++---------- src/scripts/interfaces/keycode-map.ts | 22 +++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/public/types/src/scripts/interfaces/keycode-map.d.ts b/public/types/src/scripts/interfaces/keycode-map.d.ts index 62a59a235..a6c66982a 100644 --- a/public/types/src/scripts/interfaces/keycode-map.d.ts +++ b/public/types/src/scripts/interfaces/keycode-map.d.ts @@ -1,11 +1,11 @@ -export declare const enum KeyCodeMap { - BACK_KEY = 46, - DELETE_KEY = 8, - ENTER_KEY = 13, - A_KEY = 65, - ESC_KEY = 27, - UP_KEY = 38, - DOWN_KEY = 40, - PAGE_UP_KEY = 33, - PAGE_DOWN_KEY = 34 -} +export declare const KeyCodeMap: { + readonly BACK_KEY: 46; + readonly DELETE_KEY: 8; + readonly ENTER_KEY: 13; + readonly A_KEY: 65; + readonly ESC_KEY: 27; + readonly UP_KEY: 38; + readonly DOWN_KEY: 40; + readonly PAGE_UP_KEY: 33; + readonly PAGE_DOWN_KEY: 34; +}; diff --git a/src/scripts/interfaces/keycode-map.ts b/src/scripts/interfaces/keycode-map.ts index 1898c0c86..889d139b5 100644 --- a/src/scripts/interfaces/keycode-map.ts +++ b/src/scripts/interfaces/keycode-map.ts @@ -1,11 +1,11 @@ -export const enum KeyCodeMap { - BACK_KEY = 46, - DELETE_KEY = 8, - ENTER_KEY = 13, - A_KEY = 65, - ESC_KEY = 27, - UP_KEY = 38, - DOWN_KEY = 40, - PAGE_UP_KEY = 33, - PAGE_DOWN_KEY = 34, -} +export const KeyCodeMap = { + BACK_KEY: 46, + DELETE_KEY: 8, + ENTER_KEY: 13, + A_KEY: 65, + ESC_KEY: 27, + UP_KEY: 38, + DOWN_KEY: 40, + PAGE_UP_KEY: 33, + PAGE_DOWN_KEY: 34, +} as const;